fix(db): map emr records to outpatient registration
Switch anamnesis and vital signs to reference EmrRegistrationOutpatient with one-to-one relations. Rename complaint and blood pressure fields to use consistent, correct naming. BREAKING CHANGE: emr_anamnesis.registration is now registration_outpatient and chief_complaint is now main_complaint. emr_vital_signs.registration is now registration_outpatient and blood_preasure is now blood_pressure.
This commit is contained in:
@ -6,30 +6,29 @@ import {
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { anamnesisStatus } from "../../enum/anamnesisStatus";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
|
||||
|
||||
@Entity("emr_anamnesis", { schema: "emr" })
|
||||
export class Emranamnesis {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@OneToOne(() => EmrRegistrationOutpatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
registration_outpatient: EmrRegistrationOutpatient;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
/** Contoh: "08:00-12:00" atau "Pagi" */
|
||||
@Column({ nullable: true, type: "text" })
|
||||
chief_complaint: string;
|
||||
main_complaint: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
additional_complaint: string;
|
||||
|
||||
@ -5,30 +5,24 @@ import {
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { consciousness } from "../../enum/consciousness";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
enum YesNoEnum {
|
||||
YES = "YES",
|
||||
NO = "NO"
|
||||
}
|
||||
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
|
||||
|
||||
@Entity("emr_vital_signs", { schema: "emr" })
|
||||
export class EmrVitalSigns {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@OneToOne(() => EmrRegistrationOutpatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
registration_outpatient: EmrRegistrationOutpatient;
|
||||
|
||||
/** Contoh: "08:00-12:00" atau "Pagi" */
|
||||
@Column({ nullable: true, length: 64 })
|
||||
blood_preasure: string;
|
||||
blood_pressure: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
heart_rate: string;
|
||||
|
||||
Reference in New Issue
Block a user