feat(emr): add patient and doctor relations to procedure
This commit is contained in:
@ -12,8 +12,10 @@ import {
|
|||||||
import { Service } from "../service";
|
import { Service } from "../service";
|
||||||
import { ServiceType } from "../service_type";
|
import { ServiceType } from "../service_type";
|
||||||
import { EmrRegistration } from "./emr_registration";
|
import { EmrRegistration } from "./emr_registration";
|
||||||
|
import { EmrPatient } from "./emr_patient";
|
||||||
|
import { User } from "../users";
|
||||||
|
|
||||||
@Entity('emr_doctor_procedure',{ schema: "emr" })
|
@Entity('emr_doctor_procedure', { schema: "emr" })
|
||||||
export class EmrDoctorProcedure {
|
export class EmrDoctorProcedure {
|
||||||
@PrimaryGeneratedColumn('uuid')
|
@PrimaryGeneratedColumn('uuid')
|
||||||
id: string;
|
id: string;
|
||||||
@ -22,9 +24,13 @@ export class EmrDoctorProcedure {
|
|||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
registration: EmrRegistration;
|
registration: EmrRegistration;
|
||||||
|
|
||||||
@ManyToOne(() => ServiceType, { onDelete: 'NO ACTION' })
|
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
serviceType: ServiceType;
|
patient: EmrPatient;
|
||||||
|
|
||||||
|
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||||
|
@JoinColumn()
|
||||||
|
doctor: User;
|
||||||
|
|
||||||
@ManyToOne(() => Service, { onDelete: 'NO ACTION' })
|
@ManyToOne(() => Service, { onDelete: 'NO ACTION' })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
|
|||||||
Reference in New Issue
Block a user