update: order for compounding medicine, now ir can be ordered different compounding

This commit is contained in:
wayanrivan
2026-03-31 10:39:21 +07:00
parent 8b0ee094dd
commit d2adb7242f

View File

@ -7,7 +7,9 @@ import {
DeleteDateColumn,
OneToMany,
ManyToOne,
JoinColumn
JoinColumn,
ManyToMany,
JoinTable
} from "typeorm";
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
@ -44,9 +46,20 @@ export class EmrPharmacyOrderList {
@JoinColumn()
emrregistrationoutpatient: EmrRegistrationOutpatient;
@ManyToOne(() => EmrCompoundingMedicine, { onDelete: "CASCADE" })
@JoinColumn()
emrcompoundingmedicine: EmrCompoundingMedicine;
@Column({
type: 'text',
nullable: true,
array: true,
})
emrcompoundingmedicine: string[];
@ManyToMany(() => EmrCompoundingMedicine)
@JoinTable({
name: "compounding_medicine_order_list",
joinColumn: { name: "emr_pharmacy_order_list_id", referencedColumnName: "id" },
inverseJoinColumn: { name: "emr_compounding_medicine_id", referencedColumnName: "id" },
})
emrcompoundingmedicines: EmrCompoundingMedicine[];
@ManyToOne(() => EmrPrescription, { onDelete: "CASCADE" })
@JoinColumn()