{"name": "diagnostic-report-contained-results", "comment": "A DiagnosticReport whose results and whose contained DiagnosticReport's result are \"#\" and the id of an Observation it contains: a lab result's names its contained record, by the report's name and its meta.versionId, and a vital sign's names none; the contained report's issued, a day where FHIR's instant needs a time, is not carried, which FHIR's schema refuses.", "input": {"file": "fixtures/in/diagnostic-report-contained-results.json", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/in/diagnostic-report-contained-results.json", "text": "{\n  \"resourceType\": \"DiagnosticReport\",\n  \"id\": \"outer\",\n  \"status\": \"final\",\n  \"code\": {\n    \"coding\": [\n      {\n        \"system\": \"http://loinc.org\",\n        \"code\": \"2132-9\",\n        \"display\": \"Cobalamin (Vitamin B12) [Mass/volume] in Serum or Plasma\"\n      }\n    ]\n  },\n  \"subject\": {\n    \"reference\": \"Patient/pat-1\"\n  },\n  \"meta\": {\n    \"versionId\": \"3\"\n  },\n  \"contained\": [\n    {\n      \"resourceType\": \"Observation\",\n      \"id\": \"obs\",\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\": \"2132-9\",\n            \"display\": \"Cobalamin (Vitamin B12) [Mass/volume] in Serum or Plasma\"\n          }\n        ]\n      },\n      \"subject\": {\n        \"reference\": \"Patient/pat-1\"\n      },\n      \"valueQuantity\": {\n        \"value\": 180,\n        \"unit\": \"pg/mL\",\n        \"system\": \"http://unitsofmeasure.org\",\n        \"code\": \"pg/mL\"\n      }\n    },\n    {\n      \"resourceType\": \"Observation\",\n      \"id\": \"hr\",\n      \"status\": \"final\",\n      \"category\": [\n        {\n          \"coding\": [\n            {\n              \"system\": \"http://terminology.hl7.org/CodeSystem/observation-category\",\n              \"code\": \"vital-signs\"\n            }\n          ]\n        }\n      ],\n      \"code\": {\n        \"coding\": [\n          {\n            \"system\": \"http://loinc.org\",\n            \"code\": \"8867-4\"\n          }\n        ]\n      },\n      \"subject\": {\n        \"reference\": \"Patient/pat-1\"\n      },\n      \"valueQuantity\": {\n        \"value\": 64,\n        \"unit\": \"/min\",\n        \"system\": \"http://unitsofmeasure.org\",\n        \"code\": \"/min\"\n      }\n    },\n    {\n      \"resourceType\": \"DiagnosticReport\",\n      \"id\": \"inner\",\n      \"status\": \"final\",\n      \"code\": {\n        \"coding\": [\n          {\n            \"system\": \"http://loinc.org\",\n            \"code\": \"2132-9\",\n            \"display\": \"Cobalamin (Vitamin B12) [Mass/volume] in Serum or Plasma\"\n          }\n        ]\n      },\n      \"subject\": {\n        \"reference\": \"Patient/pat-1\"\n      },\n      \"issued\": \"2026-08-15\",\n      \"result\": [\n        {\n          \"reference\": \"#obs\"\n        }\n      ]\n    }\n  ],\n  \"result\": [\n    {\n      \"reference\": \"#obs\"\n    },\n    {\n      \"reference\": \"#hr\"\n    }\n  ]\n}\n"}, "expectedGraph": {"file": "fixtures/expected/diagnostic-report-contained-results.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/expected/diagnostic-report-contained-results.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 obo: <http://purl.obolibrary.org/obo/> .\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;gflaSZu3Co0e7w8LY8z2WeKNgNn5GuyUtxmokNrioaI> cascade:testCode <http://loinc.org/rdf/2132-9> ;\n\tcascade:resultQuantity <ni:///sha-256;gflaSZu3Co0e7w8LY8z2WeKNgNn5GuyUtxmokNrioaI#value> .\n<ni:///sha-256;gflaSZu3Co0e7w8LY8z2WeKNgNn5GuyUtxmokNrioaI#value> cascade:decimalValue \"180\"^^xsd:decimal ;\n\tcascade:writtenValue \"180\" ;\n\tcascade:ucumUnit \"pg/mL\" ;\n\tcascade:unitText \"pg/mL\" .\n<ni:///sha-256;gflaSZu3Co0e7w8LY8z2WeKNgNn5GuyUtxmokNrioaI> cascade:testName \"Cobalamin (Vitamin B12) [Mass/volume] in Serum or Plasma\" ;\n\tcascade:resultValueKind cascade:QuantityResultValue ;\n\tcascade:workflowStatus \"final\" .\n<urn:uuid:07a64e0a-1eb7-8623-97b2-b333db47a208> a cascade:DiagnosticReport ;\n\tcascade:sourceUrl <http://example.org/fhir/DiagnosticReport/outer> ;\n\tcascade:sourceRecordId \"outer\" .\n<ni:///sha-256;i02iJq_eduFhqqrmP1f-atc4T2CQmIbKwHC-2HeCpA8> prov:specializationOf <urn:uuid:07a64e0a-1eb7-8623-97b2-b333db47a208> ;\n\tcascade:patient <urn:uuid:1cc3cbf1-3a8f-8691-923b-e87de6e5c3a3> .\n_:873b9114a253efba8690898a7847fd9c bridge:arrivedAs <ni:///sha-256;i02iJq_eduFhqqrmP1f-atc4T2CQmIbKwHC-2HeCpA8> ;\n\tpav:version \"3\" .\n<urn:uuid:7cfd83b5-ccac-8eba-99e3-8395ae7ba3c1> a cascade:DiagnosticReport ;\n\tcascade:sourceUrl <http://example.org/fhir/DiagnosticReport/outer#inner> ;\n\tcascade:sourceRecordId \"inner\" .\n<ni:///sha-256;YwJBtRSLDpJ1Vmy31bA_uaR-WfbuMR2zCUc9dB_rXKc> prov:specializationOf <urn:uuid:7cfd83b5-ccac-8eba-99e3-8395ae7ba3c1> ;\n\tcascade:patient <urn:uuid:1cc3cbf1-3a8f-8691-923b-e87de6e5c3a3> .\n_:4032e4b4a4a934554580ff556e5895bf bridge:arrivedAs <ni:///sha-256;YwJBtRSLDpJ1Vmy31bA_uaR-WfbuMR2zCUc9dB_rXKc> ;\n\toa:hasSelector _:e3e647eca0e02ca9243131cba8215dbe .\n_:e3e647eca0e02ca9243131cba8215dbe a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/contained/2\" .\n<urn:uuid:9b7c019e-a3cd-89b9-9a0b-01056daf07ff> a cascade:LaboratoryTestResult ;\n\tcascade:sourceUrl <http://example.org/fhir/DiagnosticReport/outer#obs> ;\n\tcascade:sourceRecordId \"obs\" .\n<ni:///sha-256;gflaSZu3Co0e7w8LY8z2WeKNgNn5GuyUtxmokNrioaI> prov:specializationOf <urn:uuid:9b7c019e-a3cd-89b9-9a0b-01056daf07ff> ;\n\tcascade:patient <urn:uuid:1cc3cbf1-3a8f-8691-923b-e87de6e5c3a3> .\n_:fbebffbe546d25dabb9819edc29775e6 bridge:arrivedAs <ni:///sha-256;gflaSZu3Co0e7w8LY8z2WeKNgNn5GuyUtxmokNrioaI> ;\n\toa:hasSelector _:b3f1ab248673775c56b135ce0d285926 .\n_:b3f1ab248673775c56b135ce0d285926 a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/contained/0\" .\n<ni:///sha-256;i02iJq_eduFhqqrmP1f-atc4T2CQmIbKwHC-2HeCpA8> obo:RO_0002351 <urn:uuid:9b7c019e-a3cd-89b9-9a0b-01056daf07ff> .\n<ni:///sha-256;YwJBtRSLDpJ1Vmy31bA_uaR-WfbuMR2zCUc9dB_rXKc> obo:RO_0002351 <urn:uuid:9b7c019e-a3cd-89b9-9a0b-01056daf07ff> .\n<ni:///sha-256;i02iJq_eduFhqqrmP1f-atc4T2CQmIbKwHC-2HeCpA8> cascade:reportName \"Cobalamin (Vitamin B12) [Mass/volume] in Serum or Plasma\" ;\n\tcascade:workflowStatus \"final\" ;\n\tcascade:reportCode <http://loinc.org/rdf/2132-9> .\n<ni:///sha-256;YwJBtRSLDpJ1Vmy31bA_uaR-WfbuMR2zCUc9dB_rXKc> cascade:reportName \"Cobalamin (Vitamin B12) [Mass/volume] in Serum or Plasma\" ;\n\tcascade:workflowStatus \"final\" ;\n\tcascade:reportCode <http://loinc.org/rdf/2132-9> .\n_:873b9114a253efba8690898a7847fd9c oa:hasSelector _:2c038402fc19fa3163d25525afeacea ;\n\toa:hasSource <ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> ;\n\tprov:wasDerivedFrom <ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> ;\n\tprov:wasGeneratedBy _:af538a9dfcd956a1f8063b3b3c83bcfd .\n_:4032e4b4a4a934554580ff556e5895bf oa:hasSource <ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> ;\n\tprov:wasDerivedFrom <ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> ;\n\tprov:wasGeneratedBy _:af538a9dfcd956a1f8063b3b3c83bcfd .\n_:fbebffbe546d25dabb9819edc29775e6 oa:hasSource <ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> ;\n\tprov:wasDerivedFrom <ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> ;\n\tprov:wasGeneratedBy _:af538a9dfcd956a1f8063b3b3c83bcfd .\n_:2c038402fc19fa3163d25525afeacea a oa:FragmentSelector ;\n\tdct:conformsTo <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n<ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> cascade:serverBaseUrl \"http://example.org/fhir\" ;\n\tpav:retrievedOn \"2026-10-13T09:00:00Z\"^^xsd:dateTime ;\n\tcascade:sourceFormatVersion \"4.0.1\" .\n_:af538a9dfcd956a1f8063b3b3c83bcfd <http://www.w3.org/2000/01/rdf-schema#label> \"Example server export\" ;\n\tprov:startedAtTime \"2026-10-13T09:00:04Z\"^^xsd:dateTime .\n<ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> a prov:Entity .\n_:af538a9dfcd956a1f8063b3b3c83bcfd a prov:Activity ;\n\tprov:used <ni:///sha-256;ilqyMDyJAHzGP0DXpD8R38Mx--x93mECuwGUyL3UItM> ;\n\tprov:qualifiedAssociation _:fadebe78fdf1fbc7d17811b05f8c4d6d .\n_:fadebe78fdf1fbc7d17811b05f8c4d6d prov:hadPlan _:5ace30bfb5a19bce1248f6a4c4b49b65 .\n_:5ace30bfb5a19bce1248f6a4c4b49b65 a prov:Plan ;\n\t<http://www.w3.org/2000/01/rdf-schema#label> \"fhir-r4\" ;\n\tpav:version \"0.1.0\" .\n_:fadebe78fdf1fbc7d17811b05f8c4d6d prov:agent _:962e8684c430b102806acefa4afabb30 .\n_:962e8684c430b102806acefa4afabb30 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/diagnostic-report-contained-results.ttl", "link": "https://github.com/the-cascade-protocol/cascade-bridge-adapter-fhir-r4/blob/15621eef1b6e4578c254871490838e45939a8487/fixtures/findings/diagnostic-report-contained-results.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_:bd48ac5e0e905b14475605700014c572 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:c4105a436f5bd75e1327f2563d2cc94 a oa:Annotation ;\n\toa:hasTarget _:e9e4fe91a98215280f079500f4a95a7b .\n_:e9e4fe91a98215280f079500f4a95a7b oa:hasSource <../in/diagnostic-report-contained-results.json> ;\n\toa:hasSelector _:bd48ac5e0e905b14475605700014c572 .\n_:c4105a436f5bd75e1327f2563d2cc94 oa:hasBody <https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-01#section-6.28> ;\n\toa:motivatedBy oa:classifying ;\n\tsh:resultSeverity sh:Violation .\n_:c5ab5d9047a2603296d7bd7b2922736f a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:a6f3888dcfa7e00d69725b85c98d0430 oa:hasSource <../in/diagnostic-report-contained-results.json> .\n_:c5ab5d9047a2603296d7bd7b2922736f oa:refinedBy _:d665b5440b17cb5622b4a3e04c715a49 .\n_:d665b5440b17cb5622b4a3e04c715a49 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/contained/1/category/0/coding/0/code\" .\n_:a6f3888dcfa7e00d69725b85c98d0430 oa:hasSelector _:c5ab5d9047a2603296d7bd7b2922736f .\n_:d55a29dee28e4a4abbf431f7ad03e83d oa:hasTarget _:a6f3888dcfa7e00d69725b85c98d0430 ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:observationNotLabResult ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"vital-signs\" .\n_:dfbf9af72d55188fd1127fb64ec07d27 a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"\" .\n_:e47fcb2bf8d5e2b257522a13ca809a oa:hasSource <../in/diagnostic-report-contained-results.json> .\n_:dfbf9af72d55188fd1127fb64ec07d27 oa:refinedBy _:c94069fe12839629d1a7f3322c6061ec .\n_:c94069fe12839629d1a7f3322c6061ec a oa:FragmentSelector ;\n\t<http://purl.org/dc/terms/conformsTo> <https://www.rfc-editor.org/rfc/rfc6901> ;\n\trdf:value \"/result/1/reference\" .\n_:e47fcb2bf8d5e2b257522a13ca809a oa:hasSelector _:dfbf9af72d55188fd1127fb64ec07d27 .\n_:b11415af53b36bf5eef284900ecc960c oa:hasTarget _:e47fcb2bf8d5e2b257522a13ca809a ;\n\tsh:resultSeverity sh:Warning ;\n\ta oa:Annotation ;\n\toa:hasBody fhirr4:reportResultNotNamed ;\n\toa:motivatedBy oa:classifying ;\n\tsh:value \"#hr\" .\n", "empty": false}}