diff --git a/src/entity/emr/emr_compounding_medicine.ts b/src/entity/emr/emr_compounding_medicine.ts index 6b7f871..9fc28d4 100644 --- a/src/entity/emr/emr_compounding_medicine.ts +++ b/src/entity/emr/emr_compounding_medicine.ts @@ -13,6 +13,7 @@ import { import { EmrCompoundingMedicineItem } from "./emr_compounding_medicine_item"; import { UsageTime } from "../pharmacy/usage_time"; import { UsageInstructions } from "../pharmacy/usage_instructions"; +import { EmrRegistration } from "./emr_registration"; @Entity("emr_compounding_medicine", { schema: "emr" }) export class EmrCompoundingMedicine { @@ -34,6 +35,10 @@ export class EmrCompoundingMedicine { @Column({ nullable: true, type: "text" }) compounding_notes: string; + @ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" }) + @JoinColumn() + emrregistration: EmrRegistration; + @ManyToOne(() => UsageTime, { onDelete: "CASCADE" }) @JoinColumn() usagetime: UsageTime; diff --git a/src/entity/emr/emr_external_consultation.ts b/src/entity/emr/emr_external_consultation.ts new file mode 100644 index 0000000..1afb241 --- /dev/null +++ b/src/entity/emr/emr_external_consultation.ts @@ -0,0 +1,47 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + DeleteDateColumn, + OneToOne, + JoinColumn, + ManyToOne, +} from "typeorm"; +import { RefferalHospital } from "../refferal_hospital"; + +@Entity("emr_external_consultation", { schema: "emr" }) +export class EmrExternalConsultation { + @PrimaryGeneratedColumn("uuid") + id: string; + + @OneToOne(() => RefferalHospital, { onDelete: "CASCADE" }) + @JoinColumn() + refferalhospital: RefferalHospital; + + @Column({ nullable: true, type: "text" }) + notes: string; + + @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 31439fe..184baf4 100644 --- a/src/schema/emr.ts +++ b/src/schema/emr.ts @@ -22,6 +22,7 @@ export * from "../entity/emr/emr_radiology_services"; 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 "../types/registration_type"; export * from "../types/registration_status";