Skip to content

Commit

Permalink
fix: several clinical_notes form fixes (openemr#6811)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymiller authored Sep 3, 2023
1 parent 408ff7c commit 6ccff40
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions interface/forms/clinical_notes/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function typeChange(othis) {
$context = $value['title'];
}
?>
<option value="<?php echo attr($value['value']); ?>" <?php echo $selected; ?>><?php echo text($value['title']); ?></option>
<option value="<?php echo attr($value['value']); ?>" <?php echo $selected; ?>><?php echo text($value['xlTitle']); ?></option>
<?php endforeach; ?>
</select>
</div>
Expand All @@ -222,7 +222,7 @@ function typeChange(othis) {
$context = $value['title'];
}
?>
<option value="<?php echo attr($value['value']); ?>" <?php echo $selected; ?>><?php echo text($value['title']); ?></option>
<option value="<?php echo attr($value['value']); ?>" <?php echo $selected; ?>><?php echo text($value['xlTitle']); ?></option>
<?php endforeach; ?>
</select>
</div>
Expand Down
8 changes: 4 additions & 4 deletions interface/forms/clinical_notes/templates/report.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ The Report template of the clinical note form.
<header class="d-flex justify-content-between bg-light border border-dark p-1 sticky-top">
<div class="form-group mb-0">
<div class="font-weight-bold">{{ "Date"|xlt }}</div>
<time datetime="{{ n.date|date()|text }}">{{ n.date|date()|text }}</time>
<time datetime="{{ n.date|date()|attr }}">{{ n.date|date()|text }}</time>
</div>
<div class="form-group mb-0">
<div class="font-weight-bold">{{ "Type"|xlt }}</div>
<div>{{ n.codetext|default("Unspecified"|xl)|xlt }}</div>
<div>{{ n.codetext is not empty ? n.codetext|xlListLabel|text : "Unspecified"|xlt }}</div>
</div>
<div class="form-group mb-0">
<div class="font-weight-bold">{{ "Category"|xlt }}</div>
<div>{{ n.category_title|default("Unspecified"|xl)|text }}</div>
<div>{{ n.category_title is not empty ? n.category_title|xlListLabel|text : "Unspecified"|xlt }}</div>
</div>
<div class="form-group mb-0">
<div class="font-weight-bold">{{ "Author"|xlt }}</div>
Expand All @@ -35,7 +35,7 @@ The Report template of the clinical note form.
</div>
{% endif %}
</header>
<section>{{ n.description|text|nl2br }}</section>
<section class="mb-3">{{ n.description|text|nl2br }}</section>
</article>
{% endfor %}
</section>
6 changes: 6 additions & 0 deletions src/Common/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ function ($string) {
return oeFormatShortDate($string);
}
),
new TwigFilter(
'xlListLabel',
function ($string) {
return xl_list_label($string);
}
),
new TwigFilter(
'xlDocCategory',
function ($string) {
Expand Down
6 changes: 3 additions & 3 deletions src/Services/ClinicalNotesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ public function getClinicalNotesForPatientForm(int $formid, $pid, $encounter)

$sql = "SELECT fcn.*, lo_category.title AS category_title, lo_category.notes AS category_code
FROM `form_clinical_notes` fcn
LEFT JOIN list_options lo_category ON lo_category.list_id = `Clinical_Notes_Category` AND lo_category.option_id = fcn.clinical_notes_category
LEFT JOIN list_options lo_type ON lo_type.list_id = `Clinical_Notes_Type` AND lo_type.option_id = fcn.clinical_notes_type
LEFT JOIN list_options lo_category ON lo_category.list_id = 'Clinical_Note_Category' AND lo_category.option_id = fcn.clinical_notes_category
LEFT JOIN list_options lo_type ON lo_type.list_id = 'Clinical_Note_Type' AND lo_type.option_id = fcn.clinical_notes_type
WHERE fcn.`form_id`=? AND fcn.`pid` = ? AND fcn.`encounter` = ?";
return QueryUtils::fetchRecords($sql, array($formid, $pid, $encounter));
}
Expand Down Expand Up @@ -366,7 +366,7 @@ private function getListAsSelectList($optionsList)

$selectList = [];
foreach ($optionsList as $option) {
$selectList[] = ['value' => $option['option_id'], 'code' => $option['notes'], 'title' => $option['title']];
$selectList[] = ['value' => $option['option_id'], 'code' => $option['notes'], 'title' => $option['title'], 'xlTitle' => xl_list_label($option['title'])];
}
return $selectList;
}
Expand Down

0 comments on commit 6ccff40

Please sign in to comment.