From 5dd5a2ba1feb5e4be0201481c6c09b7c9db29466 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sun, 3 Mar 2024 15:37:40 -0800 Subject: [PATCH] safer handling of componentValueQuantity. --- .../ips/templates/includes/observation-value.gohtml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/pkg/utils/ips/templates/includes/observation-value.gohtml b/backend/pkg/utils/ips/templates/includes/observation-value.gohtml index c92aa81f..cdfc7463 100644 --- a/backend/pkg/utils/ips/templates/includes/observation-value.gohtml +++ b/backend/pkg/utils/ips/templates/includes/observation-value.gohtml @@ -16,9 +16,14 @@ {{range $index, $text := $componentCodeText }} - {{$text}} - {{index $componentValueQuantity $index}} + {{$text}} + {{if lt $index (len $componentValueQuantity)}} + - {{index $componentValueQuantity $index}} + {{end}} {{if (get $ "include_unit")}} - {{index $componentValueQuantityUnit $index}} + {{if lt $index (len $componentValueQuantityUnit)}} + {{index $componentValueQuantityUnit $index}} + {{end}} {{end}}
{{end}}