FHIR Chat · Soft Indexing downside · shorthand

Stream: shorthand

Topic: Soft Indexing downside


view this post on Zulip Elliot Silver (Jan 29 2021 at 03:19):

So, I just discovered an issue with soft indexing. QA.html is reporting an error at "Questionnaire/WhoCrQuestionnaireCovid19Surveillance: Questionnaire.item[7].item[9].code[0]". How the heck am I supposed to figure out where that is? (I'd better not make any more wishes.)

view this post on Zulip Elliot Silver (Jan 29 2021 at 03:23):

Also, the fsh language reference example of using parameterized rules and soft indexing for a questionnaire, works only if your questionnaire is a flat list (and if you aren't specifying additional elements like valuesets, etc., but I suppose that is understandable).

view this post on Zulip Elliot Silver (Jan 29 2021 at 03:51):

Next up:

* contained[0] = WhoCrValueSetQuestionnaireCountry
* contained[1] = WhoCrValueSetQuestionnaireReasonForTesting
* meta.profile[0] = Canonical(http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire)
* meta.profile[1] = Canonical(http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-extr-defn)

The above seems to work fine, but changing all the indexes to + causes errors in sushi:

Sushi: error The element or path you referenced does not exist: contained[+]     (00:16.0063)

view this post on Zulip Chris Moesel (Jan 29 2021 at 13:57):

That's a good point about the references... that does make it more difficult to track back errors... I guess you need to do some counting? Perhaps in the future we can output a set of FSH w/ all the indexes resolved (or some kind of answer key) -- but I don't know how easy it would be and it's probably not our top priority at the moment.

As for your example, replacing those with [+] should be fine. I've whipped up a quick example myself and it seems to work: https://fshschool.org/FSHOnline/#/share/2KZEKMl

Note that I did have to change your Canonical(...) references because I didn't have SDC as a dependency so they did not resolve -- but also note that if you already have the canonical URL, you can just put it in as a string (like in my example). Canonical(...) is really just a convenience function for converting a name/id to a canonical -- so if you already have the canonical, it's not necessary.

view this post on Zulip David Pyke (Jan 29 2021 at 14:03):

HAving a preprocessor-only command for sushi which resolves macros, aliases and indexes might be useful

view this post on Zulip Chris Moesel (Jan 29 2021 at 14:10):

Yeah, that's an interesting idea, @David Pyke. I don't think we do all of those strictly as pre-processors right now -- at least not with a clear division between the pre-processing and the rest of the stuff. But it might be possible...

view this post on Zulip Elliot Silver (Jan 29 2021 at 16:36):

I think I was falling into @David Pyke 's problem last night -- I was using stale sushi. I'll give it a try again this morning and see if the contained/meta issues clear up.
I'm not really complaining about the counting thing; it is doing what we asked for. I may try to see what a hybrid approach looks like (use explicit numbering instead of +, but continue to use =).

view this post on Zulip Mark Kramer (Jan 29 2021 at 16:58):

+1 for output option after macro expand.

view this post on Zulip Jose Costa Teixeira (Jan 29 2021 at 17:11):

Would that option be a command line parameter?
And how would it work when called by the publisher?

view this post on Zulip Elliot Silver (Jan 29 2021 at 18:00):

Elliot Silver said:

I think I was falling into David Pyke 's problem last night -- I was using stale sushi. I'll give it a try again this morning and see if the contained/meta issues clear up.

Yup -- and it got weirder too -- commandline sushi worked ok, but publisher-invoked was failing. Turns out fsh.ini was pinning the sushi version to 1.0. I fixed that, and all seems good.

view this post on Zulip Chris Moesel (Jan 29 2021 at 20:19):

Yeah, that's the danger of specifying a version of SUSHI in fsh.ini. I think maybe I'll look into a feature to log out a hard-to-ignore message if SUSHI detects that there are updates available. Then at least when you look through the logs, you can notice that SUSHI is old.


Last updated: Apr 12 2022 at 19:14 UTC