Search code examples
c#xmlhl7-fhir

Read a section in FHIR Document Reference Data


Is there any way to read a CCD Data section inside the CCDA XML using FhirSerialization in R4. I have a DocumentReference FHIR Object and in that I have DATA section in a byte format. I have converted it to a string using the below line.

string decodedSamlRequest = System.Text.Encoding.UTF8.GetString(dfv);

and now in this decodedSamlRequest I have the CCD XML content.

<?xml version="1.0" encoding="UTF-8"?> 
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="xyz" xmlns:sdtc="xyz" xmlns:xsi="xyz">
    <realmCode code="US"/>       
            <assignedCustodian>
              <representedCustodianOrganization>
                <id root="123" extension="92"/>
                <name>some xyz</name>
                <telecom use="WP" value="tel:1234"/>
                <addr use="WP">
                  <streetAddressLine>address</streetAddressLine>
                  <city>city</city>
                  <state>state</state>
                  <postalCode>12345</postalCode>
                  <country>US</country>
                </addr>
              </representedCustodianOrganization>
            </assignedCustodian>
          </custodian>
    </ClinicalDocument>

In this I need to read the CITY element under Custodian Tag.


Solution

  • From FHIR's perspective, all content within an attachment is opaque. You can certainly write code to parse, access and manipulate that content - and could even create custom SearchParameters that could filter based on it. But you can't navigate into it using FHIRPath or using the navigation machinery found in any of the reference implementations.