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";