diff --git a/portal/import_template.php b/portal/import_template.php index 2a2ed145c78..be4d056bb37 100644 --- a/portal/import_template.php +++ b/portal/import_template.php @@ -326,7 +326,7 @@ function renderEditorHtml($template_id, $content) global $authUploadTemplates; $lists = [ - '{ParseAsHTML}', '{ParseAsText}', '{styleBlockStart}', '{styleBlockEnd}', '{SignaturesRequired}', '{TextInput}', '{sizedTextInput:120px}', '{smTextInput}', '{TextBox:03x080}', '{CheckMark}', '{ynRadioGroup}', '{TrueFalseRadioGroup}', '{DatePicker}', '{DateTimePicker}', '{StandardDatePicker}', '{CurrentDate:"global"}', '{CurrentTime}', '{DOS}', '{ReferringDOC}', '{PatientID}', '{PatientName}', '{PatientSex}', '{PatientDOB}', '{PatientPhone}', '{Address}', '{City}', '{State}', '{Zip}', '{PatientSignature}', '{AdminSignature}', '{WitnessSignature}', '{AcknowledgePdf:pdf name or id:title}', '{EncounterForm:LBF}', '{Questionnaire:name or id}', '{Medications}', '{ProblemList}', '{Allergies}', '{ChiefComplaint}', '{DEM: }', '{HIS: }', '{LBF: }', '{GRP}{/GRP}' + '{ParseAsHTML}', '{ParseAsText}', '{styleBlockStart}', '{styleBlockEnd}', '{SignaturesRequired}', '{TextInput}', '{sizedTextInput:120px}', '{smTextInput}', '{TextBox:03x080}', '{CheckMark}', '{RadioGroup:option1_many...}', '{RadioGroupInline:option1_many...}', '{ynRadioGroup}', '{TrueFalseRadioGroup}', '{DatePicker}', '{DateTimePicker}', '{StandardDatePicker}', '{CurrentDate:"global"}', '{CurrentTime}', '{DOS}', '{ReferringDOC}', '{PatientID}', '{PatientName}', '{PatientSex}', '{PatientDOB}', '{PatientPhone}', '{Address}', '{City}', '{State}', '{Zip}', '{PatientSignature}', '{AdminSignature}', '{WitnessSignature}', '{AcknowledgePdf:pdf name or id:title}', '{EncounterForm:LBF}', '{Questionnaire:name or id}', '{Medications}', '{ProblemList}', '{Allergies}', '{ChiefComplaint}', '{DEM: }', '{HIS: }', '{LBF: }', '{GRP}{/GRP}' ]; ?> diff --git a/portal/patient/templates/OnsiteDocumentListView.tpl.php b/portal/patient/templates/OnsiteDocumentListView.tpl.php index 59f21070f20..edeeed91893 100644 --- a/portal/patient/templates/OnsiteDocumentListView.tpl.php +++ b/portal/patient/templates/OnsiteDocumentListView.tpl.php @@ -458,6 +458,12 @@ function formReplaceRadioValues() { let rv = $('input:radio[name="' + jsAttr(name) + '"]:checked').val(); $(this).replaceWith(rv); }); + + $('.fcuGroup').each(function () { + let name = $(this).prop('id'); + let rv = $('input:radio[name="' + jsAttr(name) + '"]:checked').val(); + $(this).replaceWith(rv); + }); } function formReplaceTextInputs() { diff --git a/src/Services/DocumentTemplates/DocumentTemplateRender.php b/src/Services/DocumentTemplates/DocumentTemplateRender.php index abbec7f2c2e..5d922e2b3a0 100644 --- a/src/Services/DocumentTemplates/DocumentTemplateRender.php +++ b/src/Services/DocumentTemplates/DocumentTemplateRender.php @@ -305,6 +305,38 @@ private function doSubs($s, $formData): mixed ''; $sigfld .= ''; $s = $this->keyReplace($s, $sigfld); + } elseif (preg_match('/^\{(RadioGroup):([\w\s]+)\}/', substr($s, $this->keyLocation), $matches)) { + // matches {RadioGroup:caption1_caption2_caption3} + $this->keyLength = 3 + strlen($matches[1]) + strlen($matches[2]); + $matchesArr = explode('_', $matches[2]); + $this->grp_cnt++; + $radioCount = -1; + $sigfld = '
'; + foreach ($matchesArr as $buttonCaption) { + $radioCount++; + $checked = ($formData['group_radio' . $this->grp_cnt] ?? '') == attr($buttonCaption) ? "checked" : ''; + $sigfld .= '
' . '' . '
'; + } + $sigfld .= '
'; + $s = $this->keyReplace($s, $sigfld); + } elseif (preg_match('/^\{(RadioGroupInline):([\w\s]+)\}/', substr($s, $this->keyLocation), $matches)) { + // matches {RadioGroupInline:caption1_caption2_caption3} + $this->keyLength = 3 + strlen($matches[1]) + strlen($matches[2]); + $matchesArr = explode('_', $matches[2]); + $this->grp_cnt++; + $radioCount = -1; + $sigfld = ''; + foreach ($matchesArr as $buttonCaption) { + $radioCount++; + $checked = ($formData['inline_radio' . $this->grp_cnt] ?? '') == attr($buttonCaption) ? "checked" : ''; + $sigfld .= ''; + } + $sigfld .= ''; + $s = $this->keyReplace($s, $sigfld); } elseif ($this->keySearch($s, '{PatientName}')) { $tmp = $this->ptrow['fname']; if ($this->ptrow['mname']) {