This commit is contained in:
2026-04-29 11:02:46 +07:00
3 changed files with 100 additions and 1 deletions

View File

@ -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;
}

View File

@ -17,6 +17,7 @@ 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"; 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). * Registrasi base: data umum untuk semua tipe (rawat jalan, rawat inap, emergency, hemodialysis).
@ -28,6 +29,9 @@ export class EmrRegistration {
@PrimaryGeneratedColumn("uuid") @PrimaryGeneratedColumn("uuid")
id: string; id: string;
@OneToOne(() => EmrRegistrationEmergencyResponsible, (emergency) => emergency.emrregistration)
emergency_responsible: EmrRegistrationEmergencyResponsible;
@OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration) @OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration)
outpatient: EmrRegistrationOutpatient; outpatient: EmrRegistrationOutpatient;

View File

@ -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_doctor_order_emergency";
export * from "../entity/emr/emr_atenatal_care"; export * from "../entity/emr/emr_atenatal_care";
export * from "../entity/emr/emr_nursing_assesment"; export * from "../entity/emr/emr_nursing_assesment";
export * from "../entity/emr/emr_patient_education";
export * from "../types/registration_type"; export * from "../types/registration_type";
export * from "../types/registration_status"; export * from "../types/registration_status";