{"name": "bundle-medication-request-and-medication", "comment": "A Bundle holding a MedicationRequest and the Medication it references by type and id, and a Medication nothing references: the request reads its drug from the other entry; the referenced Medication is no record and no finding; the other is a finding.", "input": {"file": "fixtures/in/bundle-medication-request-and-medication.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/bundle-medication-request-and-medication.json", "text": "{\n  \"resourceType\": \"Bundle\",\n  \"type\": \"collection\",\n  \"entry\": [\n    {\n      \"fullUrl\": \"https://fhir.meridian.example/api/FHIR/R4/Medication/med-metformin-1\",\n      \"resource\": {\n        \"resourceType\": \"Medication\",\n        \"id\": \"med-metformin-1\",\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          \"text\": \"Metformin 500 mg tablet\"\n        }\n      }\n    },\n    {\n      \"fullUrl\": \"https://fhir.meridian.example/api/FHIR/R4/MedicationRequest/medrx-metformin-1\",\n      \"resource\": {\n        \"resourceType\": \"MedicationRequest\",\n        \"id\": \"medrx-metformin-1\",\n        \"status\": \"active\",\n        \"intent\": \"order\",\n        \"medicationReference\": {\n          \"reference\": \"Medication/med-metformin-1\"\n        },\n        \"subject\": {\n          \"reference\": \"Patient/pat-conformance-1\"\n        },\n        \"authoredOn\": \"2025-08-12\"\n      }\n    },\n    {\n      \"fullUrl\": \"https://fhir.meridian.example/api/FHIR/R4/Medication/med-unused-1\",\n      \"resource\": {\n        \"resourceType\": \"Medication\",\n        \"id\": \"med-unused-1\",\n        \"code\": {\n          \"text\": \"Lisinopril 10 mg tablet\"\n        }\n      }\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/bundle-medication-request-and-medication.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/bundle-medication-request-and-medication.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;FusGiUVAzlkUN8QgtiCX3ki853aNgxjB7undVNjPokc> cascade:prescribedOrReported \"prescribed\" ;\n\tcascade:drugName \"Metformin 500 mg tablet\" ;\n\tcascade:rxNormCode <https://ns.cascadeprotocol.org/codes/rxnorm/861007> ;\n\tcascade:workflowStatus \"active\" ;\n\tcascade:medicationRequestIntent \"order\" ;\n\tcascade:prescriptionWrittenDate \"2025-08-12\"^^xsd:date .\n<urn:uuid:d962c772-816b-8d2f-8fe8-62db56784911> a cascade:PrescribedOrReportedMedication ;\n\tcascade:sourceUrl <https://fhir.meridian.example/api/FHIR/R4/MedicationRequest/medrx-metformin-1> ;\n\tcascade:sourceRecordId \"medrx-metformin-1\" .\n<ni:///sha-256;FusGiUVAzlkUN8QgtiCX3ki853aNgxjB7undVNjPokc> prov:specializationOf <urn:uuid:d962c772-816b-8d2f-8fe8-62db56784911> ;\n\tcascade:patient <urn:uuid:7883c5a4-6c61-837c-9bf7-dbe1b37d89ff> .\n_:e227f6d7698710a778ec400b82814a1e bridge:arrivedAs <ni:///sha-256;FusGiUVAzlkUN8QgtiCX3ki853aNgxjB7undVNjPokc> ;\n\toa:hasSelector _:875bdef91d6c696044839c338946f721 ;\n\toa:hasSource <ni:///sha-256;pmOos1vWucfbHa9tG4xArOquICgZCtiLUMZRRPs6Sx0> ;\n\tprov:wasDerivedFrom <ni:///sha-256;pmOos1vWucfbHa9tG4xArOquICgZCtiLUMZRRPs6Sx0> ;\n\tprov:wasGeneratedBy _:930d64be3ec4c1fb08efa79e2263a388 .\n_:875bdef91d6c696044839c338946f721 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/1\" .\n<ni:///sha-256;pmOos1vWucfbHa9tG4xArOquICgZCtiLUMZRRPs6Sx0> cascade:serverBaseUrl \"https://fhir.meridian.example/api/FHIR/R4\" ;\n\tpav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:3799ae1dc34afb2bf093db38770c4fc7 ;\n\tprov:wasAttributedTo _:ad73c4a2d8882cb8dbcb5e0310709abb ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:714e2e502225039190cde4406d456111 prov:agent _:ad73c4a2d8882cb8dbcb5e0310709abb ;\n\tprov:hadRole cascade:AuthorRole .\n_:3799ae1dc34afb2bf093db38770c4fc7 prov:qualifiedAssociation _:714e2e502225039190cde4406d456111 .\n_:a65c72746708888c8691f0f00edc4019 prov:agent _:cc2496b1b1b91b74c92e9aac8d5bf0ef ;\n\tprov:hadRole cascade:TransmitterRole .\n_:3799ae1dc34afb2bf093db38770c4fc7 prov:qualifiedAssociation _:a65c72746708888c8691f0f00edc4019 .\n_:ad73c4a2d8882cb8dbcb5e0310709abb <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:cc2496b1b1b91b74c92e9aac8d5bf0ef <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:930d64be3ec4c1fb08efa79e2263a388 <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;pmOos1vWucfbHa9tG4xArOquICgZCtiLUMZRRPs6Sx0> a prov:Entity .\n_:930d64be3ec4c1fb08efa79e2263a388 a prov:Activity ;\n\tprov:used <ni:///sha-256;pmOos1vWucfbHa9tG4xArOquICgZCtiLUMZRRPs6Sx0> ;\n\tprov:qualifiedAssociation _:2fe000bc48c78381020ed8aae18d8072 .\n_:2fe000bc48c78381020ed8aae18d8072 prov:hadPlan _:e3ef1dcb5b87389d947a3a6119eecae5 .\n_:e3ef1dcb5b87389d947a3a6119eecae5 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:2fe000bc48c78381020ed8aae18d8072 prov:agent _:f842eb859958de2074524b1869a8e11f .\n_:f842eb859958de2074524b1869a8e11f 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-request-and-medication.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/bundle-medication-request-and-medication.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_:d47e0357c402f1086206fc0368a52661 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/2\" .\n_:b5157613505b98c9f7170d5fb4d3cd28 oa:hasSource <../in/bundle-medication-request-and-medication.json> .\n_:d47e0357c402f1086206fc0368a52661 oa:refinedBy _:bec8689270cbaebdce2ec4b98a7508b3 .\n_:bec8689270cbaebdce2ec4b98a7508b3 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/resourceType\" .\n_:b5157613505b98c9f7170d5fb4d3cd28 oa:hasSelector _:d47e0357c402f1086206fc0368a52661 .\n_:b80b154a5cdc3be1edae8da3c4442eae oa:hasTarget _:b5157613505b98c9f7170d5fb4d3cd28 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:resourceTypeNotMapped ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Medication\" .\n", "empty": false}}