{"name": "documentreference-contained-custodian", "comment": "A DocumentReference's custodian keeps the document it describes, not the file read: it names no organization, and its contained Organization is a resource of a type not mapped.", "input": {"file": "fixtures/in/documentreference-contained-custodian.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/documentreference-contained-custodian.json", "text": "{\n  \"resourceType\": \"DocumentReference\",\n  \"status\": \"current\",\n  \"contained\": [\n    {\n      \"resourceType\": \"Organization\",\n      \"identifier\": [\n        {\n          \"system\": \"https://kestrel.example/organization-ids\",\n          \"value\": \"KH\"\n        },\n        {\n          \"system\": \"http://hl7.org/fhir/sid/us-npi\",\n          \"value\": \"1234567893\"\n        }\n      ],\n      \"name\": \"Kestrel Harbor Hospital\",\n      \"address\": [\n        {\n          \"line\": [\n            \"1200 Harbor Way\",\n            \"Building C\"\n          ],\n          \"city\": \"Kestrel Harbor\",\n          \"state\": \"WA\",\n          \"postalCode\": \"98000\",\n          \"country\": \"US\"\n        }\n      ],\n      \"id\": \"keeper\"\n    }\n  ],\n  \"subject\": {\n    \"display\": \"Ada Okonkwo\"\n  },\n  \"date\": \"2026-09-02T08:00:00Z\",\n  \"custodian\": {\n    \"reference\": \"#keeper\"\n  },\n  \"content\": [\n    {\n      \"attachment\": {\n        \"contentType\": \"application/pdf\",\n        \"title\": \"Discharge summary\"\n      }\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/documentreference-contained-custodian.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/documentreference-contained-custodian.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 prov: <http://www.w3.org/ns/prov#> .\n@prefix dct: <http://purl.org/dc/terms/> .\n@prefix dcterms: <http://purl.org/dc/terms/> .\n@prefix oa: <http://www.w3.org/ns/oa#> .\n@prefix pav: <http://purl.org/pav/> .\n<ni:///sha-256;KARZDfRsJ-91g8gFXoyQF2N6imXcumHim51IuQa_ejU> cascade:attachment <ni:///sha-256;KARZDfRsJ-91g8gFXoyQF2N6imXcumHim51IuQa_ejU#attachment-1> .\n<ni:///sha-256;KARZDfRsJ-91g8gFXoyQF2N6imXcumHim51IuQa_ejU#attachment-1> cascade:attachmentContentType \"application/pdf\" ;\n\tcascade:attachmentTitle \"Discharge summary\" .\n<ni:///sha-256;KARZDfRsJ-91g8gFXoyQF2N6imXcumHim51IuQa_ejU> cascade:workflowStatus \"current\" ;\n\tcascade:noteOrDocumentDate \"2026-09-02T08:00:00Z\"^^xsd:dateTime .\n<urn:uuid:210e50ae-0089-8883-90f1-1eb6a833b0b9> a cascade:ClinicalNoteOrDocument .\n<ni:///sha-256;KARZDfRsJ-91g8gFXoyQF2N6imXcumHim51IuQa_ejU> prov:specializationOf <urn:uuid:210e50ae-0089-8883-90f1-1eb6a833b0b9> .\n_:393a07c1929be5d45ce7e6e2663d4c78 bridge:arrivedAs <ni:///sha-256;KARZDfRsJ-91g8gFXoyQF2N6imXcumHim51IuQa_ejU> ;\n\toa:hasSelector _:805937b78c87323d55c17e266783b1e0 ;\n\toa:hasSource <ni:///sha-256;iXeFyRKFNEIaLU-zhqElxToEdPbtC8SYj3a5r4z-L-A> ;\n\tprov:wasDerivedFrom <ni:///sha-256;iXeFyRKFNEIaLU-zhqElxToEdPbtC8SYj3a5r4z-L-A> ;\n\tprov:wasGeneratedBy _:79e783b2646934a9405d30b2c4db408c .\n_:805937b78c87323d55c17e266783b1e0 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n<ni:///sha-256;iXeFyRKFNEIaLU-zhqElxToEdPbtC8SYj3a5r4z-L-A> pav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:433206e3e640e8b6f94410873b69fc97 ;\n\tprov:wasAttributedTo _:b070c78fba5387b556527a504aff604f ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:993291fe0e557a71391f73a43253a450 prov:agent _:b070c78fba5387b556527a504aff604f ;\n\tprov:hadRole cascade:AuthorRole .\n_:433206e3e640e8b6f94410873b69fc97 prov:qualifiedAssociation _:993291fe0e557a71391f73a43253a450 .\n_:e9fc0aee7b99ddba1668ca10e5f60f51 prov:agent _:c0fdfb9d82a408f4108159dcc78617b9 ;\n\tprov:hadRole cascade:TransmitterRole .\n_:433206e3e640e8b6f94410873b69fc97 prov:qualifiedAssociation _:e9fc0aee7b99ddba1668ca10e5f60f51 .\n_:b070c78fba5387b556527a504aff604f <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:c0fdfb9d82a408f4108159dcc78617b9 <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:79e783b2646934a9405d30b2c4db408c <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health export\" ;\n\tprov:startedAtTime \"2026-09-01T10:00:04Z\"^^xsd:dateTime .\n<ni:///sha-256;iXeFyRKFNEIaLU-zhqElxToEdPbtC8SYj3a5r4z-L-A> a prov:Entity .\n_:79e783b2646934a9405d30b2c4db408c a prov:Activity ;\n\tprov:used <ni:///sha-256;iXeFyRKFNEIaLU-zhqElxToEdPbtC8SYj3a5r4z-L-A> ;\n\tprov:qualifiedAssociation _:d0e9a6ebe52ac6bc5fb586f98c6162c3 .\n_:d0e9a6ebe52ac6bc5fb586f98c6162c3 prov:hadPlan _:1d99869c62d1b205872c21a7c96801f4 .\n_:1d99869c62d1b205872c21a7c96801f4 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:d0e9a6ebe52ac6bc5fb586f98c6162c3 prov:agent _:e0285fbd6b5e129880e5b5dc13c43ec9 .\n_:e0285fbd6b5e129880e5b5dc13c43ec9 a prov:SoftwareAgent ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"Cascade Bridge for Rust\" ;\n\tpav:version \"0.1.0\" .\n"}, "expectedFindings": {"file": "fixtures/findings/documentreference-contained-custodian.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/documentreference-contained-custodian.ttl", "text": "@prefix fhirr4: <https://ns.cascadeprotocol.org/adapter/fhir-r4/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_:d75505ccea1603ba8f00a07914794f8d a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:f93ff17d3d28418378185c478ea98189 oa:hasSource <../in/documentreference-contained-custodian.json> .\n_:d75505ccea1603ba8f00a07914794f8d oa:refinedBy _:f0c30f460cb92e5f50b32871c6da0d45 .\n_:f0c30f460cb92e5f50b32871c6da0d45 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/subject/display\" .\n_:f93ff17d3d28418378185c478ea98189 oa:hasSelector _:d75505ccea1603ba8f00a07914794f8d .\n_:e51a76c6638bc3b96d3d097b4dbfbb78 oa:hasTarget _:f93ff17d3d28418378185c478ea98189 ;\n\tsh:resultSeverity sh:Info ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:referenceDisplay ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Ada Okonkwo\" .\n_:a0d182dbe3067f28e08b830176954e0f a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:bc7b18749f48b20cab406dad90de3206 oa:hasSource <../in/documentreference-contained-custodian.json> .\n_:a0d182dbe3067f28e08b830176954e0f oa:refinedBy _:d11c3667fe5a76666cca2df1b43b06a7 .\n_:d11c3667fe5a76666cca2df1b43b06a7 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/contained/0/resourceType\" .\n_:bc7b18749f48b20cab406dad90de3206 oa:hasSelector _:a0d182dbe3067f28e08b830176954e0f .\n_:b9a66b376c54c1707be0f4cdb93a5ac3 oa:hasTarget _:bc7b18749f48b20cab406dad90de3206 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:resourceTypeNotMapped ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Organization\" .\n", "empty": false}}