diagnosis & diagnotic procedure

This commit is contained in:
Narul Hidayah
2026-02-05 11:28:54 +07:00
parent 9ebba6385b
commit 1fadf5c0f8
8 changed files with 806 additions and 2 deletions

24
src/model/diagnosis.ts Normal file
View File

@ -0,0 +1,24 @@
import { Diagnosis } from "entity";
import { SelectQueryBuilder } from "typeorm";
import CommonHelper from "../helpers/common";
import { OrmHelper } from "../helpers/orm";
export class DiagnosisModel {
static async list(filter = {}): Promise<SelectQueryBuilder<any>> {
const repo = OrmHelper.DB.getRepository(Diagnosis);
let whereAttr = [];
let whereVal: any = {};
if (filter) {
whereAttr = [...whereAttr, ...CommonHelper.handleQueryFilter(filter).whereAttr];
whereVal = { ...whereVal, ...CommonHelper.handleQueryFilter(filter).whereVal };
}
var query = null;
query = repo.createQueryBuilder();
if (whereAttr.length != 0) {
query = query.where(whereAttr.join(" and "), whereVal);
}
return query;
}
}

View File

@ -0,0 +1,24 @@
import { DiagnosticProcedure } from "entity";
import { SelectQueryBuilder } from "typeorm";
import CommonHelper from "../helpers/common";
import { OrmHelper } from "../helpers/orm";
export class DiagnosticProcedureModel {
static async list(filter = {}): Promise<SelectQueryBuilder<any>> {
const repo = OrmHelper.DB.getRepository(DiagnosticProcedure);
let whereAttr = [];
let whereVal: any = {};
if (filter) {
whereAttr = [...whereAttr, ...CommonHelper.handleQueryFilter(filter).whereAttr];
whereVal = { ...whereVal, ...CommonHelper.handleQueryFilter(filter).whereVal };
}
var query = null;
query = repo.createQueryBuilder();
if (whereAttr.length != 0) {
query = query.where(whereAttr.join(" and "), whereVal);
}
return query;
}
}