{"name": "document-reference-master-identifiers", "comment": "Notes that name the version of the document they describe by masterIdentifier: one typed by its OID system, the identifier the C-CDA adapter writes for that ClinicalDocument/id; a urn:uuid in upper case, written in lower case; and one with no system, a plain string.", "input": {"file": "fixtures/in/document-reference-master-identifiers.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/document-reference-master-identifiers.json", "text": "{\n  \"resourceType\": \"Bundle\",\n  \"type\": \"collection\",\n  \"entry\": [\n    {\n      \"fullUrl\": \"http://example.org/fhir/DocumentReference/by-oid\",\n      \"resource\": {\n        \"resourceType\": \"DocumentReference\",\n        \"id\": \"by-oid\",\n        \"status\": \"current\",\n        \"type\": {\n          \"coding\": [\n            {\n              \"system\": \"http://loinc.org\",\n              \"code\": \"18842-5\",\n              \"display\": \"Discharge summary\"\n            }\n          ]\n        },\n        \"subject\": {\n          \"reference\": \"Patient/pat-1\"\n        },\n        \"content\": [\n          {\n            \"attachment\": {\n              \"contentType\": \"application/pdf\",\n              \"url\": \"Binary/by-oid\"\n            },\n            \"format\": {\n              \"system\": \"http://terminology.hl7.org/CodeSystem/v3-HL7DocumentFormatCodes\",\n              \"code\": \"urn:hl7-org:sdwg:ccda-nonXMLBody:2.1\"\n            }\n          }\n        ],\n        \"masterIdentifier\": {\n          \"system\": \"urn:oid:2.16.840.1.113883.19.5.99999.1\",\n          \"value\": \"CCD-2026-1005\"\n        }\n      }\n    },\n    {\n      \"fullUrl\": \"http://example.org/fhir/DocumentReference/by-uuid\",\n      \"resource\": {\n        \"resourceType\": \"DocumentReference\",\n        \"id\": \"by-uuid\",\n        \"status\": \"current\",\n        \"type\": {\n          \"coding\": [\n            {\n              \"system\": \"http://loinc.org\",\n              \"code\": \"18842-5\",\n              \"display\": \"Discharge summary\"\n            }\n          ]\n        },\n        \"subject\": {\n          \"reference\": \"Patient/pat-1\"\n        },\n        \"content\": [\n          {\n            \"attachment\": {\n              \"contentType\": \"application/pdf\",\n              \"url\": \"Binary/by-uuid\"\n            },\n            \"format\": {\n              \"system\": \"http://terminology.hl7.org/CodeSystem/v3-HL7DocumentFormatCodes\",\n              \"code\": \"urn:hl7-org:sdwg:ccda-nonXMLBody:2.1\"\n            }\n          }\n        ],\n        \"masterIdentifier\": {\n          \"system\": \"urn:ietf:rfc:3986\",\n          \"value\": \"urn:uuid:A1B2C3D4-0000-4000-8000-00000000000A\"\n        }\n      }\n    },\n    {\n      \"fullUrl\": \"http://example.org/fhir/DocumentReference/no-system\",\n      \"resource\": {\n        \"resourceType\": \"DocumentReference\",\n        \"id\": \"no-system\",\n        \"status\": \"current\",\n        \"type\": {\n          \"coding\": [\n            {\n              \"system\": \"http://loinc.org\",\n              \"code\": \"18842-5\",\n              \"display\": \"Discharge summary\"\n            }\n          ]\n        },\n        \"subject\": {\n          \"reference\": \"Patient/pat-1\"\n        },\n        \"content\": [\n          {\n            \"attachment\": {\n              \"contentType\": \"application/pdf\",\n              \"url\": \"Binary/no-system\"\n            },\n            \"format\": {\n              \"system\": \"http://terminology.hl7.org/CodeSystem/v3-HL7DocumentFormatCodes\",\n              \"code\": \"urn:hl7-org:sdwg:ccda-nonXMLBody:2.1\"\n            }\n          }\n        ],\n        \"masterIdentifier\": {\n          \"value\": \"DS-7\"\n        }\n      }\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/document-reference-master-identifiers.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/document-reference-master-identifiers.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;kPnDXcd4DfheyYm6FEfmu42m-XqHh1uAHHKtszrjNE0> cascade:attachment <ni:///sha-256;kPnDXcd4DfheyYm6FEfmu42m-XqHh1uAHHKtszrjNE0#attachment-1> .\n<ni:///sha-256;kPnDXcd4DfheyYm6FEfmu42m-XqHh1uAHHKtszrjNE0#attachment-1> cascade:attachmentContentType \"application/pdf\" ;\n\tcascade:attachmentUrl \"Binary/by-oid\"^^xsd:anyURI .\n<ni:///sha-256;kPnDXcd4DfheyYm6FEfmu42m-XqHh1uAHHKtszrjNE0> cascade:noteOrDocumentTypeName \"Discharge summary\" ;\n\tcascade:noteOrDocumentMasterIdentifier \"CCD-2026-1005\"^^<urn:oid:2.16.840.1.113883.19.5.99999.1> ;\n\tcascade:workflowStatus \"current\" ;\n\tcascade:noteOrDocumentTypeCode <http://loinc.org/rdf/18842-5> .\n<urn:uuid:05465a91-f136-82cd-8c0b-638625556858> a cascade:ClinicalNoteOrDocument ;\n\tcascade:sourceUrl <http://example.org/fhir/DocumentReference/by-oid> ;\n\tcascade:sourceRecordId \"by-oid\" .\n<ni:///sha-256;kPnDXcd4DfheyYm6FEfmu42m-XqHh1uAHHKtszrjNE0> prov:specializationOf <urn:uuid:05465a91-f136-82cd-8c0b-638625556858> ;\n\tcascade:patient <urn:uuid:1cc3cbf1-3a8f-8691-923b-e87de6e5c3a3> .\n_:535258b6977bc2746987aaf5975156c7 bridge:arrivedAs <ni:///sha-256;kPnDXcd4DfheyYm6FEfmu42m-XqHh1uAHHKtszrjNE0> ;\n\toa:hasSelector _:a9901148dd28b0a2494a027b9791d84b ;\n\toa:hasSource <ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> ;\n\tprov:wasDerivedFrom <ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> ;\n\tprov:wasGeneratedBy _:3e410ad1c8243d04c6776ea6728a73f0 .\n_:a9901148dd28b0a2494a027b9791d84b a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/0\" .\n<ni:///sha-256;lH636soHKz87GQ_usI372RxkZW04o8N1rbgpT86OXkU> cascade:attachment <ni:///sha-256;lH636soHKz87GQ_usI372RxkZW04o8N1rbgpT86OXkU#attachment-1> .\n<ni:///sha-256;lH636soHKz87GQ_usI372RxkZW04o8N1rbgpT86OXkU#attachment-1> cascade:attachmentContentType \"application/pdf\" ;\n\tcascade:attachmentUrl \"Binary/by-uuid\"^^xsd:anyURI .\n<ni:///sha-256;lH636soHKz87GQ_usI372RxkZW04o8N1rbgpT86OXkU> cascade:noteOrDocumentTypeName \"Discharge summary\" ;\n\tcascade:noteOrDocumentMasterIdentifier \"urn:uuid:a1b2c3d4-0000-4000-8000-00000000000a\"^^<urn:ietf:rfc:3986> ;\n\tcascade:workflowStatus \"current\" ;\n\tcascade:noteOrDocumentTypeCode <http://loinc.org/rdf/18842-5> .\n<urn:uuid:3163abb5-5e59-8a71-89f8-0ef00ee15ebc> a cascade:ClinicalNoteOrDocument ;\n\tcascade:sourceUrl <http://example.org/fhir/DocumentReference/by-uuid> ;\n\tcascade:sourceRecordId \"by-uuid\" .\n<ni:///sha-256;lH636soHKz87GQ_usI372RxkZW04o8N1rbgpT86OXkU> prov:specializationOf <urn:uuid:3163abb5-5e59-8a71-89f8-0ef00ee15ebc> ;\n\tcascade:patient <urn:uuid:1cc3cbf1-3a8f-8691-923b-e87de6e5c3a3> .\n_:b3d1769f339d607f7d720db900e8951d bridge:arrivedAs <ni:///sha-256;lH636soHKz87GQ_usI372RxkZW04o8N1rbgpT86OXkU> ;\n\toa:hasSelector _:616de7f4a2b0555410400e69712f7e1 ;\n\toa:hasSource <ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> ;\n\tprov:wasDerivedFrom <ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> ;\n\tprov:wasGeneratedBy _:3e410ad1c8243d04c6776ea6728a73f0 .\n_:616de7f4a2b0555410400e69712f7e1 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/1\" .\n<ni:///sha-256;LHZAISx0RXBcoyD_2WwTTf3yMzPJmGVSnwqYHrmDqm8> cascade:attachment <ni:///sha-256;LHZAISx0RXBcoyD_2WwTTf3yMzPJmGVSnwqYHrmDqm8#attachment-1> .\n<ni:///sha-256;LHZAISx0RXBcoyD_2WwTTf3yMzPJmGVSnwqYHrmDqm8#attachment-1> cascade:attachmentContentType \"application/pdf\" ;\n\tcascade:attachmentUrl \"Binary/no-system\"^^xsd:anyURI .\n<ni:///sha-256;LHZAISx0RXBcoyD_2WwTTf3yMzPJmGVSnwqYHrmDqm8> cascade:noteOrDocumentTypeName \"Discharge summary\" ;\n\tcascade:noteOrDocumentMasterIdentifier \"DS-7\" ;\n\tcascade:workflowStatus \"current\" ;\n\tcascade:noteOrDocumentTypeCode <http://loinc.org/rdf/18842-5> .\n<urn:uuid:57886b6d-244c-8aae-a737-470f48aba2e6> a cascade:ClinicalNoteOrDocument ;\n\tcascade:sourceUrl <http://example.org/fhir/DocumentReference/no-system> ;\n\tcascade:sourceRecordId \"no-system\" .\n<ni:///sha-256;LHZAISx0RXBcoyD_2WwTTf3yMzPJmGVSnwqYHrmDqm8> prov:specializationOf <urn:uuid:57886b6d-244c-8aae-a737-470f48aba2e6> ;\n\tcascade:patient <urn:uuid:1cc3cbf1-3a8f-8691-923b-e87de6e5c3a3> .\n_:739729b2b2c1ac4cecbe5bb2b212ee28 bridge:arrivedAs <ni:///sha-256;LHZAISx0RXBcoyD_2WwTTf3yMzPJmGVSnwqYHrmDqm8> ;\n\toa:hasSelector _:ddf760437a61b416cab86e39c0781213 ;\n\toa:hasSource <ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> ;\n\tprov:wasDerivedFrom <ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> ;\n\tprov:wasGeneratedBy _:3e410ad1c8243d04c6776ea6728a73f0 .\n_:ddf760437a61b416cab86e39c0781213 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/2\" .\n<ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> cascade:serverBaseUrl \"http://example.org/fhir\" ;\n\tpav:retrievedOn \"2026-10-13T09:00:00Z\"^^xsd:dateTime ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:3e410ad1c8243d04c6776ea6728a73f0 <http://www.w3.org/2000/01/rdf-schema#label> \"Example server export\" ;\n\tprov:startedAtTime \"2026-10-13T09:00:04Z\"^^xsd:dateTime .\n<ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> a prov:Entity .\n_:3e410ad1c8243d04c6776ea6728a73f0 a prov:Activity ;\n\tprov:used <ni:///sha-256;8xSEUhhuRwvO27OLsfmEyjmBR6irZSHWoqASsdENajg> ;\n\tprov:qualifiedAssociation _:16092f1c18372267cde4e041523541df .\n_:16092f1c18372267cde4e041523541df prov:hadPlan _:6cf445d5d494d6117ba840d9042d533 .\n_:6cf445d5d494d6117ba840d9042d533 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:16092f1c18372267cde4e041523541df prov:agent _:af0d1727116003d7505106ce8d77dbad .\n_:af0d1727116003d7505106ce8d77dbad 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/document-reference-master-identifiers.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/document-reference-master-identifiers.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_:ed647db7c293e1106a07b5798b373958 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/0\" .\n_:b81badc16932413d9d774328d5d29a6 oa:hasSource <../in/document-reference-master-identifiers.json> .\n_:ed647db7c293e1106a07b5798b373958 oa:refinedBy _:e0f6f8a8e3ba9de8284bb0fd3afae831 .\n_:e0f6f8a8e3ba9de8284bb0fd3afae831 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/content/0/attachment/url\" .\n_:b81badc16932413d9d774328d5d29a6 oa:hasSelector _:ed647db7c293e1106a07b5798b373958 .\n_:d17fe677ccd1530d67ade23368115927 oa:hasTarget _:b81badc16932413d9d774328d5d29a6 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:attachmentDataNotRead ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"application/pdf\" .\n_:add758525732e922dc87eee775ed5ac6 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/1\" .\n_:b6e2413cf115fa43e0095a1c6739211f oa:hasSource <../in/document-reference-master-identifiers.json> .\n_:add758525732e922dc87eee775ed5ac6 oa:refinedBy _:aa3f5aed58b947c790cefbc2bbb6315f .\n_:aa3f5aed58b947c790cefbc2bbb6315f a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/content/0/attachment/url\" .\n_:b6e2413cf115fa43e0095a1c6739211f oa:hasSelector _:add758525732e922dc87eee775ed5ac6 .\n_:e7a490f53770c2573eaee8f12c6fe42 oa:hasTarget _:b6e2413cf115fa43e0095a1c6739211f ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:attachmentDataNotRead ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"application/pdf\" .\n_:aeac3d064cb8df6d8c980991af98e6e5 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/2\" .\n_:f31d9770b8940e31e9b1cdd60e9356ad oa:hasSource <../in/document-reference-master-identifiers.json> .\n_:aeac3d064cb8df6d8c980991af98e6e5 oa:refinedBy _:bd3e8723eccb075734adac4f222dc53d .\n_:bd3e8723eccb075734adac4f222dc53d a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/content/0/attachment/url\" .\n_:f31d9770b8940e31e9b1cdd60e9356ad oa:hasSelector _:aeac3d064cb8df6d8c980991af98e6e5 .\n_:af48702f5603eaded944080d8277618a oa:hasTarget _:f31d9770b8940e31e9b1cdd60e9356ad ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:attachmentDataNotRead ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"application/pdf\" .\n", "empty": false}}