diff --git a/src/entity/emr/emr_boarding_rooms.ts b/src/entity/emr/emr_boarding_rooms.ts index 3b88913..5682329 100644 --- a/src/entity/emr/emr_boarding_rooms.ts +++ b/src/entity/emr/emr_boarding_rooms.ts @@ -1,24 +1,40 @@ import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm"; +import { EmrPatient } from "./emr_patient"; +import { EmrDiagnosis } from "./emr_diagnosis"; import { EmrRegistration } from "./emr_registration"; import { User } from "../users"; -import { EmrPatient } from "./emr_patient"; +import { InpatientRoom } from "../inpatient_rooms"; @Entity("emr_boarding_rooms", { schema: "emr" }) export class EmrBoardingRoom { @PrimaryGeneratedColumn("uuid") id: string; - @ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION" }) + @ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() registration: EmrRegistration; - @ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" }) + @ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() patient: EmrPatient; - @ManyToOne(() => User, { onDelete: "NO ACTION" }) + @ManyToOne(() => EmrDiagnosis, { onDelete: "NO ACTION", nullable: true }) @JoinColumn() - doctor: User; + diagnosis: EmrDiagnosis; + + @ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + user: User; + + @ManyToOne(() => InpatientRoom, { onDelete: "NO ACTION", nullable: true }) + @JoinColumn() + inpatient_room: InpatientRoom; + + @Column({ nullable: true, length: 32 }) + no_reg: string; + + @Column({ nullable: true, length: 64 }) + mrn: string; @Column({ nullable: false }) boarding_at: Date;