Merge branch 'main' of https://git.shiblysolution.id/SAUDE-TL/entity
This commit is contained in:
64
src/entity/examination_detail.ts
Normal file
64
src/entity/examination_detail.ts
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
ManyToOne,
|
||||||
|
JoinColumn,
|
||||||
|
} 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;
|
||||||
|
|
||||||
|
@ManyToOne(() => ReferenceRange, { onDelete: 'NO ACTION', nullable: false })
|
||||||
|
@JoinColumn()
|
||||||
|
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;
|
||||||
|
}
|
||||||
57
src/entity/examination_type.ts
Normal file
57
src/entity/examination_type.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
ManyToMany,
|
||||||
|
JoinTable,
|
||||||
|
} 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;
|
||||||
|
|
||||||
|
@ManyToMany(() => Service, { onDelete: 'NO ACTION' })
|
||||||
|
@JoinTable({
|
||||||
|
name: 'examination_type_services',
|
||||||
|
joinColumn: { name: 'examination_type_id', referencedColumnName: 'id' },
|
||||||
|
inverseJoinColumn: { name: 'service_id', referencedColumnName: 'id' },
|
||||||
|
})
|
||||||
|
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;
|
||||||
|
}
|
||||||
39
src/entity/measurement_unit.ts
Normal file
39
src/entity/measurement_unit.ts
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from 'typeorm';
|
||||||
|
|
||||||
|
import { Status } from '../types/status';
|
||||||
|
|
||||||
|
@Entity('measurement_units')
|
||||||
|
export class MeasurementUnit {
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
unit: 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;
|
||||||
|
}
|
||||||
57
src/entity/queue_monitoring.ts
Normal file
57
src/entity/queue_monitoring.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import {
|
||||||
|
Entity,
|
||||||
|
PrimaryGeneratedColumn,
|
||||||
|
Column,
|
||||||
|
CreateDateColumn,
|
||||||
|
UpdateDateColumn,
|
||||||
|
DeleteDateColumn,
|
||||||
|
ManyToMany,
|
||||||
|
JoinTable,
|
||||||
|
} from 'typeorm';
|
||||||
|
|
||||||
|
import { Status } from '../types/status';
|
||||||
|
import { Room } from './room';
|
||||||
|
|
||||||
|
@Entity('queue_monitorings')
|
||||||
|
export class QueueMonitoring {
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'text',
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
slug: string;
|
||||||
|
|
||||||
|
@ManyToMany(() => Room, { onDelete: 'NO ACTION' })
|
||||||
|
@JoinTable({
|
||||||
|
name: 'queue_monitoring_rooms',
|
||||||
|
joinColumn: { name: 'queue_monitoring_id', referencedColumnName: 'id' },
|
||||||
|
inverseJoinColumn: { name: 'room_id', referencedColumnName: 'id' },
|
||||||
|
})
|
||||||
|
rooms: Room[];
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
67
src/entity/reference_range.ts
Normal file
67
src/entity/reference_range.ts
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from 'typeorm';
|
||||||
|
|
||||||
|
import { Status } from '../types/status';
|
||||||
|
import { Gender } from '../enum/gender';
|
||||||
|
|
||||||
|
@Entity('reference_ranges')
|
||||||
|
export class ReferenceRange {
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'enum',
|
||||||
|
enum: Gender,
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
gender: Gender;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 128,
|
||||||
|
default: '0 day',
|
||||||
|
})
|
||||||
|
age_range_min: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 128,
|
||||||
|
default: '999 years',
|
||||||
|
})
|
||||||
|
age_range_max: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
value_min: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: false,
|
||||||
|
length: 256,
|
||||||
|
})
|
||||||
|
value_max: 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;
|
||||||
|
}
|
||||||
@ -13,6 +13,7 @@ import {
|
|||||||
|
|
||||||
import { ServiceType } from './service_type';
|
import { ServiceType } from './service_type';
|
||||||
import { Room } from './room';
|
import { Room } from './room';
|
||||||
|
import { ExaminationDetail } from './examination_detail';
|
||||||
|
|
||||||
@Entity('services')
|
@Entity('services')
|
||||||
export class Service {
|
export class Service {
|
||||||
@ -37,6 +38,14 @@ export class Service {
|
|||||||
})
|
})
|
||||||
rooms: Room[];
|
rooms: Room[];
|
||||||
|
|
||||||
|
@ManyToMany(() => ExaminationDetail, { onDelete: 'NO ACTION' })
|
||||||
|
@JoinTable({
|
||||||
|
name: 'service_examinations',
|
||||||
|
joinColumn: { name: 'service_id', referencedColumnName: 'id' },
|
||||||
|
inverseJoinColumn: { name: 'examination_detail_id', referencedColumnName: 'id' },
|
||||||
|
})
|
||||||
|
examination_details: ExaminationDetail[];
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
created_at: Date;
|
created_at: Date;
|
||||||
|
|||||||
4
src/enum/gender.ts
Normal file
4
src/enum/gender.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export enum Gender {
|
||||||
|
male = 'male',
|
||||||
|
female = 'female',
|
||||||
|
}
|
||||||
@ -20,6 +20,11 @@ export * from "../entity/service_fare"
|
|||||||
export * from "../entity/service_package"
|
export * from "../entity/service_package"
|
||||||
export * from "../entity/department"
|
export * from "../entity/department"
|
||||||
export * from "../entity/doctor_schedule"
|
export * from "../entity/doctor_schedule"
|
||||||
|
export * from "../entity/measurement_unit"
|
||||||
|
export * from "../entity/reference_range"
|
||||||
|
export * from "../entity/queue_monitoring"
|
||||||
|
export * from "../entity/examination_detail"
|
||||||
|
export * from "../entity/examination_type"
|
||||||
|
|
||||||
export * from "../types/action";
|
export * from "../types/action";
|
||||||
export * from "../types/error";
|
export * from "../types/error";
|
||||||
|
|||||||
Reference in New Issue
Block a user