FHIR Chat · output collecton as ivariable used as input to fhirpath · questionnaire

Stream: questionnaire

Topic: output collecton as ivariable used as input to fhirpath


view this post on Zulip Diane (Jul 25 2021 at 20:39):

In a Questionnaire resource, is it possible to put the output collection of a fhirpath expression into a variable and then drill down into that variable again using a new fhirpath expression? (Similar to how a temporary table is used in SQL). I am thinking the answer is no because fhirpath operates against a resource and what is stored in the variable would just be an output collection.

"extension": [{
"url" : "http://hl7.org/fhir/StructureDefinition/variable",
"valueExpression" : {
"language" : "text/fhirpath",
"name" : "bigExpressionResults",
"expression" : "really long complicated fhirpath expression goes here"
}
},

  {
    "url" : "http://hl7.org/fhir/StructureDefinition/variable",
    "valueExpression" : {
      "language" : "text/fhirpath",
      "name" : "firstName",
      "expression" : "%bigExpressionResults.item.where(linkId = '1')"
    }  
  },


  {
    "url" : "http://hl7.org/fhir/StructureDefinition/variable",
    "valueExpression" : {
      "language" : "text/fhirpath",
      "name" : "LastName",
      "expression" : "%bigExpressionResults.item.where(linkId = '2')"
    }  
  }

]

view this post on Zulip Lloyd McKenzie (Jul 25 2021 at 21:07):

That's absolutely what the 'variable' extension is for...

view this post on Zulip Diane (Jul 25 2021 at 21:13):

and the fhirpath will work on something that is not a full resource?

view this post on Zulip Brian Postlethwaite (Jul 25 2021 at 22:50):

Yes.

view this post on Zulip Diane (Jul 25 2021 at 23:03):

Amazing!!! :heart: So happy now.


Last updated: Apr 12 2022 at 19:14 UTC