feat(regis):add referral_hospital on emr regis
This commit is contained in:
@ -1,15 +1,4 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
ManyToMany
|
||||
} from "typeorm";
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, OneToOne, ManyToMany } from "typeorm";
|
||||
|
||||
import { RegistrationType } from "../../types/registration_type";
|
||||
import { RegistrationStatus } from "../../types/registration_status";
|
||||
@ -18,6 +7,7 @@ import { PatientGuarantor } from "../patient_guarantor";
|
||||
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
|
||||
import { EmrRegistrationEmergency } from "./emr_registration_emergency";
|
||||
import { EmrRegistrationEmergencyResponsible } from "./emr_registration_emergency_responsible";
|
||||
import { RefferalHospital } from "../refferal_hospital";
|
||||
|
||||
/**
|
||||
* Registrasi base: data umum untuk semua tipe (rawat jalan, rawat inap, emergency, hemodialysis).
|
||||
@ -26,75 +16,79 @@ import { EmrRegistrationEmergencyResponsible } from "./emr_registration_emergenc
|
||||
*/
|
||||
@Entity("emr_registrations", { schema: "emr" })
|
||||
export class EmrRegistration {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistrationEmergencyResponsible, (emergency) => emergency.emrregistration)
|
||||
emergency_responsible: EmrRegistrationEmergencyResponsible;
|
||||
@OneToOne(() => EmrRegistrationEmergencyResponsible, (emergency) => emergency.emrregistration)
|
||||
emergency_responsible: EmrRegistrationEmergencyResponsible;
|
||||
|
||||
@OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration)
|
||||
outpatient: EmrRegistrationOutpatient;
|
||||
@OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration)
|
||||
outpatient: EmrRegistrationOutpatient;
|
||||
|
||||
@OneToOne(() => EmrRegistrationEmergency, (emergency) => emergency.registration)
|
||||
emergency: EmrRegistrationEmergency;
|
||||
@OneToOne(() => EmrRegistrationEmergency, (emergency) => emergency.registration)
|
||||
emergency: EmrRegistrationEmergency;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
cancellation_reason: string;
|
||||
@Column({ nullable: true, type: "text" })
|
||||
cancellation_reason: string;
|
||||
|
||||
@ManyToOne(() => PatientGuarantor, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
guarantor: PatientGuarantor;
|
||||
@ManyToOne(() => PatientGuarantor, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
guarantor: PatientGuarantor;
|
||||
|
||||
@Column({
|
||||
type: "varchar",
|
||||
length: 32,
|
||||
nullable: false,
|
||||
})
|
||||
registration_type: RegistrationType;
|
||||
@Column({
|
||||
type: "varchar",
|
||||
length: 32,
|
||||
nullable: false,
|
||||
})
|
||||
registration_type: RegistrationType;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
registration_date: Date;
|
||||
@Column({ type: "date", nullable: false })
|
||||
registration_date: Date;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
reason_notes: string;
|
||||
@Column({ type: "text", nullable: true })
|
||||
reason_notes: string;
|
||||
|
||||
@Column({ nullable: false, length: 32 })
|
||||
status: RegistrationStatus;
|
||||
@Column({ nullable: false, length: 32 })
|
||||
status: RegistrationStatus;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
visit_date: Date;
|
||||
@Column({ type: "date", nullable: true })
|
||||
visit_date: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
fullname: string;
|
||||
@Column({ nullable: true, type: "text" })
|
||||
fullname: string;
|
||||
|
||||
@Column({ nullable: true, type: "date" })
|
||||
birthdate: Date;
|
||||
@Column({ nullable: true, type: "date" })
|
||||
birthdate: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
idcard: string;
|
||||
@Column({ nullable: true, type: "text" })
|
||||
idcard: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
@ManyToOne(() => RefferalHospital, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "referral_hospital_id" })
|
||||
referral_hospital: RefferalHospital;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user