working on rendering resources

This commit is contained in:
Jason Kulatunga 2024-02-24 10:18:59 -08:00
parent 0664f20ef9
commit 907c9be8e2
No known key found for this signature in database
4 changed files with 42 additions and 50 deletions

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 Problem</td>
<td th:insert="~{IpsUtilityFragments :: codeableConcept (cc=*{getClinicalStatus()},attr='code')}">Status</td>
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderOnset (onset=*{getOnset()})}">Onset Date</td>
</tr>
</th:block>
</th:block>
</th:block>
{{- /*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 Problem */}}
<td>{{pluckList "code" ($entry.ClinicalStatus | parseList) | uniq | join "," }}</td> {{/* Status */}}
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td> {{/* Comments - TODO: use FHIRPath */}}
<td>{{$entry.OnsetDate | date "2006-01-02"}}</td> {{/* Onset */}}
</tr>
{{end}}
</tbody>
</table>
</div>

View File

@ -15,17 +15,16 @@ Date: Procedure.performedDateTime || Procedure.performedPeriod.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')}">Procedure</td>
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderPerformed (performed=*{getPerformed()})}">Date</td>
</tr>
</th:block>
</th:block>
</th:block>
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .Procedure }}
<tr id="{{$entry.SourceResourceID}}">
<td>{{pluckList "text" ($entry.Code | parseList) | uniq | join "," }}</td> {{/* Procedure */}}
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td> {{/* Comments - TODO: use FHIRPath */}}
<td>{{$entry.Date | date "2006-01-02"}}</td> {{/* Performed Date */}}
</tr>
{{end}}
</tbody>
</table>
</div>

View File

@ -23,21 +23,20 @@ Date: Immunization.occurrenceDateTime || Immunization.occurrenceString
</tr>
</thead>
<tbody>
<th:block th:each="entry : ${resource.entry}" th:object="${entry.getResource()}">
<th:block th:if='*{getResourceType().name() == "Immunization"}'>
<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=*{getVaccineCode()},attr='display')}">Immunization</td>
<td th:text="*{getStatusElement().value}">Status</td>
<td th:insert="~{IpsUtilityFragments :: concatDoseNumber (list=*{getProtocolApplied()})}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderOrganization (orgRef=*{getManufacturer()})}">Manufacturer</td>
<td th:text="*{getLotNumber()}">Lot Number</td>
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderOccurrence (occurrence=*{getOccurrence()})}">Date</td>
</tr>
</th:block>
</th:block>
</th:block>
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .Immunization }}
<tr id="{{$entry.SourceResourceID}}">
<td>{{pluckList "text" ($entry.VaccineCode | parseList) | uniq | join "," }}</td> {{/* Immunization */}}
<td>{{pluckList "code" ($entry.Status | parseList) | uniq | join "," }}</td> {{/* Status */}}
<td th:insert="~{IpsUtilityFragments :: concatDoseNumber (list=*{getProtocolApplied()})}">Dose Number</td> {{/* Comments - TODO: use FHIRPath */}}
<td th:insert="~{IpsUtilityFragments :: renderOrganization (orgRef=*{getManufacturer()})}">Manufacturer</td> {{/* Manufacturer - TODO: use FHIRPath */}}
<td>{{$entry.LotNumber}}</td> {{/* Lot Number */}}
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td>{{$entry.Date | date "2006-01-02"}}</td> {{/* Performed Date */}}
</tr>
{{end}}
</tbody>
</table>
</div>

View File

@ -17,18 +17,15 @@ Date Recorded: DeviceUseStatement.recordedDateTime
</tr>
</thead>
<tbody>
<th:block th:each="entry : ${resource.entry}" th:object="${entry.getResource()}">
<th:block th:if='*{getResourceType().name() == "DeviceUseStatement"}'>
<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 :: renderDevice (deviceRef=*{getDevice()})}">Device</td>
<td th:text="*{getStatusElement().value}">Status</td>
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td th:insert="~{IpsUtilityFragments :: renderRecorded (recorded=*{getRecordedOn()})}">Date Recorded</td>
</tr>
</th:block>
</th:block>
</th:block>
{{- /*gotype: github.com/fastenhealth/fasten-onprem/backend/pkg/utils/ips.NarrativeTemplateData*/ -}}
{{range $index, $entry := .Device }}
<tr id="{{$entry.SourceResourceID}}">
<td>{{pluckList "text" ($entry.Type | parseList) | uniq | join "," }}</td> {{/* Device */}}
<td>{{pluckList "code" ($entry.Status | parseList) | uniq | join "," }}</td> {{/* Status */}}
<td th:insert="~{IpsUtilityFragments :: concat (list=*{getNote()},attr='text')}">Comments</td>
<td></td> {{/* Date Recorded */}}
</tr>
{{end}}
</tbody>
</table>
</div>