refactor(emr_boarding_rooms): update relationships and add new fields for patient, diagnosis, and inpatient room
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user