From bf847b68352efb20e4fc8f3ec634a217c27ac4e9 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Thu, 29 Jan 2026 09:56:45 +0700 Subject: [PATCH] fix: correct ValueSet transformLabels output format - ValueSet::transformLabels() was outputting values incorrectly: - Field contained label text (e.g., Race: 'Jawa') - *Key contained original value (e.g., RaceKey: 'JAWA') - Fixed to output correct format for all static JSON ValueSets: - Field contains original value (e.g., Race: 'JAWA') - *Label contains label text (e.g., RaceLabel: 'Jawa') - Affected ValueSets: Race, Sex, Country, Religion, Ethnic, DeathIndicator, MaritalStatus - Patient show endpoint now returns: Race:'JAWA', RaceLabel:'Jawa', Sex:'1', SexLabel:'Female' as expected --- app/Libraries/ValueSet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Libraries/ValueSet.php b/app/Libraries/ValueSet.php index 787988d..35791cb 100644 --- a/app/Libraries/ValueSet.php +++ b/app/Libraries/ValueSet.php @@ -69,8 +69,8 @@ class ValueSet { foreach ($fieldMappings as $field => $lookupName) { if (isset($row[$field]) && $row[$field] !== null) { $keyValue = $row[$field]; - $row[$field . 'Key'] = $keyValue; - $row[$field] = self::getLabel($lookupName, $keyValue) ?? ''; + $row[$field] = $keyValue; + $row[$field . 'Label'] = self::getLabel($lookupName, $keyValue) ?? ''; } } }