{"name": "bundle-medication-repeated-id", "comment": "A Bundle holding two Medications sharing type and id, and a MedicationRequest referencing that type and id: the reference resolves to neither, so the request names no drug and its reference is a finding, and each Medication is a finding.", "input": {"file": "fixtures/in/bundle-medication-repeated-id.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/bundle-medication-repeated-id.json", "text": "{\n  \"resourceType\": \"Bundle\",\n  \"type\": \"collection\",\n  \"entry\": [\n    {\n      \"fullUrl\": \"https://fhir.meridian.example/api/FHIR/R4/Medication/med-1\",\n      \"resource\": {\n        \"resourceType\": \"Medication\",\n        \"id\": \"med-1\",\n        \"code\": {\n          \"text\": \"Metformin 500 mg tablet\"\n        }\n      }\n    },\n    {\n      \"fullUrl\": \"https://fhir.riverside.example/fhir/Medication/med-1\",\n      \"resource\": {\n        \"resourceType\": \"Medication\",\n        \"id\": \"med-1\",\n        \"code\": {\n          \"text\": \"Lisinopril 10 mg tablet\"\n        }\n      }\n    },\n    {\n      \"fullUrl\": \"https://fhir.meridian.example/api/FHIR/R4/MedicationRequest/medrx-unclear-1\",\n      \"resource\": {\n        \"resourceType\": \"MedicationRequest\",\n        \"id\": \"medrx-unclear-1\",\n        \"status\": \"active\",\n        \"intent\": \"order\",\n        \"medicationReference\": {\n          \"reference\": \"Medication/med-1\"\n        },\n        \"subject\": {\n          \"reference\": \"Patient/pat-conformance-1\"\n        },\n        \"authoredOn\": \"2026-01-22\"\n      }\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/bundle-medication-repeated-id.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/bundle-medication-repeated-id.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;RMnc17mOcfCNaz-VQSD4H837mlvZQ7NSgNe800m108s> cascade:prescribedOrReported \"prescribed\" ;\n\tcascade:workflowStatus \"active\" ;\n\tcascade:medicationRequestIntent \"order\" ;\n\tcascade:prescriptionWrittenDate \"2026-01-22\"^^xsd:date .\n<urn:uuid:6038b8ef-4292-86b0-b57f-acc29700b838> a cascade:PrescribedOrReportedMedication ;\n\tcascade:sourceUrl <https://fhir.meridian.example/api/FHIR/R4/MedicationRequest/medrx-unclear-1> ;\n\tcascade:sourceRecordId \"medrx-unclear-1\" .\n<ni:///sha-256;RMnc17mOcfCNaz-VQSD4H837mlvZQ7NSgNe800m108s> prov:specializationOf <urn:uuid:6038b8ef-4292-86b0-b57f-acc29700b838> ;\n\tcascade:patient <urn:uuid:7883c5a4-6c61-837c-9bf7-dbe1b37d89ff> .\n_:5976ea6b4079206256749ae880e39211 bridge:arrivedAs <ni:///sha-256;RMnc17mOcfCNaz-VQSD4H837mlvZQ7NSgNe800m108s> ;\n\toa:hasSelector _:3a19a82ecea2bcc603154ad58797bcda ;\n\toa:hasSource <ni:///sha-256;CuF4DGqYn2c4XLCPGiBmwBUC-AjApTZBlmczy2Zsvjw> ;\n\tprov:wasDerivedFrom <ni:///sha-256;CuF4DGqYn2c4XLCPGiBmwBUC-AjApTZBlmczy2Zsvjw> ;\n\tprov:wasGeneratedBy _:56089068231888734db22e49829224f2 .\n_:3a19a82ecea2bcc603154ad58797bcda a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/2\" .\n<ni:///sha-256;CuF4DGqYn2c4XLCPGiBmwBUC-AjApTZBlmczy2Zsvjw> cascade:serverBaseUrl \"https://fhir.meridian.example/api/FHIR/R4\" ;\n\tpav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:c4c6ee5f86a2d31a2fc55ae09a91fee1 ;\n\tprov:wasAttributedTo _:ab70a17e1f8278d1dbe165f70b1156b4 ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:17adf6918675f02e65657b2a25126b9f prov:agent _:ab70a17e1f8278d1dbe165f70b1156b4 ;\n\tprov:hadRole cascade:AuthorRole .\n_:c4c6ee5f86a2d31a2fc55ae09a91fee1 prov:qualifiedAssociation _:17adf6918675f02e65657b2a25126b9f .\n_:7deadfd1e693dd0d2b727499d432fba4 prov:agent _:3c550918fe9bdb0bf13283f6b671cc6d ;\n\tprov:hadRole cascade:TransmitterRole .\n_:c4c6ee5f86a2d31a2fc55ae09a91fee1 prov:qualifiedAssociation _:7deadfd1e693dd0d2b727499d432fba4 .\n_:ab70a17e1f8278d1dbe165f70b1156b4 <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:3c550918fe9bdb0bf13283f6b671cc6d <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:56089068231888734db22e49829224f2 <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;CuF4DGqYn2c4XLCPGiBmwBUC-AjApTZBlmczy2Zsvjw> a prov:Entity .\n_:56089068231888734db22e49829224f2 a prov:Activity ;\n\tprov:used <ni:///sha-256;CuF4DGqYn2c4XLCPGiBmwBUC-AjApTZBlmczy2Zsvjw> ;\n\tprov:qualifiedAssociation _:f36af6ae818dab8331e8c31285e36507 .\n_:f36af6ae818dab8331e8c31285e36507 prov:hadPlan _:c986bbf8c04ffd761f68b42a0fec7ed3 .\n_:c986bbf8c04ffd761f68b42a0fec7ed3 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:f36af6ae818dab8331e8c31285e36507 prov:agent _:6a04087f9f54bfae3a1f037651a64c23 .\n_:6a04087f9f54bfae3a1f037651a64c23 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-repeated-id.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/bundle-medication-repeated-id.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_:e35bf7abe64697d1846d6dc40932b8e1 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/0\" .\n_:cb63675474f6b5c89a51b65e7f91cc70 oa:hasSource <../in/bundle-medication-repeated-id.json> .\n_:e35bf7abe64697d1846d6dc40932b8e1 oa:refinedBy _:e7e9ee2dc3f73198e683e1fc0555c711 .\n_:e7e9ee2dc3f73198e683e1fc0555c711 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/resourceType\" .\n_:cb63675474f6b5c89a51b65e7f91cc70 oa:hasSelector _:e35bf7abe64697d1846d6dc40932b8e1 .\n_:ac9062ed979f28a24ffb3a36e3da21d1 oa:hasTarget _:cb63675474f6b5c89a51b65e7f91cc70 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:resourceTypeNotMapped ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Medication\" .\n_:c6cbdb5a6a93092a33a93a56ca8587c2 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/1\" .\n_:e55d5e755e613fa8d212d9e19af6d423 oa:hasSource <../in/bundle-medication-repeated-id.json> .\n_:c6cbdb5a6a93092a33a93a56ca8587c2 oa:refinedBy _:eff9fa8ae0f017ad323ec08b83581a1e .\n_:eff9fa8ae0f017ad323ec08b83581a1e a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/resourceType\" .\n_:e55d5e755e613fa8d212d9e19af6d423 oa:hasSelector _:c6cbdb5a6a93092a33a93a56ca8587c2 .\n_:f6db71eb0741b586b834cff7c8a1a7a7 oa:hasTarget _:e55d5e755e613fa8d212d9e19af6d423 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:resourceTypeNotMapped ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Medication\" .\n_:a0b1e3c082dc259be9016132d6191f8e a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/entry/2\" .\n_:d172c421eee62e9a6a1cfa6066aa6845 oa:hasSource <../in/bundle-medication-repeated-id.json> .\n_:a0b1e3c082dc259be9016132d6191f8e oa:refinedBy _:d36184342cd4fefef2c1f176f8813a87 .\n_:d36184342cd4fefef2c1f176f8813a87 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/resource/medicationReference/reference\" .\n_:d172c421eee62e9a6a1cfa6066aa6845 oa:hasSelector _:a0b1e3c082dc259be9016132d6191f8e .\n_:b7ac74cd9b7ae81cda7173f9f927046a oa:hasTarget _:d172c421eee62e9a6a1cfa6066aa6845 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:medicationReferenceUnresolved ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"Medication/med-1\" .\n", "empty": false}}