Add patient list age fields
- Include Age and BirthdateConversion in patient list responses - Keep Sex label transformation unchanged - Preserve existing patient audit/update behavior
This commit is contained in:
parent
8fdaf0ade7
commit
4f87be295b
@ -48,6 +48,16 @@ class PatientModel extends BaseModel {
|
|||||||
$rows = ValueSet::transformLabels($rows, [
|
$rows = ValueSet::transformLabels($rows, [
|
||||||
'Sex' => 'sex',
|
'Sex' => 'sex',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
foreach ($rows as &$row) {
|
||||||
|
$birthdate = $row['Birthdate'] ?? null;
|
||||||
|
$row['Age'] = empty($birthdate)
|
||||||
|
? ''
|
||||||
|
: $this->calculateAgeFromBirthdate($birthdate, null);
|
||||||
|
$row['BirthdateConversion'] = $this->formatedDateForDisplay($birthdate);
|
||||||
|
}
|
||||||
|
unset($row);
|
||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user