feat(ancillary-service): add new module of ancillary service
This commit is contained in:
113
src/entity/emr/emr_ancillary_service_order.ts
Normal file
113
src/entity/emr/emr_ancillary_service_order.ts
Normal file
@ -0,0 +1,113 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
Index
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { Department } from "../department";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { AncillaryServiceOrderStatus } from "../../types/ancillary_service_order_status";
|
||||
import { Service } from "../service";
|
||||
|
||||
@Entity("emr_ancillary_service_orders", { schema: "emr" })
|
||||
@Index(["order_no"], { unique: true })
|
||||
export class EmrAncillaryServiceOrder {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 128, unique: true })
|
||||
order_no: string;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
queue_number?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
queued_at?: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
schedule_date?: Date;
|
||||
|
||||
@Column({ type: "time", nullable: true })
|
||||
schedule_time?: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
examination_date?: Date;
|
||||
|
||||
@Column({ type: "time", nullable: true })
|
||||
examination_time?: Date;
|
||||
|
||||
@ManyToOne(() => Service, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "service_id" })
|
||||
service: Service | null;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
note?: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "registration_id" })
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "referring_room_id" })
|
||||
referring_room: Room | null;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "order_room_id" })
|
||||
order_room: Room | null;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "referring_doctor_id" })
|
||||
referring_doctor: User | null;
|
||||
|
||||
@ManyToOne(() => Department, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "department_id" })
|
||||
department: Department | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: AncillaryServiceOrderStatus,
|
||||
nullable: false,
|
||||
default: AncillaryServiceOrderStatus.ORDERED,
|
||||
})
|
||||
status: AncillaryServiceOrderStatus;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
result: string;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -54,6 +54,7 @@ export * from "../entity/emr/emr_odontogram_teeth";
|
||||
export * from "../entity/treatment/treatment_plan";
|
||||
export * from "../entity/treatment/treatment_plan_session";
|
||||
export * from "../entity/emr/emr_registration_treatment";
|
||||
export * from "../entity/emr/emr_ancillary_service_order";
|
||||
|
||||
export * from "../types/registration_type";
|
||||
export * from "../types/registration_status";
|
||||
@ -65,4 +66,4 @@ export * from "../enum/consciousness";
|
||||
export * from "../types/patient_category";
|
||||
export * from "../types/citizen";
|
||||
export * from "../types/treatment_session";
|
||||
|
||||
export * from "../types/ancillary_service_order_status";
|
||||
|
||||
13
src/types/ancillary_service_order_status.ts
Normal file
13
src/types/ancillary_service_order_status.ts
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Workflow status untuk order tindakan tambahan.
|
||||
* Ordered: order diterima oleh perawat
|
||||
* In Progress: order sedang dikerjakan
|
||||
* Completed: order selesai
|
||||
* Canceled: order dibatalkan
|
||||
*/
|
||||
export enum AncillaryServiceOrderStatus {
|
||||
ORDERED = "ordered",
|
||||
IN_PROGRESS = "in_progress",
|
||||
COMPLETED = "completed",
|
||||
CANCELED = "canceled",
|
||||
}
|
||||
Reference in New Issue
Block a user