add new entity: examination_detail and examination_type
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;
|
||||
}
|
||||
@ -23,6 +23,8 @@ 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/error";
|
||||
|
||||
Reference in New Issue
Block a user