google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
463 stars 241 forks source link

Add questionnaire and qItem as reserved variables #2477

Closed FikriMilano closed 2 months ago

FikriMilano commented 2 months ago

Describe the Issue Add questionnaire and qItem as reserved variables.

Note: Based on this doc, I would argue that qItem is not supposed to be accessed via root level of any expression based extension. BUT still, I don't see the downsides of adding qItem as part of the reserved variables. It's simpler too.

The %qitem variable is defined as a shortcut to get to the Questionnaire.item that corresponds to the context QuestionnaireResponse.item. It is only valid for FHIRPath expressions defined within a Questionnaire item. https://build.fhir.org/ig/HL7/sdc/expressions.html#fhirpath-supplements

Would you like to work on the issue? Yes

FikriMilano commented 2 months ago

@jingtang10 @f-odhiambo this is a super small change

FikriMilano commented 2 months ago

@ndegwamartin

MJ1998 commented 2 months ago

@FikriMilano

You mean that, based on doc, qItem can still be used in expression defined at questionnaire root level, right ?

FikriMilano commented 2 months ago

@MJ1998 I meant the opposite

FikriMilano commented 2 months ago

qItem is only valid when used in Questionnaire item

MJ1998 commented 2 months ago

I mean the same. qItem should be a reserved item in Questionnaire items. But from definition, one should be able to use it as a variable name (not recognized as a reserved word) when declared in the questionnaire root extension(s), correct ?

But from code this will be considered as a reserved word for root level extensions as well.

FikriMilano commented 2 months ago

@MJ1998 correct and correct. Let me know if you or anyone have objections to that.

MJ1998 commented 2 months ago

Supporting this will also not be a big change but it's not needed currently. I am fine with it. @jingtang10