Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<Questionnaire xmlns="http://hl7.org/fhir">
    <id value="12345"/>
    <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml">
            <pre>---------------------------------
                Systolic Blood Pressure 120 mmHg, 
                Taken on Right Brachial Artery, 
                Diastolic Blood Pressure 75 mmHG,
                Taken on Right Brachial Artery
                ---------------------------------

                1. Blood Pressure Measurements:
                    1.1 Systolic: 120 mm[Hg]
                        1.1.1 Procedure Site: Structure of right brachial artery (body structure)
                    1.2 Diastolic: 75 mm[Hg]
                        1.2.1 Procedure Site: Structure of right brachial artery (body structure)
            </pre>
        </div>
    </text>
    <url value="http://hl7.org/fhir/Questionnaire/12345"/>
    <title value="Complex Blood Pressure Questionnaire"/>
    <status value="draft"/>
    <subjectType value="Patient"/>
    <date value="2020-07-22"/>
    <contained>
        <ValueSet>
            <id value="a773d2b4-cb02-4eff-ad1f-6043c36cb0c9"/>
            <name value="Blood Pressure Procedure Site"/>
            <status value="active"/>
            <compose>
                <include>
                    <system value="http://snomed.info/sct"/>
                    <concept>
                        <code value="723962009"/>
                        <display value="Structure of right brachial artery (body structure)"/>
                    </concept>
                    <concept>
                        <code value="723961002"/>
                        <display value="Structure of left brachial artery (body structure)"/>
                    </concept>
                </include>
            </compose>
        </ValueSet>
    </contained>
    <item>
        <linkId value="e62be151-86f0-49cd-ab05-0a9badbea800"/>
        <code>
            <system value="http://snomed.info/sct"/>
            <code value="75367002"/>
            <display value="Blood pressure (observable entity)"/>
        </code>
        <prefix value="1.0"/>
        <text value="Blood Pressure Measurement"/>
        <type value="group"/>
        <item>
            <linkId value="08bdd3d0-ba68-4589-afad-b11dd2445c47"/>
            <code>
                <system value="http://snomed.info/sct"/>
                <code value="271649006"/>
                <display value="Systolic blood pressure (observable entity)"/>
            </code>
            <prefix value="1.1"/>
            <text value="Systolic Blood Pressure"/>
            <type value="integer"/>
            <item>
                <linkId value="fb5166c2-3d21-41c9-b0db-a51710d7886e"/>
                <code>
                    <system value="http://snomed.info/sct"/>
                    <code value="363704007"/>
                    <display value="Procedure site (attribute)"/>
                </code>
                <prefix value="1.1.1"/>
                <text value="Procedure site"/>
                <type value="choice"/>
                <answerValueSet value="#a773d2b4-cb02-4eff-ad1f-6043c36cb0c9"/>
            </item>
        </item>
        <item>
            <linkId value="5772af68-dcdb-4cc1-b4cc-00dd396c245b"/>
            <code>
                <system value="http://snomed.info/sct"/>
                <code value="271650006"/>
                <display value="Diastolic blood pressure (observable entity)"/>
            </code>
            <prefix value="1.2"/>
            <text value="Diastolic Blood Pressure"/>
            <type value="integer"/>
            <item>
                <linkId value="47b5f243-a118-45c4-b366-45f480f32db1"/>
                <code>
                    <system value="http://snomed.info/sct"/>
                    <code value="363704007"/>
                    <display value="Procedure site (attribute)"/>
                </code>
                <prefix value="1.2.1"/>
                <text value="Procedure site"/>
                <type value="choice"/>
                <answerValueSet value="#a773d2b4-cb02-4eff-ad1f-6043c36cb0c9"/>
            </item>
        </item>
    </item>
</Questionnaire>

