From 9b52f879f4f3dd5084cfa2940a0ba00d380121ca Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Thu, 2 Apr 2026 14:31:20 +0700 Subject: [PATCH] update: add relation emr registration in external consultation --- src/entity/emr/emr_external_consultation.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/entity/emr/emr_external_consultation.ts b/src/entity/emr/emr_external_consultation.ts index 1afb241..6939082 100644 --- a/src/entity/emr/emr_external_consultation.ts +++ b/src/entity/emr/emr_external_consultation.ts @@ -10,6 +10,7 @@ import { ManyToOne, } from "typeorm"; import { RefferalHospital } from "../refferal_hospital"; +import { EmrRegistration } from "./emr_registration"; @Entity("emr_external_consultation", { schema: "emr" }) export class EmrExternalConsultation { @@ -20,6 +21,10 @@ export class EmrExternalConsultation { @JoinColumn() refferalhospital: RefferalHospital; + @OneToOne(() => EmrRegistration, { onDelete: "CASCADE" }) + @JoinColumn() + emrregistration: EmrRegistration; + @Column({ nullable: true, type: "text" }) notes: string;