fix: encounter conflict solve

This commit is contained in:
riefive
2025-12-05 16:38:36 +07:00
21 changed files with 373 additions and 235 deletions

No files matched your search

+38 -32
View File
@@ -82,7 +82,7 @@ const defaultKeys: Record<string, any> = {
consultation: 'consultation',
controlLetter: 'control-letter',
inpatientLetter: 'inpatient-letter',
kfr: 'kfr',
fkr: 'fkr',
refBack: 'reference-back',
screening: 'screening',
supportingDocument: 'supporting-document',
@@ -99,17 +99,19 @@ const defaultMenus: Record<string, any> = {
classCode: ['ambulatory', 'emergency', 'inpatient'],
unit: 'all',
},
earlyNurseryAssessment: {
id: defaultKeys.earlyNurseryAssessment,
title: 'Pengkajian Awal Keperawatan',
classCode: ['ambulatory', 'emergency', 'inpatient'],
unit: 'all',
},
// NOTE : HIDDEN UNTIL IT IS READY
// earlyNurseryAssessment: {
// id: defaultKeys.earlyNurseryAssessment,
// title: 'Pengkajian Awal Keperawatan',
// classCode: ['ambulatory', 'emergency', 'inpatient'],
// unit: 'all',
// },
earlyMedicalAssessment: {
id: defaultKeys.earlyMedicalAssessment,
title: 'Pengkajian Awal Medis',
classCode: ['ambulatory', 'emergency', 'inpatient'],
unit: 'all',
afterId: 'early-medical-assessment',
},
earlyMedicalRehabAssessment: {
id: defaultKeys.earlyMedicalRehabAssessment,
@@ -118,20 +120,27 @@ const defaultMenus: Record<string, any> = {
unit: 'rehab',
afterId: defaultKeys.earlyMedicalAssessment,
},
functionAssessment: {
id: defaultKeys.functionAssessment,
title: 'Asesmen Fungsi',
classCode: ['ambulatory'],
unit: 'rehab',
afterId: defaultKeys.rehabMedicalAssessment,
},
therapyProtocol: {
id: defaultKeys.therapyProtocol,
classCode: ['ambulatory'],
title: 'Protokol Terapi',
unit: 'rehab',
afterId: defaultKeys.functionAssessment,
fkr: {
id: defaultKeys.fkr,
title: 'FKR',
classCode: ['ambulatory', 'emergency', 'inpatient'],
unit: 'all',
},
// NOTE: Replaced by FRK
// functionAssessment: {
// id: 'function-assessment',
// title: 'Asesmen Fungsi',
// classCode: ['ambulatory'],
// unit: 'rehab',
// afterId: 'rehab-medical-assessment',
// },
// therapyProtocol: {
// id: 'therapy-protocol',
// classCode: ['ambulatory'],
// title: 'Protokol Terapi',
// unit: 'rehab',
// afterId: 'function-assessment',
// },
chemotherapyProtocol: {
id: defaultKeys.chemotherapyProtocol,
title: 'Protokol Kemoterapi',
@@ -253,13 +262,7 @@ const defaultMenus: Record<string, any> = {
title: 'SPRI',
classCode: ['ambulatory', 'emergency'],
unit: 'all',
},
kfr: {
id: defaultKeys.kfr,
title: 'KFR',
classCode: ['ambulatory', 'emergency', 'inpatient'],
unit: 'all',
},
},
refBack: {
id: defaultKeys.refBack,
title: 'PRB',
@@ -449,9 +452,9 @@ export function injectComponents(id: string | number, data: EncounterListData, m
currentKeys.refBack['component'] = PrbListAsync
currentKeys.refBack['props'] = { encounter: data?.encounter }
}
if (currentKeys?.kfr) {
currentKeys.kfr['component'] = KfrListAsync
currentKeys.kfr['props'] = { encounter: data?.encounter }
if (currentKeys?.fkr) {
currentKeys.fkr['component'] = KfrListAsync
currentKeys.fkr['props'] = { encounter: data?.encounter }
}
if (currentKeys?.screening) {
// TODO: add component for screening
@@ -536,9 +539,12 @@ export function mapResponseToEncounter(result: any): any {
? result.visitDate
: result.registeredAt || result.patient?.registeredAt || null,
adm_employee_id: result.adm_employee_id || 0,
appointment_doctor_id: result.appointment_doctor_id || null,
responsible_doctor_id: result.responsible_doctor_id || null,
adm_employee: result.adm_employee || null,
responsible_nurse_code: result.responsible_nurse_code || null,
responsible_nurse: result.responsible_nurse || null,
appointment_doctor_code: result.appointment_doctor_code || null,
appointment_doctor: result.appointment_doctor || null,
responsible_doctor_code: result.responsible_doctor_id || null,
responsible_doctor: result.responsible_doctor || null,
refSource_name: result.refSource_name || null,
appointment_id: result.appointment_id || null,