feat(emr): add EmrSurgerySchedule entity and update schema export

This commit is contained in:
Sony Surahmn
2026-05-19 00:39:41 +07:00
parent b6e8f7c889
commit 086db37261
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,56 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
ManyToOne,
JoinColumn,
} from "typeorm";
import { SurgeryRoom } from "../surgery_room";
import { EmrPatient } from "./emr_patient";
@Entity("emr_surgery_schedules", { schema: "emr" })
export class EmrSurgerySchedule {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => SurgeryRoom, { onDelete: "NO ACTION" })
@JoinColumn()
surgery_room: SurgeryRoom;
@Column({ type: "date", nullable: false })
schedule_date: Date;
@Column({ nullable: true, length: 256 })
patient_name: string;
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
patient: EmrPatient | null;
@Column({ nullable: false, length: 32, default: "scheduled" })
status: 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

@ -44,6 +44,7 @@ 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 "../entity/emr/emr_patient_education";
export * from "../entity/emr/emr_soap_notes"; export * from "../entity/emr/emr_soap_notes";
export * from "../entity/emr/emr_surgery_schedules";
export * from "../types/registration_type"; export * from "../types/registration_type";
export * from "../types/registration_status"; export * from "../types/registration_status";