diff --git a/src/entity/emr/emr_laboratory_orders.ts b/src/entity/emr/emr_laboratory_orders.ts index 4681bea..150ab18 100644 --- a/src/entity/emr/emr_laboratory_orders.ts +++ b/src/entity/emr/emr_laboratory_orders.ts @@ -8,6 +8,7 @@ import { ManyToOne, OneToMany, JoinColumn, + Index } from "typeorm"; import { EmrPatient } from "./emr_patient"; @@ -23,6 +24,7 @@ import { EmrRegistration } from "./emr_registration"; * Contains order header information: order number, patient, referring room/doctor, schedule, registration info. */ @Entity("emr_laboratory_orders", { schema: "emr" }) +@Index(["order_lab_no"], { unique: true }) export class EmrLaboratoryOrder { @PrimaryGeneratedColumn("uuid") id: string; diff --git a/src/entity/emr/emr_pharmacy_order.ts b/src/entity/emr/emr_pharmacy_order.ts index a323da7..8b598cc 100644 --- a/src/entity/emr/emr_pharmacy_order.ts +++ b/src/entity/emr/emr_pharmacy_order.ts @@ -20,7 +20,7 @@ import { PharmacyOrderStatus } from "../../types/pharmacy_order_status"; import { EmrPharmacyOrderActivity } from "./emr_pharmacy_order_activity"; @Entity("emr_pharmacy_order", { schema: "emr" }) -@Index(["code", "queue_number"], { unique: true }) +@Index(["code"], { unique: true }) export class EmrPharmacyOrder { @PrimaryGeneratedColumn("uuid") id: string; diff --git a/src/entity/emr/emr_radiology.ts b/src/entity/emr/emr_radiology.ts index f4fe2ef..7552360 100644 --- a/src/entity/emr/emr_radiology.ts +++ b/src/entity/emr/emr_radiology.ts @@ -8,7 +8,8 @@ import { ManyToOne, OneToOne, JoinColumn, - OneToMany + OneToMany, + Index } from "typeorm"; import { RadiologyOrderStatus } from "../../types/radiology_order_status"; import { EmrPatient } from "./emr_patient"; @@ -18,6 +19,7 @@ import { Room } from "../room"; import { EmrRegistration } from "./emr_registration"; @Entity("emr_radiology", { schema: "emr" }) +@Index(["order_number"], { unique: true }) export class Radiology { @PrimaryGeneratedColumn("uuid") id: string;