update radiology create and list done
This commit is contained in:
76
src/entity/emr/emr_radiology.ts
Normal file
76
src/entity/emr/emr_radiology.ts
Normal file
@ -0,0 +1,76 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
DeleteDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
OneToMany
|
||||
} from "typeorm";
|
||||
import { radiologyStatus } from "../../enum/radiologyStatus";
|
||||
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" })
|
||||
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;
|
||||
|
||||
// Di entity Radiology, tambahkan:
|
||||
@ManyToOne(() => EmrRegistration, { onDelete: "CASCADE" })
|
||||
@JoinColumn()
|
||||
id_registration: EmrRegistration;
|
||||
|
||||
@Column({
|
||||
type: "enum",
|
||||
enum: radiologyStatus,
|
||||
nullable: false,
|
||||
})
|
||||
status: radiologyStatus;
|
||||
|
||||
@Column({ nullable: true, type: "text" })
|
||||
order_number: string;
|
||||
|
||||
@Column()
|
||||
@CreateDateColumn()
|
||||
created_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
created_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@UpdateDateColumn()
|
||||
updated_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
updated_by: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
@DeleteDateColumn()
|
||||
deleted_at: Date;
|
||||
|
||||
@Column({ nullable: true, length: 256 })
|
||||
deleted_by: string;
|
||||
}
|
||||
|
||||
52
src/entity/emr/emr_radiology_services.ts
Normal file
52
src/entity/emr/emr_radiology_services.ts
Normal file
@ -0,0 +1,52 @@
|
||||
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()
|
||||
@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;
|
||||
}
|
||||
|
||||
6
src/enum/radiologyStatus.ts
Normal file
6
src/enum/radiologyStatus.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
export enum radiologyStatus {
|
||||
PENDING = 'PENDING',
|
||||
VERIFIED = 'VERIFIED',
|
||||
COMPLETED = 'COMPLETED',
|
||||
}
|
||||
@ -15,6 +15,8 @@ export * from "../entity/emr/emr_internal_consultation";
|
||||
export * from "../entity/emr/emr_laboratory_orders";
|
||||
export * from "../entity/emr/emr_laboratory_order_items";
|
||||
export * from "../entity/emr/emr_laboratory_order_item_results";
|
||||
export * from "../entity/emr/emr_radiology";
|
||||
export * from "../entity/emr/emr_radiology_services";
|
||||
|
||||
export * from "../types/registration_type";
|
||||
export * from "../types/registration_status";
|
||||
|
||||
Reference in New Issue
Block a user