Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FHIR R4 validation error with cross version Extension for R5 #138

Closed
oliveregger opened this issue Sep 20, 2023 · 1 comment
Closed

FHIR R4 validation error with cross version Extension for R5 #138

oliveregger opened this issue Sep 20, 2023 · 1 comment

Comments

@oliveregger
Copy link
Member

When validating with FHIR resources which contain Cross Profile Version we encountered an error for:

Slicing cannot be evaluated: Unable to resolve profile CanonicalType[http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.composition]

This error disappears if you do the validation a second time. It looks like that the extension is getting cached when you do a resource validation, but it is not cached if it evaluates the slices (e.g. see for profile http://fhir.ch/ig/ch-elm/StructureDefinition-ch-elm-document.html).

The following bundle will illustrate the problem

{
  "resourceType" : "Bundle",
  "id" : "2Doc-ChlamydiaTrachomatis",
  "meta" : {
    "profile" : ["http://fhir.ch/ig/ch-elm/StructureDefinition/ch-elm-document",
    "http://hl7.eu/fhir/laboratory/StructureDefinition/Bundle-eu-lab"]
  },
  "identifier" : {
    "system" : "urn:ietf:rfc:3986",
    "value" : "urn:uuid:1301332d-6012-443f-9690-929132b2e155"
  },
  "type" : "document",
  "timestamp" : "2023-08-05T11:30:00+02:00",
  "entry" : [{
    "fullUrl" : "urn:uuid:da065461-34df-4e2e-b69f-4181908575d0",
    "resource" : {
      "resourceType" : "Composition",
      "id" : "da065461-34df-4e2e-b69f-4181908575d0",
      "language" : "de-CH",
      "identifier" : {
        "system" : "urn:ietf:rfc:3986",
        "value" : "urn:uuid:1301332d-6012-443f-9690-929132b2e155"
      },
      "status" : "final",
      "type" : {
        "coding" : [{
          "system" : "http://snomed.info/sct",
          "version" : "http://snomed.info/sct/2011000195101",
          "code" : "4241000179101",
          "display" : "Laborbericht"
        },
        {
          "system" : "http://loinc.org",
          "code" : "11502-2",
          "display" : "Laboratory report"
        }]
      },
      "subject" : {
        "reference" : "urn:uuid:50d5deca-64e9-4a30-8cec-40ac1f015655",
        "type" : "Patient"
      },
      "date" : "2023-08-05T11:30:00+02:00",
      "author" : [{
        "reference" : "urn:uuid:8b9163cc-4894-462c-8060-b9b01f705a8b",
        "type" : "Organization"
      }],
      "title" : "Laborbericht vom 05.08.2023",
      "section" : [{
        "title" : "Analyseergebnisse der mikrobiologischen Untersuchung",
        "code" : {
          "coding" : [{
            "system" : "http://loinc.org",
            "code" : "18725-2",
            "display" : "Microbiology studies (set)"
          }]
        },
        "entry" : [{
          "reference" : "urn:uuid:632a79ff-42d7-49e0-97ca-69a3a2015760",
          "type" : "Observation"
        }]
      }]
    }
  },
  {
    "fullUrl" : "urn:uuid:2f69f609-e3bf-4863-bc42-3cbf0568cab1",
    "resource" : {
      "resourceType" : "DiagnosticReport",
      "id" : "2f69f609-e3bf-4863-bc42-3cbf0568cab1",
      "extension" : [{
        "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-DiagnosticReport.composition",
        "valueReference" : {
          "reference" : "urn:uuid:da065461-34df-4e2e-b69f-4181908575d0",
          "type" : "Composition"
        }
      }],
      "basedOn" : [{
        "reference" : "urn:uuid:9d409938-5af8-4fae-88d1-541f35111c1f",
        "type" : "ServiceRequest"
      }],
      "status" : "final",
      "code" : {
        "coding" : [{
          "system" : "http://loinc.org",
          "code" : "11502-2",
          "display" : "Laboratory report"
        }]
      },
      "subject" : {
        "reference" : "urn:uuid:50d5deca-64e9-4a30-8cec-40ac1f015655",
        "type" : "Patient"
      },
      "performer" : [{
        "reference" : "urn:uuid:8b9163cc-4894-462c-8060-b9b01f705a8b",
        "type" : "Organization"
      }],
      "specimen" : [{
        "reference" : "urn:uuid:b2b24ded-fd9f-40bc-a822-1fb07e14c2ef",
        "type" : "Specimen"
      }],
      "result" : [{
        "reference" : "urn:uuid:632a79ff-42d7-49e0-97ca-69a3a2015760",
        "type" : "Observation"
      }]
    }
  },
  {
    "fullUrl" : "urn:uuid:50d5deca-64e9-4a30-8cec-40ac1f015655",
    "resource" : {
      "resourceType" : "Patient",
      "id" : "50d5deca-64e9-4a30-8cec-40ac1f015655",
      "identifier" : [{
        "system" : "urn:oid:2.16.756.5.32",
        "value" : "7561234567897"
      }],
      "name" : [{
        "family" : "F",
        "given" : ["H"]
      }],
      "gender" : "female",
      "birthDate" : "1985-10-17",
      "address" : [{
        "use" : "home",
        "city" : "Derendingen",
        "state" : "SO",
        "postalCode" : "4552",
        "country" : "CH",
        "_country" : {
          "extension" : [{
            "url" : "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding",
            "valueCoding" : {
              "system" : "urn:iso:std:iso:3166",
              "code" : "CH"
            }
          }]
        }
      }]
    }
  },
  {
    "fullUrl" : "urn:uuid:632a79ff-42d7-49e0-97ca-69a3a2015760",
    "resource" : {
      "resourceType" : "Observation",
      "id" : "632a79ff-42d7-49e0-97ca-69a3a2015760",
      "status" : "final",
      "category" : [{
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/observation-category",
          "code" : "laboratory",
          "display" : "Laboratory"
        }]
      }],
      "code" : {
        "coding" : [{
          "system" : "http://loinc.org",
          "code" : "6349-5",
          "display" : "Chlamydia trachomatis [Presence] in Specimen by Organism specific culture"
        }]
      },
      "subject" : {
        "reference" : "urn:uuid:50d5deca-64e9-4a30-8cec-40ac1f015655",
        "type" : "Patient"
      },
      "effectiveDateTime" : "2023-08-04T08:25:00+02:00",
      "performer" : [{
        "reference" : "urn:uuid:8b9163cc-4894-462c-8060-b9b01f705a8b",
        "type" : "Organization"
      }],
      "valueCodeableConcept" : {
        "coding" : [{
          "system" : "http://snomed.info/sct",
          "code" : "10828004",
          "display" : "Positive"
        }]
      },
      "interpretation" : [{
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
          "code" : "POS",
          "display" : "Positive"
        }]
      }],
      "specimen" : {
        "reference" : "urn:uuid:b2b24ded-fd9f-40bc-a822-1fb07e14c2ef",
        "type" : "Specimen"
      }
    }
  },
  {
    "fullUrl" : "urn:uuid:b2b24ded-fd9f-40bc-a822-1fb07e14c2ef",
    "resource" : {
      "resourceType" : "Specimen",
      "id" : "b2b24ded-fd9f-40bc-a822-1fb07e14c2ef",
      "type" : {
        "coding" : [{
          "system" : "http://snomed.info/sct",
          "code" : "119393003",
          "display" : "Specimen from urethra (specimen)"
        }]
      },
      "subject" : {
        "reference" : "urn:uuid:50d5deca-64e9-4a30-8cec-40ac1f015655",
        "type" : "Patient"
      },
      "collection" : {
        "collectedDateTime" : "2023-07-29"
      }
    }
  },
  {
    "fullUrl" : "urn:uuid:9d409938-5af8-4fae-88d1-541f35111c1f",
    "resource" : {
      "resourceType" : "ServiceRequest",
      "id" : "9d409938-5af8-4fae-88d1-541f35111c1f",
      "identifier" : [{
        "system" : "http://fhir.lab.ch/order-identifier",
        "value" : "7601002331521"
      }],
      "status" : "completed",
      "intent" : "order",
      "code" : {
        "coding" : [{
          "system" : "http://loinc.org",
          "code" : "6349-5",
          "display" : "Chlamydia trachomatis [Presence] in Specimen by Organism specific culture"
        }]
      },
      "subject" : {
        "reference" : "urn:uuid:50d5deca-64e9-4a30-8cec-40ac1f015655",
        "type" : "Patient"
      },
      "requester" : {
        "reference" : "urn:uuid:c2be8e31-506b-42b2-adfc-7e47dd23cdb4",
        "type" : "PractitionerRole"
      },
      "specimen" : [{
        "reference" : "urn:uuid:b2b24ded-fd9f-40bc-a822-1fb07e14c2ef",
        "type" : "Specimen"
      }]
    }
  },
  {
    "fullUrl" : "urn:uuid:8b9163cc-4894-462c-8060-b9b01f705a8b",
    "resource" : {
      "resourceType" : "Organization",
      "id" : "8b9163cc-4894-462c-8060-b9b01f705a8b",
      "identifier" : [{
        "system" : "urn:oid:2.51.1.3",
        "value" : "7601002331470"
      }],
      "name" : "SanLab"
    }
  },
  {
    "fullUrl" : "urn:uuid:c2be8e31-506b-42b2-adfc-7e47dd23cdb4",
    "resource" : {
      "resourceType" : "PractitionerRole",
      "id" : "c2be8e31-506b-42b2-adfc-7e47dd23cdb4",
      "practitioner" : {
        "reference" : "urn:uuid:c3384814-b10a-4aea-b84c-a92e9a9f41e3",
        "type" : "Practitioner"
      },
      "organization" : {
        "reference" : "urn:uuid:f18f5763-d9a4-4bb7-999e-959beaaba714",
        "type" : "Organization"
      }
    }
  },
  {
    "fullUrl" : "urn:uuid:c3384814-b10a-4aea-b84c-a92e9a9f41e3",
    "resource" : {
      "resourceType" : "Practitioner",
      "id" : "c3384814-b10a-4aea-b84c-a92e9a9f41e3",
      "identifier" : [{
        "system" : "urn:oid:2.51.1.3",
        "value" : "7601000000514"
      }],
      "name" : [{
        "family" : "Hauser",
        "given" : ["Peter"]
      }],
      "telecom" : [{
        "system" : "email",
        "value" : "[email protected]"
      },
      {
        "system" : "phone",
        "value" : "+41 79 222 33 44"
      }]
    }
  },
  {
    "fullUrl" : "urn:uuid:f18f5763-d9a4-4bb7-999e-959beaaba714",
    "resource" : {
      "resourceType" : "Organization",
      "id" : "f18f5763-d9a4-4bb7-999e-959beaaba714",
      "name" : "Praxis Dr. Hauser",
      "address" : [{
        "line" : ["Hauptstrasse 10"],
        "city" : "Solothurn",
        "postalCode" : "4500"
      }]
    }
  }]
}
@oliveregger
Copy link
Member Author

