update: add province, city, subdistrict, and ward in patient and pharmacy info
This commit is contained in:
@ -15,6 +15,10 @@ import { Aldeia } from "../aldeia";
|
||||
import { Suco } from "../suco";
|
||||
import { Administrativu } from "../administrativu";
|
||||
import { Munisipo } from "../munisipo";
|
||||
import { Province } from "../province";
|
||||
import { City } from "../city";
|
||||
import { Subdistrict } from "../subdistrict";
|
||||
import { Ward } from "../ward";
|
||||
|
||||
@Entity("emr_patients", { schema: "emr" })
|
||||
export class EmrPatient {
|
||||
@ -76,6 +80,22 @@ export class EmrPatient {
|
||||
@JoinColumn()
|
||||
aldeia: Aldeia;
|
||||
|
||||
@ManyToOne(() => Province, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
province: Province;
|
||||
|
||||
@ManyToOne(() => City, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
city: City;
|
||||
|
||||
@ManyToOne(() => Subdistrict, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
subdistrict: Subdistrict;
|
||||
|
||||
@ManyToOne(() => Ward, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
ward: Ward;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
email: string;
|
||||
|
||||
|
||||
@ -13,6 +13,10 @@ import { Munisipo } from "../munisipo";
|
||||
import { Administrativu } from "../administrativu";
|
||||
import { Suco } from "../suco";
|
||||
import { Aldeia } from "../aldeia";
|
||||
import { Province } from "../province";
|
||||
import { City } from "../city";
|
||||
import { Subdistrict } from "../subdistrict";
|
||||
import { Ward } from "../ward";
|
||||
|
||||
@Entity("pharmacy_info", { schema: "pharmacy" })
|
||||
export class PharmacyInfo {
|
||||
@ -51,6 +55,22 @@ export class PharmacyInfo {
|
||||
@JoinColumn({ name: "default_room_id" })
|
||||
default_room?: Room;
|
||||
|
||||
@ManyToOne(() => Province, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
province: Province;
|
||||
|
||||
@ManyToOne(() => City, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
city: City;
|
||||
|
||||
@ManyToOne(() => Subdistrict, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
subdistrict: Subdistrict;
|
||||
|
||||
@ManyToOne(() => Ward, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
ward: Ward;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at!: Date;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user