CDCgov / phdi

https://cdcgov.github.io/dibbs-site/
Creative Commons Zero v1.0 Universal
35 stars 14 forks source link

BUG: Fix FHIR conversion for Specimen (Source) in Lab Info #2724

Closed angelathe closed 3 weeks ago

angelathe commented 1 month ago

Description

For the eCRs below, the Specimen (Source) is not displaying in the Lab info section. Please fix the FHIR conversion of this value to ensure that the specimen value displays when available.

6a6bcd7d-7bad-48f6-9e0b-39a4ec9e063e

TN_sample eCR2

Current code (only checks the first entry.organizer.component, not each one being looped through):

 {% elsif entry.organizer.component.procedure.participant.participantRole.playingEntity.code.displayName -%}

Potential solution: minor code fix (check the specific component that is being looped through):

 {% elsif comp.procedure.participant.participantRole.playingEntity.code.displayName -%}

Steps to reproduce

Example eCRs:

Expected Result

When a lab specimen (source) information is available, it should be displayed under the Specimen (Source) row for the Lab Result.

Actual result

Example from 6a6bcd7d-7bad-48f6-9e0b-39a4ec9e063e:

image.png

Priority

Provide an estimate for level of impact the bug has today by placing an X in the applicable bracket

Priority

Notes

Relevant liquid section that finds the Specimen (Source) value for FHIR conversion:

{% if comp.procedure.participant.participantRole.id -%}
    {% if comp.procedure.participant.participantRole.playingEntity.code.translation -%}
        {% assign translations = comp.procedure.participant.participantRole.playingEntity.code.translation | to_array -%}
        {% if translations.first.displayName -%}
            {% assign specValue = translations.first.displayName -%}
        {% endif -%}
    {% elsif comp.procedure.participant.participantRole.id.displayName -%}
        {% assign specValue = comp.procedure.participant.participantRole.id.displayName -%}
    {% elsif entry.organizer.component.procedure.participant.participantRole.playingEntity.code.displayName -%}
        {% assign specValue = comp.procedure.participant.participantRole.playingEntity.code.displayName -%}
    {% else -%}
        {% assign specValue = "None" -%}
    {% endif -%}
{% endif -%}