From d4b4b717136b8f1dcf4925a7096b88af6ecb426d Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Wed, 29 Apr 2026 10:20:15 +0700 Subject: [PATCH 1/2] update: education done --- src/entity/emr/emr_patient_education.ts | 94 +++++++++++++++++++++++++ src/schema/emr.ts | 1 + 2 files changed, 95 insertions(+) create mode 100644 src/entity/emr/emr_patient_education.ts diff --git a/src/entity/emr/emr_patient_education.ts b/src/entity/emr/emr_patient_education.ts new file mode 100644 index 0000000..01fa5f0 --- /dev/null +++ b/src/entity/emr/emr_patient_education.ts @@ -0,0 +1,94 @@ +import { + Entity, + OneToOne, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + DeleteDateColumn, + ManyToOne, + JoinColumn, + ManyToMany +} from "typeorm"; + +import { EmrPatient } from "./emr_patient"; +import { EmrRegistration } from "./emr_registration"; +import { User } from "../users"; + +@Entity("emr_patient_education") +export class PatientEducation { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => User, { onDelete: "CASCADE" }) + @JoinColumn() + user: User; + + @ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" }) + @JoinColumn() + registration: EmrRegistration; + + @ManyToOne(() => EmrPatient, { onDelete: "CASCADE" }) + @JoinColumn() + patient: EmrPatient; + + @Column({ + nullable: true, + type: "text", + }) + education_topics: string; + + @Column({ + nullable: true, + type: "text", + }) + type: string; + + @Column({ + nullable: true, + type: "text", + }) + education_recipients: string; + + @Column({ + nullable: true, + type: "text", + }) + learning_methods: string; + + @Column({ + nullable: true, + type: "text", + }) + educator_signature: string; + + @Column({ + nullable: true, + type: "text", + }) + education_recipients_signature: string; + + @Column({ + nullable: true, + type: "text", + }) + notes: string; + + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @UpdateDateColumn({ nullable: true }) + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @DeleteDateColumn({ nullable: true }) + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/schema/emr.ts b/src/schema/emr.ts index b1aa1d3..ca7ddc3 100644 --- a/src/schema/emr.ts +++ b/src/schema/emr.ts @@ -31,6 +31,7 @@ export * from "../entity/emr/emr_physical_examination_emergency"; export * from "../entity/emr/emr_doctor_order_emergency"; export * from "../entity/emr/emr_atenatal_care"; export * from "../entity/emr/emr_nursing_assesment"; +export * from "../entity/emr/emr_patient_education"; export * from "../types/registration_type"; export * from "../types/registration_status"; From 5bc3e4ab2eb66027dec8585ef098dec5b7b755d6 Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Wed, 29 Apr 2026 10:36:49 +0700 Subject: [PATCH 2/2] update --- src/entity/emr/emr_registration.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entity/emr/emr_registration.ts b/src/entity/emr/emr_registration.ts index ffd2cde..6d8c7a6 100644 --- a/src/entity/emr/emr_registration.ts +++ b/src/entity/emr/emr_registration.ts @@ -16,7 +16,8 @@ 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"; +import { EmrRegistrationEmergency } from "./emr_registration_emergency"; +import { EmrRegistrationEmergencyResponsible } from "./emr_registration_emergency_responsible"; /** * Registrasi base: data umum untuk semua tipe (rawat jalan, rawat inap, emergency, hemodialysis). @@ -28,6 +29,9 @@ export class EmrRegistration { @PrimaryGeneratedColumn("uuid") id: string; + @OneToOne(() => EmrRegistrationEmergencyResponsible, (emergency) => emergency.emrregistration) + emergency_responsible: EmrRegistrationEmergencyResponsible; + @OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration) outpatient: EmrRegistrationOutpatient;