update: emergency triage done

This commit is contained in:
wayanrivan
2026-04-14 10:42:21 +07:00
parent c311ffcffe
commit e121e7e64f
4 changed files with 199 additions and 9 deletions

View File

@ -7,14 +7,13 @@ import {
DeleteDateColumn, DeleteDateColumn,
OneToOne, OneToOne,
JoinColumn, JoinColumn,
ManyToOne,
} from "typeorm"; } from "typeorm";
import { EmrRegistration } from "./emr_registration"; import { EmrRegistration } from "./emr_registration";
import { User } from "../users";
import { Diagnosis } from "../diagnosis";
/**
* Detail registrasi gawat darurat (emergency).
* Form spesifik: tingkat keparahan, triage, waktu datang, dll.
*/
@Entity("emr_registration_emergency", { schema: "emr" }) @Entity("emr_registration_emergency", { schema: "emr" })
export class EmrRegistrationEmergency { export class EmrRegistrationEmergency {
@PrimaryGeneratedColumn("uuid") @PrimaryGeneratedColumn("uuid")
@ -24,13 +23,111 @@ export class EmrRegistrationEmergency {
@JoinColumn() @JoinColumn()
registration: EmrRegistration; registration: EmrRegistration;
/** Tingkat keparahan / triage (e.g. merah, kuning, hijau) */ @ManyToOne(() => Diagnosis, { onDelete: "CASCADE" })
@Column({ nullable: true, length: 32 }) @JoinColumn()
severity: string; diagnosis: Diagnosis;
@Column({ nullable: true, length: 64 }) @ManyToOne(() => User, { onDelete: "CASCADE" })
@JoinColumn()
user: User;
@Column({ nullable: true, type: "text" })
trauma: string;
@Column({ nullable: true, type: "text" })
registration_number: string;
@Column({ nullable: true, type: "text" })
fullname: string;
@Column({ nullable: true, type: "text" })
nik: string;
@Column({ type: "date", nullable: true })
birthdate: Date;
@Column({ nullable: true, type: "text" })
additionalcomplaint: string;
@Column({ nullable: true, type: "text" })
medicalhistory: string;
@Column({ nullable: true, type: "text" })
bloodpressure: string;
@Column({ nullable: true, type: "text" })
heartrate: string;
@Column({ nullable: true, type: "text" })
respiratoryrate: string;
@Column({ nullable: true, type: "text" })
temperature: string;
@Column({ nullable: true, type: "text" })
howtocome: string;
@Column({ nullable: true, type: "text" })
casedefinition: string;
@Column({
type: 'text',
nullable: true,
array: true,
})
consciousness: string[];
@Column({
type: 'text',
nullable: true,
array: true,
})
airway: string[];
@Column({
type: 'text',
nullable: true,
array: true,
})
breathing: string[];
@Column({
type: 'text',
nullable: true,
array: true,
})
circulation: string[];
@Column({ nullable: true, type: "text" })
resuscitation: string;
@Column({ nullable: true, type: "text" })
observation: string;
@Column({ nullable: true, type: "text" })
polycliniccontrol: string;
@Column({ nullable: true, type: "text" })
gohome: string;
@Column({ nullable: true, type: "text" })
other: string;
@Column({ type: "timestamp", nullable: true })
changeshift: Date;
@Column({ nullable: true, type: "text" })
triage_level: string; triage_level: string;
@Column({ type: "boolean", default: true })
falseemergency: boolean;
@Column({ nullable: true, type: "text" })
status: string;
@Column({ nullable: true, type: "text" })
color: string | null;
@Column({ type: "timestamp", nullable: true }) @Column({ type: "timestamp", nullable: true })
arrival_time: Date; arrival_time: Date;

View File

@ -0,0 +1,92 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
OneToOne,
JoinColumn,
OneToMany,
ManyToMany,
ManyToOne,
} from "typeorm";
import { Room } from "../room";
import { PatientGuarantor } from "../patient_guarantor";
import { Province } from "../province";
import { City } from "../city";
import { Subdistrict } from "../subdistrict";
import { Ward } from "../ward";
import { EmrRegistration } from "./emr_registration";
@Entity("emr_registration_emergency_responsible", { schema: "emr" })
export class EmrRegistrationEmergencyResponsible {
@PrimaryGeneratedColumn("uuid")
id: string;
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
@JoinColumn()
emrregistration: EmrRegistration;
@ManyToOne(() => Room, { onDelete: "CASCADE" })
@JoinColumn()
room: Room;
@ManyToOne(() => PatientGuarantor, { onDelete: "CASCADE" })
@JoinColumn()
guarantor: PatientGuarantor;
@ManyToOne(() => Province, { onDelete: "CASCADE" })
@JoinColumn({ referencedColumnName: "code" })
province: Province;
@ManyToOne(() => City, { onDelete: "CASCADE" })
@JoinColumn({ referencedColumnName: "code" })
city: City;
@ManyToOne(() => Subdistrict, { onDelete: "CASCADE" })
@JoinColumn({ referencedColumnName: "code" })
subdistrict: Subdistrict;
@ManyToOne(() => Ward, { onDelete: "CASCADE" })
@JoinColumn({ referencedColumnName: "code" })
ward: Ward;
/** Tingkat keparahan / triage (e.g. merah, kuning, hijau) */
@Column({ nullable: true, type: "text" })
fullname: string;
@Column({ nullable: true, type: "text" })
relation: string;
@Column({ nullable: true, type: "text" })
idnumber: string;
@Column({ nullable: true, type: "text" })
phone: string;
@Column({ nullable: true, type: "text" })
address: 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;
}

View File

@ -18,7 +18,7 @@ import {
// Relasi ke Service, tiap service bisa terkait dengan banyak room // Relasi ke Service, tiap service bisa terkait dengan banyak room
@ManyToOne(() => User, { nullable: false }) @ManyToOne(() => User, { nullable: false })
@JoinColumn({ name: "service_id" }) @JoinColumn({ name: "user_id" })
user!: User; user!: User;
// Relasi ke Room, tiap room bisa terkait dengan banyak service // Relasi ke Room, tiap room bisa terkait dengan banyak service

View File

@ -24,6 +24,7 @@ export * from "../entity/emr/emr_room_medical_equipment";
export * from "../entity/emr/emr_external_consultation"; export * from "../entity/emr/emr_external_consultation";
export * from "../entity/emr/emr_pharmacy_order"; export * from "../entity/emr/emr_pharmacy_order";
export * from "../entity/emr/emr_pharmacy_order_activity"; export * from "../entity/emr/emr_pharmacy_order_activity";
export * from "../entity/emr/emr_registration_emergency_responsible";
export * from "../types/registration_type"; export * from "../types/registration_type";
export * from "../types/registration_status"; export * from "../types/registration_status";