feat(emr_soap_notes): add entity for SOAP notes with relevant fields and relationships

This commit is contained in:
Sony Surahmn
2026-05-06 16:41:09 +07:00
parent 7281cedb88
commit 1ba8901473
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,66 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
ManyToOne,
JoinColumn,
} from "typeorm";
import { EmrPatient } from "./emr_patient";
import { EmrRegistration } from "./emr_registration";
import { User } from "../users";
@Entity("emr_soap_notes")
export class EmrSoapNotes {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
@JoinColumn()
registration: EmrRegistration;
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
@JoinColumn()
patient: EmrPatient;
@ManyToOne(() => User, { onDelete: "SET NULL", nullable: true })
@JoinColumn()
doctor: User | null;
@Column({ nullable: true, type: "timestamp" })
input_date: Date | null;
@Column({ nullable: true, type: "text" })
subjective: string | null;
@Column({ nullable: true, type: "text" })
objective: string | null;
@Column({ nullable: true, type: "text" })
assessment: string | null;
@Column({ nullable: true, type: "text" })
plan: string | null;
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true, length: 256 })
created_by: string;
@UpdateDateColumn({ nullable: true })
updated_at: Date;
@Column({ nullable: true, length: 256 })
updated_by: string;
@DeleteDateColumn({ nullable: true })
deleted_at: Date;
@Column({ nullable: true, length: 256 })
deleted_by: string;
}

View File

@ -43,6 +43,7 @@ export * from "../entity/emr/emr_doctor_order_emergency";
export * from "../entity/emr/emr_atenatal_care";
export * from "../entity/emr/emr_nursing_assesment";
export * from "../entity/emr/emr_patient_education";
export * from "../entity/emr/emr_soap_notes";
export * from "../types/registration_type";
export * from "../types/registration_status";