{"name": "lab-interpretation-flag-systems", "comment": "A laboratory Observation whose flags are written in four ways: v3 ObservationInterpretation by its OID after urn:oid: is carried as the v3 code; v2's table 0078 by its THO URI and its legacy URI, and an interpretation of text alone, are not, each a finding.", "input": {"file": "fixtures/in/lab-interpretation-flag-systems.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/lab-interpretation-flag-systems.json", "text": "{\n  \"resourceType\": \"Observation\",\n  \"id\": \"obs-mcv-2\",\n  \"status\": \"final\",\n  \"category\": [\n    {\n      \"coding\": [\n        {\n          \"system\": \"http://terminology.hl7.org/CodeSystem/observation-category\",\n          \"code\": \"laboratory\"\n        }\n      ]\n    }\n  ],\n  \"code\": {\n    \"coding\": [\n      {\n        \"system\": \"http://loinc.org\",\n        \"code\": \"787-2\",\n        \"display\": \"MCV [Entitic mean volume] in Red Blood Cells by Automated count\"\n      }\n    ],\n    \"text\": \"MCV\"\n  },\n  \"subject\": {\n    \"reference\": \"Patient/pat-conformance-1\"\n  },\n  \"effectiveDateTime\": \"2026-05-20\",\n  \"valueQuantity\": {\n    \"value\": 106,\n    \"unit\": \"fL\",\n    \"system\": \"http://unitsofmeasure.org\",\n    \"code\": \"fL\"\n  },\n  \"interpretation\": [\n    {\n      \"coding\": [\n        {\n          \"system\": \"urn:oid:2.16.840.1.113883.5.83\",\n          \"code\": \"H\"\n        }\n      ]\n    },\n    {\n      \"coding\": [\n        {\n          \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0078\",\n          \"code\": \"A\"\n        }\n      ]\n    },\n    {\n      \"coding\": [\n        {\n          \"system\": \"http://hl7.org/fhir/v2/0078\",\n          \"code\": \"HH\"\n        }\n      ]\n    },\n    {\n      \"text\": \"Macrocytic\"\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/lab-interpretation-flag-systems.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/lab-interpretation-flag-systems.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;X5tpGbqmIf0AOoakGZDaHFynu7666iOytFREGjxmpl0> cascade:testCode <http://loinc.org/rdf/787-2> ;\n\tcascade:resultInterpretationCode <https://ns.cascadeprotocol.org/codes/observationinterpretation/H> ;\n\tcascade:resultQuantity <ni:///sha-256;X5tpGbqmIf0AOoakGZDaHFynu7666iOytFREGjxmpl0#value> .\n<ni:///sha-256;X5tpGbqmIf0AOoakGZDaHFynu7666iOytFREGjxmpl0#value> cascade:decimalValue \"106\"^^xsd:decimal ;\n\tcascade:writtenValue \"106\" ;\n\tcascade:ucumUnit \"fL\" ;\n\tcascade:unitText \"fL\" .\n<ni:///sha-256;X5tpGbqmIf0AOoakGZDaHFynu7666iOytFREGjxmpl0> cascade:testName \"MCV\" ;\n\tcascade:resultValueKind cascade:QuantityResultValue ;\n\tcascade:resultClinicallyRelevantTime \"2026-05-20\"^^xsd:date ;\n\tcascade:workflowStatus \"final\" .\n<urn:uuid:9430c8cb-bdc0-8472-9044-a87b10c0d6d8> a cascade:LaboratoryTestResult ;\n\tcascade:sourceUrl <https://fhir.meridian.example/api/FHIR/R4/Observation/obs-mcv-2> ;\n\tcascade:sourceRecordId \"obs-mcv-2\" .\n<ni:///sha-256;X5tpGbqmIf0AOoakGZDaHFynu7666iOytFREGjxmpl0> prov:specializationOf <urn:uuid:9430c8cb-bdc0-8472-9044-a87b10c0d6d8> ;\n\tcascade:patient <urn:uuid:7883c5a4-6c61-837c-9bf7-dbe1b37d89ff> .\n_:aa74d1adefa1d2e7c57d5faf33a970a3 bridge:arrivedAs <ni:///sha-256;X5tpGbqmIf0AOoakGZDaHFynu7666iOytFREGjxmpl0> ;\n\toa:hasSelector _:5b67e7e431aa66a0bffafaf76a084831 ;\n\toa:hasSource <ni:///sha-256;dt7pgjo7v5nE7iF-KaAXX9JTyzQ7BOC_Wn03xyA_8Ro> ;\n\tprov:wasDerivedFrom <ni:///sha-256;dt7pgjo7v5nE7iF-KaAXX9JTyzQ7BOC_Wn03xyA_8Ro> ;\n\tprov:wasGeneratedBy _:84993ecea8f0f08431b84a084a60a247 .\n_:5b67e7e431aa66a0bffafaf76a084831 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n<ni:///sha-256;dt7pgjo7v5nE7iF-KaAXX9JTyzQ7BOC_Wn03xyA_8Ro> cascade:serverBaseUrl \"https://fhir.meridian.example/api/FHIR/R4\" ;\n\tpav:retrievedOn \"2026-09-01T10:00:00Z\"^^xsd:dateTime ;\n\tprov:wasGeneratedBy _:1e2c651f6e07f2d47958a08f1c969913 ;\n\tprov:wasAttributedTo _:821f2bbcae14cf9c5914452b7461ca3 ;\n\tcascade:authenticatedPatient \"Patient/eM5vN8qTz2Hc4Rk7Jw0Pb3\" ;\n\tcascade:authenticatedAsProxy false ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:33ff3c867121eb10beb162e36d33091f prov:agent _:821f2bbcae14cf9c5914452b7461ca3 ;\n\tprov:hadRole cascade:AuthorRole .\n_:1e2c651f6e07f2d47958a08f1c969913 prov:qualifiedAssociation _:33ff3c867121eb10beb162e36d33091f .\n_:4390fb94eff79c40ccfee62e76ee6f89 prov:agent _:eb689122710b984ba6bbaccb072124ca ;\n\tprov:hadRole cascade:TransmitterRole .\n_:1e2c651f6e07f2d47958a08f1c969913 prov:qualifiedAssociation _:4390fb94eff79c40ccfee62e76ee6f89 .\n_:821f2bbcae14cf9c5914452b7461ca3 <http://www.w3.org/2000/01/rdf-schema#label> \"Meridian Health System\" .\n_:eb689122710b984ba6bbaccb072124ca <http://www.w3.org/2000/01/rdf-schema#label> \"Apple Health\" .\n_:84993ecea8f0f08431b84a084a60a247 <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;dt7pgjo7v5nE7iF-KaAXX9JTyzQ7BOC_Wn03xyA_8Ro> a prov:Entity .\n_:84993ecea8f0f08431b84a084a60a247 a prov:Activity ;\n\tprov:used <ni:///sha-256;dt7pgjo7v5nE7iF-KaAXX9JTyzQ7BOC_Wn03xyA_8Ro> ;\n\tprov:qualifiedAssociation _:1a32ac00baac5b4356d373ec2b1f5227 .\n_:1a32ac00baac5b4356d373ec2b1f5227 prov:hadPlan _:f0a6a575740decaeade0cb8d00d46cc5 .\n_:f0a6a575740decaeade0cb8d00d46cc5 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:1a32ac00baac5b4356d373ec2b1f5227 prov:agent _:c1581ed6db092ec5823ca5de7581225e .\n_:c1581ed6db092ec5823ca5de7581225e 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/lab-interpretation-flag-systems.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/lab-interpretation-flag-systems.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_:b99e01a011df14d69429f9899deae4d9 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:d821595522cda06d2b344aa81f763cd7 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/interpretation/3/text\" .\n_:b99e01a011df14d69429f9899deae4d9 oa:refinedBy _:d821595522cda06d2b344aa81f763cd7 .\n_:dc0f4590d4d9914fd201ace05d636db2 a oa:Annotation ;\n\toa:hasTarget _:a1ae01937d2fa16adeecbf5a68891397 .\n_:a1ae01937d2fa16adeecbf5a68891397 oa:hasSource <../in/lab-interpretation-flag-systems.json> ;\n\toa:hasSelector _:b99e01a011df14d69429f9899deae4d9 .\n_:dc0f4590d4d9914fd201ace05d636db2 oa:hasBody fhirr4:codedValueText ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"/interpretation/text\" ;\n\tsh:resultSeverity sh:Info .\n_:d8d86b087c496d7fbd1c261b7925101f a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:b54b544f707832afba16518900bfcb4f oa:hasSource <../in/lab-interpretation-flag-systems.json> .\n_:d8d86b087c496d7fbd1c261b7925101f oa:refinedBy _:ba362039c5a562ba40074738ac32705f .\n_:ba362039c5a562ba40074738ac32705f a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/interpretation/2/coding/0/code\" .\n_:b54b544f707832afba16518900bfcb4f oa:hasSelector _:d8d86b087c496d7fbd1c261b7925101f .\n_:b0ac51b0a55138f19676de5fd8e74c4c oa:hasTarget _:b54b544f707832afba16518900bfcb4f .\n_:bc96eef86079c0653ceb4760ff0fe7b9 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:be3305c0c6a775e53978c9fb56035d12 oa:hasSource <../in/lab-interpretation-flag-systems.json> .\n_:bc96eef86079c0653ceb4760ff0fe7b9 oa:refinedBy _:da1f4ecd33358c3eed286143993622b4 .\n_:da1f4ecd33358c3eed286143993622b4 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/interpretation/1/coding/0/code\" .\n_:be3305c0c6a775e53978c9fb56035d12 oa:hasSelector _:bc96eef86079c0653ceb4760ff0fe7b9 .\n_:e48cd7f297ba99cd06e3b4363debff6a oa:hasTarget _:be3305c0c6a775e53978c9fb56035d12 .\n_:b0ac51b0a55138f19676de5fd8e74c4c sh:resultSeverity sh:Info .\n_:e48cd7f297ba99cd06e3b4363debff6a sh:resultSeverity sh:Info .\n_:b0ac51b0a55138f19676de5fd8e74c4c a oa:Annotation ;\n\toa:hasBody fhirr4:labResultInterpretationNotCarried ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"HH\" .\n_:e48cd7f297ba99cd06e3b4363debff6a a oa:Annotation ;\n\toa:hasBody fhirr4:labResultInterpretationNotCarried ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"A\" .\n", "empty": false}}