diff --git a/src/entity/emr/emr_surgery_schedules.ts b/src/entity/emr/emr_surgery_schedules.ts index 9f36ef8..5504026 100644 --- a/src/entity/emr/emr_surgery_schedules.ts +++ b/src/entity/emr/emr_surgery_schedules.ts @@ -9,18 +9,29 @@ import { JoinColumn, } from "typeorm"; import { SurgeryRoom } from "../surgery_room"; +import { SurgeryType } from "../surgery_type"; +import { Room } from "../room"; import { EmrPatient } from "./emr_patient"; import { EmrBoardingRoom } from "./emr_boarding_rooms"; +import { EmrRegistrationOutpatient } from "./emr_registration_outpatient"; @Entity("emr_surgery_schedules", { schema: "emr" }) export class EmrSurgerySchedule { @PrimaryGeneratedColumn("uuid") id: string; + @ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + room: Room | null; + @ManyToOne(() => SurgeryRoom, { onDelete: "NO ACTION" }) @JoinColumn() surgery_room: SurgeryRoom; + @ManyToOne(() => SurgeryType, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + surgery_type: SurgeryType | null; + @Column({ type: "date", nullable: false }) schedule_date: Date; @@ -62,12 +73,28 @@ export class EmrSurgerySchedule { @Column({ nullable: true, type: "time" }) schedule_time: string; + @Column({ nullable: true, type: "time" }) + schedule_end_time: string; + @Column({ nullable: false, length: 32, default: "scheduled" }) status: string; + @Column({ nullable: true, length: 32 }) + surgery_priority: string; + + @Column({ nullable: true, length: 32 }) + phone: string; + + @Column({ nullable: true, type: "text" }) + alkses_bhp: string; + @Column({ nullable: true, type: "text" }) notes: string; + @ManyToOne(() => EmrRegistrationOutpatient, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + registration_outpatient: EmrRegistrationOutpatient | null; + @CreateDateColumn() created_at: Date;