correctly handle complex Observations (ComponentValueQuantity - used by Blood Pressure - Diastolic vs Systolic)

This commit is contained in:
Jason Kulatunga 2024-03-03 14:52:14 -08:00
parent 441c8ab964
commit 83d6cdea08
No known key found for this signature in database
2 changed files with 13 additions and 0 deletions

View File

@ -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}}

View File

@ -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}}