From e911dcc652390ca79f7594455c4a93e22c6c0aa4 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Mon, 9 Mar 2026 12:15:31 +0700 Subject: [PATCH] update:relation guarantor --- src/entity/emr/emr_patient.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/entity/emr/emr_patient.ts b/src/entity/emr/emr_patient.ts index efd2b5f..6fb8f32 100644 --- a/src/entity/emr/emr_patient.ts +++ b/src/entity/emr/emr_patient.ts @@ -7,6 +7,7 @@ import { DeleteDateColumn, ManyToOne, JoinColumn, + OneToMany, } from "typeorm"; import { Status } from "../../types/status"; @@ -14,6 +15,7 @@ import { Aldeia } from "../aldeia"; import { Suco } from "../suco"; import { Administrativu } from "../administrativu"; import { Munisipo } from "../munisipo"; +import { PatientGuarantor } from "../patient_guarantor"; @Entity("emr_patients", { schema: "emr" }) export class EmrPatient { @@ -53,12 +55,16 @@ export class EmrPatient { @Column({ nullable: true, length: 256 }) place_of_birth: string; - @Column({ nullable: true, type: "text" }) + @Column({ nullable: true, type: "text" }) photo: string; @Column({ type: "text", nullable: true }) address: string; + @ManyToOne(() => PatientGuarantor, { onDelete: "NO ACTION" }) + @JoinColumn() + guarantor: PatientGuarantor; + @ManyToOne(() => Munisipo, { onDelete: "NO ACTION" }) @JoinColumn() munisipio: Munisipo;