This commit is contained in:
@ -1,44 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
import { Munisipo } from './munisipo';
|
||||
|
||||
@Entity('administrativus')
|
||||
export class Administrativu {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128
|
||||
})
|
||||
code: string;
|
||||
|
||||
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
munisipo: Munisipo;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
import { Suco } from './suco';
|
||||
|
||||
@Entity('aldeias')
|
||||
export class Aldeia {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@ManyToOne(() => Suco, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
suco: Suco;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
import { Entity, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, PrimaryColumn } from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
|
||||
@Entity('application')
|
||||
export class Application {
|
||||
@PrimaryColumn({
|
||||
nullable: false,
|
||||
length: 32
|
||||
})
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 512
|
||||
})
|
||||
reset_password_url: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,65 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
import { BloodRequest } from "./blood_request";
|
||||
import { BloodUnit } from "./blood_unit";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_dispatch" })
|
||||
@Index(["dispatch_no"], { unique: true })
|
||||
export class BloodDispatch {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 64, unique: true })
|
||||
dispatch_no: string;
|
||||
|
||||
@ManyToOne(() => BloodRequest, (req) => req.dispatches, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
blood_request: BloodRequest;
|
||||
|
||||
@ManyToOne(() => BloodUnit, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
blood_unit: BloodUnit;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
destination_room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
dispatched_by: User;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
dispatched_at: Date;
|
||||
|
||||
@Column({ nullable: false, type: "boolean", default: false })
|
||||
completed: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
transfusion_notes: string;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
transfusion_at: Date;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToMany,
|
||||
} from "typeorm";
|
||||
import { BloodUnit } from "./blood_unit";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_donor" })
|
||||
export class BloodDonor {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 64, unique: true })
|
||||
donor_no: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
full_name: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
birth_date: Date;
|
||||
|
||||
@Column({ nullable: true, length: 32 })
|
||||
gender: string;
|
||||
|
||||
@Column({ nullable: true, length: 8 })
|
||||
blood_type: string;
|
||||
|
||||
@Column({ nullable: true, length: 8 })
|
||||
rh: string;
|
||||
|
||||
@Column({ nullable: true, length: 32 })
|
||||
phone: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
address: string;
|
||||
|
||||
@Column({ nullable: false, length: 32, default: "active" })
|
||||
status: string;
|
||||
|
||||
@OneToMany(() => BloodUnit, (unit) => unit.donor)
|
||||
blood_units: BloodUnit[];
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
import { EmrPatient } from "../emr/emr_patient";
|
||||
import { EmrRegistration } from "../emr/emr_registration";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { BloodRequestStatus } from "../../types/blood_request_status";
|
||||
import { BloodRequestItem } from "./blood_request_item";
|
||||
import { CrossMatch } from "./cross_match";
|
||||
import { BloodDispatch } from "./blood_dispatch";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_request" })
|
||||
@Index(["request_no"], { unique: true })
|
||||
export class BloodRequest {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 64, unique: true })
|
||||
request_no: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: BloodRequestStatus,
|
||||
nullable: false,
|
||||
default: BloodRequestStatus.WAITING,
|
||||
})
|
||||
status: BloodRequestStatus;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
requesting_room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@Column({ nullable: false, length: 32, default: "normal" })
|
||||
priority: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@OneToMany(() => BloodRequestItem, (item) => item.blood_request, { cascade: true })
|
||||
request_items: BloodRequestItem[];
|
||||
|
||||
@OneToMany(() => CrossMatch, (cm) => cm.blood_request)
|
||||
cross_matches: CrossMatch[];
|
||||
|
||||
@OneToMany(() => BloodDispatch, (d) => d.blood_request)
|
||||
dispatches: BloodDispatch[];
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { BloodRequest } from "./blood_request";
|
||||
import { BloodComponentType } from "../../types/blood_component_type";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_request_item" })
|
||||
export class BloodRequestItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BloodRequest, (req) => req.request_items, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
blood_request: BloodRequest;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: BloodComponentType,
|
||||
nullable: false,
|
||||
})
|
||||
component_type: BloodComponentType;
|
||||
|
||||
@Column({ nullable: true, length: 8 })
|
||||
abo: string;
|
||||
|
||||
@Column({ nullable: true, length: 8 })
|
||||
rh: string;
|
||||
|
||||
@Column({ nullable: false, type: "int", default: 1 })
|
||||
quantity: number;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { BloodUnit } from "./blood_unit";
|
||||
import { Room } from "../room";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_stock" })
|
||||
export class BloodStock {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BloodUnit, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
blood_unit: BloodUnit;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
room: Room | null;
|
||||
|
||||
@Column({ nullable: false, type: "int", default: 1 })
|
||||
quantity: number;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
batch: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { BloodUnit } from "./blood_unit";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { BloodStockMovementType } from "../../types/blood_stock_movement_type";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_stock_movement" })
|
||||
export class BloodStockMovement {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BloodUnit, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
blood_unit: BloodUnit;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
from_room: Room;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
to_room: Room;
|
||||
|
||||
@Column({ nullable: false, type: "int", default: 1 })
|
||||
quantity: number;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: BloodStockMovementType,
|
||||
nullable: false,
|
||||
})
|
||||
movement_type: BloodStockMovementType;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
performed_by: User;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
import { BloodDonor } from "./blood_donor";
|
||||
import { BloodUnitStatus } from "../../types/blood_unit_status";
|
||||
import { BloodComponentType } from "../../types/blood_component_type";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_unit" })
|
||||
@Index(["unit_number"], { unique: true })
|
||||
export class BloodUnit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 64, unique: true })
|
||||
unit_number: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: BloodComponentType,
|
||||
nullable: false,
|
||||
default: BloodComponentType.WHOLE_BLOOD,
|
||||
})
|
||||
component_type: BloodComponentType;
|
||||
|
||||
@Column({ nullable: false, length: 8 })
|
||||
abo: string;
|
||||
|
||||
@Column({ nullable: false, length: 8 })
|
||||
rh: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: BloodUnitStatus,
|
||||
nullable: false,
|
||||
default: BloodUnitStatus.QUARANTINE,
|
||||
})
|
||||
status: BloodUnitStatus;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
collection_date: Date;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
exp_date: Date;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
storage_temp: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
volume_ml: string;
|
||||
|
||||
@ManyToOne(() => BloodDonor, (donor) => donor.blood_units, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
donor: BloodDonor;
|
||||
|
||||
@ManyToOne(() => BloodUnit, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
parent_unit: BloodUnit;
|
||||
|
||||
@OneToMany(() => BloodUnit, (unit) => unit.parent_unit)
|
||||
child_units: BloodUnit[];
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { BloodUnit } from "./blood_unit";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "blood_waste_log" })
|
||||
export class BloodWasteLog {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BloodUnit, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
blood_unit: BloodUnit;
|
||||
|
||||
@Column({ nullable: false, type: "text" })
|
||||
reason: string;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
discarded_by: User;
|
||||
|
||||
@Column({ type: "timestamp", nullable: false })
|
||||
discarded_at: Date;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { BloodRequest } from "./blood_request";
|
||||
import { BloodUnit } from "./blood_unit";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity({ schema: "blood_bank", name: "cross_match" })
|
||||
export class CrossMatch {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => BloodRequest, (req) => req.cross_matches, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
blood_request: BloodRequest;
|
||||
|
||||
@ManyToOne(() => BloodUnit, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
blood_unit: BloodUnit;
|
||||
|
||||
@Column({ nullable: false, length: 32 })
|
||||
result: string;
|
||||
|
||||
@Column({ nullable: false, type: "boolean", default: false })
|
||||
compatibility: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
performed_by: User;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
performed_at: Date;
|
||||
|
||||
@Column({ nullable: false, type: "boolean", default: false })
|
||||
verified: boolean;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,72 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
import { EmrPatient } from "../emr/emr_patient";
|
||||
import { CardInventoryStatus } from "../../types/card_inventory_status";
|
||||
|
||||
@Entity({ schema: "card_management", name: "card_inventory" })
|
||||
@Index(["card_number"], { unique: true })
|
||||
@Index(["running_number"], { unique: true })
|
||||
export class CardInventory {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "patientId" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
mrn: string;
|
||||
|
||||
@Column({ type: "bigint", nullable: false, unique: true })
|
||||
running_number: string;
|
||||
|
||||
@Column({ nullable: true, length: 64, unique: true })
|
||||
card_number: string;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
tag_id: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
facility_code: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: CardInventoryStatus,
|
||||
nullable: false,
|
||||
default: CardInventoryStatus.NOT_USED,
|
||||
})
|
||||
status: CardInventoryStatus;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
printed_at: Date;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
} from "typeorm";
|
||||
|
||||
/**
|
||||
* Placeholder for future batch card stock-in workflow.
|
||||
* Entity only — no API, UI, or business logic yet.
|
||||
*/
|
||||
@Entity({ schema: "card_management", name: "card_stock_in" })
|
||||
export class CardStockIn {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
batch_number: string;
|
||||
|
||||
@Column({ type: "int", nullable: true })
|
||||
quantity: number;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
notes: 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;
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
|
||||
@Entity({ schema: "card_management", name: "running_number_log" })
|
||||
@Index(["running_number"])
|
||||
@Index(["requested_at"])
|
||||
export class RunningNumberLog {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ type: "bigint", nullable: false })
|
||||
running_number: string;
|
||||
|
||||
@Column({ nullable: false, length: 128 })
|
||||
service_name: string;
|
||||
|
||||
@Column({ type: "uuid", nullable: false })
|
||||
requested_by: string;
|
||||
|
||||
@Column({ nullable: false, length: 256 })
|
||||
requested_by_name: string;
|
||||
|
||||
@Column({ type: "timestamp", nullable: false })
|
||||
requested_at: Date;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from "typeorm";
|
||||
|
||||
@Entity("card_key_sets")
|
||||
export class CardKeySet {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
length: 256,
|
||||
})
|
||||
key_set_id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
app_master_key: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
read_basic_key: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
write_update_key: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
read_sensitive_key: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "boolean",
|
||||
})
|
||||
is_active: boolean;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
}
|
||||
@ -1,105 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
import { CardPrintQueueStatus } from "../types/card_print_queue_status";
|
||||
import { CardPrintQueueType } from "../types/card_print_queue_type";
|
||||
|
||||
|
||||
@Entity("card_print_queues")
|
||||
@Index("idx_card_print_queues_patient_created", ["patient_id", "created_at"])
|
||||
export class CardPrintQueue {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
mrn?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
municipiu_code?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
posto_adm_code?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
name?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
address?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
municipiu?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
posto_adm?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
suco?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
aldeia?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
sexo?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
birthdate?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
patient_id?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
facility_code?: string;
|
||||
|
||||
@Column({ type: "bigint", nullable: true })
|
||||
running_number?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
card_number?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
provision_job_id?: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
error_message?: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: CardPrintQueueStatus,
|
||||
default: CardPrintQueueStatus.PENDING,
|
||||
})
|
||||
status!: CardPrintQueueStatus;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: CardPrintQueueType,
|
||||
default: CardPrintQueueType.PRINT_PROVISION,
|
||||
})
|
||||
type!: CardPrintQueueType;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
token?: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at!: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by?: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by?: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by?: string;
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
} from "typeorm";
|
||||
|
||||
@Entity("card_type")
|
||||
export class CardType {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id!: string;
|
||||
|
||||
@Column({ type: "text", nullable: false })
|
||||
name!: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at!: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by?: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by?: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by?: string;
|
||||
}
|
||||
@ -1,84 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
OneToMany,
|
||||
ManyToOne
|
||||
} from "typeorm";
|
||||
import { EmrRegistration } from "../emr/emr_registration";
|
||||
import { Room } from "../room";
|
||||
import { CashierItem } from "./cashier_item";
|
||||
import { BillingStatus } from "../../types/billing_status";
|
||||
|
||||
@Entity("cashiers", { schema: "cashier" })
|
||||
export class Cashier {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
emrregistration: EmrRegistration;
|
||||
|
||||
@OneToMany(() => CashierItem, (detail) => detail.cashier)
|
||||
cashieritem: CashierItem[];
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
regdate: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
total_amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
amount_paid: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
balance_due: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
status: BillingStatus;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,141 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import { Cashier } from "./cashier";
|
||||
import { Room } from "../room";
|
||||
import { Department } from "../department";
|
||||
import { ServiceClass } from "../service_class";
|
||||
import { Service } from "../service";
|
||||
import { ServiceType } from "../service_type";
|
||||
import { ItemType } from "../pharmacy/item_type";
|
||||
import { ItemMaster } from "../pharmacy/item_master";
|
||||
import { BillingItemStatus } from "../../types/billing_item_status";
|
||||
|
||||
@Entity("cashier_item", { schema: "cashier" })
|
||||
export class CashierItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => Service, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
service: Service;
|
||||
|
||||
@ManyToOne(() => ItemType, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
itemtype: ItemType;
|
||||
|
||||
@ManyToOne(() => ItemMaster, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
itemmaster: ItemMaster;
|
||||
|
||||
@ManyToOne(() => ServiceType, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
servicetype: ServiceType;
|
||||
|
||||
@ManyToOne(() => Cashier, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
cashier: Cashier;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => Department, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
department: Department;
|
||||
|
||||
@ManyToOne(() => ServiceClass, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
serviceclass: ServiceClass;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
service_date: Date;
|
||||
|
||||
@Column({ type: "boolean", default: false })
|
||||
ispay: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
guarantor_liability: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
subtotal: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
price: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
qty: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
amount_paid: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
balance_due: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
status: BillingItemStatus;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
category: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
ref_id: 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 | null;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string | null;
|
||||
}
|
||||
@ -1,129 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
OneToMany,
|
||||
ManyToOne
|
||||
} from "typeorm";
|
||||
import { EmrRegistration } from "../emr/emr_registration";
|
||||
import { Room } from "../room";
|
||||
import { Cashier } from "./cashier";
|
||||
import { User } from "../users";
|
||||
import { PaymentReceivedItem } from "./payment_received_item";
|
||||
import { PaymentMethod } from "../payment_method";
|
||||
import { CardType } from "../card_type";
|
||||
|
||||
@Entity("payment_received", { schema: "cashier" })
|
||||
export class PaymentReceived {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToMany(() => PaymentReceivedItem, (detail) => detail.paymentreceived)
|
||||
cashieritem: PaymentReceivedItem[];
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
emrregistration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => PaymentMethod, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
paymentmethod: PaymentMethod;
|
||||
|
||||
@ManyToOne(() => CardType, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
cardtype: CardType;
|
||||
|
||||
@ManyToOne(() => Cashier, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
cashier: Cashier;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
user: User;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
receipt_number: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
reason: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
total_amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
payment: number;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
card_provider: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
card_number: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
card_holder_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
paidby: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
change: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'decimal',
|
||||
precision: 10,
|
||||
scale: 2
|
||||
})
|
||||
exemption: number;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
ManyToOne
|
||||
} from "typeorm";
|
||||
import { Room } from "../room";
|
||||
import { CashierItem } from "./cashier_item";
|
||||
import { PaymentReceived } from "./payment_received";
|
||||
|
||||
@Entity("payment_received_item", { schema: "cashier" })
|
||||
export class PaymentReceivedItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => PaymentReceived, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
paymentreceived: PaymentReceived;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => CashierItem, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
cashieritem: CashierItem;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from 'typeorm';
|
||||
|
||||
@Entity('city')
|
||||
export class City {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
unique: true
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "text"
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, Index } from "typeorm";
|
||||
|
||||
@Entity("counter")
|
||||
@Index(["type", "scope_id", "counter_date"], { unique: true })
|
||||
export class Counter {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "varchar",
|
||||
length: 50
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "varchar",
|
||||
length: 100
|
||||
})
|
||||
scope_id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "date",
|
||||
})
|
||||
counter_date: Date;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "bigint",
|
||||
default: 0
|
||||
})
|
||||
value: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { Status } from "../types/status";
|
||||
|
||||
@Entity("currencies")
|
||||
export class Currency {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "text",
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
type: "text",
|
||||
})
|
||||
symbol: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
|
||||
import { Status } from "../types/status";
|
||||
|
||||
@Entity("departments")
|
||||
export class Department {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
unique: true,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
|
||||
import { Status } from "../types/status";
|
||||
import { DiagnosisType } from "../types/diagnosis_type";
|
||||
|
||||
@Entity("diagnoses")
|
||||
export class Diagnosis {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
diagnosis: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
diagnosis_ind: string | null;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
diagnosis_pt: string | null;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
diagnosis_tet: string | null;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: DiagnosisType,
|
||||
nullable: true,
|
||||
})
|
||||
type: DiagnosisType | null;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
|
||||
import { Status } from "../types/status";
|
||||
|
||||
@Entity("diagnostic_procedures")
|
||||
export class DiagnosticProcedure {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256,
|
||||
})
|
||||
diagnosticProcedure: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Index } from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
|
||||
@Entity('districts')
|
||||
export class District {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 128
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 256
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Column,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
|
||||
import { User } from "./users";
|
||||
import { ItemMaster } from "./pharmacy/item_master";
|
||||
|
||||
@Entity("doctor_item")
|
||||
@Index(["doctor", "item_master"], { unique: true })
|
||||
export class DoctorItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id!: string;
|
||||
|
||||
@ManyToOne(() => User, { nullable: false, onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "doctor_id" })
|
||||
doctor!: User;
|
||||
|
||||
@ManyToOne(() => ItemMaster, { nullable: false, onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "item_master_id" })
|
||||
item_master!: ItemMaster;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at!: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by?: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by?: string;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
ManyToMany,
|
||||
JoinTable,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
Column,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
|
||||
import { User } from "./users";
|
||||
import { ItemMaster } from "./pharmacy/item_master";
|
||||
|
||||
@Entity("doctor_item_package")
|
||||
@Index(["doctor", "name"], { unique: true })
|
||||
export class DoctorItemPackage {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id!: string;
|
||||
|
||||
@ManyToOne(() => User, { nullable: false, onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "doctor_id" })
|
||||
doctor!: User;
|
||||
|
||||
@Column({ type: "text", nullable: false })
|
||||
name!: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
description?: string;
|
||||
|
||||
@ManyToMany(() => ItemMaster)
|
||||
@JoinTable({
|
||||
name: "doctor_item_package_items",
|
||||
joinColumn: { name: "doctor_item_package_id", referencedColumnName: "id" },
|
||||
inverseJoinColumn: { name: "item_master_id", referencedColumnName: "id" },
|
||||
})
|
||||
items!: ItemMaster[];
|
||||
|
||||
@Column({ type: "boolean", default: true })
|
||||
active!: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at!: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by?: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at?: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by?: string;
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
|
||||
import { Status } from "../types/status";
|
||||
import { User } from "./users";
|
||||
import { Room } from "./room";
|
||||
|
||||
@Entity("doctor_schedules")
|
||||
export class DoctorSchedule {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 32,
|
||||
})
|
||||
day: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 16,
|
||||
})
|
||||
start_time: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 16,
|
||||
})
|
||||
end_time: string;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 32,
|
||||
})
|
||||
quota: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from "typeorm";
|
||||
|
||||
// import { anamnesisStatus } from "../../enum/anamnesisStatus";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_anamnesis", { schema: "emr" })
|
||||
export class Emranamnesis {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
main_complaint: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
additional_complaint: string;
|
||||
|
||||
@Column({ nullable: true, type: "text", array: true })
|
||||
history_of_present_illness: string[];
|
||||
|
||||
@Column({ nullable: true, type: "text", array: true })
|
||||
history_of_allergies: string[];
|
||||
|
||||
@Column({ nullable: true, type: "text", array: true })
|
||||
history_of_illness: string[];
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
follow_up_action: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
functional_status: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
tb_status: string;
|
||||
|
||||
// @Column({
|
||||
// type: "enum",
|
||||
// enum: anamnesisStatus,
|
||||
// nullable: false,
|
||||
// })
|
||||
// status: anamnesisStatus;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: 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;
|
||||
}
|
||||
|
||||
@ -1,113 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
Index
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { Department } from "../department";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { AncillaryServiceOrderStatus } from "../../types/ancillary_service_order_status";
|
||||
import { Service } from "../service";
|
||||
|
||||
@Entity("emr_ancillary_service_orders", { schema: "emr" })
|
||||
@Index(["order_no"], { unique: true })
|
||||
export class EmrAncillaryServiceOrder {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 128, unique: true })
|
||||
order_no: string;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
queue_number?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
queued_at?: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
schedule_date?: Date;
|
||||
|
||||
@Column({ type: "time", nullable: true })
|
||||
schedule_time?: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
examination_date?: Date;
|
||||
|
||||
@Column({ type: "time", nullable: true })
|
||||
examination_time?: Date;
|
||||
|
||||
@ManyToOne(() => Service, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "service_id" })
|
||||
service: Service | null;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
note?: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "registration_id" })
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "referring_room_id" })
|
||||
referring_room: Room | null;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "order_room_id" })
|
||||
order_room: Room | null;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "referring_doctor_id" })
|
||||
referring_doctor: User | null;
|
||||
|
||||
@ManyToOne(() => Department, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "department_id" })
|
||||
department: Department | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: AncillaryServiceOrderStatus,
|
||||
nullable: false,
|
||||
default: AncillaryServiceOrderStatus.ORDERED,
|
||||
})
|
||||
status: AncillaryServiceOrderStatus;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
result: 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;
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_atenatal_care", { schema: "emr" })
|
||||
export class EmrAtenatalCare {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
gestational_age: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
trimester: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
immunization_status: string
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
immunization_was_carried_out: string
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
pregnancy_status: string
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
parturition_status: string
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
abortion_status: string
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
hpht_date: Date;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
estimated_date_of_birth: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
usg_result: 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;
|
||||
}
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
import { InpatientRoom } from "../inpatient_rooms";
|
||||
|
||||
/** Tracks every bed-transfer and bed-swap event for a boarding room. */
|
||||
@Entity("emr_boarding_room_bed_histories", { schema: "emr" })
|
||||
@Index("idx_emr_brbed_hist_boarding_room", ["boarding_room"])
|
||||
export class EmrBoardingRoomBedHistory {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
/** The boarding room (patient) whose bed changed. */
|
||||
@ManyToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom;
|
||||
|
||||
/** "transfer" = pindah kamar, "swap" = tukar tempat tidur dengan pasien lain */
|
||||
@Column({ length: 16 })
|
||||
type: string;
|
||||
|
||||
@ManyToOne(() => InpatientRoom, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "from_inpatient_room_id" })
|
||||
from_inpatient_room: InpatientRoom | null;
|
||||
|
||||
@Column({ nullable: true, type: "int" })
|
||||
from_bed_number: number | null;
|
||||
|
||||
@ManyToOne(() => InpatientRoom, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "to_inpatient_room_id" })
|
||||
to_inpatient_room: InpatientRoom | null;
|
||||
|
||||
@Column({ nullable: true, type: "int" })
|
||||
to_bed_number: number | null;
|
||||
|
||||
/**
|
||||
* For "swap" type: the other boarding room involved in the swap.
|
||||
* Null for "transfer" events.
|
||||
*/
|
||||
@ManyToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "swapped_with_boarding_room_id" })
|
||||
swapped_with_boarding_room: EmrBoardingRoom | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
note: string | null;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,72 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from "typeorm";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity("emr_boarding_room_deceased", { schema: "emr" })
|
||||
export class EmrBoardingRoomDeceased {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom;
|
||||
|
||||
@Column({ nullable: true })
|
||||
deceased_at: Date;
|
||||
|
||||
/** meninggal-kurang-48-jam | meninggal-lebih-48-jam | iufd */
|
||||
@Column({ nullable: true, length: 64 })
|
||||
discharge_status: string;
|
||||
|
||||
/** meninggal-kurang-48-jam | meninggal-lebih-48-jam */
|
||||
@Column({ nullable: true, length: 64 })
|
||||
discharge_condition: string;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
declaring_doctor: User;
|
||||
|
||||
/** diagnosa-akhir | diagnosa-tambahan */
|
||||
@Column({ nullable: true, length: 64 })
|
||||
diagnosis_type: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
final_diagnosis_code: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
final_diagnosis_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
death_chronology: 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;
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
|
||||
/** Stores discharge information for inpatient boarding rooms. */
|
||||
@Entity("emr_boarding_room_discharge", { schema: "emr" })
|
||||
export class EmrBoardingRoomDischarge {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom;
|
||||
|
||||
@Column({ nullable: true })
|
||||
discharge_at: Date;
|
||||
|
||||
/** pulang | dirujuk | pulang-paksa */
|
||||
@Column({ nullable: true, length: 64 })
|
||||
discharge_status: string;
|
||||
|
||||
/** berobat-jalan | lain-lain */
|
||||
@Column({ nullable: true, length: 64 })
|
||||
discharge_condition: 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;
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, Index } from "typeorm";
|
||||
import { User } from "../users";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
|
||||
@Entity("emr_boarding_room_doctor_histories", { schema: "emr" })
|
||||
@Index("idx_emr_boarding_room_doctor_histories_patient_active", ["patient", "is_active"])
|
||||
export class EmrBoardingRoomDoctorHistory {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
note: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
change_at: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diagnosis: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
start_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
end_at: Date;
|
||||
|
||||
@Column({ nullable: true, default: false })
|
||||
is_active: boolean;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
|
||||
/** Stores emergency severity level information for inpatient boarding rooms. */
|
||||
@Entity("emr_boarding_room_emergency_status", { schema: "emr" })
|
||||
export class EmrBoardingRoomEmergencyStatus {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom;
|
||||
|
||||
/** ringan | sedang | berat */
|
||||
@Column({ nullable: true, length: 64 })
|
||||
severity_level: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
note: 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;
|
||||
}
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
|
||||
/** Resume medis pasien – satu dokumen JSON per boarding room (di-upsert). */
|
||||
@Entity("emr_boarding_room_medical_summary", { schema: "emr" })
|
||||
export class EmrBoardingRoomMedicalSummary {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom;
|
||||
|
||||
@Column({ type: "jsonb", nullable: true })
|
||||
payload: Record<string, unknown>;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
|
||||
/** Satu baris laporan tindakan per entri; satu boarding room dapat memiliki banyak laporan. */
|
||||
@Entity("emr_boarding_room_procedure_report", { schema: "emr" })
|
||||
export class EmrBoardingRoomProcedureReport {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom;
|
||||
|
||||
@Column({ nullable: true })
|
||||
input_at: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
procedure_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
description_html: string;
|
||||
|
||||
/** ICD-9-CM (opsional), dipakai di Patient Medical Summary */
|
||||
@Column({ nullable: true, length: 32 })
|
||||
icd9_cm_code: 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;
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrDiagnosis } from "./emr_diagnosis";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { User } from "../users";
|
||||
import { InpatientRoom } from "../inpatient_rooms";
|
||||
import { Room } from "../room";
|
||||
|
||||
@Entity("emr_boarding_rooms", { schema: "emr" })
|
||||
export class EmrBoardingRoom {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => EmrDiagnosis, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
diagnosis: EmrDiagnosis;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
primary_doctor: User;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
secondary_doctor: User;
|
||||
|
||||
@ManyToOne(() => InpatientRoom, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
inpatient_room: InpatientRoom;
|
||||
|
||||
@Column({ nullable: true, length: 32 })
|
||||
no_reg: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
mrn: string;
|
||||
|
||||
@Column({ nullable: false })
|
||||
boarding_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
inpatient_care_status: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
discharge_plan_note: string;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
boarding_origin_room: Room | null;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToMany,
|
||||
ManyToOne,
|
||||
JoinColumn
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrCompoundingMedicineItem } from "./emr_compounding_medicine_item";
|
||||
import { UsageTime } from "../pharmacy/usage_time";
|
||||
import { UsageInstructions } from "../pharmacy/usage_instructions";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrPharmacyOrder } from "./emr_pharmacy_order";
|
||||
|
||||
@Entity("emr_compounding_medicine", { schema: "emr" })
|
||||
export class EmrCompoundingMedicine {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "registration_id" })
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
type: "int",
|
||||
nullable: false
|
||||
})
|
||||
qty: number;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
note: string;
|
||||
|
||||
@ManyToOne(() => UsageTime, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "usage_time_id" })
|
||||
usage_time: UsageTime | null;
|
||||
|
||||
@ManyToOne(() => UsageInstructions, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "usage_instruction_id" })
|
||||
usage_instruction: UsageInstructions | null;
|
||||
|
||||
@ManyToOne(() => EmrPharmacyOrder, { onDelete: "CASCADE", nullable: true })
|
||||
@JoinColumn({ name: "pharmacy_order_id" })
|
||||
pharmacy_order: EmrPharmacyOrder | null;
|
||||
|
||||
@OneToMany(() => EmrCompoundingMedicineItem, (item) => item.compounding_medicine, { cascade: true })
|
||||
items: EmrCompoundingMedicineItem[];
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,65 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { ItemMaster } from "../pharmacy/item_master";
|
||||
import { EmrCompoundingMedicine } from "./emr_compounding_medicine";
|
||||
import { RoomStock } from "../pharmacy-logistic/room_stock";
|
||||
|
||||
@Entity("emr_compounding_medicine_item", { schema: "emr" })
|
||||
export class EmrCompoundingMedicineItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => ItemMaster, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "item_master_id" })
|
||||
item_master: ItemMaster;
|
||||
|
||||
@ManyToOne(() => EmrCompoundingMedicine, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "compounding_medicine_id" })
|
||||
compounding_medicine: EmrCompoundingMedicine;
|
||||
|
||||
@Column({
|
||||
type: "int",
|
||||
nullable: false
|
||||
})
|
||||
dose: number
|
||||
|
||||
@ManyToOne(() => RoomStock, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "room_stock_id" })
|
||||
room_stock: RoomStock;
|
||||
|
||||
@Column({ type: "decimal", precision: 10, scale: 2, nullable: true })
|
||||
unit_price?: number | null;
|
||||
|
||||
@Column({ type: "decimal", precision: 10, scale: 2, nullable: true })
|
||||
total_price?: number | null;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrDiagnosisType } from "../../enum/emrDiagnosisType";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { Diagnosis } from "../diagnosis";
|
||||
import { User } from "../users";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_diagnosis", { schema: "emr" })
|
||||
export class EmrDiagnosis {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@ManyToOne(() => Diagnosis, { onDelete: "CASCADE", nullable: true })
|
||||
@JoinColumn()
|
||||
diagnosis: Diagnosis;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diagnosis_code: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diagnosis_name: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: EmrDiagnosisType,
|
||||
nullable: false,
|
||||
})
|
||||
diagnosis_type: EmrDiagnosisType;
|
||||
|
||||
@Column({
|
||||
type: "boolean",
|
||||
nullable: true,
|
||||
default: false
|
||||
})
|
||||
is_new: boolean;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,73 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrDiagnosticProcedureType } from "../../enum/emrDiagnosticProcedureType";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { DiagnosticProcedure } from "../diagnostic_procedure";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity("emr_diagnostic_procedure", { schema: "emr" })
|
||||
export class EmrDiagnosticProcedure {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@ManyToOne(() => DiagnosticProcedure, { onDelete: "CASCADE", nullable: true })
|
||||
@JoinColumn()
|
||||
diagnostic_procedure: DiagnosticProcedure;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diagnostic_procedure_code: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diagnostic_procedure_name: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: EmrDiagnosticProcedureType,
|
||||
nullable: false,
|
||||
})
|
||||
diagnostic_procedure_type: EmrDiagnosticProcedureType;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_diet", { schema: "emr" })
|
||||
export class EmrDiet {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diet: 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;
|
||||
}
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrRegistrationEmergency } from "./emr_registration_emergency";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity("emr_discharge_status_emergency", { schema: "emr" })
|
||||
export class DischargeStatusEmergency {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistrationEmergency, (discharge) => discharge.discharge_status, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
discharge_status: EmrRegistrationEmergency;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_discharge_status: string;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
inpatient_attending_phyisician: User;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
gender_responsible_person: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
fullname_responsible_person: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "int" })
|
||||
age_responsible_person: number | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
address: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
reason_discharge: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
doctor_signature: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_signature: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
witness_signature: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
cause_of_death: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diagnosis: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn({nullable: true, type: "date"})
|
||||
discharge_date: Date;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_doctor_order_emergency", { schema: "emr" })
|
||||
export class EmrDoctorOrderEmergency {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
doctor_order: 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;
|
||||
}
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { Service } from "../service";
|
||||
import { ServiceType } from "../service_type";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity('emr_doctor_procedure', { schema: "emr" })
|
||||
export class EmrDoctorProcedure {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@ManyToOne(() => Service, { onDelete: 'NO ACTION' })
|
||||
@JoinColumn()
|
||||
service: Service;
|
||||
|
||||
@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 | null;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrEmergencyTransfer } from "./emr_emergency_transfers";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity("emr_emergency_transfer_additional_attending_physicians", { schema: "emr" })
|
||||
export class EmrEmergencyTransferAdditionalAttendingPhysician {
|
||||
// Primary key DPJP tambahan (rawat bersama)
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// Relasi ke data transfer antar unit
|
||||
@ManyToOne(() => EmrEmergencyTransfer, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
emergency_transfer: EmrEmergencyTransfer;
|
||||
|
||||
// Dokter DPJP tambahan
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrEmergencyTransfer } from "./emr_emergency_transfers";
|
||||
|
||||
@Entity("emr_emergency_transfer_attached_devices", { schema: "emr" })
|
||||
export class EmrEmergencyTransferAttachedDevice {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrEmergencyTransfer, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
emergency_transfer: EmrEmergencyTransfer;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
device_type: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
location: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
size: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
note: 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;
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrEmergencyTransfer } from "./emr_emergency_transfers";
|
||||
|
||||
@Entity("emr_emergency_transfer_clinical_interventions", { schema: "emr" })
|
||||
export class EmrEmergencyTransferClinicalIntervention {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrEmergencyTransfer, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
emergency_transfer: EmrEmergencyTransfer;
|
||||
|
||||
@Column({ nullable: true, type: "varchar", length: 128 })
|
||||
intervention_category: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: 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;
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrEmergencyTransfer } from "./emr_emergency_transfers";
|
||||
|
||||
@Entity("emr_emergency_transfer_diagnostics", { schema: "emr" })
|
||||
export class EmrEmergencyTransferDiagnostic {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrEmergencyTransfer, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
emergency_transfer: EmrEmergencyTransfer;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
test_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
result: 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;
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrEmergencyTransfer } from "./emr_emergency_transfers";
|
||||
|
||||
@Entity("emr_emergency_transfer_medications", { schema: "emr" })
|
||||
export class EmrEmergencyTransferMedication {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrEmergencyTransfer, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
emergency_transfer: EmrEmergencyTransfer;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
medicine_type: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
medicine_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
dosage: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
medicine_frequency: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
medicine_route: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
remaining_medicine: 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;
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrEmergencyTransfer } from "./emr_emergency_transfers";
|
||||
|
||||
@Entity("emr_emergency_transfer_patient_conditions", { schema: "emr" })
|
||||
export class EmrEmergencyTransferPatientCondition {
|
||||
// Primary key data kondisi pasien saat pindah
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// Relasi ke data transfer antar unit
|
||||
@ManyToOne(() => EmrEmergencyTransfer, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
emergency_transfer: EmrEmergencyTransfer;
|
||||
|
||||
// KU pasien saat pindah
|
||||
@Column({ nullable: true, type: "text" })
|
||||
general_condition: string;
|
||||
|
||||
// Kesadaran pasien saat pindah
|
||||
@Column({ nullable: true, type: "text" })
|
||||
consciousness: string;
|
||||
|
||||
// Nilai GCS E
|
||||
@Column({ nullable: true, type: "int" })
|
||||
gcs_eye: number;
|
||||
|
||||
// Nilai GCS M
|
||||
@Column({ nullable: true, type: "int" })
|
||||
gcs_motor: number;
|
||||
|
||||
// Nilai GCS V
|
||||
@Column({ nullable: true, type: "int" })
|
||||
gcs_verbal: number;
|
||||
|
||||
// Total nilai GCS
|
||||
@Column({ nullable: true, type: "int" })
|
||||
gcs_total: number;
|
||||
|
||||
// Saturasi oksigen / SaO2
|
||||
@Column({ nullable: true, type: "text" })
|
||||
oxygen_saturation: string;
|
||||
|
||||
// Tekanan darah
|
||||
@Column({ nullable: true, type: "text" })
|
||||
blood_pressure: string;
|
||||
|
||||
// Suhu tubuh
|
||||
@Column({ nullable: true, type: "text" })
|
||||
temperature: string;
|
||||
|
||||
// Nadi
|
||||
@Column({ nullable: true, type: "text" })
|
||||
pulse: string;
|
||||
|
||||
// Respiratory rate / RR
|
||||
@Column({ nullable: true, type: "text" })
|
||||
respiratory_rate: string;
|
||||
|
||||
// Waktu data dibuat
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
// User pembuat data
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
// Waktu data terakhir diubah
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
// User pengubah terakhir
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
// Waktu soft delete
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
// User yang melakukan soft delete
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EmrEmergencyTransfer } from "./emr_emergency_transfers";
|
||||
import { EmrDiagnosis } from "./emr_diagnosis";
|
||||
|
||||
@Entity("emr_emergency_transfer_secondary_diagnoses", { schema: "emr" })
|
||||
export class EmrEmergencyTransferSecondaryDiagnosis {
|
||||
// Primary key diagnosis sekunder
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// Relasi ke data transfer antar unit
|
||||
@ManyToOne(() => EmrEmergencyTransfer, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
emergency_transfer: EmrEmergencyTransfer;
|
||||
|
||||
// Diagnosis sekunder
|
||||
@ManyToOne(() => EmrDiagnosis, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
diagnosis: EmrDiagnosis;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,170 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { Room } from "../room";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
import { EmrEmergencyTransferMedication } from "./emr_emergency_transfer_medications";
|
||||
import { EmrEmergencyTransferDiagnostic } from "./emr_emergency_transfer_diagnostics";
|
||||
import { EmrEmergencyTransferClinicalIntervention } from "./emr_emergency_transfer_clinical_interventions";
|
||||
import { EmrEmergencyTransferPatientCondition } from "./emr_emergency_transfer_patient_conditions";
|
||||
import { User } from "../users";
|
||||
import { EmrDiagnosis } from "./emr_diagnosis";
|
||||
import { TransferMethodType, TransferRiskType } from "../../types/emr";
|
||||
import { EmrEmergencyTransferAttachedDevice } from "./emr_emergency_transfer_attached_devices";
|
||||
import { EmrEmergencyTransferAdditionalAttendingPhysician } from "./emr_emergency_transfer_additional_attending_physicians";
|
||||
import { EmrEmergencyTransferSecondaryDiagnosis } from "./emr_emergency_transfer_secondary_diagnoses";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { InpatientRoom } from "../inpatient_rooms";
|
||||
import { InpatientRoomBed } from "../inpatient_room_beds";
|
||||
|
||||
@Entity("emr_emergency_transfers", { schema: "emr" })
|
||||
export class EmrEmergencyTransfer {
|
||||
// Primary key data transfer antar unit
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
// Registrasi emergency yang memiliki transfer antar unit
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
// Asal ruang rawat
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
origin_room: Room;
|
||||
|
||||
// Ruang rawat selanjutnya (tujuan pindah)
|
||||
@ManyToOne(() => InpatientRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
destination_room: InpatientRoom;
|
||||
|
||||
// Ruang rawat selanjutnya (tujuan pindah)
|
||||
@ManyToOne(() => InpatientRoomBed, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
destination_room_bed: InpatientRoomBed;
|
||||
|
||||
// Tanggal masuk / jam
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
admission_datetime: Date;
|
||||
|
||||
// Tanggal pindah / jam
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
transfer_datetime: Date;
|
||||
|
||||
// Indikasi masuk
|
||||
@Column({ nullable: true, type: "text" })
|
||||
admission_indication: string;
|
||||
|
||||
// DPJP utama
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
primary_attending_physician: User;
|
||||
|
||||
// DPJP tambahan (rawat bersama) - bisa lebih dari satu
|
||||
@OneToMany(() => EmrEmergencyTransferAdditionalAttendingPhysician, (physician: EmrEmergencyTransferAdditionalAttendingPhysician) => physician.emergency_transfer)
|
||||
additional_attending_physicians: EmrEmergencyTransferAdditionalAttendingPhysician[];
|
||||
|
||||
// Diagnosis utama
|
||||
@ManyToOne(() => EmrDiagnosis, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
primary_diagnosis: EmrDiagnosis;
|
||||
|
||||
// Diagnosis sekunder - bisa lebih dari satu
|
||||
@OneToMany(() => EmrEmergencyTransferSecondaryDiagnosis, (diagnosis: EmrEmergencyTransferSecondaryDiagnosis) => diagnosis.emergency_transfer)
|
||||
secondary_diagnoses: EmrEmergencyTransferSecondaryDiagnosis[];
|
||||
|
||||
// Alasan pemindahan: kondisi memburuk / tidak stabil
|
||||
@Column({ nullable: true, type: "boolean", default: false })
|
||||
transfer_reason_condition_worsening: boolean;
|
||||
|
||||
// Alasan pemindahan: butuh tenaga ahli / tenaga kurang
|
||||
@Column({ nullable: true, type: "boolean", default: false })
|
||||
transfer_reason_staff_needed: boolean;
|
||||
|
||||
// Alasan pemindahan: fasilitas / peralatan lebih baik
|
||||
@Column({ nullable: true, type: "boolean", default: false })
|
||||
transfer_reason_facility_needed: boolean;
|
||||
|
||||
// Alasan pemindahan: pemeriksaan penunjang
|
||||
@Column({ nullable: true, type: "boolean", default: false })
|
||||
transfer_reason_supporting_exam: boolean;
|
||||
|
||||
// Alasan pemindahan: lain-lain (checkbox)
|
||||
@Column({ nullable: true, type: "boolean", default: false })
|
||||
transfer_reason_other: boolean;
|
||||
|
||||
// Alasan pemindahan: keterangan lain-lain
|
||||
@Column({ nullable: true, type: "text" })
|
||||
transfer_reason_other_text: string;
|
||||
|
||||
// Riwayat kesehatan
|
||||
@Column({ nullable: true, type: "text" })
|
||||
medical_history: string;
|
||||
|
||||
// Metode pemindahan pasien
|
||||
@Column({ nullable: true, default: "stretcher" })
|
||||
transfer_method: TransferMethodType;
|
||||
|
||||
// Risiko selama transfer
|
||||
@Column({ nullable: true })
|
||||
transfer_risk: TransferRiskType;
|
||||
|
||||
// Risiko selama transfer: keterangan lain-lain
|
||||
@Column({ nullable: true, type: "text" })
|
||||
transfer_risk_other_text: string;
|
||||
|
||||
// Risiko jatuh
|
||||
@Column({ nullable: true, type: "text" })
|
||||
fall_risk: string;
|
||||
|
||||
// Nyeri
|
||||
@Column({ nullable: true, type: "text" })
|
||||
pain: string;
|
||||
|
||||
// Persetujuan pasien/keluarga (ya/tidak)
|
||||
@Column({ nullable: true, type: "boolean", default: false })
|
||||
transfer_consent: boolean;
|
||||
|
||||
// Nama pemberi persetujuan (jika keluarga)
|
||||
@Column({ nullable: true, type: "text" })
|
||||
consenter_name: string;
|
||||
|
||||
// Hubungan pemberi persetujuan dengan pasien
|
||||
@Column({ nullable: true, type: "text" })
|
||||
consenter_relationship: string;
|
||||
|
||||
// Kategori transfer pasien (0/1/2/3)
|
||||
@Column({ nullable: true, type: "text" })
|
||||
category_patient: string;
|
||||
|
||||
// TTD pasien / keluarga (path/base64 sesuai implementasi)
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_or_family_signature: string;
|
||||
|
||||
// TTD petugas pendamping
|
||||
@Column({ nullable: true, type: "text" })
|
||||
staff_signature: string;
|
||||
|
||||
// Turunan data prosedur yang dilakukan
|
||||
@Column({ nullable: true, type: "text" })
|
||||
procedure: 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;
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
} from "typeorm";
|
||||
import { RefferalHospital } from "../refferal_hospital";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_external_consultation", { schema: "emr" })
|
||||
export class EmrExternalConsultation {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => RefferalHospital,{ onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
refferalhospital: RefferalHospital;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
emrregistration: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: 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;
|
||||
}
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
|
||||
|
||||
export enum HemodialysisPlanStatus {
|
||||
DRAFT = "draft",
|
||||
ACTIVE = "active",
|
||||
}
|
||||
|
||||
@Entity("emr_hemodialysis_plans", { schema: "emr" })
|
||||
export class HemodialysisPlan {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => EmrRegistrationOutpatient, { onDelete: "SET NULL", nullable: true })
|
||||
@JoinColumn({ name: "opd_visit_id" })
|
||||
opd_visit: EmrRegistrationOutpatient | null;
|
||||
|
||||
@Column({ type: "smallint", nullable: false })
|
||||
sessions_per_week: number;
|
||||
|
||||
@Column({ type: "decimal", precision: 5, scale: 2, nullable: false })
|
||||
duration_hours: number;
|
||||
|
||||
@Column({ type: "decimal", precision: 6, scale: 2, nullable: true })
|
||||
dry_weight: number | null;
|
||||
|
||||
@Column({ type: "int", nullable: true })
|
||||
blood_flow_rate_qb: number | null;
|
||||
|
||||
@Column({ type: "int", nullable: true })
|
||||
dialysate_flow_rate_qd: number | null;
|
||||
|
||||
@Column({ type: "varchar", length: 256, nullable: true })
|
||||
dialyzer_type: string | null;
|
||||
|
||||
@Column({ type: "varchar", length: 256, nullable: true })
|
||||
anticoagulant_dose: string | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: HemodialysisPlanStatus,
|
||||
default: HemodialysisPlanStatus.DRAFT,
|
||||
})
|
||||
status: HemodialysisPlanStatus;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { HemodialysisPlan } from "./emr_hemodialysis_plan";
|
||||
|
||||
export enum HemodialysisScheduleStatus {
|
||||
SCHEDULED = "SCHEDULED",
|
||||
CHECKED_IN = "CHECKED_IN",
|
||||
COMPLETED = "COMPLETED",
|
||||
CANCELLED = "CANCELLED",
|
||||
}
|
||||
|
||||
@Entity("emr_hemodialysis_schedules", { schema: "emr" })
|
||||
export class HemodialysisSchedule {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => HemodialysisPlan, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn({ name: "plan_id" })
|
||||
plan: HemodialysisPlan;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
scheduled_date: string;
|
||||
|
||||
/** ISO weekday: 1 = Monday … 7 = Sunday (recurring weekly slot) */
|
||||
@Column({ type: "smallint", nullable: true })
|
||||
day_of_week: number | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: HemodialysisScheduleStatus,
|
||||
default: HemodialysisScheduleStatus.SCHEDULED,
|
||||
})
|
||||
status: HemodialysisScheduleStatus;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
assigned_by: string | null;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
} from "typeorm";
|
||||
|
||||
@Entity("emr_hemodialysis_settings", { schema: "emr" })
|
||||
export class HemodialysisSettings {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ type: "int", nullable: false })
|
||||
daily_quota_limit: number;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { HemodialysisSchedule } from "./emr_hemodialysis_schedule";
|
||||
|
||||
export enum HemodialysisVisitStatus {
|
||||
WAITING_NURSING = "WAITING_NURSING",
|
||||
IN_PROGRESS = "IN_PROGRESS",
|
||||
COMPLETED = "COMPLETED",
|
||||
}
|
||||
|
||||
export enum HemodialysisCheckinMethod {
|
||||
SCAN = "SCAN",
|
||||
MANUAL = "MANUAL",
|
||||
}
|
||||
|
||||
@Entity("emr_hemodialysis_visits", { schema: "emr" })
|
||||
export class HemodialysisVisit {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => HemodialysisSchedule, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn({ name: "schedule_id" })
|
||||
schedule: HemodialysisSchedule;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "registration_id" })
|
||||
registration: EmrRegistration | null;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
visit_date: string;
|
||||
|
||||
@Column({ type: "timestamptz", nullable: true })
|
||||
checkin_time: Date | null;
|
||||
|
||||
@Column({ type: "timestamptz", nullable: true })
|
||||
checkout_time: Date | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: HemodialysisVisitStatus,
|
||||
default: HemodialysisVisitStatus.WAITING_NURSING,
|
||||
})
|
||||
status: HemodialysisVisitStatus;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: HemodialysisCheckinMethod,
|
||||
nullable: true,
|
||||
})
|
||||
checkin_method: HemodialysisCheckinMethod | null;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { HemodialysisVisit } from "./emr_hemodialysis_visit";
|
||||
|
||||
export enum HemodialysisVisitDetailStatus {
|
||||
DRAFT = "DRAFT",
|
||||
IN_PROGRESS = "IN_PROGRESS",
|
||||
COMPLETED = "COMPLETED",
|
||||
}
|
||||
|
||||
@Entity("emr_hemodialysis_visit_details", { schema: "emr" })
|
||||
export class HemodialysisVisitDetail {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => HemodialysisVisit, { onDelete: "CASCADE", nullable: false })
|
||||
@JoinColumn({ name: "visit_id" })
|
||||
visit: HemodialysisVisit;
|
||||
|
||||
@Column({ type: "jsonb", nullable: true })
|
||||
nursing_form: Record<string, unknown> | null;
|
||||
|
||||
@Column({ type: "jsonb", nullable: true })
|
||||
assessment_form: Record<string, unknown> | null;
|
||||
|
||||
@Column({ type: "jsonb", nullable: true })
|
||||
monitoring_form: Record<string, unknown> | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: HemodialysisVisitDetailStatus,
|
||||
default: HemodialysisVisitDetailStatus.DRAFT,
|
||||
})
|
||||
status: HemodialysisVisitDetailStatus;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
completed_by: string | null;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { InternalConsulStatus } from "../../enum/internalConsulStatus";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { User } from "../users";
|
||||
import { Room } from "../room";
|
||||
import { Diagnosis } from "../diagnosis";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_internal_consultation", { schema: "emr" })
|
||||
export class EmrInternalConsultation {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "date" })
|
||||
patient_birth_date: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_gender: string;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE", nullable: true })
|
||||
@JoinColumn()
|
||||
referring_room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
referring_doctor: User;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
consulted_doctor: User;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
consulted_room: Room;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
consulted_registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => Diagnosis, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
diagnosis: Diagnosis;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
requested_consultation: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
consultation_report: string;
|
||||
|
||||
@Column({ type: "date", nullable: true, default: () => "CURRENT_DATE" })
|
||||
referring_date: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
consultation_date: Date;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: InternalConsulStatus,
|
||||
nullable: false,
|
||||
})
|
||||
status: InternalConsulStatus;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrLaboratoryOrderItem } from "./emr_laboratory_order_items";
|
||||
import { ExaminationDetail } from "../examination_detail";
|
||||
|
||||
/**
|
||||
* Laboratory order item results entity.
|
||||
* Stores examination results for each examination_detail of a service.
|
||||
* Each examination_detail has fixed reference_range and measurement_unit.
|
||||
* Only the examination_result value is stored here and can be filled.
|
||||
*/
|
||||
@Entity("emr_laboratory_order_item_results", { schema: "emr" })
|
||||
export class EmrLaboratoryOrderItemResult {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrLaboratoryOrderItem, (item) => item.results, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
order_item: EmrLaboratoryOrderItem;
|
||||
|
||||
@ManyToOne(() => ExaminationDetail, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
examination_detail: ExaminationDetail;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
examination_detail_name: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
measurement_unit: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
reference_range: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
examination_result: 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;
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrLaboratoryOrder } from "./emr_laboratory_orders";
|
||||
import { Service } from "../service";
|
||||
import { EmrLaboratoryOrderItemResult } from "./emr_laboratory_order_item_results";
|
||||
|
||||
/**
|
||||
* Laboratory order items entity.
|
||||
* Contains individual lab services ordered for each laboratory order.
|
||||
* Each service has examination_details, and results are stored in emr_laboratory_order_item_results.
|
||||
*/
|
||||
@Entity("emr_laboratory_order_items", { schema: "emr" })
|
||||
export class EmrLaboratoryOrderItem {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrLaboratoryOrder, (order) => order.order_items, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
laboratory_order: EmrLaboratoryOrder;
|
||||
|
||||
@ManyToOne(() => Service, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
service: Service;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
service_name: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
examination_type_name: string;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
examination_time: Date;
|
||||
|
||||
@OneToMany(() => EmrLaboratoryOrderItemResult, (result) => result.order_item, { cascade: true })
|
||||
results: EmrLaboratoryOrderItemResult[];
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
JoinColumn,
|
||||
Index
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { Department } from "../department";
|
||||
import { EmrLaboratoryOrderItem } from "./emr_laboratory_order_items";
|
||||
import { LaboratoryOrderStatus } from "../../types/laboratory_order_status";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
/**
|
||||
* Laboratory orders entity.
|
||||
* Contains order header information: order number, patient, referring room/doctor, schedule, registration info.
|
||||
*/
|
||||
@Entity("emr_laboratory_orders", { schema: "emr" })
|
||||
@Index(["order_lab_no"], { unique: true })
|
||||
export class EmrLaboratoryOrder {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 128, unique: true })
|
||||
order_lab_no: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
schedule_date: Date;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
notes: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
referring_room: Room | null;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
order_room: Room | null;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
referring_doctor: User | null;
|
||||
|
||||
@ManyToOne(() => Department, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
department: Department | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: LaboratoryOrderStatus,
|
||||
nullable: false,
|
||||
default: LaboratoryOrderStatus.WAITING,
|
||||
})
|
||||
status: LaboratoryOrderStatus;
|
||||
|
||||
@OneToMany(() => EmrLaboratoryOrderItem, (item) => item.laboratory_order, { cascade: true })
|
||||
order_items: EmrLaboratoryOrderItem[];
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
queue_number?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
queued_at?: Date;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,265 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { FosterCareHistory } from "../foster_care_history";
|
||||
import { Room } from "../room";
|
||||
|
||||
interface ResultsCriteria {
|
||||
group: number;
|
||||
name: string;
|
||||
level: number
|
||||
}
|
||||
|
||||
interface Causes {
|
||||
group: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface RelatedClinicalCondition {
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface FluidsAndMedication {
|
||||
datetime: string;
|
||||
fluid_type: string;
|
||||
bottle_number: string;
|
||||
medication: string;
|
||||
dose: string;
|
||||
rute: string;
|
||||
family_signature: string;
|
||||
oral: string;
|
||||
drain: string;
|
||||
ngt: string;
|
||||
urine: string;
|
||||
poop: string;
|
||||
}
|
||||
|
||||
interface NursingAction {
|
||||
datetime: string;
|
||||
nurse_action: string;
|
||||
name: string;
|
||||
user_id?: string;
|
||||
}
|
||||
|
||||
interface VitalSign {
|
||||
compos_mentis: string;
|
||||
blood_pressure: string;
|
||||
pulse: string;
|
||||
heart_rate: string;
|
||||
respiratory_rate: string;
|
||||
saturation: string;
|
||||
temperature: string;
|
||||
}
|
||||
|
||||
@Entity("emr_nursing_assesment", { schema: "emr" })
|
||||
export class EmrNursingAssesment {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, (registration) => registration.emergency, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => FosterCareHistory, { onDelete: "CASCADE", nullable: true })
|
||||
@JoinColumn()
|
||||
foster_care_history: FosterCareHistory;
|
||||
|
||||
@Column({ nullable: true, type: "text", array: true })
|
||||
airway: string[];
|
||||
|
||||
@Column({ nullable: true, type: "text", array: true })
|
||||
breathing: string[];
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
pulse: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
crt: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
skin_color: string;
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
bleeding: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
wound: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
wound_input: string;
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
pitchiae: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
pitchiae_input: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
consciousness: string;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
motor: number;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
vision: number;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
eye: number;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
location_of_pain: string;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
pain_scale: number;
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
way_of_walking: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
way_of_sit: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
fluids_and_medication: FluidsAndMedication[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
nursing_action: NursingAction[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
vital_sign: VitalSign[];
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
discharge_planning: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text", array: true })
|
||||
inpatient_check: string[];
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
inpatientroom: Room;
|
||||
|
||||
@Column({ nullable: true, type: "text", array: true })
|
||||
outapatient_check: string[];
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
discharge: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
result_criteria: ResultsCriteria[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
causes: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
related_clinical_condition: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
subjective_major: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
objectitve_major: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
subjective_minor: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
objective_minor: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
observation: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
therapeutic: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
education: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
colaboration: RelatedClinicalCondition[];
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
|
||||
import { Avpu } from "../../enum/avpu";
|
||||
import { User } from "../users";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_observation_record", { schema: "emr" })
|
||||
@Index("idx_emr_observation_record_registration", ["registration"])
|
||||
export class ObservationRecord {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "registration_id" })
|
||||
registration: EmrRegistration;
|
||||
|
||||
@Column({ length: 5 })
|
||||
oras: string;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
respirasi: number | null;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
spo2: number | null;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
hr: number | null;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
bp_systolic: number | null;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
bp_diastolic: number | null;
|
||||
|
||||
@Column({ nullable: true, type: "float" })
|
||||
temperatura: number | null;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: Avpu,
|
||||
nullable: true,
|
||||
})
|
||||
avpu: Avpu | null;
|
||||
|
||||
@Column({ nullable: true, type: "float" })
|
||||
todan: number | null;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "assina_uuid" })
|
||||
assina: User;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { User } from "../users";
|
||||
import { EmrOdontogramTeeth } from "./emr_odontogram_teeth";
|
||||
import { OneToMany } from "typeorm";
|
||||
|
||||
@Entity("emr_odontogram", { schema: "emr" })
|
||||
export class EmrOdontogram {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: string;
|
||||
|
||||
@OneToMany(() => EmrOdontogramTeeth, (teeth: EmrOdontogramTeeth) => teeth.odontogram)
|
||||
teeth: EmrOdontogramTeeth[]
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrOdontogram } from "./emr_odontogram";
|
||||
|
||||
@Entity("emr_odontogram_teeth", { schema: "emr" })
|
||||
export class EmrOdontogramTeeth {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrOdontogram, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
odontogram: EmrOdontogram;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
tooth_number: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
surface: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
condition_code: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
note: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: 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;
|
||||
}
|
||||
|
||||
@ -1,152 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
|
||||
import { Status } from "../../types/status";
|
||||
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";
|
||||
import { Citizen } from "../../types/citizen";
|
||||
|
||||
@Entity("emr_patients", { schema: "emr" })
|
||||
export class EmrPatient {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: false, length: 64 })
|
||||
mrn_number: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
passport_number: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
first_name: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
last_name: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
full_name: string;
|
||||
|
||||
@Column({ nullable: true, length: 256, unique: true })
|
||||
card_number: string;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
birth_date: Date;
|
||||
|
||||
@Column({ nullable: false, length: 32 })
|
||||
gender: string;
|
||||
|
||||
@Column({ nullable: true, length: 32 })
|
||||
citizen: Citizen;
|
||||
|
||||
@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, type: "text" })
|
||||
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;
|
||||
|
||||
@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;
|
||||
|
||||
@Column({ nullable: false, length: 64 })
|
||||
status: Status;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
electoral_id_number: string;
|
||||
|
||||
// Bilhete de Identidade (BI)
|
||||
@Column({ nullable: true, length: 128 })
|
||||
bi_number: string;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
phone: string;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
telephone: string;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
tag_id: string;
|
||||
|
||||
@Column({ nullable: false, type: 'boolean', default: false })
|
||||
is_card_printing: boolean;
|
||||
|
||||
card_print_status?: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "int", default: 0 })
|
||||
card_print_count: number;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
card_name: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
card_print_queue_id: 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;
|
||||
}
|
||||
@ -1,109 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
OneToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
ManyToMany
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity("emr_patient_education")
|
||||
export class PatientEducation {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
user: User;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
education_topics: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
education_recipients: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
learning_methods: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
educator_signature: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
education_recipients_signature: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
notes: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
education_recipient_name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "text",
|
||||
})
|
||||
learning_evaluation: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
education_date: Date;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
|
||||
@Entity("patient_past_medical_document", { schema: "emr" })
|
||||
@Index("idx_patient_past_medical_document_patient", ["patient"])
|
||||
export class PatientPastMedicalDocument {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
name: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "date" })
|
||||
date: Date | null;
|
||||
|
||||
@Column({ length: 512 })
|
||||
file_name: string;
|
||||
|
||||
@Column({ length: 512 })
|
||||
file_path: string;
|
||||
|
||||
@Column({ type: "int8", nullable: true })
|
||||
file_size: number | null;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
mime_type: string | null;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,96 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
Index,
|
||||
} from "typeorm";
|
||||
import { EmrCompoundingMedicine } from "./emr_compounding_medicine";
|
||||
import { EmrPrescription } from "./emr_prescription";
|
||||
import { User } from "../users";
|
||||
import { Room } from "../room";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { PharmacyOrderStatus } from "../../types/pharmacy_order_status";
|
||||
import { EmrPharmacyOrderActivity } from "./emr_pharmacy_order_activity";
|
||||
|
||||
@Entity("emr_pharmacy_order", { schema: "emr" })
|
||||
@Index(["code"], { unique: true })
|
||||
export class EmrPharmacyOrder {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({ type: "varchar", unique: true })
|
||||
code: string;
|
||||
|
||||
@Column({ nullable: true, type: "varchar", length: 256 })
|
||||
queue_number?: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "registration_id" })
|
||||
registration: EmrRegistration | null;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "doctor_id" })
|
||||
doctor: User | null;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient | null;
|
||||
|
||||
@OneToMany(() => EmrCompoundingMedicine, compounding => compounding.pharmacy_order, { cascade: true })
|
||||
compounding_medicines: EmrCompoundingMedicine[];
|
||||
|
||||
@OneToMany(() => EmrPrescription, (prescription) => prescription.pharmacy_order, { cascade: true })
|
||||
prescriptions: EmrPrescription[];
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "room_id" })
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "referring_room_id" })
|
||||
referring_room: Room | null;
|
||||
|
||||
@Column({ nullable: true, type: "jsonb" })
|
||||
prescription_screening?: object;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: PharmacyOrderStatus;
|
||||
|
||||
@Column({ nullable: true, type: "float" })
|
||||
subtotal_price?: number | null;
|
||||
|
||||
@OneToMany(() => EmrPharmacyOrderActivity, (activity) => activity.pharmacy_order)
|
||||
activities: EmrPharmacyOrderActivity[];
|
||||
|
||||
@Column({ nullable: true })
|
||||
queued_at?: Date;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { EmrPharmacyOrder } from "./emr_pharmacy_order";
|
||||
import { PharmacyOrderStatus } from "../../types/pharmacy_order_status";
|
||||
|
||||
@Entity("emr_pharmacy_order_activity", { schema: "emr" })
|
||||
export class EmrPharmacyOrderActivity {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPharmacyOrder, order => order.activities, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ name: "pharmacy_order_id" })
|
||||
pharmacy_order: EmrPharmacyOrder;
|
||||
|
||||
@Column({ type: "varchar" })
|
||||
code: string;
|
||||
|
||||
@Column({ nullable: true, type: "varchar" })
|
||||
queue_number?: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
doctor: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "jsonb" })
|
||||
compounding_medicines: object | null;
|
||||
|
||||
@Column({ nullable: true, type: "jsonb" })
|
||||
prescriptions: object | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
room: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
referring_room: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "jsonb" })
|
||||
prescription_screening?: object | null;
|
||||
|
||||
@Column({ type: "enum", enum: PharmacyOrderStatus })
|
||||
status: PharmacyOrderStatus;
|
||||
|
||||
@Column({ nullable: true, type: "float" })
|
||||
subtotal_price?: number | null;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_physical_examination", { schema: "emr" })
|
||||
export class EmrPhysicalExamination {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
internal_status: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
findings: 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;
|
||||
}
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_physical_examination_emergency", { schema: "emr" })
|
||||
export class EmrPhysicalExaminationEmergency {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status_generalis: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status_neurologis: 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;
|
||||
}
|
||||
|
||||
@ -1,90 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { EmrPharmacyOrder } from "./emr_pharmacy_order";
|
||||
import { UsageTime } from "../pharmacy/usage_time";
|
||||
import { UsageInstructions } from "../pharmacy/usage_instructions";
|
||||
import { ItemMaster } from "../pharmacy/item_master";
|
||||
import { RoomStock } from "../pharmacy-logistic/room_stock";
|
||||
|
||||
@Entity("emr_prescription", { schema: "emr" })
|
||||
export class EmrPrescription {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "registration_id" })
|
||||
registration: EmrRegistration | null;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "patient_id" })
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => ItemMaster, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "item_master_id" })
|
||||
item_master: ItemMaster;
|
||||
|
||||
@Column({ type: "int", nullable: false, default: 1 })
|
||||
qty: number;
|
||||
|
||||
@ManyToOne(() => UsageInstructions, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "usage_instruction_id" })
|
||||
usage_instruction: UsageInstructions | null;
|
||||
|
||||
@ManyToOne(() => UsageTime, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "usage_time_id" })
|
||||
usage_time: UsageTime | null;
|
||||
|
||||
@ManyToOne(() => EmrPharmacyOrder, { onDelete: "CASCADE", nullable: true })
|
||||
@JoinColumn({ name: "pharmacy_order_id" })
|
||||
pharmacy_order: EmrPharmacyOrder | null;
|
||||
|
||||
@ManyToOne(() => RoomStock, { onDelete: "NO ACTION" })
|
||||
@JoinColumn({ name: "room_stock_id" })
|
||||
room_stock: RoomStock;
|
||||
|
||||
@Column({ type: "decimal", precision: 10, scale: 2, nullable: true })
|
||||
unit_price?: number | null;
|
||||
|
||||
@Column({ type: "decimal", precision: 10, scale: 2, nullable: true })
|
||||
total_price?: number | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
note: string | null;
|
||||
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,101 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
Index
|
||||
} from "typeorm";
|
||||
import { RadiologyOrderStatus } from "../../types/radiology_order_status";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { User } from "../users";
|
||||
import { RadiologyServices } from "./emr_radiology_services";
|
||||
import { Room } from "../room";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
@Entity("emr_radiology", { schema: "emr" })
|
||||
@Index(["order_number"], { unique: true })
|
||||
export class Radiology {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToMany(() => RadiologyServices, (rs) => rs.id_radiology)
|
||||
radiology_services: RadiologyServices[];
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
id_patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
id_doctor: User;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
id_room: Room;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
refferingroom: Room;
|
||||
|
||||
// Di entity Radiology, tambahkan:
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
id_registration: EmrRegistration;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: RadiologyOrderStatus,
|
||||
nullable: false,
|
||||
default: RadiologyOrderStatus.WAITING,
|
||||
})
|
||||
status: RadiologyOrderStatus;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
queue_number?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
queued_at?: Date;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
schedule_date: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
order_number: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "date" })
|
||||
patient_birth_date: Date;
|
||||
|
||||
@Column({ nullable: true, type: "varchar" })
|
||||
patient_gender: 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;
|
||||
}
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { Radiology } from "./emr_radiology";
|
||||
import { Service } from "../service";
|
||||
|
||||
@Entity("emr_radiology_services", { schema: "emr" })
|
||||
export class RadiologyServices {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => Radiology, (radiology) => radiology.radiology_services, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
id_radiology: Radiology;
|
||||
|
||||
@ManyToOne(() => Service, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
id_service: Service;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
result: string;
|
||||
|
||||
@Column({nullable: true, type: "text"})
|
||||
diagnostic_findings: 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;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
procedure_time: Date;
|
||||
}
|
||||
|
||||
@ -1,109 +0,0 @@
|
||||
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";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
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";
|
||||
import { EmrDiagnosis } from "./emr_diagnosis";
|
||||
import { OneToMany } from "typeorm";
|
||||
import { EmrRegistrationTreatment } from "./emr_registration_treatment";
|
||||
|
||||
/**
|
||||
* Registrasi base: data umum untuk semua tipe (rawat jalan, rawat inap, emergency, hemodialysis).
|
||||
* Detail per tipe ada di tabel terpisah (1:1) agar form dan validasi bisa beda-beda.
|
||||
* Relasi ke detail: query dari tabel emr_outpatient_registrations dll where registration_id = id.
|
||||
*/
|
||||
@Entity("emr_registrations", { schema: "emr" })
|
||||
export class EmrRegistration {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistrationEmergencyResponsible, (emergency) => emergency.emrregistration)
|
||||
emergency_responsible: EmrRegistrationEmergencyResponsible;
|
||||
|
||||
@OneToOne(() => EmrRegistrationOutpatient, (out) => out.registration)
|
||||
outpatient: EmrRegistrationOutpatient;
|
||||
|
||||
@OneToOne(() => EmrRegistrationEmergency, (emergency) => emergency.registration)
|
||||
emergency: EmrRegistrationEmergency;
|
||||
|
||||
@OneToOne(() => EmrRegistrationTreatment, (treatment) => treatment.registration)
|
||||
treatment: EmrRegistrationTreatment;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
cancellation_reason: string;
|
||||
|
||||
@ManyToOne(() => PatientGuarantor, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
guarantor: PatientGuarantor;
|
||||
|
||||
@Column({
|
||||
type: "varchar",
|
||||
length: 32,
|
||||
nullable: false,
|
||||
})
|
||||
registration_type: RegistrationType;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
registration_date: Date;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
reason_notes: string;
|
||||
|
||||
@Column({ nullable: false, length: 32 })
|
||||
status: RegistrationStatus;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
visit_date: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
fullname: string;
|
||||
|
||||
@Column({ nullable: true, type: "date" })
|
||||
birthdate: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
idcard: string;
|
||||
|
||||
@ManyToOne(() => RefferalHospital, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn({ name: "referral_hospital_id" })
|
||||
referral_hospital: RefferalHospital;
|
||||
|
||||
@Column({ nullable: false, type: "boolean", default: false })
|
||||
is_referral_emergency: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_category: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
referral_letter_photo: 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;
|
||||
}
|
||||
@ -1,194 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { User } from "../users";
|
||||
import { DischargeStatusEmergency } from "./emr_discharge_status_emergency";
|
||||
import { Room } from "../room";
|
||||
import { MainDisease } from "../main_disease";
|
||||
|
||||
@Entity("emr_registration_emergency", { schema: "emr" })
|
||||
export class EmrRegistrationEmergency {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, (registration) => registration.emergency, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => DischargeStatusEmergency, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
discharge_status: DischargeStatusEmergency;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
user: User;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
trauma: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
registration_number: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
fullname: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
nik: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
birthdate: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
additionalcomplaint: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
medicalhistory: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
bloodpressure: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
heartrate: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
respiratoryrate: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
spo2: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
temperature: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
height: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
weight: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
howtocome: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: true,
|
||||
array: true,
|
||||
})
|
||||
consciousness: string[];
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: true,
|
||||
array: true,
|
||||
})
|
||||
airway: string[];
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: true,
|
||||
array: true,
|
||||
})
|
||||
breathing: string[];
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: true,
|
||||
array: true,
|
||||
})
|
||||
circulation: string[];
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
resuscitation: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
observation: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
polycliniccontrol: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
gohome: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
other: string;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
changeshift: Date;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
triage_level: string;
|
||||
|
||||
@Column({ type: "boolean", default: true })
|
||||
falseemergency: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
status: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
color: string | null;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
arrival_time: Date;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
chief_complaint: string;
|
||||
|
||||
@Column({ type: "timestamp", nullable: true })
|
||||
accident_datetime: Date;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
police_case_note: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
police_case_classification: string;
|
||||
|
||||
@Column({ type: "jsonb", nullable: true })
|
||||
initial_diagnosis: any[];
|
||||
|
||||
@ManyToOne(() => MainDisease, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
main_disease: MainDisease;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
main_disease_note: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
condition: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
category: 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;
|
||||
}
|
||||
@ -1,127 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
ManyToMany,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { Room } from "../room";
|
||||
import { PatientGuarantor } from "../patient_guarantor";
|
||||
import { Province } from "../province";
|
||||
import { City } from "../city";
|
||||
import { Subdistrict } from "../subdistrict";
|
||||
import { Ward } from "../ward";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { Administrativu } from "../administrativu";
|
||||
import { Suco } from "../suco";
|
||||
import { Aldeia } from "../aldeia";
|
||||
import { Munisipo } from "../munisipo";
|
||||
|
||||
@Entity("emr_registration_emergency_responsible", { schema: "emr" })
|
||||
export class EmrRegistrationEmergencyResponsible {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
emrregistration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => PatientGuarantor, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
guarantor: PatientGuarantor;
|
||||
|
||||
@ManyToOne(() => Administrativu, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
administrativu: Administrativu;
|
||||
|
||||
@ManyToOne(() => Suco, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
suco: Suco;
|
||||
|
||||
@ManyToOne(() => Aldeia, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
aldeia: Aldeia;
|
||||
|
||||
@ManyToOne(() => Munisipo, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
munisipo: Munisipo;
|
||||
|
||||
@ManyToOne(() => Province, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
province: Province;
|
||||
|
||||
@ManyToOne(() => City, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
city: City;
|
||||
|
||||
@ManyToOne(() => Subdistrict, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
subdistrict: Subdistrict;
|
||||
|
||||
@ManyToOne(() => Ward, { onDelete: "CASCADE" })
|
||||
@JoinColumn({ referencedColumnName: "code" })
|
||||
ward: Ward;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patientfullname: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patientnik: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
patientbirthdate: Date;
|
||||
|
||||
/** Tingkat keparahan / triage (e.g. merah, kuning, hijau) */
|
||||
@Column({ nullable: true, type: "text" })
|
||||
fullname: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
relation: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
idnumber: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
phone: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
address: string;
|
||||
|
||||
@Column({ nullable: true, type: "boolean", default: false })
|
||||
consent: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
consent_file: 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;
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
|
||||
/**
|
||||
* Detail registrasi hemodialysis.
|
||||
* Form spesifik: jadwal sesi, mesin, akses vaskular, dll.
|
||||
*/
|
||||
@Entity("emr_registration_hemodialysis", { schema: "emr" })
|
||||
export class EmrRegistrationHemodialysis {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
session_schedule: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
machine_id: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
session_date: Date;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
vascular_access_notes: 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;
|
||||
}
|
||||
@ -1,103 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, OneToOne, JoinColumn } from "typeorm";
|
||||
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { Room } from "../room";
|
||||
import { InpatientRoom } from "../inpatient_rooms";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { InpatientRoomBed } from "../inpatient_room_beds";
|
||||
import { Munisipo } from "../munisipo";
|
||||
import { Administrativu } from "../administrativu";
|
||||
import { Suco } from "../suco";
|
||||
import { Aldeia } from "../aldeia";
|
||||
|
||||
@Entity("emr_registration_inpatient", { schema: "emr" })
|
||||
export class EmrRegistrationInpatient {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE", nullable: true })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => InpatientRoom, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
inpatient_room: InpatientRoom;
|
||||
|
||||
@ManyToOne(() => InpatientRoomBed, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
inpatient_room_bed: InpatientRoomBed | null;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true })
|
||||
registration_number: string;
|
||||
|
||||
@Column({ nullable: true, length: 32 })
|
||||
bed_number: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
admission_date: Date;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
admission_notes: string;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
administrative_officer_signature: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
responsible_fullname: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
responsible_relation: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
responsible_idnumber: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
responsible_phone: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
responsible_address: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
responsible_signature: string;
|
||||
|
||||
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
responsible_munisipo: Munisipo | null;
|
||||
|
||||
@ManyToOne(() => Administrativu, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
responsible_administrativu: Administrativu | null;
|
||||
|
||||
@ManyToOne(() => Suco, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
responsible_suco: Suco | null;
|
||||
|
||||
@ManyToOne(() => Aldeia, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
responsible_aldeia: Aldeia | null;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,112 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { DoctorSchedule } from "../doctor_schedule";
|
||||
import { EmrInternalConsultation } from "./emr_internal_consultation";
|
||||
import { ScheduleSeries } from "../schedule_series";
|
||||
import { PatientGuarantor } from "../patient_guarantor";
|
||||
// import { RegistrationOutPatientStatus } from "../../enum/registrationOutPatientStatus";
|
||||
|
||||
/**
|
||||
* Detail registrasi rawat jalan (outpatient).
|
||||
* Form: patient, registration date, reason/notes, department, doctor, practice hour, visit date.
|
||||
* "Choose from schedule" → isi doctor_schedule_id.
|
||||
*/
|
||||
@Entity("emr_registration_outpatient", { schema: "emr" })
|
||||
export class EmrRegistrationOutpatient {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => PatientGuarantor, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
guarantor: PatientGuarantor;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
room_number: string;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@ManyToOne(() => DoctorSchedule, { onDelete: "SET NULL", nullable: true })
|
||||
@JoinColumn()
|
||||
doctor_schedule: DoctorSchedule | null;
|
||||
|
||||
@ManyToOne(() => ScheduleSeries, { onDelete: "SET NULL", nullable: true })
|
||||
@JoinColumn({ name: "schedule_series_id" })
|
||||
schedule_series: ScheduleSeries | null;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
practice_hour: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
visit_date: Date;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
registration_status: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
qeue_number: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
room_status: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
registration_number: string;
|
||||
|
||||
@ManyToOne(() => EmrInternalConsultation, { onDelete: "SET NULL", nullable: true })
|
||||
@JoinColumn()
|
||||
ref_consultation: EmrInternalConsultation | null;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "SET NULL", nullable: true })
|
||||
@JoinColumn({ name: "ref_appointment_id" })
|
||||
ref_appointment: EmrRegistration;
|
||||
|
||||
@Column({ nullable: true })
|
||||
queued_at?: Date;
|
||||
|
||||
@Column({ nullable: false, type: 'boolean', default: false })
|
||||
is_mrn_label_printed?: boolean;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { Room } from "../room";
|
||||
import { User } from "../users";
|
||||
import { TreatmentPlanSession } from "../treatment/treatment_plan_session";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
|
||||
@Entity("emr_registration_treatment", { schema: "emr" })
|
||||
export class EmrRegistrationTreatment {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, (reg) => reg.treatment, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => TreatmentPlanSession, { onDelete: "SET NULL", nullable: true })
|
||||
@JoinColumn()
|
||||
treatment_plan_session: TreatmentPlanSession;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
room: Room;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
doctor: User;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
registration_status: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
registration_number: string;
|
||||
|
||||
@Column({ type: "date", nullable: true })
|
||||
visit_date: Date;
|
||||
|
||||
@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;
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { RoomStock } from "../pharmacy-logistic/room_stock";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
|
||||
@Entity("emr_room_medical_equipment", { schema: "emr" })
|
||||
export class EmrRoomMedicalEquipment {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => RoomStock, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
roomstock: RoomStock;
|
||||
|
||||
@Column({
|
||||
type: "int",
|
||||
nullable: false
|
||||
})
|
||||
qty: number;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { User } from "../users";
|
||||
|
||||
@Entity("emr_soap_notes")
|
||||
export class EmrSoapNotes {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@ManyToOne(() => User, { onDelete: "SET NULL", nullable: true })
|
||||
@JoinColumn()
|
||||
doctor: User | null;
|
||||
|
||||
@Column({ nullable: true, type: "timestamp" })
|
||||
input_date: Date | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
subjective: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
objective: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
assessment: string | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
plan: string | null;
|
||||
|
||||
@Column({ nullable: false, type: "boolean", default: false })
|
||||
tbak: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
|
||||
@ -1,115 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from "typeorm";
|
||||
import { SurgeryRoom } from "../surgery_room";
|
||||
import { SurgeryType } from "../surgery_type";
|
||||
import { Room } from "../room";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
import { EmrBoardingRoom } from "./emr_boarding_rooms";
|
||||
import { EmrRegistrationOutpatient } from "./emr_registration_outpatient";
|
||||
|
||||
@Entity("emr_surgery_schedules", { schema: "emr" })
|
||||
export class EmrSurgerySchedule {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => Room, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
room: Room | null;
|
||||
|
||||
@ManyToOne(() => SurgeryRoom, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
surgery_room: SurgeryRoom;
|
||||
|
||||
@ManyToOne(() => SurgeryType, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
surgery_type: SurgeryType | null;
|
||||
|
||||
@Column({ type: "date", nullable: false })
|
||||
schedule_date: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
patient_name: string;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient | null;
|
||||
|
||||
@Column({ nullable: true, length: 128 })
|
||||
patient_registration_no: string;
|
||||
|
||||
@Column({ nullable: true, length: 512 })
|
||||
input_source: string;
|
||||
|
||||
@Column({ nullable: true, length: 512 })
|
||||
inpatient_room_label: string;
|
||||
|
||||
@ManyToOne(() => EmrBoardingRoom, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
boarding_room: EmrBoardingRoom | null;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
diagnosis: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
surgeon_name: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
anesthesiologist_name: string;
|
||||
|
||||
@Column({ nullable: true, length: 512 })
|
||||
procedure_name: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
equipment: string;
|
||||
|
||||
@Column({ nullable: true, type: "time" })
|
||||
schedule_time: string;
|
||||
|
||||
@Column({ nullable: true, type: "time" })
|
||||
schedule_end_time: string;
|
||||
|
||||
@Column({ nullable: false, length: 32, default: "scheduled" })
|
||||
status: string;
|
||||
|
||||
@Column({ nullable: true, length: 32 })
|
||||
surgery_priority: string;
|
||||
|
||||
@Column({ nullable: true, length: 32 })
|
||||
phone: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
alkses_bhp: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
notes: string;
|
||||
|
||||
@ManyToOne(() => EmrRegistrationOutpatient, { onDelete: "NO ACTION", nullable: true })
|
||||
@JoinColumn()
|
||||
registration_outpatient: EmrRegistrationOutpatient | null;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,184 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
JoinColumn,
|
||||
OneToOne,
|
||||
ManyToOne,
|
||||
} from "typeorm";
|
||||
|
||||
import { consciousness } from "../../enum/consciousness";
|
||||
import { EmrRegistration } from "./emr_registration";
|
||||
import { EmrPatient } from "./emr_patient";
|
||||
|
||||
@Entity("emr_vital_signs", { schema: "emr" })
|
||||
export class EmrVitalSigns {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@OneToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
registration: EmrRegistration;
|
||||
|
||||
@ManyToOne(() => EmrPatient, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
patient: EmrPatient;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
blood_pressure: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
heart_rate: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
temperature: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
respiratory_rate: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
spo2: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
saturation: string;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: consciousness,
|
||||
nullable: true,
|
||||
})
|
||||
consciousness: consciousness;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
weight: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
height: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
head_circumference: string;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
bmi: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
assistive_devices: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
prosthesis: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
physical_disability: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: false,
|
||||
})
|
||||
is_adl: boolean;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
adl: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
history_of_falls: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
obstetric_and_gynecologic_status: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
psychological_status: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: false,
|
||||
})
|
||||
is_language_barrier: boolean;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
language_barrier: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: false,
|
||||
})
|
||||
is_physical_cognitive_disabilities: boolean;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
physical_cognitive_disabilities: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
nutritional_status_assessment: string;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
patient_education: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
health_problems: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
nursing_interventions: string;
|
||||
|
||||
@Column({ nullable: true, length: 10 })
|
||||
pain_intensity: string;
|
||||
|
||||
@Column({ nullable: true, length: 10 })
|
||||
staggering: string;
|
||||
|
||||
@Column({ nullable: true, length: 10 })
|
||||
using_assistive_device: string;
|
||||
|
||||
@Column({ nullable: true, length: 10 })
|
||||
holding_on_to_something: string;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
result: string;
|
||||
|
||||
@Column({ nullable: true, length: 10 })
|
||||
risk_of_falling: string;
|
||||
|
||||
@Column({ nullable: true, length: 10 })
|
||||
hospitalize: string;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
eye: number;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
vision: number;
|
||||
|
||||
@Column({ nullable: true, type: "int2" })
|
||||
motor: number;
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
patient_gait: boolean;
|
||||
|
||||
@Column({ nullable: true, type: "boolean" })
|
||||
support_when_sittiong: boolean;
|
||||
|
||||
@Column({ nullable: true, length: 64 })
|
||||
onset: 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;
|
||||
}
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
ManyToMany,
|
||||
JoinTable
|
||||
} from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
import { MeasurementUnit } from './measurement_unit';
|
||||
import { ReferenceRange } from './reference_range';
|
||||
|
||||
@Entity('examination_details')
|
||||
export class ExaminationDetail {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
order_no: string;
|
||||
|
||||
@ManyToOne(() => MeasurementUnit, { onDelete: 'NO ACTION', nullable: false })
|
||||
@JoinColumn()
|
||||
measurement_unit: MeasurementUnit;
|
||||
|
||||
@ManyToMany(() => ReferenceRange)
|
||||
@JoinTable()
|
||||
reference_range: ReferenceRange[];
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToMany,
|
||||
OneToMany,
|
||||
} from 'typeorm';
|
||||
|
||||
import { Status } from '../types/status';
|
||||
import { Service } from './service';
|
||||
|
||||
@Entity('examination_types')
|
||||
export class ExaminationType {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@OneToMany(() => Service, (service) => service.examination_type)
|
||||
services: Service[];
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
@Entity('fare_type')
|
||||
export class FareType {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,161 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from "typeorm";
|
||||
|
||||
import { Status } from "../types/status";
|
||||
|
||||
interface ResultsCriteria {
|
||||
group: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface Causes {
|
||||
group: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface RelatedClinicalCondition {
|
||||
name: string;
|
||||
}
|
||||
|
||||
|
||||
@Entity("foster_care_history")
|
||||
export class FosterCareHistory {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 256,
|
||||
})
|
||||
diagnosis: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 128,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 128,
|
||||
})
|
||||
category: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 128,
|
||||
})
|
||||
subcategory: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 128,
|
||||
})
|
||||
definition: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 128,
|
||||
})
|
||||
objective: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
result_criteria: ResultsCriteria[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
causes: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
related_clinical_condition: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
subjective_major: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
objectitve_major: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
subjective_minor: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
objective_minor: Causes[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
observation: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
therapeutic: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
education: RelatedClinicalCondition[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'jsonb',
|
||||
default: [],
|
||||
})
|
||||
colaboration: RelatedClinicalCondition[];
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,112 +0,0 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn
|
||||
} from 'typeorm';
|
||||
|
||||
import { Province } from './province';
|
||||
import { City } from './city';
|
||||
import { Subdistrict } from './subdistrict';
|
||||
import { Ward } from './ward';
|
||||
|
||||
import { Administrativu } from './administrativu';
|
||||
import { Suco } from './suco';
|
||||
import { Aldeia } from './aldeia';
|
||||
import { Munisipo } from './munisipo';
|
||||
|
||||
@Entity('hospital_information')
|
||||
export class HospitalInformation {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: true,
|
||||
})
|
||||
code: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: true,
|
||||
})
|
||||
facility_id: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
address: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
phone: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: false,
|
||||
})
|
||||
logo: string;
|
||||
|
||||
@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;
|
||||
|
||||
@ManyToOne(() => Administrativu, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
administrativu: Administrativu;
|
||||
|
||||
@ManyToOne(() => Munisipo, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
munisipo: Munisipo;
|
||||
|
||||
@ManyToOne(() => Suco, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
suco: Suco;
|
||||
|
||||
@ManyToOne(() => Aldeia, { onDelete: "NO ACTION" })
|
||||
@JoinColumn()
|
||||
aldeia: Aldeia;
|
||||
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@UpdateDateColumn({ nullable: true })
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@DeleteDateColumn({ nullable: true })
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
@ -1,138 +0,0 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { Status } from "../../types/status";
|
||||
import { HrmsEmployee } from "./hrms_employee";
|
||||
import { AttendanceType } from "../../types/hrms";
|
||||
import { HrmsShift } from "./hrms_shift";
|
||||
|
||||
@Entity("hrms_attendances", { schema: "hrms" })
|
||||
export class HrmsAttendance {
|
||||
@PrimaryGeneratedColumn("uuid")
|
||||
id: string;
|
||||
|
||||
@ManyToOne(() => HrmsEmployee, { onDelete: "NO ACTION", nullable: false })
|
||||
@JoinColumn()
|
||||
employee: HrmsEmployee;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
type: AttendanceType;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
date_at: Date;
|
||||
|
||||
/** Nullable when record created from break punch only (no clock in) */
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
in_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
break_out_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
break_in_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
out_at: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
duration_work: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
duration_break: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "float8",
|
||||
})
|
||||
duration_total: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
default: false,
|
||||
})
|
||||
is_late: boolean;
|
||||
|
||||
/** Snapshot: batas awal clock in shift saat absen (agar tidak berubah jika shift diubah nanti) */
|
||||
@Column({
|
||||
type: "time",
|
||||
nullable: true,
|
||||
})
|
||||
shift_in_start_time: string;
|
||||
|
||||
/** Snapshot: batas akhir clock in shift saat absen (agar tidak berubah jika shift diubah nanti) */
|
||||
@Column({
|
||||
type: "time",
|
||||
nullable: true,
|
||||
})
|
||||
shift_in_end_time: string;
|
||||
|
||||
/** Snapshot: batas break out shift saat absen */
|
||||
@Column({
|
||||
type: "time",
|
||||
nullable: true,
|
||||
})
|
||||
shift_break_out_start_time: string;
|
||||
|
||||
@Column({
|
||||
type: "time",
|
||||
nullable: true,
|
||||
})
|
||||
shift_break_out_end_time: string;
|
||||
|
||||
/** Snapshot: batas break in shift saat absen */
|
||||
@Column({
|
||||
type: "time",
|
||||
nullable: true,
|
||||
})
|
||||
shift_break_in_start_time: string;
|
||||
|
||||
@Column({
|
||||
type: "time",
|
||||
nullable: true,
|
||||
})
|
||||
shift_break_in_end_time: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
length: 64,
|
||||
})
|
||||
status: Status;
|
||||
|
||||
@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;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user