feat(db): add registration relation to lab orders

This commit is contained in:
avicenan
2026-03-08 14:08:10 +07:00
parent 22bacf8e01
commit 164854ef04

View File

@ -16,6 +16,7 @@ import { User } from "../users";
import { Department } from "../department";
import { EmrLaboratoryOrderItem } from "./emr_laboratory_order_items";
import { LaboratoryOrderStatus } from "../../enum/laboratoryOrderStatus";
import { EmrRegistration } from "./emr_registration";
/**
* Laboratory orders entity.
@ -35,6 +36,10 @@ export class EmrLaboratoryOrder {
@Column({ type: "text", nullable: true })
notes: string;
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
@JoinColumn()
registration: EmrRegistration;
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
@JoinColumn()
patient: EmrPatient;