update: EmrCompoundingMedicine entity to include relation with EmrRegistration and update related controller to handle the new relation
This commit is contained in:
@ -13,6 +13,7 @@ import {
|
|||||||
import { EmrCompoundingMedicineItem } from "./emr_compounding_medicine_item";
|
import { EmrCompoundingMedicineItem } from "./emr_compounding_medicine_item";
|
||||||
import { UsageTime } from "../pharmacy/usage_time";
|
import { UsageTime } from "../pharmacy/usage_time";
|
||||||
import { UsageInstructions } from "../pharmacy/usage_instructions";
|
import { UsageInstructions } from "../pharmacy/usage_instructions";
|
||||||
|
import { EmrRegistration } from "./emr_registration";
|
||||||
|
|
||||||
@Entity("emr_compounding_medicine", { schema: "emr" })
|
@Entity("emr_compounding_medicine", { schema: "emr" })
|
||||||
export class EmrCompoundingMedicine {
|
export class EmrCompoundingMedicine {
|
||||||
@ -34,6 +35,10 @@ export class EmrCompoundingMedicine {
|
|||||||
@Column({ nullable: true, type: "text" })
|
@Column({ nullable: true, type: "text" })
|
||||||
compounding_notes: string;
|
compounding_notes: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||||
|
@JoinColumn()
|
||||||
|
emrregistration: EmrRegistration;
|
||||||
|
|
||||||
@ManyToOne(() => UsageTime, { onDelete: "CASCADE" })
|
@ManyToOne(() => UsageTime, { onDelete: "CASCADE" })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
usagetime: UsageTime;
|
usagetime: UsageTime;
|
||||||
|
|||||||
47
src/entity/emr/emr_external_consultation.ts
Normal file
47
src/entity/emr/emr_external_consultation.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
OneToOne,
|
||||||
|
JoinColumn,
|
||||||
|
ManyToOne,
|
||||||
|
} from "typeorm";
|
||||||
|
import { RefferalHospital } from "../refferal_hospital";
|
||||||
|
|
||||||
|
@Entity("emr_external_consultation", { schema: "emr" })
|
||||||
|
export class EmrExternalConsultation {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@OneToOne(() => RefferalHospital, { onDelete: "CASCADE" })
|
||||||
|
@JoinColumn()
|
||||||
|
refferalhospital: RefferalHospital;
|
||||||
|
|
||||||
|
@Column({ nullable: true, type: "text" })
|
||||||
|
notes: 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;
|
||||||
|
}
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ export * from "../entity/emr/emr_radiology_services";
|
|||||||
export * from "../entity/emr/emr_compounding_medicine";
|
export * from "../entity/emr/emr_compounding_medicine";
|
||||||
export * from "../entity/emr/emr_compounding_medicine_item";
|
export * from "../entity/emr/emr_compounding_medicine_item";
|
||||||
export * from "../entity/emr/emr_room_medical_equipment";
|
export * from "../entity/emr/emr_room_medical_equipment";
|
||||||
|
export * from "../entity/emr/emr_external_consultation";
|
||||||
|
|
||||||
export * from "../types/registration_type";
|
export * from "../types/registration_type";
|
||||||
export * from "../types/registration_status";
|
export * from "../types/registration_status";
|
||||||
|
|||||||
Reference in New Issue
Block a user