add new entity: internal consultation done
This commit is contained in:
78
src/entity/emr/emr_internal_consultation.ts
Normal file
78
src/entity/emr/emr_internal_consultation.ts
Normal file
@ -0,0 +1,78 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { InternalConsulStatus } from "../../enum/internalConsulStatus";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { User } from "../users";
|
||||
import { Room } from "../room";
|
||||
import { Diagnosis } from "../diagnosis";
|
||||
|
||||
@Entity("emr_internal_consultation", { schema: "emr" })
|
||||
export class EmrInternalConsultation {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
emrpatient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
referring_room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
referring_doctor: User;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
consulted_room: Room;
|
||||
|
||||
@ManyToOne(() => Diagnosis, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
diagnosis: Diagnosis;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
requested_consultation: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
dates: Date;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: InternalConsulStatus,
|
||||
nullable: false,
|
||||
})
|
||||
status: InternalConsulStatus;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ export class EmrRegistrationOutpatient {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
|
||||
4
src/enum/internalConsulStatus.ts
Normal file
4
src/enum/internalConsulStatus.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export enum InternalConsulStatus {
|
||||
normal = 'normal',
|
||||
cito = 'cito',
|
||||
}
|
||||
@ -11,6 +11,7 @@ export * from "../entity/emr/emr_diet";
|
||||
export * from "../entity/emr/emr_diagnosis";
|
||||
export * from "../entity/emr/emr_diagnostic_procedure";
|
||||
export * from "../entity/emr/emr_doctor_procedure";
|
||||
export * from "../entity/emr/emr_internal_consultation";
|
||||
|
||||
export * from "../types/registration_type";
|
||||
export * from "../types/registration_status";
|
||||
|
||||
Reference in New Issue
Block a user