EXP-ParamsTransform
type: Parameters
node role: treeRoot
id:
  v: EXP-ParamsTransform
meta:
  profile:
    v: http://fyrstain.com/fhir/R4/janus-ig/StructureDefinition/PR-TransformParametersIn
    link: http://fyrstain.com/fhir/R4/janus-ig/StructureDefinition/PR-TransformParametersIn
parameter:
  name:
    v: structureMap
  parameters.parameter.resource: StructureMap
    id:
      v: StructureMap-QuestionnaireResponse-JSON
    url:
      v: https://www.ghdc.be/StructureMap/StructureMap-QuestionnaireResponse-JSON
    name:
      v: TransformeQuestionnaireResponseJSONEnQuestionnaireRepsonseFHIRSDC
    title:
      v: Transforme une extraction JSON QuestionnaireResponse vers un FHIR SDC QuestionnaireResponse
    status:
      v: draft
    description:
      v: StructureMap permettant la transformation d'une extraction JSON de QuestionnaireResponse vers le standard FHIR SDC QuestionnaireResponse.
    structure:
      url:
        v: https://www.ghdc.be
        link: https://www.ghdc.be
      mode:
        v: source
      alias:
        v: source
    structure:
      url:
        v: http://hl7.org/fhir/StructureDefinition/Questionnaire
        link: http://hl7.org/fhir/StructureDefinition/Questionnaire
      mode:
        v: source
      alias:
        v: source
    structure:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse
        link: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse
      mode:
        v: target
      alias:
        v: target
    group:
      name:
        v: main
      type mode:
        v: none
parameter:
  name:
    v: input
  part:
    name:
      v: source
    parameters.parameter.resource: Binary
      id:
        v: EXP-SourceJSONTransform
      content type:
        v: application/json
  part:
    name:
      v: questionnaire
    parameters.parameter.resource: Binary
      id:
        v: EXP-QuestionnaireTransform
      content type:
        v: application/json
  part:
    name:
      v: target
    parameters.parameter.resource: Binary
      id:
        v: EXP-TargetQRTransform
      content type:
        v: application/json

v: source

v: JSON

v: source

v: questionnaire

v: Questionnaire

v: source

v: target

v: QuestionnaireResponse

v: target

v: reponses

context:
  v: source
type:
  v: JSON
element:
  v: reponses
variable:
  v: reponses

name:
  v: groupId
source:
  context:
    v: reponses
  type:
    v: json
  element:
    v: groupId
  variable:
    v: groupId
rule:
  name:
    v: FindGroup
  source:
    context:
      v: target
    element:
      v: item
    variable:
      v: groupItem
    condition:
      v: $this.linkId=%groupId
  rule:
    name:
      v: Questions
    source:
      context:
        v: reponses
      type:
        v: json
      element:
        v: questions
      variable:
        v: question
    rule:
      name:
        v: QuestionId

v: question

v: json

v: questionId

v: questionId

v: FindQuestion

context:
  v: groupItem
element:
  v: item
variable:
  v: questionItem
condition:
  v: $this.linkId=%questionId

name:
  v: FindQuestionnaireGroup
source:
  context:
    v: questionnaire
  element:
    v: item
  variable:
    v: questionnaireGroupItem
  condition:
    v: $this.linkId=%groupId
rule:
  name:
    v: FindQuestionnaireQuestion
  source:
    context:
      v: questionnaireGroupItem
    element:
      v: item
    variable:
      v: questionnaireQuestionItem
    condition:
      v: $this.linkId=%questionId
  rule:
    name:
      v: FetchQuestionType
    source:
      context:
        v: questionnaireQuestionItem
      element:
        v: type
      variable:
        v: questionType
    rule:
      name:
        v: FetchResponse

v: question

v: json

v: reponse

v: reponse

v: CastNoChoice

context:
  v: questionType
variable:
  v: questionType
condition:
  v: ($this = 'choice').not() and %reponse.exists()

context:
  v: questionItem
context type:
  v: variable
element:
  v: answer[0].value
transform:
  v: cast
parameter:
  value: id
    v: reponse
parameter:
  value: id
    v: questionType

v: CastChoice

context:
  v: questionType
variable:
  v: questionType
condition:
  v: $this = 'choice' and %reponse.exists()

context:
  v: questionItem
context type:
  v: variable
element:
  v: answer[0].value
transform:
  v: c
parameter:
  value: string
    v: http://loinc.org
parameter:
  value: id
    v: reponse