From 4182c6c660554c3baec190ea65a15e95782ee518 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Tue, 14 Apr 2026 15:06:01 +0700 Subject: [PATCH] update: emergency registration done --- src/entity/emr/emr_registration.ts | 16 +++++++++++++++- .../emr_registration_emergency_responsible.ts | 12 ++++++++++++ src/types/registration_status.ts | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/entity/emr/emr_registration.ts b/src/entity/emr/emr_registration.ts index 5f3e2d0..ffd2cde 100644 --- a/src/entity/emr/emr_registration.ts +++ b/src/entity/emr/emr_registration.ts @@ -7,7 +7,8 @@ import { DeleteDateColumn, ManyToOne, JoinColumn, - OneToOne + OneToOne, + ManyToMany } from "typeorm"; import { RegistrationType } from "../../types/registration_type"; @@ -15,6 +16,7 @@ import { RegistrationStatus } from "../../types/registration_status"; import { EmrPatient } from "./emr_patient"; import { PatientGuarantor } from "../patient_guarantor"; import { EmrRegistrationOutpatient } from "./emr_registration_outpatient"; +import {EmrRegistrationEmergency} from "./emr_registration_emergency"; /** * Registrasi base: data umum untuk semua tipe (rawat jalan, rawat inap, emergency, hemodialysis). @@ -29,6 +31,9 @@ export class EmrRegistration { @OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration) outpatient: EmrRegistrationOutpatient; + @OneToOne(() => EmrRegistrationEmergency, (emergency) => emergency.registration) + emergency: EmrRegistrationEmergency; + @ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" }) @JoinColumn() patient: EmrPatient; @@ -59,6 +64,15 @@ export class EmrRegistration { @Column({ type: "date", nullable: true }) visit_date: Date; + @Column({ nullable: true, type: "text" }) + fullname: string; + + @Column({ nullable: true, type: "date" }) + birthdate: Date; + + @Column({ nullable: true, type: "text" }) + idcard: string; + @Column() @CreateDateColumn() created_at: Date; diff --git a/src/entity/emr/emr_registration_emergency_responsible.ts b/src/entity/emr/emr_registration_emergency_responsible.ts index 6cc9e59..70f35c5 100644 --- a/src/entity/emr/emr_registration_emergency_responsible.ts +++ b/src/entity/emr/emr_registration_emergency_responsible.ts @@ -53,6 +53,15 @@ export class EmrRegistrationEmergencyResponsible { @JoinColumn({ referencedColumnName: "code" }) ward: Ward; + @Column({ nullable: true, type: "text" }) + patientfullname: string; + + @Column({ nullable: true, type: "text" }) + patientnik: string; + + @Column({ type: "date", nullable: true }) + patientbirthdate: Date; + /** Tingkat keparahan / triage (e.g. merah, kuning, hijau) */ @Column({ nullable: true, type: "text" }) fullname: string; @@ -69,6 +78,9 @@ export class EmrRegistrationEmergencyResponsible { @Column({ nullable: true, type: "text" }) address: string; + @Column({ nullable: true, type: "boolean", default: false }) + consent: boolean; + @Column() @CreateDateColumn() created_at: Date; diff --git a/src/types/registration_status.ts b/src/types/registration_status.ts index 1007831..62bc91c 100644 --- a/src/types/registration_status.ts +++ b/src/types/registration_status.ts @@ -7,5 +7,7 @@ export enum RegistrationStatus { COMPLETED = "completed", // layanan sudah selesai CANCELED = "canceled", // dibatalkan RESERVED = "reserved", // sudah didaftarkan, belum dipanggil + REGISTERED = "registered", // sudah didaftarkan + UNREGISTERED = "unregistered", // belum didaftarkan }