diff --git a/src/entity/emr/emr_inpatient_room_beds.ts b/src/entity/emr/emr_inpatient_room_beds.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/entity/inpatient_room_beds.ts b/src/entity/inpatient_room_beds.ts new file mode 100644 index 0000000..0d068c2 --- /dev/null +++ b/src/entity/inpatient_room_beds.ts @@ -0,0 +1,51 @@ +import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm"; +import { InpatientRoom } from "./inpatient_rooms"; +import { EmrBoardingRoom } from "./emr/emr_boarding_rooms"; +import { InpatientRoomBedStatus } from "../types/public"; + +@Entity("inpatient_room_beds") +export class InpatientRoomBed { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => InpatientRoom, { onDelete: "NO ACTION" }) + @JoinColumn() + inpatient_room: InpatientRoom; + + @ManyToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" }) + @JoinColumn() + boarding_room: EmrBoardingRoom; + + @Column({ + nullable: false, + type: "int", + }) + order_number: number; + + @Column({ + nullable: false, + length: 64, + }) + status: InpatientRoomBedStatus; + + @Column() + @CreateDateColumn() + created_at: Date; + + @Column({ nullable: true, length: 256 }) + created_by: string; + + @Column({ nullable: true }) + @UpdateDateColumn() + updated_at: Date; + + @Column({ nullable: true, length: 256 }) + updated_by: string; + + @Column({ nullable: true }) + @DeleteDateColumn() + deleted_at: Date; + + @Column({ nullable: true, length: 256 }) + deleted_by: string; +} diff --git a/src/schema/public.ts b/src/schema/public.ts index 603ff7d..a97f9c8 100644 --- a/src/schema/public.ts +++ b/src/schema/public.ts @@ -11,6 +11,7 @@ export * from "../entity/suco"; export * from "../entity/application"; export * from "../entity/currencies"; export * from "../entity/inpatient_rooms"; +export * from "../entity/inpatient_room_beds"; export * from "../entity/nationality"; export * from "../entity/diagnosis"; export * from "../entity/diagnostic_procedure"; @@ -51,6 +52,7 @@ export * from "../entity/ward"; export * from "../entity/responsible_party_consent"; export * from "../entity/foster_care_history"; +export * from "../types/public"; export * from "../types/action"; export * from "../types/error"; export * from "../types/paging"; diff --git a/src/types/public.ts b/src/types/public.ts new file mode 100644 index 0000000..205a528 --- /dev/null +++ b/src/types/public.ts @@ -0,0 +1,16 @@ +export enum InpatientRoomBedStatus { + "Green" = "green", + "Red" = "red", + "Pink" = "pink", + "Yellow" = "yellow", + "Gray" = "gray", + "Blue" = "blue", + "Purple" = "purple", + "Orange" = "orange", + "White" = "white", + "Brown" = "brown", + "DarkBlue" = "dark_blue", + "PeachPuff" = "peachpuff", + "PinkIntermittent" = "pink_intermittent", + "PinkContinues" = "pink_continues", +}