{"name": "bundle-medication-versioned-reference", "comment": "A Bundle holding a Medication and a MedicationRequest referencing a version of it: the request reads its drug and its RxNorm code and NDC, as its 11-digit code, from the Medication, which is no record and no finding.", "input": {"file": "fixtures/in/bundle-medication-versioned-reference.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/bundle-medication-versioned-reference.json", "text": "{\n  \"resourceType\": \"Bundle\",\n  \"type\": \"collection\",\n  \"entry\": [\n    {\n      \"fullUrl\": \"https://fhir.meridian.example/api/FHIR/R4/Medication/med-metformin-2\",\n      \"resource\": {\n        \"resourceType\": \"Medication\",\n        \"id\": \"med-metformin-2\",\n        \"code\": {\n          \"coding\": [\n            {\n              \"system\": \"http://www.nlm.nih.gov/research/umls/rxnorm\",\n              \"code\": \"861007\",\n              \"display\": \"metformin hydrochloride 500 MG Oral Tablet\"\n            },\n            {\n              \"system\": \"http://hl7.org/fhir/sid/ndc\",\n              \"code\": \"0093-1048-01\"\n            }\n          ],\n          \"text\": \"Metformin 500 mg tablet\"\n        }\n      }\n    },\n    {\n      \"fullUrl\": \"https://fhir.meridian.example/api/FHIR/R4/MedicationRequest/medrx-metformin-3\",\n      \"resource\": {\n        \"resourceType\": \"MedicationRequest\",\n        \"id\": \"medrx-metformin-3\",\n        \"status\": \"active\",\n        \"intent\": \"order\",\n        \"medicationReference\": {\n          \"reference\": \"Medication/med-metformin-2/_history/3\"\n        },\n        \"subject\": {\n          \"reference\": \"Patient/pat-conformance-1\"\n        },\n        \"authoredOn\": \"2026-02-18\"\n      }\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/bundle-medication-versioned-reference.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/bundle-medication-versioned-reference.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;d7iW4gp5-IhryzNLItmJJQOdQJR59EfqWANgZ-GwHGI> cascade:prescribedOrReported \"prescribed\" ;\n\tcascade:drugName \"Metformin 500 mg tablet\" ;\n\tcascade:ndcCode <https://ns.cascadeprotocol.org/codes/ndc11/00093104801> ;\n\tcascade:workflowStatus \"active\" ;\n\tcascade:medicationRequestIntent \"order\" ;\n\tcascade:prescriptionWrittenDate \"2026-02-18\"^^xsd:date ;\n\tcascade:rxNormCode <https://ns.cascadeprotocol.org/codes/rxnorm/861007> .\n<urn:uuid:8ceac133-4c7f-8cb5-9dc3-e8ef5092a65d> a cascade:PrescribedOrReportedMedication ;\n\tcascade:sourceUrl <https://fhir.meridian.example/api/FHIR/R4/MedicationRequest/medrx-metformin-3> ;\n\tcascade:sourceRecordId \"medrx-metformin-3\" .\n<ni:///sha-256;d7iW4gp5-IhryzNLItmJJQOdQJR59EfqWANgZ-GwHGI> prov:specializationOf <urn:uuid:8ceac133-4c7f-8cb5-9dc3-e8ef5092a65d> ;\n\tcascade:patient <urn:uuid:7883c5a4-6c61-837c-9bf7-dbe1b37d89ff> .\n_:548255293827ee749f309d963f144151 bridge:arrivedAs <ni:///sha-256;d7iW4gp5-IhryzNLItmJJQOdQJR59EfqWANgZ-GwHGI> ;\n\toa:hasSelector _:fd23cafc13fe1285f425949ddbf884af ;\n\toa:hasSource <ni:///sha-256;EecD2on0y2LdT4yIJmZbjv5rPnDtZPRdusuIvhT6etI> ;\n\tprov:wasDerivedFrom <ni:///sha-256;EecD2on0y2LdT4yIJmZbjv5rPnDtZPRdusuIvhT6etI> ;\n\tprov:wasGeneratedBy _:12dca0c769bd83a90fd46f1f3c7b4b31 .\n_:fd23cafc13fe1285f425949ddbf884af a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/1\" .\n<ni:///sha-256;EecD2on0y2LdT4yIJmZbjv5rPnDtZPRdusuIvhT6etI> cascade:serverBaseUrl \"https://fhir.meridian.example/api/FHIR/R4\" ;\n\tpav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:51bc002b8491d1acc87ea1564c7409ef ;\n\tprov:wasAttributedTo _:c10e0df16989ee32589f3357b2a2c669 ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:3d3d5d346b3bcbb85fc95a47c09e8cb3 prov:agent _:c10e0df16989ee32589f3357b2a2c669 ;\n\tprov:hadRole cascade:AuthorRole .\n_:51bc002b8491d1acc87ea1564c7409ef prov:qualifiedAssociation _:3d3d5d346b3bcbb85fc95a47c09e8cb3 .\n_:35333378c110261c5a74480650e222d2 prov:agent _:56eb3d4b236dad1e97e9fe8ce65f3b3a ;\n\tprov:hadRole cascade:TransmitterRole .\n_:51bc002b8491d1acc87ea1564c7409ef prov:qualifiedAssociation _:35333378c110261c5a74480650e222d2 .\n_:c10e0df16989ee32589f3357b2a2c669 <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:56eb3d4b236dad1e97e9fe8ce65f3b3a <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:12dca0c769bd83a90fd46f1f3c7b4b31 <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;EecD2on0y2LdT4yIJmZbjv5rPnDtZPRdusuIvhT6etI> a prov:Entity .\n_:12dca0c769bd83a90fd46f1f3c7b4b31 a prov:Activity ;\n\tprov:used <ni:///sha-256;EecD2on0y2LdT4yIJmZbjv5rPnDtZPRdusuIvhT6etI> ;\n\tprov:qualifiedAssociation _:9ad545493ae10dfcadf657e0c5f83882 .\n_:9ad545493ae10dfcadf657e0c5f83882 prov:hadPlan _:c550123905b4b700b5d2e54e7ed52503 .\n_:c550123905b4b700b5d2e54e7ed52503 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:9ad545493ae10dfcadf657e0c5f83882 prov:agent _:ed45d6b3866c59db5a409a6a141c8b39 .\n_:ed45d6b3866c59db5a409a6a141c8b39 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-medication-versioned-reference.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/bundle-medication-versioned-reference.ttl", "text": "", "empty": true}}