expand export summary.

This commit is contained in:
Jason Kulatunga 2024-02-24 11:38:35 -08:00
parent 907c9be8e2
commit 55509c9a92
No known key found for this signature in database
5 changed files with 80 additions and 50 deletions

View File

@ -19,19 +19,16 @@ Planned End: CarePlan.period.end
</tr>
</thead>
<tbody>
<th:block th:each="entry : ${resource.entry}" th:object="${entry.getResource()}">
<th:block th:unless='*{getResourceType().name() == "Composition"}'>
<th:block th:with="extension=${entry.getResource().getExtensionByUrl('http://hl7.org/fhir/StructureDefinition/narrativeLink').getValue().getValue()}">
<tr th:id="${#strings.arraySplit(extension, '#')[1]}">
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .CarePlan }}
<tr id="{{$entry.SourceResourceID}}">
<td th:text="*{getDescription()}">Activity</td>
<td th:text="*{getIntent().toCode()}">Intent</td>
<td>{{pluckList "code" ($entry.Intent | parseList) | uniq | join "," }}</td> {{/* Intent */}}
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:text="*{getPeriod().getStartElement().getValue()}">Planned Start</td>
<td>{{.$entry.Date}}</td>{{/* Planned Start */}}
<td th:text="*{getPeriod().getEndElement().getValue()}">Planned End</td>
</tr>
</th:block>
</th:block>
</th:block>
{{end}}
</tbody>
</table>
</div>

View File

@ -17,18 +17,25 @@ Date: Observation.effectiveDateTime || Observation.effectivePeriod.start
</tr>
</thead>
<tbody>
<th:block th:each="entry : ${resource.entry}" th:object="${entry.getResource()}">
<th:block th:unless='*{getResourceType().name() == "Composition"}'>
<th:block th:with="extension=${entry.getResource().getExtensionByUrl('http://hl7.org/fhir/StructureDefinition/narrativeLink').getValue().getValue()}">
<tr th:id="${#strings.arraySplit(extension, '#')[1]}">
<td th:insert="~{IpsUtilityFragments :: codeableConcept (cc=*{getCode()},attr='display')}">Code</td>
<td th:insert="~{IpsUtilityFragments :: renderValue (value=*{getValue()})}">Result</td>
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .Observation }}
<tr id="{{$entry.SourceResourceID}}">
<td>{{pluckList "text" ($entry.Code | parseList) | uniq | join "," }}</td> {{/* Code */}}
<td>
{{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}}
</td> {{/* Result */}}
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderEffective (effective=*{getEffective()})}">Date</td>
<td>{{$entry.Date | date "2006-01-02"}}</td> {{/* Date */}}
</tr>
</th:block>
</th:block>
</th:block>
{{end}}
</tbody>
</table>
</div>

View File

@ -17,18 +17,15 @@ Onset Date: Condition.onsetDateTime || Condition.onsetPeriod.start && “-“ &&
</tr>
</thead>
<tbody>
<th:block th:each="entry : ${resource.entry}" th:object="${entry.getResource()}">
<th:block th:unless='*{getResourceType().name() == "Composition"}'>
<th:block th:with="extension=${entry.getResource().getExtensionByUrl('http://hl7.org/fhir/StructureDefinition/narrativeLink').getValue().getValue()}">
<tr th:id="${#strings.arraySplit(extension, '#')[1]}">
<td th:insert="~{IpsUtilityFragments :: codeableConcept (cc=*{getCode()},attr='display')}">Medical Problems</td>
<td th:insert="~{IpsUtilityFragments :: codeableConcept (cc=*{getClinicalStatus()},attr='code')}">Status</td>
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .Condition }}
<tr id="{{$entry.SourceResourceID}}">
<td>{{pluckList "text" ($entry.Code | parseList) | uniq | join "," }}</td> {{/* Medical Problems */}}
<td>{{pluckList "code" ($entry.ClinicalStatus | parseList) | uniq | join "," }}</td> {{/* Status */}}
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderOnset (onset=*{getOnset()})}">Onset Date</td>
<td>{{$entry.OnsetDate | date "2006-01-02"}}</td> {{/* Onset */}}
</tr>
</th:block>
</th:block>
</th:block>
{{end}}
</tbody>
</table>
</div>

View File

@ -19,19 +19,26 @@ Date: Observation.effectiveDateTime || Observation.effectivePeriod.start
</tr>
</thead>
<tbody>
<th:block th:each="entry : ${resource.entry}" th:object="${entry.getResource()}">
<th:block th:unless='*{getResourceType().name() == "Composition"}'>
<th:block th:with="extension=${entry.getResource().getExtensionByUrl('http://hl7.org/fhir/StructureDefinition/narrativeLink').getValue().getValue()}">
<tr th:id="${#strings.arraySplit(extension, '#')[1]}">
<td th:insert="~{IpsUtilityFragments :: codeableConcept (cc=*{getCode()},attr='display')}">Code</td>
<td th:insert="~{IpsUtilityFragments :: renderValue (value=*{getValue()})}">Result</td>
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .Observation }}
<tr id="{{$entry.SourceResourceID}}">
<td>{{pluckList "text" ($entry.Code | parseList) | uniq | join "," }}</td> {{/* Code */}}
<td>
{{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}}
</td> {{/* Result */}}
<td th:insert="~{IpsUtilityFragments :: renderValueUnit (value=*{getValue()})}">Unit</td>
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderEffective (effective=*{getEffective()})}">Date</td>
<td>{{$entry.Date | date "2006-01-02"}}</td> {{/* Date */}}
</tr>
</th:block>
</th:block>
</th:block>
{{end}}
</tbody>
</table>
</div>

View File

@ -35,6 +35,28 @@ Date: Observation.effectiveDateTime || Observation.effectivePeriod.start
</th:block>
</th:block>
</th:block>
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .Observation }}
<tr id="{{$entry.SourceResourceID}}">
<td>{{pluckList "text" ($entry.Code | parseList) | uniq | join "," }}</td> {{/* Code */}}
<td>
{{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}}
</td> {{/* Result */}}
<td th:insert="~{IpsUtilityFragments :: renderValueUnit (value=*{getValue()})}">Unit</td>
<td th:replace="~{IpsUtilityFragments :: firstFromCodeableConceptList (list=*{getInterpretation()})}">Interpretation</td>
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td>{{$entry.Date | date "2006-01-02"}}</td> {{/* Date */}}
</tr>
{{end}}
</tbody>
</table>
</div>