feat(patient): add new column of phone, telephone and bi number

This commit is contained in:
avicenan
2026-05-10 21:00:51 +09:00
parent dfd00b7147
commit 8d7a177b82

View File

@ -1,14 +1,4 @@
import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
DeleteDateColumn,
ManyToOne,
JoinColumn,
OneToMany,
} from "typeorm";
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { Status } from "../../types/status";
import { Aldeia } from "../aldeia";
@ -22,107 +12,117 @@ import { Ward } from "../ward";
@Entity("emr_patients", { schema: "emr" })
export class EmrPatient {
@PrimaryGeneratedColumn("uuid")
id: string;
@PrimaryGeneratedColumn("uuid")
id: string;
@Column({ nullable: false, length: 64 })
mrn_number: string;
@Column({ nullable: false, length: 64 })
mrn_number: string;
@Column({ nullable: false, length: 256 })
first_name: string;
@Column({ nullable: false, length: 256 })
first_name: string;
@Column({ nullable: false, length: 256 })
last_name: string;
@Column({ nullable: false, length: 256 })
last_name: string;
@Column({ nullable: true, length: 256 })
full_name: string;
@Column({ nullable: true, length: 256 })
full_name: string;
@Column({ type: "date", nullable: false })
birth_date: Date;
@Column({ type: "date", nullable: false })
birth_date: Date;
@Column({ nullable: false, length: 32 })
gender: string;
@Column({ nullable: false, length: 32 })
gender: string;
@Column({ nullable: false, length: 32 })
citizen: string;
@Column({ nullable: false, length: 32 })
citizen: string;
@Column({ nullable: true, length: 64 })
marriage_status: string;
@Column({ nullable: true, length: 64 })
marriage_status: string;
@Column({ nullable: true, length: 256 })
profession: string;
@Column({ nullable: true, length: 256 })
profession: string;
@Column({ nullable: false, length: 32 })
born_in: string;
@Column({ nullable: false, length: 32 })
born_in: string;
@Column({ nullable: true, length: 256 })
place_of_birth: string;
@Column({ nullable: true, length: 256 })
place_of_birth: string;
@Column({ nullable: true, type: "text" })
photo: string;
@Column({ nullable: true, type: "text" })
photo: string;
@Column({ type: "text", nullable: true })
address: string;
@Column({ type: "text", nullable: true })
address: string;
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION" })
@JoinColumn()
munisipio: Munisipo;
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION" })
@JoinColumn()
munisipio: Munisipo;
@ManyToOne(() => Administrativu, { onDelete: "NO ACTION" })
@JoinColumn()
administrativu: Administrativu;
@ManyToOne(() => Administrativu, { onDelete: "NO ACTION" })
@JoinColumn()
administrativu: Administrativu;
@ManyToOne(() => Suco, { onDelete: "NO ACTION" })
@JoinColumn()
suco: Suco;
@ManyToOne(() => Suco, { onDelete: "NO ACTION" })
@JoinColumn()
suco: Suco;
@ManyToOne(() => Aldeia, { onDelete: "NO ACTION" })
@JoinColumn()
aldeia: Aldeia;
@ManyToOne(() => Aldeia, { onDelete: "NO ACTION" })
@JoinColumn()
aldeia: Aldeia;
@ManyToOne(() => Province, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
province: Province;
@ManyToOne(() => Province, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
province: Province;
@ManyToOne(() => City, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
city: City;
@ManyToOne(() => City, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
city: City;
@ManyToOne(() => Subdistrict, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
subdistrict: Subdistrict;
@ManyToOne(() => Subdistrict, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
subdistrict: Subdistrict;
@ManyToOne(() => Ward, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
ward: Ward;
@ManyToOne(() => Ward, { onDelete: "NO ACTION" })
@JoinColumn({ referencedColumnName: "code" })
ward: Ward;
@Column({ nullable: true, length: 256 })
email: string;
@Column({ nullable: true, length: 256 })
email: string;
@Column({ nullable: false, length: 64 })
status: Status;
@Column({ nullable: false, length: 64 })
status: Status;
@Column({ nullable: true, length: 128 })
electoral_id_number: string;
@Column({ nullable: true, length: 128 })
electoral_id_number: string;
@Column()
@CreateDateColumn()
created_at: Date;
// Bilhete de Identidade (BI)
@Column({ nullable: true, length: 128 })
bi_number: string;
@Column({ nullable: true, length: 256 })
created_by: string;
@Column({ nullable: true, length: 128 })
phone: string;
@Column({ nullable: true })
@UpdateDateColumn()
updated_at: Date;
@Column({ nullable: true, length: 128 })
telephone: string;
@Column({ nullable: true, length: 256 })
updated_by: string;
@Column()
@CreateDateColumn()
created_at: Date;
@Column({ nullable: true })
@DeleteDateColumn()
deleted_at: Date;
@Column({ nullable: true, length: 256 })
created_by: string;
@Column({ nullable: true, length: 256 })
deleted_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;
}