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,
|
UpdateDateColumn,
|
||||||
DeleteDateColumn,
|
DeleteDateColumn,
|
||||||
ManyToOne,
|
ManyToOne,
|
||||||
OneToOne,
|
|
||||||
JoinColumn,
|
JoinColumn,
|
||||||
|
OneToOne,
|
||||||
} from "typeorm";
|
} from "typeorm";
|
||||||
|
|
||||||
import { anamnesisStatus } from "../../enum/anamnesisStatus";
|
import { anamnesisStatus } from "../../enum/anamnesisStatus";
|
||||||
import { EmrRegistration } from "./emr_registration";
|
|
||||||
import { EmrPatient } from "./emr_patient";
|
import { EmrPatient } from "./emr_patient";
|
||||||
|
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
|
||||||
|
|
||||||
@Entity("emr_anamnesis", { schema: "emr" })
|
@Entity("emr_anamnesis", { schema: "emr" })
|
||||||
export class Emranamnesis {
|
export class Emranamnesis {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
@OneToOne(() => EmrRegistrationOutpatient, { onDelete: "CASCADE" })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
registration: EmrRegistration;
|
registration_outpatient: EmrRegistrationOutpatient;
|
||||||
|
|
||||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
patient: EmrPatient;
|
patient: EmrPatient;
|
||||||
|
|
||||||
/** Contoh: "08:00-12:00" atau "Pagi" */
|
|
||||||
@Column({ nullable: true, type: "text" })
|
@Column({ nullable: true, type: "text" })
|
||||||
chief_complaint: string;
|
main_complaint: string;
|
||||||
|
|
||||||
@Column({ nullable: true, type: "text" })
|
@Column({ nullable: true, type: "text" })
|
||||||
additional_complaint: string;
|
additional_complaint: string;
|
||||||
|
|||||||
@ -5,30 +5,24 @@ import {
|
|||||||
CreateDateColumn,
|
CreateDateColumn,
|
||||||
UpdateDateColumn,
|
UpdateDateColumn,
|
||||||
DeleteDateColumn,
|
DeleteDateColumn,
|
||||||
ManyToOne,
|
|
||||||
JoinColumn,
|
JoinColumn,
|
||||||
|
OneToOne,
|
||||||
} from "typeorm";
|
} from "typeorm";
|
||||||
|
|
||||||
import { consciousness } from "../../enum/consciousness";
|
import { consciousness } from "../../enum/consciousness";
|
||||||
import { EmrRegistration } from "./emr_registration";
|
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
|
||||||
|
|
||||||
enum YesNoEnum {
|
|
||||||
YES = "YES",
|
|
||||||
NO = "NO"
|
|
||||||
}
|
|
||||||
|
|
||||||
@Entity("emr_vital_signs", { schema: "emr" })
|
@Entity("emr_vital_signs", { schema: "emr" })
|
||||||
export class EmrVitalSigns {
|
export class EmrVitalSigns {
|
||||||
@PrimaryGeneratedColumn("uuid")
|
@PrimaryGeneratedColumn("uuid")
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
@OneToOne(() => EmrRegistrationOutpatient, { onDelete: "CASCADE" })
|
||||||
@JoinColumn()
|
@JoinColumn()
|
||||||
registration: EmrRegistration;
|
registration_outpatient: EmrRegistrationOutpatient;
|
||||||
|
|
||||||
/** Contoh: "08:00-12:00" atau "Pagi" */
|
|
||||||
@Column({ nullable: true, length: 64 })
|
@Column({ nullable: true, length: 64 })
|
||||||
blood_preasure: string;
|
blood_pressure: string;
|
||||||
|
|
||||||
@Column({ nullable: true, length: 64 })
|
@Column({ nullable: true, length: 64 })
|
||||||
heart_rate: string;
|
heart_rate: string;
|
||||||
@ -106,7 +100,7 @@ export class EmrVitalSigns {
|
|||||||
@Column({ nullable: true, length: 256 })
|
@Column({ nullable: true, length: 256 })
|
||||||
nutritional_status_assessment: string;
|
nutritional_status_assessment: string;
|
||||||
|
|
||||||
@Column({ nullable: true, type: "text" })
|
@Column({ nullable: true, type: "text" })
|
||||||
patient_education: string;
|
patient_education: string;
|
||||||
|
|
||||||
@Column({ nullable: true, length: 256 })
|
@Column({ nullable: true, length: 256 })
|
||||||
|
|||||||
Reference in New Issue
Block a user