add patient group
This commit is contained in:
41
src/entity/patient_group.ts
Normal file
41
src/entity/patient_group.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
} from "typeorm";
|
||||||
|
|
||||||
|
@Entity("patient_group")
|
||||||
|
export class PatientGroup {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
@Column({ type: "text", nullable: false })
|
||||||
|
patient_group_name!: string;
|
||||||
|
|
||||||
|
// Tanggal pembuatan grup pasien
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at!: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang membuat data ini
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by?: string;
|
||||||
|
|
||||||
|
// Tanggal pembaruan data grup pasien
|
||||||
|
@UpdateDateColumn({ nullable: true })
|
||||||
|
updated_at?: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang memperbarui data ini
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by?: string;
|
||||||
|
|
||||||
|
// Tanggal penghapusan grup pasien
|
||||||
|
@DeleteDateColumn({ nullable: true })
|
||||||
|
deleted_at?: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang menghapus data ini
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by?: string;
|
||||||
|
}
|
||||||
74
src/entity/patient_guarantor.ts
Normal file
74
src/entity/patient_guarantor.ts
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
ManyToOne,
|
||||||
|
JoinColumn,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
} from "typeorm";
|
||||||
|
import { PatientGroup } from "./patient_group"; // Import entity PatientGroup
|
||||||
|
|
||||||
|
@Entity("patient_guarantor")
|
||||||
|
export class PatientGuarantor {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
// Nama penjamin pasien
|
||||||
|
@Column({ type: "text", nullable: false })
|
||||||
|
guarantor_name!: string;
|
||||||
|
|
||||||
|
// Nomor telepon penjamin pasien
|
||||||
|
@Column({ type: "text", nullable: false })
|
||||||
|
phone!: string;
|
||||||
|
|
||||||
|
// Provinsi tempat tinggal penjamin pasien
|
||||||
|
@Column({ type: "text", nullable: false })
|
||||||
|
province!: string;
|
||||||
|
|
||||||
|
// Kota tempat tinggal penjamin pasien
|
||||||
|
@Column({ type: "text", nullable: false })
|
||||||
|
city!: string;
|
||||||
|
|
||||||
|
// Kode pos tempat tinggal penjamin pasien
|
||||||
|
@Column({ type: "text", nullable: false })
|
||||||
|
zip_code!: string;
|
||||||
|
|
||||||
|
// Nomor perjanjian atau kontrak
|
||||||
|
@Column({ type: "text", nullable: false })
|
||||||
|
agreement_no!: string;
|
||||||
|
|
||||||
|
// Deskripsi perjanjian atau kontrak
|
||||||
|
@Column({ type: "text", nullable: true })
|
||||||
|
agreement_desc?: string;
|
||||||
|
|
||||||
|
// Relasi ke PatientGroup, setiap penjamin dapat terhubung dengan satu grup pasien
|
||||||
|
@ManyToOne(() => PatientGroup, { nullable: false })
|
||||||
|
@JoinColumn({ name: "patient_group_id" })
|
||||||
|
patient_group!: PatientGroup;
|
||||||
|
|
||||||
|
// Tanggal pembuatan
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at!: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang membuat
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by?: string;
|
||||||
|
|
||||||
|
// Tanggal pembaruan
|
||||||
|
@UpdateDateColumn({ nullable: true })
|
||||||
|
updated_at?: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang memperbarui
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by?: string;
|
||||||
|
|
||||||
|
// Tanggal penghapusan
|
||||||
|
@DeleteDateColumn({ nullable: true })
|
||||||
|
deleted_at?: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang menghapus
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by?: string;
|
||||||
|
}
|
||||||
52
src/entity/user_to_room.ts
Normal file
52
src/entity/user_to_room.ts
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
ManyToOne,
|
||||||
|
JoinColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
} from "typeorm";
|
||||||
|
import { User } from "./users"; // Import entity Service
|
||||||
|
import { Room } from "./room"; // Import entity Room
|
||||||
|
|
||||||
|
@Entity("user_to_room")
|
||||||
|
export class UserToRoom {
|
||||||
|
@PrimaryGeneratedColumn("uuid")
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
// Relasi ke Service, tiap service bisa terkait dengan banyak room
|
||||||
|
@ManyToOne(() => User, { nullable: false })
|
||||||
|
@JoinColumn({ name: "service_id" })
|
||||||
|
user!: User;
|
||||||
|
|
||||||
|
// Relasi ke Room, tiap room bisa terkait dengan banyak service
|
||||||
|
@ManyToOne(() => Room, { nullable: false })
|
||||||
|
@JoinColumn({ name: "room_id" })
|
||||||
|
room!: Room;
|
||||||
|
|
||||||
|
// Tanggal pembuatan
|
||||||
|
@CreateDateColumn()
|
||||||
|
created_at!: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang membuat
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
created_by?: string;
|
||||||
|
|
||||||
|
// Tanggal pembaruan
|
||||||
|
@UpdateDateColumn({ nullable: true })
|
||||||
|
updated_at?: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang memperbarui
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
updated_by?: string;
|
||||||
|
|
||||||
|
// Tanggal penghapusan
|
||||||
|
@DeleteDateColumn({ nullable: true })
|
||||||
|
deleted_at?: Date;
|
||||||
|
|
||||||
|
// Kolom untuk tracking siapa yang menghapus
|
||||||
|
@Column({ nullable: true, length: 256 })
|
||||||
|
deleted_by?: string;
|
||||||
|
}
|
||||||
@ -28,6 +28,9 @@ export * from "../entity/examination_type"
|
|||||||
export * from "../entity/examination_detail"
|
export * from "../entity/examination_detail"
|
||||||
export * from "../entity/measurement_unit"
|
export * from "../entity/measurement_unit"
|
||||||
export * from "../entity/hospital_information"
|
export * from "../entity/hospital_information"
|
||||||
|
export * from "../entity/patient_group"
|
||||||
|
export * from "../entity/patient_guarantor"
|
||||||
|
export * from "../entity/user_to_room"
|
||||||
|
|
||||||
export * from "../types/action";
|
export * from "../types/action";
|
||||||
export * from "../types/error";
|
export * from "../types/error";
|
||||||
|
|||||||
Reference in New Issue
Block a user