diff --git a/src/entity/emr/emr_amnanesis.ts b/src/entity/emr/emr_amnanesis.ts new file mode 100644 index 0000000..6f1e204 --- /dev/null +++ b/src/entity/emr/emr_amnanesis.ts @@ -0,0 +1,67 @@ +import { + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, + DeleteDateColumn, + ManyToOne, + OneToOne, + JoinColumn, +} from "typeorm"; + +import { AmnanesisStatus } from "../../enum/amnanesisStatus"; +import { EmrRegistrationOutpatient } from "./emr_registration_outpatient"; + + +@Entity("emr_amnanesis", { schema: "emr" }) +export class EmrAmnanesis { + @PrimaryGeneratedColumn("uuid") + id: string; + + @ManyToOne(() => EmrRegistrationOutpatient, { onDelete: "CASCADE" }) + @JoinColumn() + id_emr_outpatient: EmrRegistrationOutpatient; + + /** Contoh: "08:00-12:00" atau "Pagi" */ + @Column({ nullable: true, length: 512 }) + chief_complaint: string; + + @Column({ nullable: true, length: 512 }) + additional_complaint: string; + + @Column({ nullable: true, length: 512 }) + history_of_present_illness: string; + + @Column({ nullable: true, length: 512 }) + history_of_allergies: string; + + @Column({ + type: "enum", + enum: AmnanesisStatus, + nullable: false, + }) + status: AmnanesisStatus; + + @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; +} + diff --git a/src/enum/amnanesisStatus.ts b/src/enum/amnanesisStatus.ts new file mode 100644 index 0000000..63de87a --- /dev/null +++ b/src/enum/amnanesisStatus.ts @@ -0,0 +1,7 @@ + +export enum AmnanesisStatus { + REFER = 'REFER', + INPATIENT = 'INPATIENT', + PRB = 'PRB', + DISCHARGE = 'DISCHARGE', +} diff --git a/src/schema/emr.ts b/src/schema/emr.ts index c429da4..3a8f633 100644 --- a/src/schema/emr.ts +++ b/src/schema/emr.ts @@ -4,6 +4,7 @@ export * from "../entity/emr/emr_registration_outpatient"; export * from "../entity/emr/emr_registration_inpatient"; export * from "../entity/emr/emr_registration_emergency"; export * from "../entity/emr/emr_registration_hemodialysis"; +export * from "../entity/emr/emr_amnanesis"; export * from "../types/registration_type"; export * from "../types/registration_status";