Skip to content

Commit

Permalink
correctly handle complex Observations (ComponentValueQuantity - used …
Browse files Browse the repository at this point in the history
…by Blood Pressure - Diastolic vs Systolic)
  • Loading branch information
AnalogJ committed Mar 3, 2024
1 parent e12d48c commit 181d8a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
{{.ValueDate | date "2006-01-02" }}
{{else if not (empty (.ValueConcept | parseList)) }}
{{.ValueConcept}}
{{else if not (empty (.ComponentValueQuantity | parseList)) }}
{{.ComponentValueQuantity | parseList | pluckList "unit" | join "," }}
{{end}}
11 changes: 11 additions & 0 deletions backend/pkg/utils/ips/templates/includes/observation-value.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,15 @@
{{.entry.ValueDate | date "2006-01-02" }}
{{else if not (empty (.entry.ValueConcept | parseList)) }}
{{.entry.ValueConcept}}
{{else if not (empty (.entry.ComponentValueQuantity | parseList)) }}
{{$componentCodeText := $.entry.ComponentCode | parseList | pluckList "text" }}
{{$componentValueQuantity := $.entry.ComponentValueQuantity | parseList | pluckList "value" | roundList 2 }}

{{range $index, $text := $componentCodeText }}
{{$text}} - {{index $componentValueQuantity $index}}
{{end}}

{{if (get . "include_unit")}}
{{.ComponentValueQuantity | parseList | pluckList "unit" | join "," }}
{{end}}
{{end}}

0 comments on commit 181d8a7

Please sign in to comment.