fix(abdm): dynamically format ImmunizationRecord display with vaccine name and date in recordsFetch
This commit is contained in:
parent
25ded76a45
commit
1a5bb0efdf
|
|
@ -5463,6 +5463,14 @@ class AbdmGateway extends BaseController
|
|||
default => 'Consultation Record',
|
||||
};
|
||||
$disp = ! empty($hrRow['care_context_display']) ? $hrRow['care_context_display'] : $defaultDisp;
|
||||
if ($recHiType === 'ImmunizationRecord' && ! empty($hrRow['entity_id']) && $db->tableExists('immunization_records')) {
|
||||
$immRow = $db->table('immunization_records')->select('vaccine_name, given_date, scheduled_date')->where('id', (int) $hrRow['entity_id'])->get(1)->getRowArray();
|
||||
if ($immRow) {
|
||||
$vName = trim((string) ($immRow['vaccine_name'] ?? 'BCG'));
|
||||
$vDate = ! empty($immRow['given_date']) ? $immRow['given_date'] : (! empty($immRow['scheduled_date']) ? $immRow['scheduled_date'] : date('Y-m-d'));
|
||||
$disp = 'ImmunizationRecord - ' . $vName . ' (' . date('d M Y', strtotime((string) $vDate)) . ')';
|
||||
}
|
||||
}
|
||||
$records[] = [
|
||||
'careContextReference' => $ref,
|
||||
'hiType' => $recHiType,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user