{"name": "medication-request-reference-outside", "comment": "A MedicationRequest whose drug is a Medication outside its document, as an Apple Health export holds one: the reference's display names the drug, no code is written, and a finding says so.", "input": {"file": "fixtures/in/medication-request-reference-outside.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/medication-request-reference-outside.json", "text": "{\n  \"resourceType\": \"MedicationRequest\",\n  \"id\": \"medrx-metformin-2\",\n  \"status\": \"active\",\n  \"intent\": \"order\",\n  \"medicationReference\": {\n    \"reference\": \"Medication/med-metformin-ext\",\n    \"display\": \"metFORMIN 500 MG tablet\"\n  },\n  \"subject\": {\n    \"reference\": \"Patient/pat-conformance-1\"\n  },\n  \"authoredOn\": \"2025-08-12\"\n}\n"}, "expectedGraph": {"file": "fixtures/expected/medication-request-reference-outside.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/medication-request-reference-outside.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;1ngx-34_MstA8oL3xNQb2z_90vs1kkw5YbzqtBTr3Hk> cascade:prescribedOrReported \"prescribed\" ;\n\tcascade:drugName \"metFORMIN 500 MG tablet\" ;\n\tcascade:workflowStatus \"active\" ;\n\tcascade:medicationRequestIntent \"order\" ;\n\tcascade:prescriptionWrittenDate \"2025-08-12\"^^xsd:date .\n<urn:uuid:eecdfb48-f001-83b7-8037-93f28a7ec846> a cascade:PrescribedOrReportedMedication ;\n\tcascade:sourceUrl <https://fhir.meridian.example/api/FHIR/R4/MedicationRequest/medrx-metformin-2> ;\n\tcascade:sourceRecordId \"medrx-metformin-2\" .\n<ni:///sha-256;1ngx-34_MstA8oL3xNQb2z_90vs1kkw5YbzqtBTr3Hk> prov:specializationOf <urn:uuid:eecdfb48-f001-83b7-8037-93f28a7ec846> ;\n\tcascade:patient <urn:uuid:7883c5a4-6c61-837c-9bf7-dbe1b37d89ff> .\n_:46ffc7b17f6c4197c0ce1c0d6aa05155 bridge:arrivedAs <ni:///sha-256;1ngx-34_MstA8oL3xNQb2z_90vs1kkw5YbzqtBTr3Hk> ;\n\toa:hasSelector _:a6438153cf5675231ea4299993d67e9a ;\n\toa:hasSource <ni:///sha-256;5hLbfaBRxIsEARJ-bbia28IHhvQsWCflP5bW9NWIXP0> ;\n\tprov:wasDerivedFrom <ni:///sha-256;5hLbfaBRxIsEARJ-bbia28IHhvQsWCflP5bW9NWIXP0> ;\n\tprov:wasGeneratedBy _:39eddb1bff96bb5ba1c4198065b67681 .\n_:a6438153cf5675231ea4299993d67e9a a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n<ni:///sha-256;5hLbfaBRxIsEARJ-bbia28IHhvQsWCflP5bW9NWIXP0> cascade:serverBaseUrl \"https://fhir.meridian.example/api/FHIR/R4\" ;\n\tpav:retrievedFrom <https://FHIR.Meridian.example/api/FHIR/R4/MedicationRequest/medrx-metformin-2> ;\n\tpav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:712bb66f2664ba8effffcf1c7bf15c72 ;\n\tprov:wasAttributedTo _:ff921216914e7e85b3d74c6a36bbc905 ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:e71373c0e53e3756a2162ee5f56fafdd prov:agent _:ff921216914e7e85b3d74c6a36bbc905 ;\n\tprov:hadRole cascade:AuthorRole .\n_:712bb66f2664ba8effffcf1c7bf15c72 prov:qualifiedAssociation _:e71373c0e53e3756a2162ee5f56fafdd .\n_:1deeeb99811f03c7aff2d010cf5a44c1 prov:agent _:117cebe0ae049a9feecde657b655fe6e ;\n\tprov:hadRole cascade:TransmitterRole .\n_:712bb66f2664ba8effffcf1c7bf15c72 prov:qualifiedAssociation _:1deeeb99811f03c7aff2d010cf5a44c1 .\n_:ff921216914e7e85b3d74c6a36bbc905 <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:117cebe0ae049a9feecde657b655fe6e <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:39eddb1bff96bb5ba1c4198065b67681 <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;5hLbfaBRxIsEARJ-bbia28IHhvQsWCflP5bW9NWIXP0> a prov:Entity .\n_:39eddb1bff96bb5ba1c4198065b67681 a prov:Activity ;\n\tprov:used <ni:///sha-256;5hLbfaBRxIsEARJ-bbia28IHhvQsWCflP5bW9NWIXP0> ;\n\tprov:qualifiedAssociation _:d84e33b29c18442de2e1640fa0a79b23 .\n_:d84e33b29c18442de2e1640fa0a79b23 prov:hadPlan _:f879f326694b8446c60cc339e6b8e46a .\n_:f879f326694b8446c60cc339e6b8e46a a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:d84e33b29c18442de2e1640fa0a79b23 prov:agent _:be732abda6c0dd85cacf21cb5609bc40 .\n_:be732abda6c0dd85cacf21cb5609bc40 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/medication-request-reference-outside.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/medication-request-reference-outside.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_:a68b7de163727d1a382142ce92bacb81 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:e11c1072ac5f89270615c104127ae7d2 oa:hasSource <../in/medication-request-reference-outside.json> .\n_:a68b7de163727d1a382142ce92bacb81 oa:refinedBy _:e3351bca351fea22561847c4280a7480 .\n_:e3351bca351fea22561847c4280a7480 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/medicationReference/reference\" .\n_:e11c1072ac5f89270615c104127ae7d2 oa:hasSelector _:a68b7de163727d1a382142ce92bacb81 .\n_:fc5989b2d6c92496f6982874cb91079e oa:hasTarget _:e11c1072ac5f89270615c104127ae7d2 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:medicationReferenceUnresolved ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Medication/med-metformin-ext\" .\n", "empty": false}}