From e0ff2521068ec02bf787147a8fb0e0100ef92b78 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Fri, 27 Mar 2026 14:23:20 +0700 Subject: [PATCH 1/4] update compounding.ts and pharmacyorderlist.ts --- src/entity/emr/emr_pharmacy_order_list.ts | 96 +++++++++++++++++++++++ src/schema/emr.ts | 1 + 2 files changed, 97 insertions(+) create mode 100644 src/entity/emr/emr_pharmacy_order_list.ts diff --git a/src/entity/emr/emr_pharmacy_order_list.ts b/src/entity/emr/emr_pharmacy_order_list.ts new file mode 100644 index 0000000..2d16e13 --- /dev/null +++ b/src/entity/emr/emr_pharmacy_order_list.ts @@ -0,0 +1,96 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + DeleteDateColumn, + OneToMany, + ManyToOne, + JoinColumn +} from "typeorm"; + +import { EmrRegistrationOutpatient } from "./emr_registration_outpatient"; +import { EmrCompoundingMedicine } from "./emr_compounding_medicine"; +import { EmrPrescriptionOrder } from "./emr_prescription_orders"; +import { User } from "../users"; +import { PatientGuarantor } from "../patient_guarantor"; +import { Room } from "../room"; +import { Department } from "../department"; +import { EmrRegistration } from "./emr_registration"; + + +@Entity("emr_pharmacy_order_list", { schema: "emr" }) +export class EmrPharmacyOrderList { + @PrimaryGeneratedColumn("uuid") + id: string; + + @Column({ nullable: true }) + order_date: Date; + + @Column({ nullable: true, type: "text" }) + prescription_number: string; + + @Column({ nullable: true, type: "text" }) + type: string; + + @Column({ nullable: true, type: "text" }) + status: string; + + @Column({ nullable: true, type: "text", array: true }) + prescription_screening: string[]; + + @ManyToOne(() => EmrRegistrationOutpatient, { onDelete: "CASCADE" }) + @JoinColumn() + emrregistrationoutpatient: EmrRegistrationOutpatient; + + @ManyToOne(() => EmrCompoundingMedicine, { onDelete: "CASCADE" }) + @JoinColumn() + emrcompoundingmedicine: EmrCompoundingMedicine; + + @ManyToOne(() => EmrPrescriptionOrder, { onDelete: "CASCADE" }) + @JoinColumn() + emrprescriptionorder: EmrPrescriptionOrder; + + @ManyToOne(() => User, { onDelete: "CASCADE" }) + @JoinColumn() + user: User; + + @ManyToOne(() => PatientGuarantor, { onDelete: "CASCADE" }) + @JoinColumn() + patientguarantor: PatientGuarantor; + + @ManyToOne(() => Room, { onDelete: "CASCADE" }) + @JoinColumn() + room: Room; + + @ManyToOne(() => Department, { onDelete: "CASCADE" }) + @JoinColumn() + department: Department; + + @ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" }) + @JoinColumn() + emrregistration: EmrRegistration; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} + diff --git a/src/schema/emr.ts b/src/schema/emr.ts index 184baf4..3f4f281 100644 --- a/src/schema/emr.ts +++ b/src/schema/emr.ts @@ -23,6 +23,7 @@ export * from "../entity/emr/emr_compounding_medicine"; export * from "../entity/emr/emr_compounding_medicine_item"; export * from "../entity/emr/emr_room_medical_equipment"; export * from "../entity/emr/emr_external_consultation"; +export * from "../entity/emr/emr_pharmacy_order_list"; export * from "../types/registration_type"; export * from "../types/registration_status"; From 9aa40e20e79b5fc8380f86db85480d736e264715 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Fri, 27 Mar 2026 14:24:01 +0700 Subject: [PATCH 2/4] Merge branch 'main' of https://git.shiblysolution.id/SAUDE-TL/entity From 90defad7dc42639036e8d118199d8cb02bd42769 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Fri, 27 Mar 2026 14:34:49 +0700 Subject: [PATCH 3/4] update --- src/entity/pharmacy-logistic/delivery_room.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/entity/pharmacy-logistic/delivery_room.ts b/src/entity/pharmacy-logistic/delivery_room.ts index eeba02d..9e059c3 100644 --- a/src/entity/pharmacy-logistic/delivery_room.ts +++ b/src/entity/pharmacy-logistic/delivery_room.ts @@ -29,7 +29,6 @@ export class DeliveryRoom { @JoinColumn() destinationroom: Room; - @ManyToOne(() => RoomOrder, { onDelete: "NO ACTION" }) @JoinColumn() roomorder: RoomOrder; From 0c79ff53b5dc63cecafef153f6efe7c08a9f8654 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Fri, 27 Mar 2026 15:12:01 +0700 Subject: [PATCH 4/4] update: pharmacy order list relation to prescription --- src/entity/emr/emr_pharmacy_order_list.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/entity/emr/emr_pharmacy_order_list.ts b/src/entity/emr/emr_pharmacy_order_list.ts index 2d16e13..f7f8245 100644 --- a/src/entity/emr/emr_pharmacy_order_list.ts +++ b/src/entity/emr/emr_pharmacy_order_list.ts @@ -12,7 +12,7 @@ import { import { EmrRegistrationOutpatient } from "./emr_registration_outpatient"; import { EmrCompoundingMedicine } from "./emr_compounding_medicine"; -import { EmrPrescriptionOrder } from "./emr_prescription_orders"; +import { EmrPrescription } from "./emr_prescription"; import { User } from "../users"; import { PatientGuarantor } from "../patient_guarantor"; import { Room } from "../room"; @@ -48,9 +48,9 @@ export class EmrPharmacyOrderList { @JoinColumn() emrcompoundingmedicine: EmrCompoundingMedicine; - @ManyToOne(() => EmrPrescriptionOrder, { onDelete: "CASCADE" }) + @ManyToOne(() => EmrPrescription, { onDelete: "CASCADE" }) @JoinColumn() - emrprescriptionorder: EmrPrescriptionOrder; + emrprescription: EmrPrescription; @ManyToOne(() => User, { onDelete: "CASCADE" }) @JoinColumn()