feat: add new table of medical_form to store specific poli room. add odontogram emr form
This commit is contained in:
66
src/entity/emr/emr_odontogram.ts
Normal file
66
src/entity/emr/emr_odontogram.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { User } from "../users";
|
||||
import { EmrOdontogramTeeth } from "./emr_odontogram_teeth";
|
||||
import { OneToMany } from "typeorm";
|
||||
|
||||
@Entity("emr_odontogram", { schema: "emr" })
|
||||
export class EmrOdontogram {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: string;
|
||||
|
||||
@OneToMany(() => EmrOdontogramTeeth, (teeth: EmrOdontogramTeeth) => teeth.odontogram)
|
||||
teeth: EmrOdontogramTeeth[]
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
59
src/entity/emr/emr_odontogram_teeth.ts
Normal file
59
src/entity/emr/emr_odontogram_teeth.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrOdontogram } from "./emr_odontogram";
|
||||
|
||||
@Entity("emr_odontogram_teeth", { schema: "emr" })
|
||||
export class EmrOdontogramTeeth {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrOdontogram, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
odontogram: EmrOdontogram;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
tooth_number: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
surface: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
condition_code: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
note: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: 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;
|
||||
}
|
||||
|
||||
50
src/entity/medical_form.ts
Normal file
50
src/entity/medical_form.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
} from "typeorm";
|
||||
|
||||
@Entity("medical_form")
|
||||
export class MedicalForm {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
type: "varchar",
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 512,
|
||||
type: "varchar",
|
||||
})
|
||||
description: 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;
|
||||
}
|
||||
|
||||
@ -5,6 +5,9 @@ import { Department } from "./department";
|
||||
import { Service } from "./service";
|
||||
import { RoomStock } from "./pharmacy-logistic/room_stock";
|
||||
import { ServiceClass } from "./service_class";
|
||||
import { OneToMany } from "typeorm";
|
||||
import { MedicalForm } from "./medical_form";
|
||||
import { JoinTable } from "typeorm";
|
||||
|
||||
@Entity("rooms")
|
||||
export class Room {
|
||||
@ -66,6 +69,10 @@ export class Room {
|
||||
@ManyToMany(() => Service, (service) => service.rooms)
|
||||
services: Service[];
|
||||
|
||||
@ManyToMany(() => MedicalForm, { onDelete: "CASCADE" })
|
||||
@JoinTable()
|
||||
medical_forms: MedicalForm[];
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
|
||||
@ -45,6 +45,8 @@ export * from "../entity/emr/emr_nursing_assesment";
|
||||
export * from "../entity/emr/emr_patient_education";
|
||||
export * from "../entity/emr/emr_soap_notes";
|
||||
export * from "../entity/emr/emr_surgery_schedules";
|
||||
export * from "../entity/emr/emr_odontogram";
|
||||
export * from "../entity/emr/emr_odontogram_teeth";
|
||||
|
||||
export * from "../types/registration_type";
|
||||
export * from "../types/registration_status";
|
||||
|
||||
@ -56,6 +56,7 @@ export * from "../entity/responsible_party_consent";
|
||||
export * from "../entity/foster_care_history";
|
||||
export * from "../entity/notification";
|
||||
export * from "../entity/counter";
|
||||
export * from "../entity/medical_form";
|
||||
|
||||
export * from "../types/public";
|
||||
export * from "../types/action";
|
||||
|
||||
Reference in New Issue
Block a user