Merge branch 'main' of https://git.shiblysolution.id/SAUDE-TL/service-master-data
This commit is contained in:
@ -68,6 +68,30 @@ export class RefferalHospitalController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async option(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
||||||
|
/*
|
||||||
|
#swagger.tags = ['RefferalHospital']
|
||||||
|
#swagger.security = [{ "bearerAuth": [] }]
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
var query = await RefferalHospitalModel.list();
|
||||||
|
|
||||||
|
const res_count = query;
|
||||||
|
const res_list = query.orderBy("refferal_hospital.created_at", "DESC");
|
||||||
|
|
||||||
|
const current_page = 1;
|
||||||
|
const total_count_data = await res_count.getCount();
|
||||||
|
const list_data = await res_list.getMany();
|
||||||
|
const count_data = CommonHelper.countObject(list_data);
|
||||||
|
|
||||||
|
return ReturnHelper.successResponselist(res, 200, Language.lang.success_view, count_data, current_page, total_count_data, list_data);
|
||||||
|
} catch (e: unknown) {
|
||||||
|
log.error(e);
|
||||||
|
const err = e as Error;
|
||||||
|
return ReturnHelper.errorResponse(res, 400, 401, Language.lang.failed_view, err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static async export(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
static async export(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['RefferalHospital']
|
#swagger.tags = ['RefferalHospital']
|
||||||
|
|||||||
@ -100,7 +100,7 @@ export class RegistrationFeeController {
|
|||||||
/*
|
/*
|
||||||
#swagger.tags = ['Registration Fee']
|
#swagger.tags = ['Registration Fee']
|
||||||
#swagger.security = [{ "bearerAuth": [] }]
|
#swagger.security = [{ "bearerAuth": [] }]
|
||||||
#swagger.parameters['id'] = { description: 'Room ID', in: 'path', type: 'string' }
|
#swagger.parameters['id'] = { description: 'ID', in: 'path', type: 'string' }
|
||||||
#swagger.requestBody = { required: true, content: { "application/json": { schema: { $ref: "#/components/schemas/registration_fee" } } } }
|
#swagger.requestBody = { required: true, content: { "application/json": { schema: { $ref: "#/components/schemas/registration_fee" } } } }
|
||||||
*/
|
*/
|
||||||
const queryRunner = OrmHelper.DB.createQueryRunner();
|
const queryRunner = OrmHelper.DB.createQueryRunner();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import config from 'config';
|
import config from 'config';
|
||||||
import { DataSource } from "typeorm";
|
import { DataSource } from "typeorm";
|
||||||
import { ILogObj, Logger } from 'tslog';
|
import { ILogObj, Logger } from 'tslog';
|
||||||
import { RegistrationFee,FareType, RoomStock, Administrativu, Aldeia, District, Menu, Munisipo, Suco, Application, Nationality, Diagnosis, DiagnosticProcedure, Room, ServiceType, ServiceClass, Service, ServiceFare, ServicePackage, Department, DoctorSchedule, MeasurementUnit, ReferenceRange, QueueMonitoring, ExaminationDetail, ExaminationType, User, UserRole, HrmsEmployee, HrmsDepartment, HrmsPosition, HrmsShift, HospitalInformation, ItemOrigin, ItemType, ItemTypeDetail, Unit, ItemCategory, ItemStatus, UsageInstructions, UsageTime, ItemClass, ItemClassDetail, GenericName, Factory, Supplier, FactoryToSupplier, ItemMaster, ItemGroup, PharmacyInfo, ItemPrice, SellingPricePercentage, PatientGroup, PatientGuarantor, InitialStock, DoctorItem, DoctorItemPackage, UserToRoom, RoomToPharmacy, PlanningVerificator, ScheduleSeries, ScheduleException, CardType, PaymentMethod } from 'entity'
|
import { RefferalHospital,RegistrationFee,FareType, RoomStock, Administrativu, Aldeia, District, Menu, Munisipo, Suco, Application, Nationality, Diagnosis, DiagnosticProcedure, Room, ServiceType, ServiceClass, Service, ServiceFare, ServicePackage, Department, DoctorSchedule, MeasurementUnit, ReferenceRange, QueueMonitoring, ExaminationDetail, ExaminationType, User, UserRole, HrmsEmployee, HrmsDepartment, HrmsPosition, HrmsShift, HospitalInformation, ItemOrigin, ItemType, ItemTypeDetail, Unit, ItemCategory, ItemStatus, UsageInstructions, UsageTime, ItemClass, ItemClassDetail, GenericName, Factory, Supplier, FactoryToSupplier, ItemMaster, ItemGroup, PharmacyInfo, ItemPrice, SellingPricePercentage, PatientGroup, PatientGuarantor, InitialStock, DoctorItem, DoctorItemPackage, UserToRoom, RoomToPharmacy, PlanningVerificator, ScheduleSeries, ScheduleException, CardType, PaymentMethod } from 'entity'
|
||||||
|
|
||||||
export class OrmHelper {
|
export class OrmHelper {
|
||||||
static DB: DataSource = null
|
static DB: DataSource = null
|
||||||
@ -53,7 +53,8 @@ export class OrmHelper {
|
|||||||
FareType,
|
FareType,
|
||||||
CardType,
|
CardType,
|
||||||
PaymentMethod,
|
PaymentMethod,
|
||||||
RegistrationFee
|
RegistrationFee,
|
||||||
|
RefferalHospital
|
||||||
],
|
],
|
||||||
subscribers: [],
|
subscribers: [],
|
||||||
migrations: [],
|
migrations: [],
|
||||||
|
|||||||
@ -2,48 +2,114 @@ import path from 'path';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { NextFunction, Request, Response } from 'express';
|
import { NextFunction, Request, Response } from 'express';
|
||||||
|
|
||||||
|
// interface LanguageValue {
|
||||||
|
// success_insert?: string;
|
||||||
|
// success_update?: string;
|
||||||
|
// success_delete?: string;
|
||||||
|
// success_restore?: string;
|
||||||
|
// success_view?: string;
|
||||||
|
// success?: string;
|
||||||
|
// success_valid_otp?: string;
|
||||||
|
|
||||||
|
// failed?: string;
|
||||||
|
// failed_access?: string;
|
||||||
|
// failed_access_otp?: string;
|
||||||
|
// failed_expired_otp?: string;
|
||||||
|
// failed_access_pin?: string;
|
||||||
|
// failed_try_pin?: string;
|
||||||
|
// failed_insert?: string;
|
||||||
|
// failed_update?: string;
|
||||||
|
// failed_delete?: string;
|
||||||
|
// failed_restore?: string;
|
||||||
|
// failed_save?: string;
|
||||||
|
// failed_view?: string;
|
||||||
|
// failed_empty?: string;
|
||||||
|
// failed_data?: string;
|
||||||
|
// failed_duplicate?: string;
|
||||||
|
// failed_not_found?: string;
|
||||||
|
// failed_limit_otp?: string;
|
||||||
|
// failed_limit_link_code?: string;
|
||||||
|
// failed_expired_token?: string;
|
||||||
|
// failed_token?: string;
|
||||||
|
// failed_add_point?: string;
|
||||||
|
|
||||||
|
// //login
|
||||||
|
// success_login?: string;
|
||||||
|
// failed_password?: string;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// export class Language {
|
||||||
|
// static lang_init: LanguageValue = {};
|
||||||
|
// static lang: LanguageValue = {};
|
||||||
|
|
||||||
|
// static setup() {
|
||||||
|
// const fileLang: any = fs.readFileSync(
|
||||||
|
// path.join(__dirname, '../langs/json/en.json')
|
||||||
|
// );
|
||||||
|
// Language.lang_init['en'] = JSON.parse(fileLang.toString('utf8'));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// static apply = (req: Request, res: Response, next: NextFunction) => {
|
||||||
|
// const acceptLanguageHeader = req.get('Accept-Language') as string | null;
|
||||||
|
// if (!acceptLanguageHeader) {
|
||||||
|
// //default
|
||||||
|
// req.params.language = 'en';
|
||||||
|
// } else {
|
||||||
|
// req.params.language = acceptLanguageHeader.substring(0, 2).toLowerCase();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Language.lang = Language.lang_init[req.params.language] ? Language.lang_init[req.params.language] : Language.lang_init['en'];
|
||||||
|
|
||||||
|
// return next();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
interface LanguageValue {
|
interface LanguageValue {
|
||||||
success_insert?: string;
|
success_insert: string;
|
||||||
success_update?: string;
|
success_update: string;
|
||||||
success_delete?: string;
|
success_delete: string;
|
||||||
success_restore?: string;
|
success_restore: string;
|
||||||
success_view?: string;
|
success_view: string;
|
||||||
success?: string;
|
success: string;
|
||||||
success_valid_otp?: string;
|
success_valid_otp: string;
|
||||||
|
|
||||||
failed?: string;
|
failed: string;
|
||||||
failed_access?: string;
|
failed_access: string;
|
||||||
failed_access_otp?: string;
|
failed_access_otp: string;
|
||||||
failed_expired_otp?: string;
|
failed_expired_otp: string;
|
||||||
failed_access_pin?: string;
|
failed_access_pin: string;
|
||||||
failed_try_pin?: string;
|
failed_try_pin: string;
|
||||||
failed_insert?: string;
|
failed_insert: string;
|
||||||
failed_update?: string;
|
failed_update: string;
|
||||||
failed_delete?: string;
|
failed_delete: string;
|
||||||
failed_restore?: string;
|
failed_restore: string;
|
||||||
failed_save?: string;
|
failed_save: string;
|
||||||
failed_view?: string;
|
failed_view: string;
|
||||||
failed_empty?: string;
|
failed_empty: string;
|
||||||
failed_data?: string;
|
failed_data: string;
|
||||||
failed_duplicate?: string;
|
failed_duplicate: string;
|
||||||
failed_not_found?: string;
|
failed_not_found: string;
|
||||||
failed_limit_otp?: string;
|
failed_limit_otp: string;
|
||||||
failed_limit_link_code?: string;
|
failed_limit_link_code: string;
|
||||||
failed_expired_token?: string;
|
failed_expired_token: string;
|
||||||
failed_token?: string;
|
failed_token: string;
|
||||||
failed_add_point?: string;
|
failed_add_point: string;
|
||||||
|
|
||||||
//login
|
success_login: string;
|
||||||
success_login?: string;
|
failed_password: string;
|
||||||
failed_password?: string;
|
}
|
||||||
|
|
||||||
|
// Tambah index signature agar bisa akses dengan ['en']
|
||||||
|
interface LanguageStore {
|
||||||
|
[key: string]: LanguageValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Language {
|
export class Language {
|
||||||
static lang_init: LanguageValue = {};
|
static lang_init: LanguageStore = {};
|
||||||
static lang: LanguageValue = {};
|
static lang: LanguageValue = {} as LanguageValue;
|
||||||
|
|
||||||
static setup() {
|
static setup() {
|
||||||
const fileLang: any = fs.readFileSync(
|
const fileLang = fs.readFileSync(
|
||||||
path.join(__dirname, '../langs/json/en.json')
|
path.join(__dirname, '../langs/json/en.json')
|
||||||
);
|
);
|
||||||
Language.lang_init['en'] = JSON.parse(fileLang.toString('utf8'));
|
Language.lang_init['en'] = JSON.parse(fileLang.toString('utf8'));
|
||||||
@ -52,13 +118,13 @@ export class Language {
|
|||||||
static apply = (req: Request, res: Response, next: NextFunction) => {
|
static apply = (req: Request, res: Response, next: NextFunction) => {
|
||||||
const acceptLanguageHeader = req.get('Accept-Language') as string | null;
|
const acceptLanguageHeader = req.get('Accept-Language') as string | null;
|
||||||
if (!acceptLanguageHeader) {
|
if (!acceptLanguageHeader) {
|
||||||
//default
|
|
||||||
req.params.language = 'en';
|
req.params.language = 'en';
|
||||||
} else {
|
} else {
|
||||||
req.params.language = acceptLanguageHeader.substring(0, 2).toLowerCase();
|
req.params.language = acceptLanguageHeader.substring(0, 2).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
Language.lang = Language.lang_init[req.params.language] ? Language.lang_init[req.params.language] : Language.lang_init['en'];
|
Language.lang = Language.lang_init[req.params.language]
|
||||||
|
?? Language.lang_init['en'];
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -432,6 +432,7 @@ export class RoutePrivate {
|
|||||||
app.get('/api/patient-guarantor/view/:id', PatientGuarantorController.detail)
|
app.get('/api/patient-guarantor/view/:id', PatientGuarantorController.detail)
|
||||||
|
|
||||||
app.get('/api/refferal-hospital/list', RefferalHospitalController.list)
|
app.get('/api/refferal-hospital/list', RefferalHospitalController.list)
|
||||||
|
app.get('/api/refferal-hospital/option', RefferalHospitalController.option)
|
||||||
app.get('/api/refferal-hospital/export', RefferalHospitalController.export)
|
app.get('/api/refferal-hospital/export', RefferalHospitalController.export)
|
||||||
app.post('/api/refferal-hospital/create', RefferalHospitalController.create)
|
app.post('/api/refferal-hospital/create', RefferalHospitalController.create)
|
||||||
app.put('/api/refferal-hospital/update/:id', RefferalHospitalController.update)
|
app.put('/api/refferal-hospital/update/:id', RefferalHospitalController.update)
|
||||||
|
|||||||
Reference in New Issue
Block a user