feat(prescription): add new column of note
This commit is contained in:
@ -63,6 +63,10 @@ export class EmrPrescription {
|
|||||||
@Column({ type: "decimal", precision: 10, scale: 2, nullable: true })
|
@Column({ type: "decimal", precision: 10, scale: 2, nullable: true })
|
||||||
total_price?: number | null;
|
total_price?: number | null;
|
||||||
|
|
||||||
|
@Column({ nullable: true, type: "text" })
|
||||||
|
note: string | null;
|
||||||
|
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|||||||
@ -1,66 +0,0 @@
|
|||||||
import {
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
DeleteDateColumn,
|
|
||||||
ManyToOne,
|
|
||||||
JoinColumn,
|
|
||||||
} from "typeorm";
|
|
||||||
|
|
||||||
import { EmrPrescriptionOrder } from "./emr_prescription_orders";
|
|
||||||
import { ItemMaster } from "../pharmacy/item_master";
|
|
||||||
import { UsageInstructions } from "../pharmacy/usage_instructions";
|
|
||||||
import { UsageTime } from "../pharmacy/usage_time";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prescription order items entity.
|
|
||||||
* Stores each medication item with quantity and usage instructions/timing.
|
|
||||||
*/
|
|
||||||
@Entity("emr_prescription_order_items", { schema: "emr" })
|
|
||||||
export class EmrPrescriptionOrderItem {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => EmrPrescriptionOrder, (order) => order.items, { onDelete: "CASCADE" })
|
|
||||||
@JoinColumn({ name: "prescription_order_id" })
|
|
||||||
prescription_order: EmrPrescriptionOrder;
|
|
||||||
|
|
||||||
@ManyToOne(() => ItemMaster, { onDelete: "NO ACTION" })
|
|
||||||
@JoinColumn({ name: "item_master_id" })
|
|
||||||
item_master: ItemMaster;
|
|
||||||
|
|
||||||
@Column({ type: "int", nullable: false, default: 1 })
|
|
||||||
qty: number;
|
|
||||||
|
|
||||||
@ManyToOne(() => UsageInstructions, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn({ name: "usage_instruction_id" })
|
|
||||||
usage_instruction: UsageInstructions | null;
|
|
||||||
|
|
||||||
@ManyToOne(() => UsageTime, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn({ name: "usage_time_id" })
|
|
||||||
usage_time: UsageTime | null;
|
|
||||||
|
|
||||||
@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;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,84 +0,0 @@
|
|||||||
import {
|
|
||||||
Entity,
|
|
||||||
PrimaryGeneratedColumn,
|
|
||||||
Column,
|
|
||||||
CreateDateColumn,
|
|
||||||
UpdateDateColumn,
|
|
||||||
DeleteDateColumn,
|
|
||||||
ManyToOne,
|
|
||||||
OneToMany,
|
|
||||||
JoinColumn,
|
|
||||||
} from "typeorm";
|
|
||||||
|
|
||||||
import { EmrPatient } from "./emr_patient";
|
|
||||||
import { Room } from "../room";
|
|
||||||
import { User } from "../users";
|
|
||||||
import { EmrRegistration } from "./emr_registration";
|
|
||||||
import { EmrPrescriptionOrderItem } from "./emr_prescription_order_items";
|
|
||||||
import { PrescriptionPharmacyStatus } from "../../types/prescription_pharmacy_status";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prescription orders entity.
|
|
||||||
* Header information for a medication prescription: order number, patient, doctor, rooms, registration, and pharmacy status.
|
|
||||||
*/
|
|
||||||
@Entity("emr_prescription_orders", { schema: "emr" })
|
|
||||||
export class EmrPrescriptionOrder {
|
|
||||||
@PrimaryGeneratedColumn("uuid")
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
@Column({ nullable: false, length: 128, unique: true })
|
|
||||||
order_no: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn({ name: "registration_id" })
|
|
||||||
registration: EmrRegistration | null;
|
|
||||||
|
|
||||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
|
||||||
@JoinColumn({ name: "patient_id" })
|
|
||||||
patient: EmrPatient;
|
|
||||||
|
|
||||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn({ name: "doctor_id" })
|
|
||||||
doctor: User | null;
|
|
||||||
|
|
||||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn({ name: "room_id" })
|
|
||||||
room: Room | null;
|
|
||||||
|
|
||||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
|
||||||
@JoinColumn({ name: "referring_room_id" })
|
|
||||||
referring_room: Room | null;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
type: "enum",
|
|
||||||
enum: PrescriptionPharmacyStatus,
|
|
||||||
nullable: false,
|
|
||||||
default: PrescriptionPharmacyStatus.PENDING,
|
|
||||||
})
|
|
||||||
pharmacy_status: PrescriptionPharmacyStatus;
|
|
||||||
|
|
||||||
@OneToMany(() => EmrPrescriptionOrderItem, (item) => item.prescription_order, { cascade: true })
|
|
||||||
items: EmrPrescriptionOrderItem[];
|
|
||||||
|
|
||||||
@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;
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user