{"name": "bundle-document-custodian-and-authors", "comment": "The custodian's NPI names its organization record, the name the C-CDA adapter's organizations-root-and-extension gives a custodian with that NPI: cascade-vocabulary's organization-from-npi naming vector.", "input": {"file": "fixtures/in/bundle-document-custodian-and-authors.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/bundle-document-custodian-and-authors.json", "text": "{\n  \"resourceType\": \"Bundle\",\n  \"type\": \"document\",\n  \"entry\": [\n    {\n      \"fullUrl\": \"urn:uuid:9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f\",\n      \"resource\": {\n        \"resourceType\": \"Composition\",\n        \"status\": \"final\",\n        \"type\": {\n          \"coding\": [\n            {\n              \"system\": \"http://loinc.org\",\n              \"code\": \"60591-5\"\n            }\n          ]\n        },\n        \"subject\": {\n          \"reference\": \"urn:uuid:7d1f0c2a-4b6e-4f3a-9c8d-1e2f3a4b5c6d\"\n        },\n        \"date\": \"2026-09-01\",\n        \"author\": [\n          {\n            \"reference\": \"urn:uuid:3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d\"\n          },\n          {\n            \"reference\": \"urn:uuid:5d6e7f8a-9b0c-4d1e-8f2a-3b4c5d6e7f8a\"\n          },\n          {\n            \"reference\": \"urn:uuid:6e7f8a9b-0c1d-4e2f-9a3b-4c5d6e7f8a9b\"\n          }\n        ],\n        \"title\": \"Patient summary\",\n        \"custodian\": {\n          \"reference\": \"urn:uuid:4c5d6e7f-8a9b-4c0d-9e1f-2a3b4c5d6e7f\"\n        }\n      }\n    },\n    {\n      \"fullUrl\": \"urn:uuid:7d1f0c2a-4b6e-4f3a-9c8d-1e2f3a4b5c6d\",\n      \"resource\": {\n        \"resourceType\": \"Patient\",\n        \"name\": [\n          {\n            \"family\": \"Okonkwo\",\n            \"given\": [\n              \"Ada\"\n            ]\n          }\n        ],\n        \"gender\": \"female\",\n        \"birthDate\": \"1979-06-02\"\n      }\n    },\n    {\n      \"fullUrl\": \"urn:uuid:4c5d6e7f-8a9b-4c0d-9e1f-2a3b4c5d6e7f\",\n      \"resource\": {\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      }\n    },\n    {\n      \"fullUrl\": \"urn:uuid:5d6e7f8a-9b0c-4d1e-8f2a-3b4c5d6e7f8a\",\n      \"resource\": {\n        \"resourceType\": \"Organization\",\n        \"identifier\": [\n          {\n            \"system\": \"urn:oid:2.16.840.1.113883.19.5.2\",\n            \"value\": \"CLINIC-7\"\n          }\n        ],\n        \"name\": \"Fernhill Family Clinic\",\n        \"address\": [\n          {\n            \"text\": \"14 Fern Hill Road, Kestrel Harbor, WA 98001\",\n            \"line\": [\n              \"14 Fern Hill Road\"\n            ],\n            \"city\": \"Kestrel Harbor\"\n          }\n        ]\n      }\n    },\n    {\n      \"fullUrl\": \"urn:uuid:6e7f8a9b-0c1d-4e2f-9a3b-4c5d6e7f8a9b\",\n      \"resource\": {\n        \"resourceType\": \"Organization\",\n        \"identifier\": [\n          {\n            \"system\": \"https://example.org/partner-ids\",\n            \"value\": \"P-22\"\n          }\n        ],\n        \"name\": \"Harbor Partners Billing\"\n      }\n    },\n    {\n      \"fullUrl\": \"urn:uuid:3a9b8c7d-6e5f-4a1b-9c2d-8e7f6a5b4c3d\",\n      \"resource\": {\n        \"resourceType\": \"Practitioner\",\n        \"name\": [\n          {\n            \"family\": \"Lindqvist\",\n            \"given\": [\n              \"Maya\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"fullUrl\": \"urn:uuid:0e4c8b6a-2d1f-4a3b-8c5d-6e7f8a9b0c1d\",\n      \"resource\": {\n        \"resourceType\": \"Condition\",\n        \"code\": {\n          \"coding\": [\n            {\n              \"system\": \"http://snomed.info/sct\",\n              \"code\": \"38341003\",\n              \"display\": \"Hypertensive disorder\"\n            }\n          ],\n          \"text\": \"Hypertension\"\n        },\n        \"subject\": {\n          \"reference\": \"urn:uuid:7d1f0c2a-4b6e-4f3a-9c8d-1e2f3a4b5c6d\"\n        }\n      }\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/bundle-document-custodian-and-authors.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/bundle-document-custodian-and-authors.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 dct: <http://purl.org/dc/terms/> .\n@prefix dcterms: <http://purl.org/dc/terms/> .\n@prefix org: <http://www.w3.org/ns/org#> .\n@prefix oa: <http://www.w3.org/ns/oa#> .\n@prefix pav: <http://purl.org/pav/> .\n<ni:///sha-256;Y6zuKW3zerpLbnb90eQilLs1ITA3qc-QSoDnkeacBbo> foaf:familyName \"Okonkwo\" ;\n\tfoaf:givenName \"Ada\" ;\n\tcascade:dateOfBirth \"1979-06-02\"^^xsd:date ;\n\tcascade:administrativeGender \"female\" .\n<urn:uuid:3173c54d-45f7-8efa-b86a-257bf6d7c409> a cascade:PatientProfile .\n<ni:///sha-256;Y6zuKW3zerpLbnb90eQilLs1ITA3qc-QSoDnkeacBbo> prov:specializationOf <urn:uuid:3173c54d-45f7-8efa-b86a-257bf6d7c409> .\n_:19d9c061d828b41c9c3b1da13a13a2aa bridge:arrivedAs <ni:///sha-256;Y6zuKW3zerpLbnb90eQilLs1ITA3qc-QSoDnkeacBbo> ;\n\toa:hasSelector _:d851dba3c0b7ab5c18fe31cf63a7c0d9 ;\n\toa:hasSource <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasDerivedFrom <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasGeneratedBy _:a46bcd6ba5fac03ee5c230ef643da48d .\n_:d851dba3c0b7ab5c18fe31cf63a7c0d9 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/1\" .\n<urn:uuid:b272d9d2-08db-8fd9-9d33-eca1e48c75ba> a cascade:Organization .\n<ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> prov:wasGeneratedBy _:fbb8e2530154056400c9f7f9b5ef135 ;\n\tprov:wasAttributedTo <urn:uuid:b272d9d2-08db-8fd9-9d33-eca1e48c75ba> .\n_:fbb8e2530154056400c9f7f9b5ef135 prov:qualifiedAssociation _:ea102a87b7e95d203b07640b6d8580a0 .\n_:ea102a87b7e95d203b07640b6d8580a0 prov:agent <urn:uuid:b272d9d2-08db-8fd9-9d33-eca1e48c75ba> ;\n\tprov:hadRole cascade:CustodianRole .\n<ni:///sha-256;S8Fa_wp_GgEILd_ckcSEmNQGJppHNzHqA8Z2Zl-7TFk> prov:specializationOf <urn:uuid:b272d9d2-08db-8fd9-9d33-eca1e48c75ba> .\n_:ef4765fd6de0de4fb73beb7382491d8b bridge:arrivedAs <ni:///sha-256;S8Fa_wp_GgEILd_ckcSEmNQGJppHNzHqA8Z2Zl-7TFk> .\n<ni:///sha-256;S8Fa_wp_GgEILd_ckcSEmNQGJppHNzHqA8Z2Zl-7TFk> foaf:name \"Kestrel Harbor Hospital\" ;\n\torg:identifier \"1234567893\"^^<http://hl7.org/fhir/sid/us-npi> , \"KH\"^^<https://kestrel.example/organization-ids> ;\n\tcascade:organizationAddress \"1200 Harbor Way\\nBuilding C\\nKestrel Harbor\\nWA\\n98000\\nUS\" .\n_:ef4765fd6de0de4fb73beb7382491d8b oa:hasSelector _:af4450fb510be8cc39f149a5950f2c1b ;\n\toa:hasSource <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasDerivedFrom <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasGeneratedBy _:a46bcd6ba5fac03ee5c230ef643da48d .\n_:af4450fb510be8cc39f149a5950f2c1b a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/2\" .\n<urn:uuid:5f0b3af1-bc5d-84fc-a2fc-3551a9d2d8dc> a cascade:Organization .\n<ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> prov:wasGeneratedBy _:c46006c8c9f04323bb284b4788c3502e ;\n\tprov:wasAttributedTo <urn:uuid:5f0b3af1-bc5d-84fc-a2fc-3551a9d2d8dc> .\n_:c46006c8c9f04323bb284b4788c3502e prov:qualifiedAssociation _:eefbe92eb21c68daafc2526920d9b8f6 .\n_:eefbe92eb21c68daafc2526920d9b8f6 prov:agent <urn:uuid:5f0b3af1-bc5d-84fc-a2fc-3551a9d2d8dc> ;\n\tprov:hadRole cascade:AuthorRole .\n<ni:///sha-256;_eEf45YnUxPjgcCW0ZsmMJ0oNtrKjACrO38c9PWvZ1g> prov:specializationOf <urn:uuid:5f0b3af1-bc5d-84fc-a2fc-3551a9d2d8dc> .\n_:f5bf72fb3a62dec3d3c15d2b1fba0b25 bridge:arrivedAs <ni:///sha-256;_eEf45YnUxPjgcCW0ZsmMJ0oNtrKjACrO38c9PWvZ1g> .\n<ni:///sha-256;_eEf45YnUxPjgcCW0ZsmMJ0oNtrKjACrO38c9PWvZ1g> foaf:name \"Fernhill Family Clinic\" ;\n\torg:identifier \"CLINIC-7\"^^<urn:oid:2.16.840.1.113883.19.5.2> ;\n\tcascade:organizationAddress \"14 Fern Hill Road, Kestrel Harbor, WA 98001\" .\n_:f5bf72fb3a62dec3d3c15d2b1fba0b25 oa:hasSelector _:f221d09c286debb4c6ce67edc69e2921 ;\n\toa:hasSource <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasDerivedFrom <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasGeneratedBy _:a46bcd6ba5fac03ee5c230ef643da48d .\n_:f221d09c286debb4c6ce67edc69e2921 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/3\" .\n<ni:///sha-256;i-CzE44pKE8hfAsG-yX71V2aviQ7xEQ8hwUy1HWRdp0> cascade:conditionName \"Hypertension\" ;\n\tcascade:conditionCode <http://snomed.info/id/38341003> .\n<urn:uuid:5e9f0df4-1242-8e0a-8d58-103be139bd7a> a cascade:ProblemOrDiagnosis .\n<ni:///sha-256;i-CzE44pKE8hfAsG-yX71V2aviQ7xEQ8hwUy1HWRdp0> prov:specializationOf <urn:uuid:5e9f0df4-1242-8e0a-8d58-103be139bd7a> ;\n\tcascade:patient <urn:uuid:3173c54d-45f7-8efa-b86a-257bf6d7c409> .\n_:507c9366258021ea23ca8793d7633a4e bridge:arrivedAs <ni:///sha-256;i-CzE44pKE8hfAsG-yX71V2aviQ7xEQ8hwUy1HWRdp0> ;\n\toa:hasSelector _:7dc1c86060c3824164f37d80f53545c9 ;\n\toa:hasSource <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasDerivedFrom <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:wasGeneratedBy _:a46bcd6ba5fac03ee5c230ef643da48d .\n_:7dc1c86060c3824164f37d80f53545c9 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/6\" .\n<ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> pav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:17add8525c7ccd876496a55b50126f99 ;\n\tprov:wasAttributedTo _:f4bbb4b3c9c2e1d659cb2d673ea62930 ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:a5646d1fb55d1d7c9bf237bfc1c7134d prov:agent _:f4bbb4b3c9c2e1d659cb2d673ea62930 ;\n\tprov:hadRole cascade:AuthorRole .\n_:17add8525c7ccd876496a55b50126f99 prov:qualifiedAssociation _:a5646d1fb55d1d7c9bf237bfc1c7134d .\n_:c28643e3242d8d097462e480e587c2a8 prov:agent _:17b5105a01c712c79dce0f58b3907671 ;\n\tprov:hadRole cascade:TransmitterRole .\n_:17add8525c7ccd876496a55b50126f99 prov:qualifiedAssociation _:c28643e3242d8d097462e480e587c2a8 .\n_:f4bbb4b3c9c2e1d659cb2d673ea62930 <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:17b5105a01c712c79dce0f58b3907671 <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:a46bcd6ba5fac03ee5c230ef643da48d <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;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> a prov:Entity .\n_:a46bcd6ba5fac03ee5c230ef643da48d a prov:Activity ;\n\tprov:used <ni:///sha-256;ubvi-LvrcaMOPm5w_3Y3lRXvqiFFnDGrqXr0rJxAD84> ;\n\tprov:qualifiedAssociation _:e4de85cf6f803b4f15296b7be420193b .\n_:e4de85cf6f803b4f15296b7be420193b prov:hadPlan _:5f1d57e24c28f895810b47e0c0c4519d .\n_:5f1d57e24c28f895810b47e0c0c4519d a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:e4de85cf6f803b4f15296b7be420193b prov:agent _:63766b5c214e254173afa6d38b60d2e7 .\n_:63766b5c214e254173afa6d38b60d2e7 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/bundle-document-custodian-and-authors.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/bundle-document-custodian-and-authors.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_:ce5eba2be3fd2975897513e71cf1da6 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/0\" .\n_:eb8eb8decff761d0830391c00616107d oa:hasSource <../in/bundle-document-custodian-and-authors.json> .\n_:ce5eba2be3fd2975897513e71cf1da6 oa:refinedBy _:bd78550499bf96debd1f3be69493ab59 .\n_:bd78550499bf96debd1f3be69493ab59 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/resourceType\" .\n_:eb8eb8decff761d0830391c00616107d oa:hasSelector _:ce5eba2be3fd2975897513e71cf1da6 .\n_:a82cfb4e76a2771ed2743b00b89757d8 oa:hasTarget _:eb8eb8decff761d0830391c00616107d ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:resourceTypeNotMapped ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Composition\" .\n_:c06aa21e336d3a75edd385af89e94186 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/4\" .\n_:fa09b70a9ddee4abe33fad78e7a19e44 oa:hasSource <../in/bundle-document-custodian-and-authors.json> .\n_:c06aa21e336d3a75edd385af89e94186 oa:refinedBy _:c3c3783a5a0fd28f3b606836d8ac8721 .\n_:c3c3783a5a0fd28f3b606836d8ac8721 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/resourceType\" .\n_:fa09b70a9ddee4abe33fad78e7a19e44 oa:hasSelector _:c06aa21e336d3a75edd385af89e94186 .\n_:b2bbfdd55b6cdb7d4e6700deeb80090b oa:hasTarget _:fa09b70a9ddee4abe33fad78e7a19e44 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:resourceTypeNotMapped ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Organization\" .\n_:a1d1b20fff7e0d0314cb8d862c2d4f23 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/5\" .\n_:d04c4546e0f050a54a5bcf63021fb07b oa:hasSource <../in/bundle-document-custodian-and-authors.json> .\n_:a1d1b20fff7e0d0314cb8d862c2d4f23 oa:refinedBy _:e1983f5bc99df096a318bf3b4a3d2bfe .\n_:e1983f5bc99df096a318bf3b4a3d2bfe a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/resourceType\" .\n_:d04c4546e0f050a54a5bcf63021fb07b oa:hasSelector _:a1d1b20fff7e0d0314cb8d862c2d4f23 .\n_:edcd1202179cbffcf2ad35557d2440f4 oa:hasTarget _:d04c4546e0f050a54a5bcf63021fb07b ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:resourceTypeNotMapped ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Practitioner\" .\n", "empty": false}}