From eab2ca828bb48024203fd3c7a2f4654a46b22589 Mon Sep 17 00:00:00 2001 From: avicenan Date: Tue, 31 Mar 2026 22:05:06 +0700 Subject: [PATCH] fix vital signs --- src/entity/emr/emr_vital_signs.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/entity/emr/emr_vital_signs.ts b/src/entity/emr/emr_vital_signs.ts index e7d597e..1aaadfe 100644 --- a/src/entity/emr/emr_vital_signs.ts +++ b/src/entity/emr/emr_vital_signs.ts @@ -7,19 +7,25 @@ import { DeleteDateColumn, JoinColumn, OneToOne, + ManyToOne, } from "typeorm"; import { consciousness } from "../../enum/consciousness"; -import { EmrRegistrationOutpatient } from "./emr_registration_outpatient"; +import { EmrRegistration } from "./emr_registration"; +import { EmrPatient } from "./emr_patient"; @Entity("emr_vital_signs", { schema: "emr" }) export class EmrVitalSigns { @PrimaryGeneratedColumn("uuid") id: string; - @OneToOne(() => EmrRegistrationOutpatient, { onDelete: "CASCADE" }) + @OneToOne(() => EmrRegistration, { onDelete: "CASCADE" }) @JoinColumn() - registration_outpatient: EmrRegistrationOutpatient; + registration: EmrRegistration; + + @ManyToOne(() => EmrPatient, { onDelete: "CASCADE" }) + @JoinColumn() + patient: EmrPatient; @Column({ nullable: true, length: 64 }) blood_pressure: string;