{"name": "unstructured-document-text", "comment": "An Unstructured Document whose nonXMLBody holds base64 text/plain: one note, named by the document's id, typed by its code 18842-5, dated by its effectiveTime, its text the decoded body, and the body its attachment, text/plain.", "input": {"file": "fixtures/in/unstructured-document-text.xml", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-ccda/blob/0c6ffe52b3c3d2dcd0dfaf3f0b9e00b69bf2ba96/fixtures/in/unstructured-document-text.xml", "text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ClinicalDocument xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <realmCode code=\"US\"/>\n  <typeId root=\"2.16.840.1.113883.1.3\" extension=\"POCD_HD000040\"/>\n  <templateId root=\"2.16.840.1.113883.10.20.22.1.1\" extension=\"2015-08-01\"/>\n  <templateId root=\"2.16.840.1.113883.10.20.22.1.10\" extension=\"2015-08-01\"/>\n  <id root=\"2.16.840.1.113883.19.5.99999.1\" extension=\"UD-2026-1030-T\"/>\n  <code code=\"18842-5\" displayName=\"Discharge summary\" codeSystem=\"2.16.840.1.113883.6.1\" codeSystemName=\"LOINC\"/>\n  <title>Discharge Summary</title>\n  <effectiveTime value=\"20261030090000-0500\"/>\n  <confidentialityCode code=\"N\" codeSystem=\"2.16.840.1.113883.5.25\"/>\n  <languageCode code=\"en-US\"/>\n  <recordTarget>\n    <patientRole>\n      <id root=\"2.16.840.1.113883.19.5.99999.2\" extension=\"MRN-448120\"/>\n      <patient>\n        <name use=\"L\">\n          <given>Robin</given>\n          <family>Ahmadi</family>\n        </name>\n        <administrativeGenderCode code=\"F\" codeSystem=\"2.16.840.1.113883.5.1\"/>\n        <birthTime value=\"19780214\"/>\n      </patient>\n    </patientRole>\n  </recordTarget>\n  <author>\n    <time value=\"20261030090000-0500\"/>\n    <assignedAuthor>\n      <id root=\"2.16.840.1.113883.19.5.99999.3\"/>\n      <representedOrganization>\n        <name>Riverside Community Hospital</name>\n      </representedOrganization>\n    </assignedAuthor>\n  </author>\n  <custodian>\n    <assignedCustodian>\n      <representedCustodianOrganization>\n        <id root=\"2.16.840.1.113883.19.5.99999.3\"/>\n        <name>Riverside Community Hospital</name>\n      </representedCustodianOrganization>\n    </assignedCustodian>\n  </custodian>\n  <component>\n    <nonXMLBody>\n      <text mediaType=\"text/plain\" representation=\"B64\">RGlzY2hhcmdlIHN1bW1hcnkKQWRtaXR0ZWQgMjAyNi0xMC0yMCB3aXRoIGFuYWVtaWE7IEIxMiBsb3c7IHN0YXJ0ZWQgY3lhbm9jb2JhbGFtaW4u</text>\n    </nonXMLBody>\n  </component>\n</ClinicalDocument>\n"}, "expectedGraph": {"file": "fixtures/expected/unstructured-document-text.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-ccda/blob/0c6ffe52b3c3d2dcd0dfaf3f0b9e00b69bf2ba96/fixtures/expected/unstructured-document-text.ttl", "text": "@prefix bridge: <https://ns.cascadeprotocol.org/bridge/v1-draft#> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix cascade: <https://ns.cascadeprotocol.org/cascade#> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n@prefix prov: <http://www.w3.org/ns/prov#> .\n@prefix org: <http://www.w3.org/ns/org#> .\n@prefix oa: <http://www.w3.org/ns/oa#> .\n<urn:uuid:5769da63-d46b-8c66-b381-d00b2f7ccadb> a cascade:Organization .\n<ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> prov:wasGeneratedBy _:aebeea1cb127191fd3d34436432055df ;\n\tprov:wasAttributedTo <urn:uuid:5769da63-d46b-8c66-b381-d00b2f7ccadb> .\n_:aebeea1cb127191fd3d34436432055df prov:qualifiedAssociation _:c493c066720edb88bcfdab4e43c07177 .\n_:c493c066720edb88bcfdab4e43c07177 prov:agent <urn:uuid:5769da63-d46b-8c66-b381-d00b2f7ccadb> ;\n\tprov:hadRole cascade:CustodianRole .\n<ni:///sha-256;grKi0ms_W2WGoIJBSajj9WqQqFYdSHTIaehKWGv5yRg> prov:specializationOf <urn:uuid:5769da63-d46b-8c66-b381-d00b2f7ccadb> .\n_:f59636504909760552dcc42114f94155 bridge:arrivedAs <ni:///sha-256;grKi0ms_W2WGoIJBSajj9WqQqFYdSHTIaehKWGv5yRg> ;\n\toa:hasSelector _:abc99c4c95dd217ce8ec885bba9fca72 .\n_:abc99c4c95dd217ce8ec885bba9fca72 a oa:XPathSelector ;\n\trdf:value \"/*[local-name()='ClinicalDocument' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='custodian' and namespace-uri()='urn:hl7-org:v3'][1]/*[local-name()='assignedCustodian' and namespace-uri()='urn:hl7-org:v3'][1]/*[local-name()='representedCustodianOrganization' and namespace-uri()='urn:hl7-org:v3'][1]\" .\n<ni:///sha-256;grKi0ms_W2WGoIJBSajj9WqQqFYdSHTIaehKWGv5yRg> foaf:name \"Riverside Community Hospital\" ;\n\torg:identifier \"urn:oid:2.16.840.1.113883.19.5.99999.3\"^^<urn:ietf:rfc:3986> .\n<ni:///sha-256;u1VNOG97_nxl6ZqcvwwU7SlRIUDWzAnY8fmpCtYt-hQ> cascade:workflowStatus \"current\" ;\n\tcascade:narrativeText \"Discharge summary\\nAdmitted 2026-10-20 with anaemia; B12 low; started cyanocobalamin.\" ;\n\tcascade:noteOrDocumentTypeName \"Discharge summary\" ;\n\tcascade:noteOrDocumentDate \"2026-10-30T09:00:00-05:00\"^^xsd:dateTime ;\n\tcascade:noteOrDocumentTypeCode <http://loinc.org/rdf/18842-5> ;\n\tcascade:noteOrDocumentMasterIdentifier \"UD-2026-1030-T\"^^<urn:oid:2.16.840.1.113883.19.5.99999.1> ;\n\tcascade:attachment <ni:///sha-256;u1VNOG97_nxl6ZqcvwwU7SlRIUDWzAnY8fmpCtYt-hQ#attachment-1> .\n<ni:///sha-256;u1VNOG97_nxl6ZqcvwwU7SlRIUDWzAnY8fmpCtYt-hQ#attachment-1> cascade:attachmentContentType \"text/plain\" .\n<ni:///sha-256;8OhFhApPXbNaEpnniPsDDmUOh7GZ3tQ3brvo1CVgP0c> foaf:familyName \"Ahmadi\" ;\n\tfoaf:givenName \"Robin\" ;\n\tcascade:dateOfBirth \"1978-02-14\"^^xsd:date ;\n\tcascade:administrativeGender \"female\" .\n<urn:uuid:ed62f5a3-7994-8c3c-9b4a-9f1f41a1aba4> a cascade:PatientProfile ;\n\tcascade:sourceUrl <urn:hl7ii:2.16.840.1.113883.19.5.99999.2:MRN-448120> ;\n\tcascade:sourceRecordId \"2.16.840.1.113883.19.5.99999.2:MRN-448120\" .\n<ni:///sha-256;8OhFhApPXbNaEpnniPsDDmUOh7GZ3tQ3brvo1CVgP0c> prov:specializationOf <urn:uuid:ed62f5a3-7994-8c3c-9b4a-9f1f41a1aba4> .\n_:e7f65929b0a9f3c4b1a9e67aad22394 a oa:XPathSelector ;\n\trdf:value \"/*[local-name()='ClinicalDocument' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='recordTarget' and namespace-uri()='urn:hl7-org:v3'][1]/*[local-name()='patientRole' and namespace-uri()='urn:hl7-org:v3'][1]\" .\n_:bf5c04a203ae12122fe56d2e5d109d43 bridge:arrivedAs <ni:///sha-256;8OhFhApPXbNaEpnniPsDDmUOh7GZ3tQ3brvo1CVgP0c> ;\n\toa:hasSelector _:e7f65929b0a9f3c4b1a9e67aad22394 .\n<urn:uuid:a0b073b8-69bd-8ab0-a1dd-ebb242aef0f7> a cascade:ClinicalNoteOrDocument ;\n\tcascade:sourceUrl <urn:hl7ii:2.16.840.1.113883.19.5.99999.1:UD-2026-1030-T> ;\n\tcascade:sourceRecordId \"2.16.840.1.113883.19.5.99999.1:UD-2026-1030-T\" .\n<ni:///sha-256;u1VNOG97_nxl6ZqcvwwU7SlRIUDWzAnY8fmpCtYt-hQ> prov:specializationOf <urn:uuid:a0b073b8-69bd-8ab0-a1dd-ebb242aef0f7> ;\n\tcascade:patient <urn:uuid:ed62f5a3-7994-8c3c-9b4a-9f1f41a1aba4> .\n_:f09829afbd140eeaf38781cbfef5d279 a oa:XPathSelector ;\n\trdf:value \"/*[local-name()='ClinicalDocument' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='component' and namespace-uri()='urn:hl7-org:v3'][1]/*[local-name()='nonXMLBody' and namespace-uri()='urn:hl7-org:v3'][1]\" .\n_:cbb89270bd77a553297c6e30ad5924fe bridge:arrivedAs <ni:///sha-256;u1VNOG97_nxl6ZqcvwwU7SlRIUDWzAnY8fmpCtYt-hQ> ;\n\toa:hasSelector _:f09829afbd140eeaf38781cbfef5d279 .\n_:f59636504909760552dcc42114f94155 oa:hasSource <ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> ;\n\tprov:wasDerivedFrom <ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> ;\n\tprov:wasGeneratedBy _:dcc80daf5b7d02483e3239911aba48c7 .\n_:cbb89270bd77a553297c6e30ad5924fe oa:hasSource <ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> ;\n\tprov:wasDerivedFrom <ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> ;\n\tprov:wasGeneratedBy _:dcc80daf5b7d02483e3239911aba48c7 .\n_:bf5c04a203ae12122fe56d2e5d109d43 oa:hasSource <ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> ;\n\tprov:wasDerivedFrom <ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> ;\n\tprov:wasGeneratedBy _:dcc80daf5b7d02483e3239911aba48c7 .\n<ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> <http://purl.org/pav/retrievedOn> \"2025-07-02T09:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:94c91e5f11cb9d378e13f0ce2bdf6462 .\n_:b785bbc919ef3c9b9f4e4f3235a0c861 prov:agent _:a4e4bfff4f597be042df0881f7134d0 ;\n\tprov:hadRole cascade:TransmitterRole .\n_:94c91e5f11cb9d378e13f0ce2bdf6462 prov:qualifiedAssociation _:b785bbc919ef3c9b9f4e4f3235a0c861 .\n_:a4e4bfff4f597be042df0881f7134d0 <http://www.w3.org/2000/01/rdf-schema#label> \"Riverside patient portal\" .\n_:dcc80daf5b7d02483e3239911aba48c7 <http://www.w3.org/2000/01/rdf-schema#label> \"C-CDA download\" ;\n\tprov:startedAtTime \"2025-07-02T09:00:04Z\"^^xsd:dateTime .\n<ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> a prov:Entity .\n_:dcc80daf5b7d02483e3239911aba48c7 a prov:Activity ;\n\tprov:used <ni:///sha-256;dLnK_CaPAj2pnG1kujl4KI-CYSIvhh_wzKqqf3r2_sU> ;\n\tprov:qualifiedAssociation _:51b4fc29a5f9be525bc38ee4a94acde .\n_:51b4fc29a5f9be525bc38ee4a94acde prov:hadPlan _:83bf0a48f3d7620b8502534da0c1714b .\n_:83bf0a48f3d7620b8502534da0c1714b a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"ccda\" ;\n\t<http://purl.org/pav/version> \"0.1.0\" .\n_:51b4fc29a5f9be525bc38ee4a94acde prov:agent _:1810ab3b693f807cf0332c383fc0c0b7 .\n_:1810ab3b693f807cf0332c383fc0c0b7 a prov:SoftwareAgent ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"Cascade Bridge for Rust\" ;\n\t<http://purl.org/pav/version> \"0.1.0\" .\n"}, "expectedFindings": {"file": "fixtures/findings/unstructured-document-text.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-ccda/blob/0c6ffe52b3c3d2dcd0dfaf3f0b9e00b69bf2ba96/fixtures/findings/unstructured-document-text.ttl", "text": "@prefix ccda: <https://ns.cascadeprotocol.org/adapter/ccda/v1-draft#> .\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n@prefix sh: <http://www.w3.org/ns/shacl#> .\n@prefix oa: <http://www.w3.org/ns/oa#> .\n_:c971ca013b2a932013bce1fd2c7b71f1 a oa:XPathSelector ;\n\trdf:value \"/*[local-name()='ClinicalDocument' and namespace-uri()='urn:hl7-org:v3']\" .\n_:f563da73d93761827143cc4191a47b30 a oa:XPathSelector ;\n\trdf:value \"*[local-name()='author' and namespace-uri()='urn:hl7-org:v3'][1]\" .\n_:c971ca013b2a932013bce1fd2c7b71f1 oa:refinedBy _:f563da73d93761827143cc4191a47b30 .\n_:fe7f99b26e4473ce0a5433dc0cc15aaf a oa:Annotation ;\n\toa:hasTarget _:f9126377c364253745a48cdbfcc56032 .\n_:f9126377c364253745a48cdbfcc56032 oa:hasSource <../in/unstructured-document-text.xml> ;\n\toa:hasSelector _:c971ca013b2a932013bce1fd2c7b71f1 .\n_:fe7f99b26e4473ce0a5433dc0cc15aaf oa:hasBody ccda:documentAuthor ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"/*[local-name()='ClinicalDocument' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='author' and namespace-uri()='urn:hl7-org:v3']\" ;\n\tsh:resultSeverity sh:Info .\n", "empty": false}}