FHIR Questionnaire Response

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<QuestionnaireResponse xmlns="http://hl7.org/fhir">
    <id value="3141"/>
    <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml">
            <pre>---------------------------------
                Systolic Blood Pressure 120 mmHg, 
                Taken on Right Brachial Artery, 
                Diastolic Blood Pressure 75 mmHG,
                Taken on Right Brachial Artery
                ---------------------------------

                1. Blood Pressure Measurements:
                    1.1 Systolic: 120 mm[Hg]
                        1.1.1 Procedure Site: Structure of right brachial artery (body structure)
                    1.2 Diastolic: 75 mm[Hg]
                        1.2.1 Procedure Site: Structure of right brachial artery (body structure)
          </pre>
        </div>
    </text>
    <identifier>
        <value value="d41198f3-15f6-4274-8ef9-344580a01070"/>
    </identifier>
    <status value="completed"/>
    <item>
        <linkId value="e62be151-86f0-49cd-ab05-0a9badbea800"/>
        <item>
            <linkId value="08bdd3d0-ba68-4589-afad-b11dd2445c47"/>
            <answer>
                <valueInteger value="120"/>
            </answer>
            <item>
                <linkId value="fb5166c2-3d21-41c9-b0db-a51710d7886e"/>
                <answer>
                    <valueCoding>
                        <system value="http://snomed.info/sct"/>
                        <code value="723962009"/>
                        <display value="Structure of right brachial artery (body structure)"/>
                    </valueCoding>
                </answer>
            </item>
        </item>
        <item>
            <linkId value="5772af68-dcdb-4cc1-b4cc-00dd396c245b"/>
            <answer>
                <valueInteger value="75"/>
            </answer>
            <item>
                <linkId value="47b5f243-a118-45c4-b366-45f480f32db1"/>
                <answer>
                    <valueCoding>
                        <system value="http://snomed.info/sct"/>
                        <code value="723962009"/>
                        <display value="Structure of right brachial artery (body structure)"/>
                    </valueCoding>
                </answer>
            </item>
        </item>
    </item>
</QuestionnaireResponse>

Attribute Refinement ANF Transformation (XSLT)

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xpath-default-namespace="http://hl7.org/fhir">
    <xsl:output indent="yes" omit-xml-declaration="no"/>
    <xsl:template match="/">
        <anf>
            <xsl:for-each select="//item">
                <xsl:if test="./type/@value != 'group' and count(./item) = 1">
                    <xsl:variable name="attributeValuelinkId" select="./item/linkId/@value" />
                    <xsl:variable name="resultValueLinkId" select="./linkId/@value"/>
                    <statement>
                        <topic><xsl:value-of select="./code/code/@value" />|<xsl:value-of select="./code/display/@value" />|:<xsl:value-of select="./item/code/code/@value" />|<xsl:value-of select="./item/code/display/@value" />|=<xsl:value-of select="document('questionnaireResponse.xml')//item/linkId[@value = $attributeValuelinkId]/../answer/valueCoding/code/@value"/>|<xsl:value-of select="document('questionnaireResponse.xml')//item/linkId[@value = $attributeValuelinkId]/../answer/valueCoding/display/@value"/>|</topic>
                        <circumstance type="performance">
                            <status><xsl:value-of select="document('questionnaireResponse.xml')/QuestionnaireResponse/status/@value"/></status>
                            <result>[<xsl:value-of select="document('questionnaireResponse.xml')//item/linkId[@value = $resultValueLinkId]/../answer/valueInteger/@value"/>,<xsl:value-of select="document('questionnaireResponse.xml')//item/linkId[@value = $resultValueLinkId]/../answer/valueInteger/@value"/>]</result>
                        </circumstance>
                    </statement>
                </xsl:if>
            </xsl:for-each>
        </anf>
    </xsl:template>
</xsl:stylesheet>

ANF Logical Representation (XML)

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<anf>
   <statement>
      <topic>271649006|Systolic blood pressure (observable entity)|:363704007|Procedure site (attribute)|=723962009|Structure of right brachial artery (body structure)|</topic>
      <circumstance type="performance">
         <status>completed</status>
         <result>[120,120]</result>
      </circumstance>
   </statement>
   <statement>
      <topic>271650006|Diastolic blood pressure (observable entity)|:363704007|Procedure site (attribute)|=723962009|Structure of right brachial artery (body structure)|</topic>
      <circumstance type="performance">
         <status>completed</status>
         <result>[75,75]</result>
      </circumstance>
   </statement>
</anf>