Respect formulation in duplicate medicine report groups
This commit is contained in:
parent
07916f3baf
commit
058debb593
|
|
@ -116,6 +116,11 @@ class OpdMedicineModel
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$normalizedFormulation = $this->normalizeMedicineName($formulation);
|
||||||
|
if ($normalizedFormulation !== '') {
|
||||||
|
$base .= '::f:' . $normalizedFormulation;
|
||||||
|
}
|
||||||
|
|
||||||
$strength = $this->extractStrengthSignature($name, $formulation);
|
$strength = $this->extractStrengthSignature($name, $formulation);
|
||||||
if ($strength === '') {
|
if ($strength === '') {
|
||||||
return $base;
|
return $base;
|
||||||
|
|
@ -184,9 +189,15 @@ class OpdMedicineModel
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($groups[$norm])) {
|
if (! isset($groups[$norm])) {
|
||||||
|
$displayName = trim((string) ($row['item_name'] ?? ''));
|
||||||
|
$displayFormulation = trim((string) ($row['formulation'] ?? ''));
|
||||||
|
if ($displayFormulation !== '') {
|
||||||
|
$displayName .= ' (' . $displayFormulation . ')';
|
||||||
|
}
|
||||||
|
|
||||||
$groups[$norm] = [
|
$groups[$norm] = [
|
||||||
'normalized_name' => $norm,
|
'normalized_name' => $norm,
|
||||||
'display_name' => (string) ($row['item_name'] ?? ''),
|
'display_name' => $displayName,
|
||||||
'rows' => [],
|
'rows' => [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user