update entity and controller for compounding medicine to add relation with usage time and usage instructions
This commit is contained in:
@ -5,10 +5,14 @@ import {
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToMany
|
||||
OneToMany,
|
||||
ManyToOne,
|
||||
JoinColumn
|
||||
} from "typeorm";
|
||||
|
||||
import {EmrCompoundingMedicineItem} from "./emr_compounding_medicine_item";
|
||||
import { EmrCompoundingMedicineItem } from "./emr_compounding_medicine_item";
|
||||
import { UsageTime } from "../pharmacy/usage_time";
|
||||
import { UsageInstructions } from "../pharmacy/usage_instructions";
|
||||
|
||||
@Entity("emr_compounding_medicine", { schema: "emr" })
|
||||
export class EmrCompoundingMedicine {
|
||||
@ -30,11 +34,13 @@ export class EmrCompoundingMedicine {
|
||||
@Column({ nullable: true, type: "text" })
|
||||
compounding_notes: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
usage_time: string;
|
||||
@ManyToOne(() => UsageTime, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
usagetime: UsageTime;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
usage_instructions: string;
|
||||
@ManyToOne(() => UsageInstructions, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
usageinstructions: UsageInstructions;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
|
||||
Reference in New Issue
Block a user