FHIR Chat · Oxygen fhirPath support · implementers

Stream: implementers

Topic: Oxygen fhirPath support


view this post on Zulip Alexander Henket (Jun 24 2019 at 14:17):

For most of what I do I use Oxygen XML Editor (java). Oxygen can be extended with an XMLCatalog for FHIR. Oxygen also recently added XPath support for JSON, which helps, but it got me thinking how much nicer life would be if there were fhirPath support inside.

Oxygen is extensible in a number of ways, but did anyone by any chance already look into how that would work?

view this post on Zulip Alexander Henket (Jul 03 2019 at 08:35):

I was also looking for the Java implementation of fhirPath, but the Wiki looks outdated or at the very least I cannot find something I would send to the Oxygen makers as part of my feature request. Is there really only a DSTU3 implementation or is there something separate from FHIR releases now that FHIRPath itself has been branched off?

view this post on Zulip Lloyd McKenzie (Jul 03 2019 at 13:38):

FHIRPath support is part of HAPI and has full support for all versions, including draft R5

view this post on Zulip Alexander Henket (Jul 03 2019 at 17:33):

I thought HAPI inherited that from somewhere in github.com/hl7/fhir, but I could make out where/what. Apparently the code actually lives in HAPI?

https://github.com/hapifhir/org.hl7.fhir.core/tree/master/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils
https://github.com/hapifhir/org.hl7.fhir.core/tree/master/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils
https://github.com/hapifhir/org.hl7.fhir.core/tree/master/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils

view this post on Zulip Vadim Peretokin (Jul 03 2019 at 19:23):

The code has been migrated to the HAPI repository, yes

view this post on Zulip Vadim Peretokin (Jul 03 2019 at 19:23):

That's the right stuff you're looking at

view this post on Zulip Christof Gessner (Oct 29 2019 at 20:08):

I am trying to use oxygen with the current R4 schematrons. Keep getting error "Cannot find a 0-argument function named {http://www.w3.org/2005/xpath-functions}name.exists()". Before and after adding the XMLCatalog you mentioned. Any idea?

view this post on Zulip Lloyd McKenzie (Oct 29 2019 at 20:52):

That sounds like we've got FHIRPath that suck into XPath somehow. Can you look at the schematron and see where name.exists() is appearing?

view this post on Zulip Christof Gessner (Oct 29 2019 at 21:41):

fhir-invariants.sch line 4753:

<sch:assert test="((not(f:type/@value = 'named-event')) or name.exists()) and (not(f:type/@value = 'periodic') or timing.exists()) and (not(starts-with(f:type/@value, 'data-')) or data.exists())">trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data</sch:assert>

I am looking at the R4 release schemas/schematrons. Those from build.fhir yield schema errors earlier in the process.

view this post on Zulip Lloyd McKenzie (Oct 29 2019 at 21:46):

@Grahame Grieve Any chance this was fixed in the technical correction?

view this post on Zulip Christof Gessner (Oct 29 2019 at 21:50):

Just tried the build version: Now the same error points to line 4999 in the same file.

view this post on Zulip Grahame Grieve (Oct 29 2019 at 22:26):

I don't know of any reason it would have been fixed in the technical correction

view this post on Zulip Grahame Grieve (Oct 29 2019 at 22:54):

and I just completed the gold build, and the clock is running...

view this post on Zulip Christof Gessner (Oct 29 2019 at 23:04):

no worries, I am not in production. Just checking the validation tools in a good old experimental XML environment.

view this post on Zulip Lloyd McKenzie (Oct 30 2019 at 01:55):

It should be:
(not(f:type/@value='named-event') or exists(f:name)) and (not(f:type/@value='periodic') or exists(f:timing)) and (not(starts-with(f:type/@value, 'data-')) or exists(f:data))

view this post on Zulip Lloyd McKenzie (Oct 30 2019 at 02:02):

Submitted as GF#25088]

view this post on Zulip Christof Gessner (Oct 30 2019 at 12:41):

Thanks, @Lloyd McKenzie ! I fixed this at two occurrences. And also a few other flaws, including a few unmatched closing brackets, and commented out two lines with erroneous regexp. fhir-invariants.sch. Now it appears to work as expected.

view this post on Zulip Lloyd McKenzie (Oct 30 2019 at 13:34):

Can you tell us where the other errors were?

view this post on Zulip Christof Gessner (Oct 30 2019 at 18:32):

lines 2718-2721: unmatched closing bracket
<sch:assert test="exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='adr'])))">ppc-4: IF Scope=adr, there must be a patient</sch:assert>
<sch:assert test="exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='treatment'])))">ppc-5: IF Scope=treatment, there must be a patient</sch:assert>
<sch:assert test="exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='patient-privacy'])))">ppc-2: IF Scope=privacy, there must be a patient</sch:assert>
<sch:assert test="exists(f:patient) or not(exists(f:scope/f:coding[f:system/@value='something' and f:code/@value='research'])))">ppc-3: IF Scope=research, there must be a patient</sch:assert>

line 4753 and 5047: function call
<sch:assert test="((not(f:type/@value = 'named-event')) or name.exists()) and (not(f:type/@value = 'periodic') or timing.exists()) and (not(starts-with(f:type/@value, 'data-')) or data.exists())">trd-3: A named event requires a name, a periodic event requires timing, and a data event requires data</sch:assert>

line 10670: trailing garbage within first bracket (unmatched quote)
<sch:assert test="f:type/@value=('choice','open-choice','decimal','integer','date','dateTime','time','string','quantity',') or not(f:answerOption or f:answerValueSet)">que-5: Only 'choice' and 'open-choice' items can have answerValueSet</sch:assert>

lines 12144 and 12182: parser complains about regexp (something with amp character... had no time to analyze):
<sch:assert test="matches(path/@value, '[^\s\.,:;\'&quot;\/|?!@#$%&amp;*()\[\]{}]{1,64}(\.[^\s\.,:;\'&quot;\/|?!@#$%&amp;*()\[\]{}]{1,64}(\[x\])?(\:[^\s\.]+)?)*')">eld-19: Element names cannot include some special characters</sch:assert>

view this post on Zulip Christof Gessner (Oct 30 2019 at 18:51):

If you diff the file I attached in previous message vs the original, you'll see what I changed.

view this post on Zulip Lloyd McKenzie (Oct 30 2019 at 19:06):

thanks


Last updated: Apr 12 2022 at 19:14 UTC