FHIR Chat · Problem with x-query syntax · questionnaire

Stream: questionnaire

Topic: Problem with x-query syntax


view this post on Zulip Lloyd McKenzie (Dec 19 2021 at 17:15):

As part of cleaning up the SDC spec, I moved the source for all of the examples from JSON to XML (so they could be validated during authoring). In doing so, I discovered something unpleasant:
<url value="Condition?patient={{%patient.id}}&amp;active=true"/>
fails schema validation because the schema requires the value to match xs:anyURI, and % is not allowed in a URI. Escaping it as % doesn't make any difference - it's still considered invalid

Do we change the syntax to $patient.id or something like that instead? @Paul Lynch @Brian Postlethwaite @Grahame Grieve
Also, Grahame, this suggests that we need to tighten our validator somehow so it yells about the same things that schema validation does.

view this post on Zulip Brian Postlethwaite (Dec 19 2021 at 20:16):

That's fhirpath inside the braces, so that would break more things.

view this post on Zulip Lloyd McKenzie (Dec 19 2021 at 22:08):

Potentially, yes. So - how do we escape the FHIRPath? Do we just use HTML escaping?

view this post on Zulip Brian Postlethwaite (Dec 20 2021 at 01:09):

% is allowed in any Uri, that's the Unicode prefix char. Was news to me that they are uris and I needed to handle that decoding. (I'll need to go check my code now)

view this post on Zulip Brian Postlethwaite (Dec 20 2021 at 01:24):

Hang on, the url for the expression isn't in the url, it's in the expression string value. Which doesn't have that problem.

view this post on Zulip Brian Postlethwaite (Dec 20 2021 at 01:26):

The reference would be if the expression was defined elsewhere if I'm not mistaken.

view this post on Zulip Grahame Grieve (Dec 20 2021 at 01:27):

I don't understand this either - there's no way that % is not valid in a URI

view this post on Zulip Brian Postlethwaite (Dec 20 2021 at 01:28):

Won't matter, the value Lloyd is referring to should be in the expression not url field.

view this post on Zulip Lloyd McKenzie (Dec 20 2021 at 02:46):

The full context is this:

      <entry>
        <fullUrl value="urn:uuid:88f151c0-a954-468a-88bd-5ae15c08e060"/>
        <request>
          <method value="GET"/>
          <url value="MedicationStatement?patient={{%patient.id}}&amp;active=true"/>
        </request>
      </entry>

view this post on Zulip Lloyd McKenzie (Dec 20 2021 at 02:48):

Which is part of a Bundle referenced by this:
<extension url="http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-sourceQueries">
<valueReference>
<reference value="#PrePopQuery"/>
</valueReference>
</extension>

view this post on Zulip Brian Postlethwaite (Dec 20 2021 at 09:30):

Then that's not the x-fhir-query I thought you were talking about (in the expression datatype)

view this post on Zulip Brian Postlethwaite (Dec 20 2021 at 09:31):

That's a batch search request, and yes your problem might be there.

view this post on Zulip Paul Lynch (Dec 20 2021 at 14:53):

Why not just update the schema validation to handle the embedded FHIRPath? I don't think changing the FHIRPath syntax is the right thing to do.

view this post on Zulip Lloyd McKenzie (Dec 20 2021 at 15:17):

Validation schema for the type is normative, so that's hard to change. For now, I've just HTTP-escaped the string and mentioned in the spec that that may be necessary.


Last updated: Apr 12 2022 at 19:14 UTC