Open ir4y opened 1 year ago
Example that leverage assign #3 in FSH
Instance: undefined
InstanceOf: Bundle
Usage: #example
* type = #transaction
* entry.request.url = "{{ '/Patient/' + QuestionnaireResponse.repeat(item).where(linkId='patientId').answer.valueString }}"
* entry.request.method = #PATCH
* entry.resource = Inline-Instance-for-undefined-1
Instance: Inline-Instance-for-undefined-1
InstanceOf: Patient
Usage: #inline
* extension.url = "assign"
* extension.extension[+].url = "name"
* extension.extension[=].valueString = "qr"
* extension.extension[+].url = "value"
* extension.extension[=].valueExpression.language = #text/fhirpath
* extension.extension[=].valueExpression.expression = "QuestionnaireResponse.repeat(item)"
* telecom.extension.url = "data-source"
* telecom.extension.valueExpression.language = #text/fhirpath
* telecom.extension.valueExpression.expression = "%qr.where(linkId='phone-group')"
* telecom.system = #phone
* telecom.use = #"{{ item.where(linkId='phone-type').answer.valueString }}"
* telecom.value = "{{ item.where(linkId='phone-number').answer.valueString }}"
Example that leverage assign #3 in FSH and RuleSet
Instance: undefined
InstanceOf: Bundle
Usage: #example
* type = #transaction
* entry.request.url = "{{ '/Patient/' + QuestionnaireResponse.repeat(item).where(linkId='patientId').answer.valueString }}"
* entry.request.method = #PATCH
* entry.resource = Inline-Instance-for-undefined-1
Instance: Inline-Instance-for-undefined-1
InstanceOf: Patient
Usage: #inline
* insert Assign("qr", "{{ QuestionnaireResponse.repeat(item) }}")
* telecom.extension.url = "data-source"
* telecom.extension.valueExpression.language = #text/fhirpath
* telecom.extension.valueExpression.expression = "%qr.where(linkId='phone-group')"
* telecom.system = #phone
* telecom.use = #"{{ item.where(linkId='phone-type').answer.valueString }}"
* telecom.value = "{{ item.where(linkId='phone-number').answer.valueString }}"
To simplify the mapper we can leverage FSH to describe a resource like this
When we need to map a list we can use an extension: