update: compounding medicine done

This commit is contained in:
wayanrivan
2026-03-26 13:57:30 +07:00
parent db8325e00b
commit a0bff58d49
3 changed files with 116 additions and 0 deletions

View File

@ -0,0 +1,60 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
OneToMany
} from "typeorm";
import {EmrCompoundingMedicineItem} from "./emr_compounding_medicine_item";
@Entity("emr_compounding_medicine", { schema: "emr" })
export class EmrCompoundingMedicine {
@PrimaryGeneratedColumn("uuid")
id: string;
@OneToMany(() => EmrCompoundingMedicineItem, (detail) => detail.compoundingmedicine)
compoundingmedicineitem: EmrCompoundingMedicineItem[];
@Column({ nullable: true, type: "text" })
name: string;
@Column({
type: "int",
nullable: false
})
qty: number;
@Column({ nullable: true, type: "text" })
compounding_notes: string;
@Column({ nullable: true, type: "text" })
usage_time: string;
@Column({ nullable: true, type: "text" })
usage_instructions: 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;
}

View File

@ -0,0 +1,54 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
ManyToOne,
JoinColumn,
} from "typeorm";
import { ItemMaster } from "../pharmacy/item_master";
import { EmrCompoundingMedicine } from "./emr_compounding_medicine";
@Entity("emr_compounding_medicine_item", { schema: "emr" })
export class EmrCompoundingMedicineItem {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => ItemMaster, { onDelete: "CASCADE" })
@JoinColumn()
itemmaster: ItemMaster;
@ManyToOne(() => EmrCompoundingMedicine, { onDelete: "CASCADE" })
@JoinColumn()
compoundingmedicine: EmrCompoundingMedicine;
@Column({
type: "int",
nullable: false
})
dose: number
@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;
}

View File

@ -19,6 +19,8 @@ export * from "../entity/emr/emr_prescription_orders";
export * from "../entity/emr/emr_prescription_order_items"; export * from "../entity/emr/emr_prescription_order_items";
export * from "../entity/emr/emr_radiology"; export * from "../entity/emr/emr_radiology";
export * from "../entity/emr/emr_radiology_services"; export * from "../entity/emr/emr_radiology_services";
export * from "../entity/emr/emr_compounding_medicine";
export * from "../entity/emr/emr_compounding_medicine_item";
export * from "../types/registration_type"; export * from "../types/registration_type";
export * from "../types/registration_status"; export * from "../types/registration_status";