-
Notifications
You must be signed in to change notification settings - Fork 3
Call-in notification handling does not replace $patientName placeholder #521
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The call-in notification template had (temporarily removed in opalmedapps/opal-db-management#751) the placeholder $patientName which does not get replaced when building the notification to be sent to caregivers:
opal-admin-legacy/publisher/php/HospitalPushNotification.php
Lines 166 to 182 in e307d5f
| $language = strtoupper($detail['language']); | |
| $message = self::buildMessageForRoomNotification($room["room_".$language], $messageLabels["Name_".$language ], $messageLabels["Description_".$language]); | |
| $dynamicKeys = []; | |
| // Special case for replacing the $institution wildcard | |
| if (str_contains($message["mdesc"], '$institution')) { | |
| $dynamicKeys['$institution'] = $detail['institution_acronym']; | |
| } | |
| // prepare array for replacements | |
| $patterns = array(); | |
| $replacements = array(); | |
| $indice = 0; | |
| foreach($dynamicKeys as $key=>$val) { | |
| $patterns[$indice] = $key; | |
| $replacements[$indice] = $val; | |
| $indice +=1; | |
| } |
Probably doing something like this should work:
opal-admin-legacy/php/classes/OpalProject.php
Lines 226 to 231 in e307d5f
| // Special case for replacing the $patientName wildcard | |
| if (str_contains($messageTemplate, '$patientName')) { | |
| $firstName = $patient['FirstName']; | |
| // Add $patientName as a wildcard for replacement | |
| $dynamicKeys['$patientName'] = $firstName; | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working