feat: add laboratory orders entity
This commit is contained in:
@ -31,6 +31,22 @@ export class EmrLaboratoryOrderItemResult {
|
||||
@JoinColumn()
|
||||
examination_detail: ExaminationDetail;
|
||||
|
||||
/** Denormalized: examination type name from examination_type.name */
|
||||
@Column({ type: "text", nullable: true })
|
||||
examination_type: string;
|
||||
|
||||
/** Denormalized: examination detail name from examination_detail.name */
|
||||
@Column({ type: "text", nullable: true })
|
||||
examination_detail_name: string;
|
||||
|
||||
/** Denormalized: measurement unit from measurement_unit.unit */
|
||||
@Column({ nullable: true, length: 256 })
|
||||
measurement_unit: string;
|
||||
|
||||
/** Denormalized: reference range as flat string from reference_range */
|
||||
@Column({ type: "text", nullable: true })
|
||||
reference_range: string;
|
||||
|
||||
/** The actual examination result value that can be filled */
|
||||
@Column({ type: "text", nullable: true })
|
||||
examination_result: string;
|
||||
|
||||
@ -15,6 +15,7 @@ import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { Department } from "../department";
|
||||
import { EmrLaboratoryOrderItem } from "./emr_laboratory_order_items";
|
||||
import { LaboratoryOrderStatus } from "../../enum/laboratoryOrderStatus";
|
||||
|
||||
/**
|
||||
* Laboratory orders entity.
|
||||
@ -42,6 +43,10 @@ export class EmrLaboratoryOrder {
|
||||
@JoinColumn()
|
||||
referring_room: Room | null;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
order_room: Room | null;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
referring_doctor: User | null;
|
||||
@ -50,6 +55,14 @@ export class EmrLaboratoryOrder {
|
||||
@JoinColumn()
|
||||
department: Department | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: LaboratoryOrderStatus,
|
||||
nullable: false,
|
||||
default: LaboratoryOrderStatus.PENDING,
|
||||
})
|
||||
status: LaboratoryOrderStatus;
|
||||
|
||||
@OneToMany(() => EmrLaboratoryOrderItem, (item) => item.laboratory_order, { cascade: true })
|
||||
order_items: EmrLaboratoryOrderItem[];
|
||||
|
||||
|
||||
6
src/enum/laboratoryOrderStatus.ts
Normal file
6
src/enum/laboratoryOrderStatus.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export enum LaboratoryOrderStatus {
|
||||
PENDING = "pending",
|
||||
VERIFIED = "verified",
|
||||
COMPLETED = "completed",
|
||||
CANCELED = "canceled",
|
||||
}
|
||||
Reference in New Issue
Block a user