emr patient

This commit is contained in:
Narul Hidayah
2026-02-11 11:41:36 +07:00
parent 9c48ac1f01
commit 262477a26f
3 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,104 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
ManyToOne,
JoinColumn,
} from "typeorm";
import { Status } from "../../types/status";
import { Aldeia } from "../aldeia";
import { Suco } from "../suco";
import { Administrativu } from "../administrativu";
import { Munisipo } from "../munisipo";
@Entity("emr_patients", { schema: "emr" })
export class EmrPatient {
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({ nullable: false, length: 64 })
mrn_number: string;
@Column({ nullable: false, length: 256 })
first_name: string;
@Column({ nullable: false, length: 256 })
last_name: string;
@Column({ type: "date", nullable: false })
birth_date: Date;
@Column({ nullable: false, length: 32 })
gender: string;
@Column({ nullable: false, length: 32 })
citizen: string;
@Column({ nullable: true, length: 64 })
marriage_status: string;
@Column({ nullable: true, length: 256 })
profession: string;
@Column({ nullable: false, length: 32 })
born_in: string;
@Column({ nullable: true, length: 256 })
place_of_birth: string;
@Column({ nullable: true, length: 512 })
photo: string;
@Column({ type: "text", nullable: true })
address: string;
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION" })
@JoinColumn()
munisipio: Munisipo;
@ManyToOne(() => Administrativu, { onDelete: "NO ACTION" })
@JoinColumn()
administrativu: Administrativu;
@ManyToOne(() => Suco, { onDelete: "NO ACTION" })
@JoinColumn()
suco: Suco;
@ManyToOne(() => Aldeia, { onDelete: "NO ACTION" })
@JoinColumn()
aldeia: Aldeia;
@Column({ nullable: true, length: 256 })
email: string;
@Column({ nullable: false, length: 64 })
status: Status;
@Column({ nullable: true, length: 128 })
electoral_id_number: 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

@ -1,4 +1,5 @@
export * from "./schema/public"; export * from "./schema/public";
export * from "./schema/hrms"; export * from "./schema/hrms";
export * from "./schema/emr";
export * from "./schema/finances"; export * from "./schema/finances";
export * from "./schema/procurement"; export * from "./schema/procurement";

1
src/schema/emr.ts Normal file
View File

@ -0,0 +1 @@
export * from "../entity/emr/emr_patient";