From d4b4b717136b8f1dcf4925a7096b88af6ecb426d Mon Sep 17 00:00:00 2001 From: wayanrivan Date: Wed, 29 Apr 2026 10:20:15 +0700 Subject: [PATCH] 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";