diff --git a/backend/pkg/utils/ips/templates/history_of_illness.gohtml b/backend/pkg/utils/ips/templates/history_of_illness.gohtml index 11f06d54..ec96b346 100644 --- a/backend/pkg/utils/ips/templates/history_of_illness.gohtml +++ b/backend/pkg/utils/ips/templates/history_of_illness.gohtml @@ -17,18 +17,15 @@ Onset Date: Condition.onsetDateTime || Condition.onsetPeriod.start && “-“ && - - - - - Medical Problem - 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 Problem */}} + {{pluckList "code" ($entry.ClinicalStatus | parseList) | uniq | join "," }} {{/* Status */}} + Comments {{/* Comments - TODO: use FHIRPath */}} + {{$entry.OnsetDate | date "2006-01-02"}} {{/* Onset */}} + + {{end}} diff --git a/backend/pkg/utils/ips/templates/history_of_procedures.gohtml b/backend/pkg/utils/ips/templates/history_of_procedures.gohtml index 9e4bfcc6..29eadf36 100644 --- a/backend/pkg/utils/ips/templates/history_of_procedures.gohtml +++ b/backend/pkg/utils/ips/templates/history_of_procedures.gohtml @@ -15,17 +15,16 @@ Date: Procedure.performedDateTime || Procedure.performedPeriod.start && “-“ - - - - - Procedure - Comments - Date - - - - + + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .Procedure }} + + {{pluckList "text" ($entry.Code | parseList) | uniq | join "," }} {{/* Procedure */}} + Comments {{/* Comments - TODO: use FHIRPath */}} + {{$entry.Date | date "2006-01-02"}} {{/* Performed Date */}} + + {{end}} + diff --git a/backend/pkg/utils/ips/templates/immunizations.gohtml b/backend/pkg/utils/ips/templates/immunizations.gohtml index e21ca2e1..9161f09a 100644 --- a/backend/pkg/utils/ips/templates/immunizations.gohtml +++ b/backend/pkg/utils/ips/templates/immunizations.gohtml @@ -23,21 +23,20 @@ Date: Immunization.occurrenceDateTime || Immunization.occurrenceString - - - - - Immunization - Status - Comments - Manufacturer - Lot Number - Comments - Date - - - - + + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .Immunization }} + + {{pluckList "text" ($entry.VaccineCode | parseList) | uniq | join "," }} {{/* Immunization */}} + {{pluckList "code" ($entry.Status | parseList) | uniq | join "," }} {{/* Status */}} + Dose Number {{/* Comments - TODO: use FHIRPath */}} + Manufacturer {{/* Manufacturer - TODO: use FHIRPath */}} + {{$entry.LotNumber}} {{/* Lot Number */}} + Comments + {{$entry.Date | date "2006-01-02"}} {{/* Performed Date */}} + + {{end}} + diff --git a/backend/pkg/utils/ips/templates/medical_devices.gohtml b/backend/pkg/utils/ips/templates/medical_devices.gohtml index 73902b88..d237d73e 100644 --- a/backend/pkg/utils/ips/templates/medical_devices.gohtml +++ b/backend/pkg/utils/ips/templates/medical_devices.gohtml @@ -17,18 +17,15 @@ Date Recorded: DeviceUseStatement.recordedDateTime - - - - - Device - Status - Comments - Date Recorded - - - - + {{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}} + {{range $index, $entry := .Device }} + + {{pluckList "text" ($entry.Type | parseList) | uniq | join "," }} {{/* Device */}} + {{pluckList "code" ($entry.Status | parseList) | uniq | join "," }} {{/* Status */}} + Comments + {{/* Date Recorded */}} + + {{end}}