update: emergency registration done

This commit is contained in:
wayanrivan
2026-04-14 15:06:01 +07:00
parent e121e7e64f
commit 4182c6c660
3 changed files with 29 additions and 1 deletions

View File

@ -7,7 +7,8 @@ import {
DeleteDateColumn, DeleteDateColumn,
ManyToOne, ManyToOne,
JoinColumn, JoinColumn,
OneToOne OneToOne,
ManyToMany
} from "typeorm"; } from "typeorm";
import { RegistrationType } from "../../types/registration_type"; import { RegistrationType } from "../../types/registration_type";
@ -15,6 +16,7 @@ import { RegistrationStatus } from "../../types/registration_status";
import { EmrPatient } from "./emr_patient"; import { EmrPatient } from "./emr_patient";
import { PatientGuarantor } from "../patient_guarantor"; import { PatientGuarantor } from "../patient_guarantor";
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient"; 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). * 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) @OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration)
outpatient: EmrRegistrationOutpatient; outpatient: EmrRegistrationOutpatient;
@OneToOne(() => EmrRegistrationEmergency, (emergency) => emergency.registration)
emergency: EmrRegistrationEmergency;
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" }) @ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
@JoinColumn() @JoinColumn()
patient: EmrPatient; patient: EmrPatient;
@ -59,6 +64,15 @@ export class EmrRegistration {
@Column({ type: "date", nullable: true }) @Column({ type: "date", nullable: true })
visit_date: Date; 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() @Column()
@CreateDateColumn() @CreateDateColumn()
created_at: Date; created_at: Date;

View File

@ -53,6 +53,15 @@ export class EmrRegistrationEmergencyResponsible {
@JoinColumn({ referencedColumnName: "code" }) @JoinColumn({ referencedColumnName: "code" })
ward: Ward; 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) */ /** Tingkat keparahan / triage (e.g. merah, kuning, hijau) */
@Column({ nullable: true, type: "text" }) @Column({ nullable: true, type: "text" })
fullname: string; fullname: string;
@ -69,6 +78,9 @@ export class EmrRegistrationEmergencyResponsible {
@Column({ nullable: true, type: "text" }) @Column({ nullable: true, type: "text" })
address: string; address: string;
@Column({ nullable: true, type: "boolean", default: false })
consent: boolean;
@Column() @Column()
@CreateDateColumn() @CreateDateColumn()
created_at: Date; created_at: Date;

View File

@ -7,5 +7,7 @@ export enum RegistrationStatus {
COMPLETED = "completed", // layanan sudah selesai COMPLETED = "completed", // layanan sudah selesai
CANCELED = "canceled", // dibatalkan CANCELED = "canceled", // dibatalkan
RESERVED = "reserved", // sudah didaftarkan, belum dipanggil RESERVED = "reserved", // sudah didaftarkan, belum dipanggil
REGISTERED = "registered", // sudah didaftarkan
UNREGISTERED = "unregistered", // belum didaftarkan
} }