FHIR Chat · Errors from the validator · implementers

Stream: implementers

Topic: Errors from the validator


view this post on Zulip Grahame Grieve (Jul 05 2019 at 00:20):

This issue report: https://github.com/hapifhir/org.hl7.fhir.core/issues/50 says that the indexes reported by the validator are wrong.

but XPath indexes are 1 based: https://mukulgandhi.blogspot.com/2008/05/blog-post.html

JsonPath, of course, they start at 0. FHIRPath makes it 0 except in special cases

view this post on Zulip Grahame Grieve (Jul 05 2019 at 00:21):

it's not obvious to me what the right behavior for the validator is here

view this post on Zulip Lloyd McKenzie (Jul 05 2019 at 01:22):

There was a time when the indexes were inconsistent in the validator. Sometimes 0-based, sometimes 1-based. Not sure if that's still the case.

view this post on Zulip Lloyd McKenzie (Jul 05 2019 at 01:23):

We're using FHIRPath to report the locations, so we should be using 0-based

view this post on Zulip Lloyd McKenzie (Jul 05 2019 at 01:23):

(though that's certainly going to be confusing to some)

view this post on Zulip Grahame Grieve (Jul 05 2019 at 02:40):

well, it's not FHIRPath based. :-(. Guess I'll have to invest in this part of the validator...

view this post on Zulip Grahame Grieve (Jul 05 2019 at 02:45):

@Lloyd McKenzie do you have any memory for what this part of the validator code is about:

 private boolean isGrandfathered(String path) {
    if (path.startsWith("xds-documentmanifest."))
      return true;
    if (path.startsWith("observation-device-metric-devicemetricobservation."))
      return true;
    if (path.startsWith("medicationadministration-immunization-vaccine."))
      return true;
    if (path.startsWith("elementdefinition-de-dataelement."))
      return true;
    if (path.startsWith("dataelement-sdc-sdcelement."))
      return true;
    if (path.startsWith("questionnaireresponse-sdc-structureddatacaptureanswers."))
      return true;
    if (path.startsWith("valueset-sdc-structureddatacapturevalueset."))
      return true;
    if (path.startsWith("dataelement-sdc-de-sdcelement."))
      return true;
    if (path.startsWith("do-uslab-uslabdo."))
      return true;
    if (path.startsWith("."))
      return true;
    if (path.startsWith("."))
      return true;
    if (path.startsWith("."))
      return true;
    if (path.startsWith("."))
      return true;

    return false;
  }

view this post on Zulip Vadim Peretokin (Jul 05 2019 at 07:26):

.NET Validator uses 0 based ones for comparison

view this post on Zulip Grahame Grieve (Jul 05 2019 at 09:04):

Is it right though?

view this post on Zulip Vadim Peretokin (Jul 05 2019 at 09:25):

Well - I hope it is - because then I can just treat the location as a valid FHIRpath, give it to the FHIRpath engine and retrieve the element in question that has the error

view this post on Zulip Vadim Peretokin (Jul 05 2019 at 09:25):

If I had to manually parse the location and +1 all the indexes (and insert them in short.forms) that wouldn't be nice :(

view this post on Zulip Grahame Grieve (Jul 05 2019 at 10:25):

well, next release will generate proper FHIRPaths now.

view this post on Zulip Vadim Peretokin (Jul 05 2019 at 10:42):

Nice, thank you. That'll really help tools that show the raw resource put the error messages right

view this post on Zulip Brian Postlethwaite (Jul 05 2019 at 13:11):

Or my front ends that use that value to select the control.

view this post on Zulip Lloyd McKenzie (Jul 05 2019 at 14:04):

Nope. And the last 4 clauses are troubling. The sdc ones aren't being used anymore. I expect it was a transition where we didn't want to break things that had previously been valid while enforcing tighter rules on everyone else. It seems reasonable to be tight on everyone at this point.


Last updated: Apr 12 2022 at 19:14 UTC