FHIR Validation tool Version 6.1.5 does not show an error, need to investigate patch when we update:

https://build.fhir.org/ig/ahdis/ch-ig/branches/oe_r5ext_valissue/qa.html

FHIR Validation tool Version 6.1.5 (Git# a09216c6e85d). Built 2023-09-11T01:26:41.34Z (10 days old)
Java: 20.0.1 from /opt/homebrew/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home on aarch64 (64bit). 8192MB available
Paths: Current = /Users/oegger/Documents/github/ch-ig, Package Cache = /Users/oegger/.fhir/packages
Params: /Users/oegger/Documents/github/ch-ig/output/Bundle-BundleExInst.xml -version 4.0.1
Locale: Switzerland/CH
Jurisdiction: Switzerland
Loading
Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4576 resources (00:03.397)
Load hl7.fhir.uv.extensions.r4#1.0.0 - 1328 resources (00:00.260)
Load hl7.terminology#5.3.0 - 4201 resources (00:00.894)
Load hl7.terminology.r5#5.0.0 - 4174 resources (00:00.454)
Load hl7.fhir.uv.extensions#1.0.0 - 1328 resources (00:00.013)
Terminology server http://tx.fhir.org - Version 3.0.0 (00:01.008)
Package Summary: [hl7.fhir.r4.core#4.0.1, hl7.fhir.xver-extensions#0.0.12, hl7.fhir.uv.extensions.r4#1.0.0, hl7.terminology#5.3.0, hl7.terminology.r5#5.0.0, hl7.fhir.uv.extensions#1.0.0]
Get set... go (00:02.344)
Validating
Validate /Users/oegger/Documents/github/ch-ig/output/Bundle-BundleExInst.xml
Validate Bundle against http://hl7.org/fhir/StructureDefinition/Bundle|4.0.1...Error fetching http://packages.fhir.org/ch.fhir.ig.ch-ig: Invalid HTTP response 404 from http://packages.fhir.org/ch.fhir.ig.ch-ig (Not Found) (content in /var/folders/l2/kxp46ty52lj3tpdqm59ntp640000gn/T/http-log/fhir-http-2.log)
2023-09-21 22:06:06.456 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:331] Failed to determine latest version of package ch.fhir.ig.ch-ig from server: http://packages.fhir.org
2023-09-21 22:06:07.091 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:331] Failed to determine latest version of package ch.fhir.ig.ch-ig from server: https://packages2.fhir.org/packages
2023-09-21 22:06:08.071 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:338] Failed to determine latest version of package ch.fhir.ig.ch-ig from server: build.fhir.org
2023-09-21 22:06:08.072 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:355] Latest version of package ch.fhir.ig.ch-ig found locally is dev - using that
Load hl7.terminology.r4#5.3.0 - 4201 resources (00:02.966)
Load hl7.terminology.r4#5.0.0 - 4174 resources (00:00.945)
Load ihe.formatcode.fhir#1.1.0 - 2 resources (00:00.002)
Load hl7.terminology#5.1.0 - 4180 resources (00:01.347)
Load ch.fhir.ig.ch-epr-term#2.0.x - 34 resources (00:00.001)
Load ch.fhir.ig.ch-core#3.0.0 - 84 resources (00:00.015)
Load ch.fhir.ig.ch-ig#dev - 3 resources (00:00.000)
Error fetching http://packages.fhir.org/ch.fhir.ig.ch-ig: Invalid HTTP response 404 from http://packages.fhir.org/ch.fhir.ig.ch-ig (Not Found) (content in /var/folders/l2/kxp46ty52lj3tpdqm59ntp640000gn/T/http-log/fhir-http-3.log)
2023-09-21 22:06:11.092 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:331] Failed to determine latest version of package ch.fhir.ig.ch-ig from server: http://packages.fhir.org
2023-09-21 22:06:11.217 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:331] Failed to determine latest version of package ch.fhir.ig.ch-ig from server: https://packages2.fhir.org/packages
2023-09-21 22:06:11.274 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:338] Failed to determine latest version of package ch.fhir.ig.ch-ig from server: build.fhir.org
2023-09-21 22:06:11.275 [main] INFO o.h.f.u.n.FilesystemPackageCacheManager [FilesystemPackageCacheManager.java:355] Latest version of package ch.fhir.ig.ch-ig found locally is dev - using that
.......20..........40..........60..........80.........|
Validate Bundle against http://fhir.ch/ig/ch-ig/StructureDefinition/Bundle-ex..........20.....|
00:01.021
Done. Times: Loading: 00:08.507, validation: 00:06.300. Memory = 444Mb

Success: 0 errors, 1 warnings, 0 notes

oliveregger added a commit that referenced this issue Aug 26, 2024
oliveregger added a commit that referenced this issue Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant