From 55509c9a9211c26846d6d27e798e63761898ea34 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 24 Feb 2024 11:38:35 -0800 Subject: [PATCH] expand export summary. --- .../utils/ips/templates/plan_of_care.gohtml | 23 ++++++------- .../pkg/utils/ips/templates/pregnancy.gohtml | 31 ++++++++++------- .../utils/ips/templates/problem_list.gohtml | 21 +++++------- .../utils/ips/templates/social_history.gohtml | 33 +++++++++++-------- .../utils/ips/templates/vital_signs.gohtml | 22 +++++++++++++ 5 files changed, 80 insertions(+), 50 deletions(-) diff --git a/backend/pkg/utils/ips/templates/plan_of_care.gohtml b/backend/pkg/utils/ips/templates/plan_of_care.gohtml index d87170fa..22d6f84b 100644 --- a/backend/pkg/utils/ips/templates/plan_of_care.gohtml +++ b/backend/pkg/utils/ips/templates/plan_of_care.gohtml @@ -19,19 +19,16 @@ Planned End: CarePlan.period.end - - - - - Activity - Intent - Comments - Planned Start - Planned End - - - - + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .CarePlan }} + + Activity + {{pluckList "code" ($entry.Intent | parseList) | uniq | join "," }} {{/* Intent */}} + Comments + {{.$entry.Date}}{{/* Planned Start */}} + Planned End + + {{end}} diff --git a/backend/pkg/utils/ips/templates/pregnancy.gohtml b/backend/pkg/utils/ips/templates/pregnancy.gohtml index d939053c..92b42bfe 100644 --- a/backend/pkg/utils/ips/templates/pregnancy.gohtml +++ b/backend/pkg/utils/ips/templates/pregnancy.gohtml @@ -17,18 +17,25 @@ Date: Observation.effectiveDateTime || Observation.effectivePeriod.start - - - - - Code - Result - Comments - Date - - - - + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .Observation }} + + {{pluckList "text" ($entry.Code | parseList) | uniq | join "," }} {{/* Code */}} + + {{if gt (len $entry.ValueString) 0 }} + {{$entry.ValueString}} + {{else if gt (len ($entry.ValueQuantity | parseList)) 0 }} + {{$entry.ValueQuantity}} + {{else if gt (len $entry.ValueDateTime) 0 }} + {{$entry.ValueDateTime | date "2006-01-02" }} + {{else if gt (len ($entry.ValueCodeableConcept | parseList)) 0 }} + {{$entry.ValueCodeableConcept}} + {{end}} + {{/* Result */}} + Comments + {{$entry.Date | date "2006-01-02"}} {{/* Date */}} + + {{end}} diff --git a/backend/pkg/utils/ips/templates/problem_list.gohtml b/backend/pkg/utils/ips/templates/problem_list.gohtml index 5c0e796b..8abae809 100644 --- a/backend/pkg/utils/ips/templates/problem_list.gohtml +++ b/backend/pkg/utils/ips/templates/problem_list.gohtml @@ -17,18 +17,15 @@ Onset Date: Condition.onsetDateTime || Condition.onsetPeriod.start && “-“ && - - - - - Medical Problems - Status - Comments - Onset Date - - - - + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .Condition }} + + {{pluckList "text" ($entry.Code | parseList) | uniq | join "," }} {{/* Medical Problems */}} + {{pluckList "code" ($entry.ClinicalStatus | parseList) | uniq | join "," }} {{/* Status */}} + Comments + {{$entry.OnsetDate | date "2006-01-02"}} {{/* Onset */}} + + {{end}} diff --git a/backend/pkg/utils/ips/templates/social_history.gohtml b/backend/pkg/utils/ips/templates/social_history.gohtml index de7ba86c..20f76be4 100644 --- a/backend/pkg/utils/ips/templates/social_history.gohtml +++ b/backend/pkg/utils/ips/templates/social_history.gohtml @@ -19,19 +19,26 @@ Date: Observation.effectiveDateTime || Observation.effectivePeriod.start - - - - - Code - Result - Unit - Comments - Date - - - - + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .Observation }} + + {{pluckList "text" ($entry.Code | parseList) | uniq | join "," }} {{/* Code */}} + + {{if gt (len $entry.ValueString) 0 }} + {{$entry.ValueString}} + {{else if gt (len ($entry.ValueQuantity | parseList)) 0 }} + {{$entry.ValueQuantity}} + {{else if gt (len $entry.ValueDateTime) 0 }} + {{$entry.ValueDateTime | date "2006-01-02" }} + {{else if gt (len ($entry.ValueCodeableConcept | parseList)) 0 }} + {{$entry.ValueCodeableConcept}} + {{end}} + {{/* Result */}} + Unit + Comments + {{$entry.Date | date "2006-01-02"}} {{/* Date */}} + + {{end}} diff --git a/backend/pkg/utils/ips/templates/vital_signs.gohtml b/backend/pkg/utils/ips/templates/vital_signs.gohtml index f890ad6c..b43a4eff 100644 --- a/backend/pkg/utils/ips/templates/vital_signs.gohtml +++ b/backend/pkg/utils/ips/templates/vital_signs.gohtml @@ -35,6 +35,28 @@ Date: Observation.effectiveDateTime || Observation.effectivePeriod.start + + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .Observation }} + + {{pluckList "text" ($entry.Code | parseList) | uniq | join "," }} {{/* Code */}} + + {{if gt (len $entry.ValueString) 0 }} + {{$entry.ValueString}} + {{else if gt (len ($entry.ValueQuantity | parseList)) 0 }} + {{$entry.ValueQuantity}} + {{else if gt (len $entry.ValueDateTime) 0 }} + {{$entry.ValueDateTime | date "2006-01-02" }} + {{else if gt (len ($entry.ValueCodeableConcept | parseList)) 0 }} + {{$entry.ValueCodeableConcept}} + {{end}} + {{/* Result */}} + Unit + Interpretation + Comments + {{$entry.Date | date "2006-01-02"}} {{/* Date */}} + + {{end}}