{"name": "document-reference-context-and-displays", "comment": "A DocumentReference with an encounter, a period of service, an author, a custodian and a content format: none has a Cascade predicate, the encounter, the period and the two displays being reported, and the format display carrying nothing its code does not.", "input": {"file": "fixtures/in/document-reference-context-and-displays.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/document-reference-context-and-displays.json", "text": "{\n  \"resourceType\": \"DocumentReference\",\n  \"id\": \"docref-context-1\",\n  \"status\": \"current\",\n  \"type\": {\n    \"coding\": [\n      {\n        \"system\": \"http://loinc.org\",\n        \"code\": \"11506-3\",\n        \"display\": \"Progress note\"\n      }\n    ],\n    \"text\": \"Progress note\"\n  },\n  \"subject\": {\n    \"reference\": \"Patient/pat-1\"\n  },\n  \"date\": \"2026-08-20T14:05:00Z\",\n  \"author\": [\n    {\n      \"reference\": \"Organization/clinic-1\",\n      \"display\": \"Riverside Clinic\"\n    }\n  ],\n  \"custodian\": {\n    \"reference\": \"Organization/clinic-1\",\n    \"display\": \"Riverside Clinic\"\n  },\n  \"content\": [\n    {\n      \"attachment\": {\n        \"contentType\": \"text/plain\",\n        \"data\": \"U2VlbiBmb3IgZm9sbG93LXVwLg==\",\n        \"title\": \"Progress note\"\n      },\n      \"format\": {\n        \"system\": \"http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem\",\n        \"code\": \"urn:ihe:iti:xds:2017:mimeTypeSufficient\",\n        \"display\": \"mimeType Sufficient\"\n      }\n    }\n  ],\n  \"context\": {\n    \"encounter\": [\n      {\n        \"reference\": \"Encounter/enc-visit-1\"\n      }\n    ],\n    \"period\": {\n      \"start\": \"2026-08-20T13:30:00Z\",\n      \"end\": \"2026-08-20T14:00:00Z\"\n    }\n  }\n}\n"}, "expectedGraph": {"file": "fixtures/expected/document-reference-context-and-displays.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/document-reference-context-and-displays.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;8Y5UqnHEEG0MVXsCKDLhfr9QmQmL13V3VqpxXK0jjlU> cascade:attachment <ni:///sha-256;8Y5UqnHEEG0MVXsCKDLhfr9QmQmL13V3VqpxXK0jjlU#attachment-1> .\n<ni:///sha-256;8Y5UqnHEEG0MVXsCKDLhfr9QmQmL13V3VqpxXK0jjlU#attachment-1> cascade:attachmentContentType \"text/plain\" ;\n\tcascade:attachmentTitle \"Progress note\" .\n<ni:///sha-256;8Y5UqnHEEG0MVXsCKDLhfr9QmQmL13V3VqpxXK0jjlU> cascade:narrativeText \"Seen for follow-up.\" ;\n\tcascade:noteOrDocumentTypeName \"Progress note\" ;\n\tcascade:workflowStatus \"current\" ;\n\tcascade:noteOrDocumentDate \"2026-08-20T14:05:00Z\"^^xsd:dateTime ;\n\tcascade:noteOrDocumentTypeCode <http://loinc.org/rdf/11506-3> .\n<urn:uuid:7d9cd914-a51a-8a21-9194-a1f72d60b1e3> a cascade:ClinicalNoteOrDocument ;\n\tcascade:sourceUrl <https://fhir.meridian.example/api/FHIR/R4/DocumentReference/docref-context-1> ;\n\tcascade:sourceRecordId \"docref-context-1\" .\n<ni:///sha-256;8Y5UqnHEEG0MVXsCKDLhfr9QmQmL13V3VqpxXK0jjlU> prov:specializationOf <urn:uuid:7d9cd914-a51a-8a21-9194-a1f72d60b1e3> ;\n\tcascade:patient <urn:uuid:291f0287-2f67-8f0d-86d2-fdc50aa5ad06> .\n_:84c72a59126a05d317527769228542c1 bridge:arrivedAs <ni:///sha-256;8Y5UqnHEEG0MVXsCKDLhfr9QmQmL13V3VqpxXK0jjlU> .\n<ni:///sha-256;8Y5UqnHEEG0MVXsCKDLhfr9QmQmL13V3VqpxXK0jjlU> prov:wasAttributedTo <urn:uuid:920a28bc-9556-8016-a1e2-e1652049087e> .\n_:84c72a59126a05d317527769228542c1 oa:hasSelector _:805b116504f24632af84b4b0976b4002 ;\n\toa:hasSource <ni:///sha-256;4YSSuUIIHFeH1ZNa1f1O0xWu3aRdRMVs_Bsnh_S6wew> ;\n\tprov:wasDerivedFrom <ni:///sha-256;4YSSuUIIHFeH1ZNa1f1O0xWu3aRdRMVs_Bsnh_S6wew> ;\n\tprov:wasGeneratedBy _:c87d03b4d25a496991deb9e2b09363df .\n_:805b116504f24632af84b4b0976b4002 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n<ni:///sha-256;4YSSuUIIHFeH1ZNa1f1O0xWu3aRdRMVs_Bsnh_S6wew> cascade:serverBaseUrl \"https://fhir.meridian.example/api/FHIR/R4\" ;\n\tpav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:ed6375b74b135dda449c49cef51ed93 ;\n\tprov:wasAttributedTo _:c1fa2895ea008e1021a677c5dbc1f6d2 ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:92906d0fa34620fc274164c10f40d692 prov:agent _:c1fa2895ea008e1021a677c5dbc1f6d2 ;\n\tprov:hadRole cascade:AuthorRole .\n_:ed6375b74b135dda449c49cef51ed93 prov:qualifiedAssociation _:92906d0fa34620fc274164c10f40d692 .\n_:4ed1c71435336db82d259a6e7ada4f4a prov:agent _:dae32c72029e37b763d7b45cdf00c34e ;\n\tprov:hadRole cascade:TransmitterRole .\n_:ed6375b74b135dda449c49cef51ed93 prov:qualifiedAssociation _:4ed1c71435336db82d259a6e7ada4f4a .\n_:c1fa2895ea008e1021a677c5dbc1f6d2 <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:dae32c72029e37b763d7b45cdf00c34e <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:c87d03b4d25a496991deb9e2b09363df <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;4YSSuUIIHFeH1ZNa1f1O0xWu3aRdRMVs_Bsnh_S6wew> a prov:Entity .\n_:c87d03b4d25a496991deb9e2b09363df a prov:Activity ;\n\tprov:used <ni:///sha-256;4YSSuUIIHFeH1ZNa1f1O0xWu3aRdRMVs_Bsnh_S6wew> ;\n\tprov:qualifiedAssociation _:57f55dcd219f68b098d32c6d94edf3e2 .\n_:57f55dcd219f68b098d32c6d94edf3e2 prov:hadPlan _:207432f9dcc7056dc248bc58a65708f7 .\n_:207432f9dcc7056dc248bc58a65708f7 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:57f55dcd219f68b098d32c6d94edf3e2 prov:agent _:29cd26a279e8fd2f589a71af8ec58709 .\n_:29cd26a279e8fd2f589a71af8ec58709 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-context-and-displays.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/document-reference-context-and-displays.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_:ec2d87b587f2075b400c9553617b8c78 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:d66a27cf54344fad8696e88941f2f8c a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/context/encounter/0/reference\" .\n_:ec2d87b587f2075b400c9553617b8c78 oa:refinedBy _:d66a27cf54344fad8696e88941f2f8c .\n_:b93199a08cdcf53b177de6863ad56cf8 a oa:Annotation ;\n\toa:hasTarget _:e1e969c819761fa7ab31ba1f1a31cb2c .\n_:e1e969c819761fa7ab31ba1f1a31cb2c oa:hasSource <../in/document-reference-context-and-displays.json> ;\n\toa:hasSelector _:ec2d87b587f2075b400c9553617b8c78 .\n_:b93199a08cdcf53b177de6863ad56cf8 oa:hasBody fhirr4:encounterNotCarried ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"/context/encounter/reference\" ;\n\tsh:resultSeverity sh:Info .\n_:ff6ae711284c7f02dfbbacb1726ae913 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:f86678e42cd20c57aaf17c4d8c1f56c3 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/context/period/start\" .\n_:ff6ae711284c7f02dfbbacb1726ae913 oa:refinedBy _:f86678e42cd20c57aaf17c4d8c1f56c3 .\n_:adf12b468a1694e76126fbb8c348dec6 a oa:Annotation ;\n\toa:hasTarget _:ab1581a3ea6bc48beee773d95a5249de .\n_:ab1581a3ea6bc48beee773d95a5249de oa:hasSource <../in/document-reference-context-and-displays.json> ;\n\toa:hasSelector _:ff6ae711284c7f02dfbbacb1726ae913 .\n_:adf12b468a1694e76126fbb8c348dec6 oa:hasBody fhirr4:documentServicePeriod ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"/context/period/start\" ;\n\tsh:resultSeverity sh:Info .\n_:ea8b8f96afb20384b9d6f2876d786035 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:df18ad131a8974857d95a0e782d179c a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/context/period/end\" .\n_:ea8b8f96afb20384b9d6f2876d786035 oa:refinedBy _:df18ad131a8974857d95a0e782d179c .\n_:a61ee9237170b8322e6375a9cecec90c a oa:Annotation ;\n\toa:hasTarget _:ad14b8d2181104ee292fbb48cfde70c8 .\n_:ad14b8d2181104ee292fbb48cfde70c8 oa:hasSource <../in/document-reference-context-and-displays.json> ;\n\toa:hasSelector _:ea8b8f96afb20384b9d6f2876d786035 .\n_:a61ee9237170b8322e6375a9cecec90c oa:hasBody fhirr4:documentServicePeriod ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"/context/period/end\" ;\n\tsh:resultSeverity sh:Info .\n_:e8628d763bc4031be155d6b9a5588ca a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:cbcee5f5f1dca1ffa2b0331c2d652be6 oa:hasSource <../in/document-reference-context-and-displays.json> .\n_:e8628d763bc4031be155d6b9a5588ca oa:refinedBy _:a435d07dc19ebc8419834637f1a6d8c9 .\n_:a435d07dc19ebc8419834637f1a6d8c9 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/custodian/display\" .\n_:cbcee5f5f1dca1ffa2b0331c2d652be6 oa:hasSelector _:e8628d763bc4031be155d6b9a5588ca .\n_:a1c92b9bdcf8e017955b21c1e626b995 oa:hasTarget _:cbcee5f5f1dca1ffa2b0331c2d652be6 .\n_:d9f08d6f20b6f24c539a0e8a61f9422b a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:a5e05fbd7b26591ee0ce7eb4492906b5 oa:hasSource <../in/document-reference-context-and-displays.json> .\n_:d9f08d6f20b6f24c539a0e8a61f9422b oa:refinedBy _:c3a20aac4ffd8c74f9bec60f58f14729 .\n_:c3a20aac4ffd8c74f9bec60f58f14729 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/author/0/display\" .\n_:a5e05fbd7b26591ee0ce7eb4492906b5 oa:hasSelector _:d9f08d6f20b6f24c539a0e8a61f9422b .\n_:e51ae684288ec7ccac1b391f003c1f02 oa:hasTarget _:a5e05fbd7b26591ee0ce7eb4492906b5 .\n_:a1c92b9bdcf8e017955b21c1e626b995 sh:resultSeverity sh:Info .\n_:e51ae684288ec7ccac1b391f003c1f02 sh:resultSeverity sh:Info .\n_:a1c92b9bdcf8e017955b21c1e626b995 a oa:Annotation ;\n\toa:hasBody fhirr4:referenceDisplay ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Riverside Clinic\" .\n_:e51ae684288ec7ccac1b391f003c1f02 a oa:Annotation ;\n\toa:hasBody fhirr4:referenceDisplay ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Riverside Clinic\" .\n", "empty": false}}