Q2FSL
type: StructureMap
node role: treeRoot
id:
  v: Q2FSL
text:
  status:
    v: generated
  div: Narratif généré : StructureMap Q2FSL #xD; map "https://interop.aphp.fr/ig/fhir/dm/StructureMap/Q2FSL" = "Q2FSL"#xD; #xD; // Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles#xD; #xD; uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QuestionnaireResponse as source#xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target#xD; #xD; // Main entry point: Transform QuestionnaireResponse to Bundle#xD; group QuestionnaireResponseToBundle(source src : QuestionnaireResponse, target bundle : Bundle) {#xD; // Initialize Bundle#xD; src -> bundle.id = uuid() "bundleid";#xD; src -> bundle.type = 'collection' "bundletype";#xD; src -> bundle.timestamp = (now()) "setTimestamp";#xD; // Create Patient resource#xD; src -> bundle.entry as patientEntry then {#xD; src -> patientEntry.resource = create('Patient') as patient then {#xD; src then CreatePatient(src, patient) "createpatient";#xD; src -> patient.id as patientId, patientEntry.fullUrl = append('urn:uuid:', patientId) "setfullUrl";#xD; // Create Locations from geocoding data#xD; // src then CreateLocations(src, patient, bundle) "create-locations";#xD; // Create Encounters from PMSI data#xD; src then CreateEncounters(src, patient, bundle) "createencounters";#xD; // Create Laboratory Observations#xD; src then CreateLaboratoryObservations(src, patient, bundle) "createlabobservations";#xD; // Create Medication Requests#xD; src then CreateMedicationRequests(src, patient, bundle) "createmedicationrequests";#xD; // Create Medication Administrations#xD; src then CreateMedicationAdministrations(src, patient, bundle) "createmedicationadministrations";#xD; // Create Vital Sign Observations#xD; src then CreateVitalSignObservations(src, patient, bundle) "createvitalsigns";#xD; } "createpatientresource";#xD; } "patiententry";#xD; }#xD; #xD; // Group: Create Patient from QuestionnaireResponse#xD; group CreatePatient(source sr…
url:
  v: https://interop.aphp.fr/ig/fhir/dm/StructureMap/Q2FSL
version:
  v: 0.1.0
name:
  v: Q2FSL
title:
  v: Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles
status:
  v: draft
date:
  v: 2025-10-23T20:49:03+00:00
publisher:
  v: AP-HP
contact:
  name:
    v: AP-HP
  telecom:
    system:
      v: url
    value:
      v: https://aphp.fr
description:
  v: Transforms QuestionnaireResponse based on Questionnaire Usage Variables socles into FHIR resources conforming to DM profiles
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
    code:
      v: FR
    display:
      v: France
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse
    link: http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse
  mode:
    v: source
  alias:
    v: QuestionnaireResponse
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Bundle
    link: http://hl7.org/fhir/StructureDefinition/Bundle
  mode:
    v: target
  alias:
    v: Bundle
group:
  name:
    v: QuestionnaireResponseToBundle
  type mode:
    v: none
  documentation:
    v: Main entry point: Transform QuestionnaireResponse to Bundle
  input:
    name:
      v: src
    type:
      v: QuestionnaireResponse
    mode:
      v: source
  input:
    name:
      v: bundle
    type:
      v: Bundle
    mode:
      v: target
  rule:
    name:
      v: bundleid
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: id
      transform:
        v: uuid
  rule:
    name:
      v: bundletype
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: type
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: setTimestamp
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: timestamp
      transform:
        v: evaluate
      parameter:
        value: string
  rule:
    name:
      v: patiententry
    source:
      context:
        v: src
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: patientEntry
    rule:
      name:
        v: createpatientresource
group:
  name:
    v: CreatePatient
  type mode:
    v: none
  documentation:
    v: Group: Create Patient from QuestionnaireResponse
  input:
    name:
      v: src
    type:
      v: QuestionnaireResponse
    mode:
      v: source
  input:
    name:
      v: patient
    type:
      v: Patient
    mode:
      v: target
  rule:
    name:
      v: patientid
    source:
      context:
        v: src
    target:
      context:
        v: patient
      context type:
        v: variable
      element:
        v: id
      transform:
        v: uuid
  rule:
    name:
      v: patientmeta
    source:
      context:
        v: src
    target:
      context:
        v: patient
      context type:
        v: variable
      element:
        v: meta
      variable:
        v: meta
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: patientprofile

string
v: collection

string
v: now()

v: src

v: patientEntry

v: variable

v: resource

v: patient

v: create

value: string
  v: Patient

v: createpatient

context:
  v: src

name:
  v: CreatePatient
variable:
  v: src
variable:
  v: patient

v: setfullUrl

context:
  v: src

context:
  v: patient
context type:
  v: variable
element:
  v: id
variable:
  v: patientId

context:
  v: patientEntry
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: patientId

v: createencounters

context:
  v: src

name:
  v: CreateEncounters
variable:
  v: src
variable:
  v: patient
variable:
  v: bundle

v: createlabobservations

context:
  v: src

name:
  v: CreateLaboratoryObservations
variable:
  v: src
variable:
  v: patient
variable:
  v: bundle

v: createmedicationrequests

context:
  v: src

name:
  v: CreateMedicationRequests
variable:
  v: src
variable:
  v: patient
variable:
  v: bundle

v: createmedicationadministrations

context:
  v: src

name:
  v: CreateMedicationAdministrations
variable:
  v: src
variable:
  v: patient
variable:
  v: bundle

v: createvitalsigns

context:
  v: src

name:
  v: CreateVitalSignObservations
variable:
  v: src
variable:
  v: patient
variable:
  v: bundle

string
v: Meta

v: src

v: meta

v: variable

v: profile

v: copy

name:
  v: processsociodemographics
source:
  context:
    v: src
  element:
    v: item
  variable:
    v: socioDemo
  condition:
    v: (linkId = '4647259356106')
rule:
  name:
    v: processidentity
  source:
    context:
      v: socioDemo
    element:
      v: item
    variable:
      v: identity
    condition:
      v: (linkId = '2958000860428')
  rule:
    name:
      v: setname
    source:
      context:
        v: identity
    target:
      context:
        v: patient
      context type:
        v: variable
      element:
        v: name
      variable:
        v: name
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: extractfamily
    rule:
      name:
        v: extractgiven
  rule:
    name:
      v: extractnir
    source:
      context:
        v: identity
      element:
        v: item
      variable:
        v: nirItem
      condition:
        v: (linkId = '5711960356160')
    rule:
      name:
        v: setnir
  rule:
    name:
      v: extractins
    source:
      context:
        v: identity
      element:
        v: item
      variable:
        v: insItem
      condition:
        v: (linkId = '3764723550987')
    rule:
      name:
        v: setins
  rule:
    name:
      v: extractbirthdate
    source:
      context:
        v: identity
      element:
        v: item
      variable:
        v: birthItem
      condition:
        v: (linkId = '5036133558154')
    rule:
      name:
        v: setbirthdate
  rule:
    name:
      v: extractdeath
    source:
      context:
        v: identity
      element:
        v: item
      variable:
        v: deathItem
      condition:
        v: (linkId = '5633552097315')
    rule:
      name:
        v: setdeceaseddate
    rule:
      name:
        v: extractdeathsource
  rule:
    name:
      v: extractmultiplebirth
    source:
      context:
        v: identity
      element:
        v: item
      variable:
        v: multipleItem
      condition:
        v: (linkId = '6931296968515')
    rule:
      name:
        v: navigatevalue
rule:
  name:
    v: extractpmsidemographics
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: pmsiGroup
    condition:
      v: (linkId = '2825244231605')
  rule:
    name:
      v: extractgender
    source:
      context:
        v: pmsiGroup
      element:
        v: item
      variable:
        v: sexItem
      condition:
        v: (linkId = '3894630481120')
    rule:
      name:
        v: valueCoding
  rule:
    name:
      v: extractcodegeo
    source:
      context:
        v: pmsiGroup
      element:
        v: item
      variable:
        v: codeGeoItem
      condition:
        v: (linkId = '2446369196222')
    rule:
      name:
        v: setaddress

string
v: HumanName

v: identity

v: item

v: familyItem

v: (linkId = '8605698058770')

v: setfamily

context:
  v: familyItem
element:
  v: answer
variable:
  v: ans

context:
  v: name
context type:
  v: variable
element:
  v: family
transform:
  v: evaluate
parameter:
  value: string
    v: ans.valueString

v: identity

v: item

v: givenItem

v: (linkId = '6214879623503')

v: setgiven

context:
  v: givenItem
element:
  v: answer
variable:
  v: ans

context:
  v: name
context type:
  v: variable
element:
  v: given
transform:
  v: evaluate
parameter:
  value: string
    v: ans.valueString

v: nirItem

v: answer

v: ans

v: patient

v: variable

v: identifier

v: nir

v: create

value: string
  v: Identifier

v: nirsystem

context:
  v: ans

context:
  v: nir
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: urn:oid:1.2.250.1.213.1.4.8

v: nirvalue

context:
  v: ans

context:
  v: nir
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: ans.valueString

v: nirtype

context:
  v: ans

context:
  v: nir
context type:
  v: variable
element:
  v: type
transform:
  v: cc
parameter:
  value: string
    v: http://interopsante.org/fhir/CodeSystem/fr-v2-0203
parameter:
  value: string
    v: NIR

v: insItem

v: answer

v: ans

v: patient

v: variable

v: identifier

v: ins

v: create

value: string
  v: Identifier

v: inssystem

context:
  v: ans

context:
  v: ins
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: urn:oid:1.2.250.1.213.1.4.10

v: insvalue

context:
  v: ans

context:
  v: ins
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: ans.valueString

v: instype

context:
  v: ans

context:
  v: ins
context type:
  v: variable
element:
  v: type
transform:
  v: cc
parameter:
  value: string
    v: http://interopsante.org/fhir/CodeSystem/fr-v2-0203
parameter:
  value: string
    v: INS-C

v: birthItem

v: answer

v: ans

v: patient

v: variable

v: birthDate

v: evaluate

value: string
  v: ans.valueDate

v: deathItem

v: answer

v: ans

v: patient

v: variable

v: deceased

v: evaluate

value: string
  v: ans.valueDate

v: deathItem

v: item

v: deathSource

v: (linkId = '9098810065693')

v: setdeathsourceext

context:
  v: deathSource
element:
  v: answer
variable:
  v: sourceAns

context:
  v: patient
context type:
  v: variable
element:
  v: extension
variable:
  v: ext
transform:
  v: create
parameter:
  value: string
    v: Extension

name:
  v: deathsourceurl
source:
  context:
    v: sourceAns
target:
  context:
    v: ext
  context type:
    v: variable
  element:
    v: url
  transform:
    v: copy
  parameter:
    value: string
      v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/death-source

name:
  v: deathsourcevalue
source:
  context:
    v: sourceAns
target:
  context:
    v: ext
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: sourceAns.valueCoding

v: multipleItem

v: answer

v: ans

v: setmultiplebirth

context:
  v: ans
element:
  v: valueInteger
variable:
  v: valueInteger

context:
  v: patient
context type:
  v: variable
element:
  v: multipleBirth
transform:
  v: copy
parameter:
  value: id
    v: valueInteger

v: sexItem

v: answer

v: ans

v: setgender

context:
  v: ans
element:
  v: valueCoding
variable:
  v: valueCoding

context:
  v: patient
context type:
  v: variable
element:
  v: gender
transform:
  v: translate
parameter:
  value: id
    v: valueCoding
parameter:
  value: string
    v: https://interop.aphp.fr/ig/fhir/dm/ConceptMap/dpi-gender-2-hl7-gender
parameter:
  value: string
    v: code

v: codeGeoItem

v: answer

v: ans

v: patient

v: variable

v: address

v: addr

v: create

value: string
  v: Address

v: setcodegeoext

context:
  v: ans

context:
  v: addr
context type:
  v: variable
element:
  v: extension
variable:
  v: ext
transform:
  v: create
parameter:
  value: string
    v: Extension

name:
  v: codegeourl
source:
  context:
    v: ans
target:
  context:
    v: ext
  context type:
    v: variable
  element:
    v: url
  transform:
    v: copy
  parameter:
    value: string
      v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/pmsi-code-geo

name:
  v: codegeovalue
source:
  context:
    v: ans
target:
  context:
    v: ext
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: ans.valueCoding

name:
  v: CreateLocations
type mode:
  v: none
documentation:
  v: Group: Create Locations from geocoding and IRIS data
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: processsociodemographicslocation
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: socioDemo
    condition:
      v: (linkId = '4647259356106')
  rule:
    name:
      v: processenvironment
    source:
      context:
        v: socioDemo
      element:
        v: item
      variable:
        v: environment
      condition:
        v: (linkId = '5491974639955')
    rule:
      name:
        v: geocodinglocationentry
    rule:
      name:
        v: processiris

v: environment

v: item

v: geocodingItem

v: (linkId = '3816475533472')

v: bundle

v: variable

v: entry

v: locationEntry

v: createlocation

context:
  v: geocodingItem

context:
  v: locationEntry
context type:
  v: variable
element:
  v: resource
variable:
  v: location
transform:
  v: create
parameter:
  value: string
    v: Location

name:
  v: locationid
source:
  context:
    v: geocodingItem
target:
  context:
    v: location
  context type:
    v: variable
  element:
    v: id
  transform:
    v: uuid

name:
  v: locationmeta
source:
  context:
    v: geocodingItem
target:
  context:
    v: location
  context type:
    v: variable
  element:
    v: meta
  variable:
    v: meta
  transform:
    v: create
  parameter:
    value: string
      v: Meta
rule:
  name:
    v: locationprofile
  source:
    context:
      v: geocodingItem
  target:
    context:
      v: meta
    context type:
      v: variable
    element:
      v: profile
    transform:
      v: copy
    parameter:
      value: string
        v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMLocation

name:
  v: setposition
source:
  context:
    v: geocodingItem
target:
  context:
    v: location
  context type:
    v: variable
  element:
    v: position
  variable:
    v: pos
  transform:
    v: create
  parameter:
    value: string
      v: LocationPosition
rule:
  name:
    v: extractlatitude
  source:
    context:
      v: geocodingItem
    element:
      v: item
    variable:
      v: latItem
    condition:
      v: (linkId = '3709843054556')
  rule:
    name:
      v: setlatitude
    source:
      context:
        v: latItem
      element:
        v: answer
      variable:
        v: ans
    target:
      context:
        v: pos
      context type:
        v: variable
      element:
        v: latitude
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: extractlongitude
  source:
    context:
      v: geocodingItem
    element:
      v: item
    variable:
      v: longItem
    condition:
      v: (linkId = '7651448032665')
  rule:
    name:
      v: setlongitude
    source:
      context:
        v: longItem
      element:
        v: answer
      variable:
        v: ans
    target:
      context:
        v: pos
      context type:
        v: variable
      element:
        v: longitude
      transform:
        v: evaluate
      parameter:
        value: string

string
v: ans.valueDecimal

string
v: ans.valueDecimal

name:
  v: setrequest
source:
  context:
    v: location
target:
  context:
    v: locationEntry
  context type:
    v: variable
  element:
    v: request
  variable:
    v: request
rule:
  name:
    v: setmethod
  source:
    context:
      v: location
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: method
    transform:
      v: copy
    parameter:
      value: string
        v: POST
rule:
  name:
    v: seturl
  source:
    context:
      v: location
  target:
    context:
      v: request
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: Location

name:
  v: setfullUrl
source:
  context:
    v: location
  element:
    v: id
  variable:
    v: locId
target:
  context:
    v: locationEntry
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: locId

v: environment

v: item

v: irisItem

v: (linkId = '7621032273792')

v: irislocationentry

context:
  v: irisItem
element:
  v: answer
variable:
  v: irisAnswer

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: locationEntry

name:
  v: createirislocation
source:
  context:
    v: irisAnswer
target:
  context:
    v: locationEntry
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: location
  transform:
    v: create
  parameter:
    value: string
      v: Location
rule:
  name:
    v: locationid
  source:
    context:
      v: irisAnswer
  target:
    context:
      v: location
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: locationmeta
  source:
    context:
      v: irisAnswer
  target:
    context:
      v: location
    context type:
      v: variable
    element:
      v: meta
    variable:
      v: meta
    transform:
      v: create
    parameter:
      value: string
        v: Meta
  rule:
    name:
      v: locationprofile
    source:
      context:
        v: irisAnswer
    target:
      context:
        v: meta
      context type:
        v: variable
      element:
        v: profile
      transform:
        v: copy
      parameter:
        value: string
rule:
  name:
    v: setirisidentifier
  source:
    context:
      v: irisAnswer
  target:
    context:
      v: location
    context type:
      v: variable
    element:
      v: identifier
    variable:
      v: identifier
    transform:
      v: create
    parameter:
      value: string
        v: Identifier
  rule:
    name:
      v: irissystem
    source:
      context:
        v: irisAnswer
    target:
      context:
        v: identifier
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: irisvalue
    source:
      context:
        v: irisAnswer
    target:
      context:
        v: identifier
      context type:
        v: variable
      element:
        v: value
      transform:
        v: evaluate
      parameter:
        value: string
rule:
  name:
    v: setrequest
  source:
    context:
      v: location
  target:
    context:
      v: locationEntry
    context type:
      v: variable
    element:
      v: request
    variable:
      v: request
  rule:
    name:
      v: setmethod
    source:
      context:
        v: location
    target:
      context:
        v: request
      context type:
        v: variable
      element:
        v: method
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: seturl
    source:
      context:
        v: location
    target:
      context:
        v: request
      context type:
        v: variable
      element:
        v: url
      transform:
        v: copy
      parameter:
        value: string
rule:
  name:
    v: setfullUrl
  source:
    context:
      v: location
    element:
      v: id
    variable:
      v: locId
  target:
    context:
      v: locationEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: locId

string
v: urn:oid:2.16.840.1.113883.2.8.1.5.5

string
v: irisAnswer.valueCoding.code

string
v: POST

string
v: Location

name:
  v: CreateEncounters
type mode:
  v: none
documentation:
  v: Group: Create Encounters from PMSI data
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: encounterentry
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: pmsiItem
    condition:
      v: (linkId = '2825244231605')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: encounterEntry
  rule:
    name:
      v: createencounter
    source:
      context:
        v: pmsiItem
    target:
      context:
        v: encounterEntry
      context type:
        v: variable
      element:
        v: resource
      variable:
        v: encounter
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: encounterid
    rule:
      name:
        v: encountermeta
    rule:
      name:
        v: setsubject
    rule:
      name:
        v: setperiod
    rule:
      name:
        v: extractmodein
    rule:
      name:
        v: extractmodeout
    rule:
      name:
        v: setfullUrl
    rule:
      name:
        v: createconditions
    rule:
      name:
        v: createprocedures

string
v: Encounter

v: pmsiItem

v: encounter

v: variable

v: id

v: uuid

v: pmsiItem

v: encounter

v: variable

v: meta

v: meta

v: create

value: string
  v: Meta

v: encounterprofile

context:
  v: pmsiItem

context:
  v: meta
context type:
  v: variable
element:
  v: profile
transform:
  v: copy
parameter:
  value: string
    v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMEncounter

v: src

v: encounter

v: variable

v: subject

v: ref

v: create

value: string
  v: Reference

v: patient

v: variable

v: id

v: patId

v: ref

v: variable

v: reference

v: append

value: string
  v: Patient/

value: id
  v: patId

v: pmsiItem

v: encounter

v: variable

v: period

v: period

v: create

value: string
  v: Period

v: extractstart

context:
  v: pmsiItem
element:
  v: item
variable:
  v: startItem
condition:
  v: (linkId = '5991443718282')

name:
  v: setstart
source:
  context:
    v: startItem
  element:
    v: answer
  variable:
    v: ans
target:
  context:
    v: period
  context type:
    v: variable
  element:
    v: start
  transform:
    v: evaluate
  parameter:
    value: string
      v: ans.valueDate

v: extractend

context:
  v: pmsiItem
element:
  v: item
variable:
  v: endItem
condition:
  v: (linkId = '6114780320846')

name:
  v: setend
source:
  context:
    v: endItem
  element:
    v: answer
  variable:
    v: ans
target:
  context:
    v: period
  context type:
    v: variable
  element:
    v: end
  transform:
    v: evaluate
  parameter:
    value: string
      v: ans.valueDate

v: pmsiItem

v: item

v: modeInItem

v: (linkId = '6172398101212')

v: pmsiItem

v: item

v: modeOutItem

v: (linkId = '3354867075704')

v: src

v: encounter

v: variable

v: id

v: encId

v: encounterEntry

v: variable

v: fullUrl

v: append

value: string
  v: urn:uuid:

value: id
  v: encId

v: pmsiItem

v: CreateConditions

v: pmsiItem

v: patient

v: encounter

v: bundle

v: pmsiItem

v: CreateProcedures

v: pmsiItem

v: patient

v: encounter

v: bundle

name:
  v: CreateConditions
type mode:
  v: none
documentation:
  v: Group: Create Conditions from nested diagnostics
input:
  name:
    v: pmsiItem
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: encounter
  type:
    v: Encounter
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: conditionentry
  source:
    context:
      v: pmsiItem
    element:
      v: item
    variable:
      v: diagGroup
    condition:
      v: (linkId = '9391816419630')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: conditionEntry
  rule:
    name:
      v: createcondition
    source:
      context:
        v: diagGroup
    target:
      context:
        v: conditionEntry
      context type:
        v: variable
      element:
        v: resource
      variable:
        v: condition
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: conditionid
    rule:
      name:
        v: conditionmeta
    rule:
      name:
        v: setsubject
    rule:
      name:
        v: setencounter
    rule:
      name:
        v: extractdiagcode
    rule:
      name:
        v: extractdiagtype
    rule:
      name:
        v: extractrecordeddate

string
v: Condition

v: diagGroup

v: condition

v: variable

v: id

v: uuid

v: diagGroup

v: condition

v: variable

v: meta

v: meta

v: create

value: string
  v: Meta

v: conditionprofile

context:
  v: diagGroup

context:
  v: meta
context type:
  v: variable
element:
  v: profile
transform:
  v: copy
parameter:
  value: string
    v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMCondition

v: diagGroup

v: condition

v: variable

v: subject

v: ref

v: create

value: string
  v: Reference

v: patient

v: variable

v: id

v: patId

v: ref

v: variable

v: reference

v: append

value: string
  v: Patient/

value: id
  v: patId

v: diagGroup

v: encounter

v: variable

v: id

v: encId

v: condition

v: variable

v: encounter

v: ref

v: create

value: string
  v: Reference

v: ref

v: variable

v: reference

v: append

value: string
  v: Encounter/

value: id
  v: encId

v: diagGroup

v: item

v: diagCodeItem

v: (linkId = '5505101189372')

v: setcode

context:
  v: diagCodeItem
element:
  v: answer
variable:
  v: ans

context:
  v: condition
context type:
  v: variable
element:
  v: code
variable:
  v: code
transform:
  v: create
parameter:
  value: string
    v: CodeableConcept

name:
  v: setcoding
source:
  context:
    v: ans
target:
  context:
    v: code
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: evaluate
  parameter:
    value: string
      v: ans.valueCoding

v: diagGroup

v: item

v: diagTypeItem

v: (linkId = '6427586743735')

v: setcategory

context:
  v: diagTypeItem
element:
  v: answer
variable:
  v: ans

context:
  v: condition
context type:
  v: variable
element:
  v: category
variable:
  v: category
transform:
  v: create
parameter:
  value: string
    v: CodeableConcept

name:
  v: setcategorycoding
source:
  context:
    v: ans
target:
  context:
    v: category
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: coding
  transform:
    v: create
  parameter:
    value: string
      v: Coding
rule:
  name:
    v: diagtypesystem
  source:
    context:
      v: ans
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: https://interop.aphp.fr/ig/fhir/dm/CodeSystem/pmsi-mco-diag-type
rule:
  name:
    v: diagtypecode
  source:
    context:
      v: ans
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: code
    transform:
      v: evaluate
    parameter:
      value: string
        v: ans.valueCoding.code
rule:
  name:
    v: diagtypedisplay
  source:
    context:
      v: ans
  target:
    context:
      v: coding
    context type:
      v: variable
    element:
      v: display
    transform:
      v: evaluate
    parameter:
      value: string
        v: ans.valueCoding.display

v: diagGroup

v: item

v: dateItem

v: (linkId = '7114466839467')

v: setrecordeddate

context:
  v: dateItem
element:
  v: answer
variable:
  v: ans

context:
  v: condition
context type:
  v: variable
element:
  v: recordedDate
transform:
  v: evaluate
parameter:
  value: string
    v: ans.valueDate

name:
  v: CreateProcedures
type mode:
  v: none
documentation:
  v: Group: Create Procedures from nested actes
input:
  name:
    v: pmsiItem
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: encounter
  type:
    v: Encounter
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: procedureentry
  source:
    context:
      v: pmsiItem
    element:
      v: item
    variable:
      v: acteGroup
    condition:
      v: (linkId = '591926901726')
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: procedureEntry
  rule:
    name:
      v: createprocedure
    source:
      context:
        v: acteGroup
    target:
      context:
        v: procedureEntry
      context type:
        v: variable
      element:
        v: resource
      variable:
        v: procedure
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: procedureid
    rule:
      name:
        v: proceduremeta
    rule:
      name:
        v: setsubject
    rule:
      name:
        v: setencounter
    rule:
      name:
        v: extractactecode
    rule:
      name:
        v: extractperformeddate

string
v: Procedure

v: acteGroup

v: procedure

v: variable

v: id

v: uuid

v: acteGroup

v: procedure

v: variable

v: meta

v: meta

v: create

value: string
  v: Meta

v: procedureprofile

context:
  v: acteGroup

context:
  v: meta
context type:
  v: variable
element:
  v: profile
transform:
  v: copy
parameter:
  value: string
    v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMProcedure

v: acteGroup

v: procedure

v: variable

v: subject

v: ref

v: create

value: string
  v: Reference

v: patient

v: variable

v: id

v: patId

v: ref

v: variable

v: reference

v: append

value: string
  v: Patient/

value: id
  v: patId

v: acteGroup

v: encounter

v: variable

v: id

v: encId

v: procedure

v: variable

v: encounter

v: ref

v: create

value: string
  v: Reference

v: ref

v: variable

v: reference

v: append

value: string
  v: Encounter/

value: id
  v: encId

v: acteGroup

v: item

v: acteCodeItem

v: (linkId = '7758110033600')

v: setcode

context:
  v: acteCodeItem
element:
  v: answer
variable:
  v: ans

context:
  v: procedure
context type:
  v: variable
element:
  v: code
variable:
  v: code
transform:
  v: create
parameter:
  value: string
    v: CodeableConcept

name:
  v: setcoding
source:
  context:
    v: ans
target:
  context:
    v: code
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: evaluate
  parameter:
    value: string
      v: ans.valueCoding

v: acteGroup

v: item

v: dateItem

v: (linkId = '5066866286682')

v: setperformed

context:
  v: dateItem
element:
  v: answer
variable:
  v: ans

context:
  v: procedure
context type:
  v: variable
element:
  v: performed
transform:
  v: evaluate
parameter:
  value: string
    v: ans.valueDateTime

name:
  v: CreateMedicationRequests
type mode:
  v: none
documentation:
  v: Group: Create Medication Requests
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: processmedexpo
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: medExpoGroup
    condition:
      v: (linkId = '817801935685')
  rule:
    name:
      v: medreqentry
    source:
      context:
        v: medExpoGroup
      element:
        v: item
      variable:
        v: prescribedGroup
      condition:
        v: (linkId = '156631794800')
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: medReqEntry
    rule:
      name:
        v: createmedreq

v: prescribedGroup

v: medReqEntry

v: variable

v: resource

v: medReq

v: create

value: string
  v: MedicationRequest

v: medreqid

context:
  v: prescribedGroup

context:
  v: medReq
context type:
  v: variable
element:
  v: id
transform:
  v: uuid

v: medreqmeta

context:
  v: prescribedGroup

context:
  v: medReq
context type:
  v: variable
element:
  v: meta
variable:
  v: meta
transform:
  v: create
parameter:
  value: string
    v: Meta

name:
  v: medreqprofile
source:
  context:
    v: prescribedGroup
target:
  context:
    v: meta
  context type:
    v: variable
  element:
    v: profile
  transform:
    v: copy
  parameter:
    value: string
      v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMMedicationRequest

v: setsubject

context:
  v: prescribedGroup

context:
  v: medReq
context type:
  v: variable
element:
  v: subject
variable:
  v: ref
transform:
  v: create
parameter:
  value: string
    v: Reference

context:
  v: patient
context type:
  v: variable
element:
  v: id
variable:
  v: patId

context:
  v: ref
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: Patient/
parameter:
  value: id
    v: patId

v: setstatus

context:
  v: prescribedGroup

context:
  v: medReq
context type:
  v: variable
element:
  v: status
transform:
  v: copy
parameter:
  value: string
    v: active

v: setintent

context:
  v: prescribedGroup

context:
  v: medReq
context type:
  v: variable
element:
  v: intent
transform:
  v: copy
parameter:
  value: string
    v: order

v: medicationentry

context:
  v: prescribedGroup

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: medEntry

name:
  v: createmedication
source:
  context:
    v: prescribedGroup
target:
  context:
    v: medEntry
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: medication
  transform:
    v: create
  parameter:
    value: string
      v: Medication
rule:
  name:
    v: medid
  source:
    context:
      v: prescribedGroup
  target:
    context:
      v: medication
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: extractatc
  source:
    context:
      v: prescribedGroup
    element:
      v: item
    variable:
      v: atcItem
    condition:
      v: (linkId.contains('ATC'))
  rule:
    name:
      v: setmedcode
    source:
      context:
        v: atcItem
      element:
        v: answer
      variable:
        v: ans
    target:
      context:
        v: medication
      context type:
        v: variable
      element:
        v: code
      variable:
        v: code
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: setatccoding
rule:
  name:
    v: setfullUrl
  source:
    context:
      v: prescribedGroup
  target:
    context:
      v: medication
    context type:
      v: variable
    element:
      v: id
    variable:
      v: medId
  target:
    context:
      v: medEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: medId
rule:
  name:
    v: setmedicationreference
  source:
    context:
      v: prescribedGroup
  target:
    context:
      v: medication
    context type:
      v: variable
    element:
      v: id
    variable:
      v: medId
  target:
    context:
      v: medReq
    context type:
      v: variable
    element:
      v: medication
    variable:
      v: ref
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: Medication/
    parameter:
      value: id
        v: medId

string
v: CodeableConcept

v: ans

v: code

v: variable

v: coding

v: evaluate

value: string
  v: ans.valueCoding

v: setdosage

context:
  v: prescribedGroup

context:
  v: medReq
context type:
  v: variable
element:
  v: dosageInstruction
variable:
  v: dosage
transform:
  v: create
parameter:
  value: string
    v: Dosage

name:
  v: extractroute
source:
  context:
    v: prescribedGroup
  element:
    v: item
  variable:
    v: routeItem
  condition:
    v: (linkId.contains('voie'))
rule:
  name:
    v: setroute
  source:
    context:
      v: routeItem
    element:
      v: answer
    variable:
      v: ans
  target:
    context:
      v: dosage
    context type:
      v: variable
    element:
      v: route
    variable:
      v: route
    transform:
      v: create
    parameter:
      value: string
        v: CodeableConcept
  rule:
    name:
      v: setroutecoding
    source:
      context:
        v: ans
    target:
      context:
        v: route
      context type:
        v: variable
      element:
        v: coding
      transform:
        v: evaluate
      parameter:
        value: string

string
v: ans.valueCoding

name:
  v: extracttiming
source:
  context:
    v: prescribedGroup
  element:
    v: item
  variable:
    v: timingItem
  condition:
    v: (linkId.contains('timing') or linkId.contains('fréquence'))
rule:
  name:
    v: settimingstructure
  source:
    context:
      v: timingItem
    element:
      v: answer
    variable:
      v: ans
  target:
    context:
      v: dosage
    context type:
      v: variable
    element:
      v: timing
    variable:
      v: timing
    transform:
      v: create
    parameter:
      value: string
        v: Timing
  rule:
    name:
      v: settiming
    source:
      context:
        v: ans
    target:
      context:
        v: timing
      context type:
        v: variable
      element:
        v: repeat
      variable:
        v: repeat
      transform:
        v: create
      parameter:
        value: string

string
v: TimingRepeat

name:
  v: CreateMedicationAdministrations
type mode:
  v: none
documentation:
  v: Group: Create Medication Administrations
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: processmedexpoadmin
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: medExpoGroup
    condition:
      v: (linkId = '817801935685')
  rule:
    name:
      v: medadminentry
    source:
      context:
        v: medExpoGroup
      element:
        v: item
      variable:
        v: adminGroup
      condition:
        v: (linkId = '266852453304')
    target:
      context:
        v: bundle
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: medAdminEntry
    rule:
      name:
        v: createmedadmin

v: adminGroup

v: medAdminEntry

v: variable

v: resource

v: medAdmin

v: create

value: string
  v: MedicationAdministration

v: medadminid

context:
  v: adminGroup

context:
  v: medAdmin
context type:
  v: variable
element:
  v: id
transform:
  v: uuid

v: medadminmeta

context:
  v: adminGroup

context:
  v: medAdmin
context type:
  v: variable
element:
  v: meta
variable:
  v: meta
transform:
  v: create
parameter:
  value: string
    v: Meta

name:
  v: medadminprofile
source:
  context:
    v: adminGroup
target:
  context:
    v: meta
  context type:
    v: variable
  element:
    v: profile
  transform:
    v: copy
  parameter:
    value: string
      v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMMedicationAdministration

v: setsubject

context:
  v: adminGroup

context:
  v: medAdmin
context type:
  v: variable
element:
  v: subject
variable:
  v: ref
transform:
  v: create
parameter:
  value: string
    v: Reference

context:
  v: patient
context type:
  v: variable
element:
  v: id
variable:
  v: patId

context:
  v: ref
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: Patient/
parameter:
  value: id
    v: patId

v: setstatus

context:
  v: adminGroup

context:
  v: medAdmin
context type:
  v: variable
element:
  v: status
transform:
  v: copy
parameter:
  value: string
    v: completed

v: medicationentry

context:
  v: adminGroup

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: medEntry

name:
  v: createmedication
source:
  context:
    v: adminGroup
target:
  context:
    v: medEntry
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: medication
  transform:
    v: create
  parameter:
    value: string
      v: Medication
rule:
  name:
    v: medid
  source:
    context:
      v: adminGroup
  target:
    context:
      v: medication
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: extractatc
  source:
    context:
      v: adminGroup
    element:
      v: item
    variable:
      v: atcItem
    condition:
      v: (linkId.contains('ATC'))
  rule:
    name:
      v: setmedcode
    source:
      context:
        v: atcItem
      element:
        v: answer
      variable:
        v: ans
    target:
      context:
        v: medication
      context type:
        v: variable
      element:
        v: code
      variable:
        v: code
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: setatccoding
rule:
  name:
    v: setfullUrl
  source:
    context:
      v: adminGroup
  target:
    context:
      v: medication
    context type:
      v: variable
    element:
      v: id
    variable:
      v: medId
  target:
    context:
      v: medEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: Medication/
    parameter:
      value: id
        v: medId
rule:
  name:
    v: setmedicationreference
  source:
    context:
      v: adminGroup
  target:
    context:
      v: medication
    context type:
      v: variable
    element:
      v: id
    variable:
      v: medId
  target:
    context:
      v: medAdmin
    context type:
      v: variable
    element:
      v: medication
    variable:
      v: ref
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: medId

string
v: CodeableConcept

v: ans

v: code

v: variable

v: coding

v: evaluate

value: string
  v: ans.valueCoding

v: seteffective

context:
  v: adminGroup

context:
  v: medAdmin
context type:
  v: variable
element:
  v: effective
variable:
  v: period
transform:
  v: create
parameter:
  value: string
    v: Period

name:
  v: extractstart
source:
  context:
    v: adminGroup
  element:
    v: item
  variable:
    v: startItem
  condition:
    v: (linkId.contains('début'))
rule:
  name:
    v: setstart
  source:
    context:
      v: startItem
    element:
      v: answer
    variable:
      v: ans
  target:
    context:
      v: period
    context type:
      v: variable
    element:
      v: start
    transform:
      v: evaluate
    parameter:
      value: string
        v: ans.valueDateTime

name:
  v: extractend
source:
  context:
    v: adminGroup
  element:
    v: item
  variable:
    v: endItem
  condition:
    v: (linkId.contains('fin'))
rule:
  name:
    v: setend
  source:
    context:
      v: endItem
    element:
      v: answer
    variable:
      v: ans
  target:
    context:
      v: period
    context type:
      v: variable
    element:
      v: end
    transform:
      v: evaluate
    parameter:
      value: string
        v: ans.valueDateTime

v: setdosage

context:
  v: adminGroup

context:
  v: medAdmin
context type:
  v: variable
element:
  v: dosage
variable:
  v: dosage
transform:
  v: create
parameter:
  value: string
    v: Dosage

name:
  v: extractroute
source:
  context:
    v: adminGroup
  element:
    v: item
  variable:
    v: routeItem
  condition:
    v: (linkId.contains('voie'))
rule:
  name:
    v: setroute
  source:
    context:
      v: routeItem
    element:
      v: answer
    variable:
      v: ans
  target:
    context:
      v: dosage
    context type:
      v: variable
    element:
      v: route
    variable:
      v: route
    transform:
      v: create
    parameter:
      value: string
        v: CodeableConcept
  rule:
    name:
      v: setroutecoding
    source:
      context:
        v: ans
    target:
      context:
        v: route
      context type:
        v: variable
      element:
        v: coding
      transform:
        v: evaluate
      parameter:
        value: string

string
v: ans.valueCoding

name:
  v: extractdose
source:
  context:
    v: adminGroup
  element:
    v: item
  variable:
    v: doseItem
  condition:
    v: (linkId.contains('dose'))
rule:
  name:
    v: setdose
  source:
    context:
      v: doseItem
    element:
      v: answer
    variable:
      v: ans
  target:
    context:
      v: dosage
    context type:
      v: variable
    element:
      v: dose
    transform:
      v: evaluate
    parameter:
      value: string
        v: ans.valueQuantity

name:
  v: CreateVitalSignObservations
type mode:
  v: none
documentation:
  v: Group: Create Vital Sign Observations
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: processexam
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: examGroup
    condition:
      v: (linkId = '214880328197')
  rule:
    name:
      v: processdossier
    source:
      context:
        v: examGroup
      element:
        v: item
      variable:
        v: dossierGroup
      condition:
        v: (linkId = '305831246173')
    rule:
      name:
        v: extractheight
    rule:
      name:
        v: extractweight
    rule:
      name:
        v: extractbloodpressure

v: dossierGroup

v: item

v: heightItem

v: (linkId = '4846902346416')

v: heightobsentry

context:
  v: heightItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: obsEntry

name:
  v: createheightobs
source:
  context:
    v: ans
target:
  context:
    v: obsEntry
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: obs
  transform:
    v: create
  parameter:
    value: string
      v: Observation
rule:
  name:
    v: obsid
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: setfullUrl
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: id
    variable:
      v: obsId
  target:
    context:
      v: obsEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: obsId
rule:
  name:
    v: obsmeta
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: meta
    variable:
      v: meta
    transform:
      v: create
    parameter:
      value: string
        v: Meta
  rule:
    name:
      v: obsprofile
    source:
      context:
        v: ans
    target:
      context:
        v: meta
      context type:
        v: variable
      element:
        v: profile
      transform:
        v: copy
      parameter:
        value: string
rule:
  name:
    v: obsstatus
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: final
rule:
  name:
    v: obscategory
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: category
    transform:
      v: cc
    parameter:
      value: string
        v: http://terminology.hl7.org/CodeSystem/observation-category
    parameter:
      value: string
        v: vital-signs
rule:
  name:
    v: obscode
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: code
    transform:
      v: cc
    parameter:
      value: string
        v: http://loinc.org
    parameter:
      value: string
        v: 8302-2
    parameter:
      value: string
        v: Body height
rule:
  name:
    v: setsubject
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: subject
    variable:
      v: ref
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: patient
    context type:
      v: variable
    element:
      v: id
    variable:
      v: patId
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append

value: string
  v: Patient/

value: id
  v: patId

name:
  v: setvalue
source:
  context:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: ans.valueQuantity

name:
  v: extracteffective
source:
  context:
    v: heightItem
  element:
    v: item
  variable:
    v: dateItem
  condition:
    v: (linkId.contains('Date'))
rule:
  name:
    v: seteffective
  source:
    context:
      v: dateItem
    element:
      v: answer
    variable:
      v: dateAns
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: effective
    transform:
      v: evaluate
    parameter:
      value: string
        v: dateAns.valueDate

v: dossierGroup

v: item

v: weightItem

v: (linkId = '451513217936')

v: weightobsentry

context:
  v: weightItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable
element:
  v: entry
variable:
  v: obsEntry

name:
  v: createweightobs
source:
  context:
    v: ans
target:
  context:
    v: obsEntry
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: obs
  transform:
    v: create
  parameter:
    value: string
      v: Observation
rule:
  name:
    v: obsid
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: id
    transform:
      v: uuid
rule:
  name:
    v: setfullUrl
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: id
    variable:
      v: obsId
  target:
    context:
      v: obsEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: obsId
rule:
  name:
    v: obsmeta
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: meta
    variable:
      v: meta
    transform:
      v: create
    parameter:
      value: string
        v: Meta
  rule:
    name:
      v: obsprofile
    source:
      context:
        v: ans
    target:
      context:
        v: meta
      context type:
        v: variable
      element:
        v: profile
      transform:
        v: copy
      parameter:
        value: string
rule:
  name:
    v: obsstatus
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: status
    transform:
      v: copy
    parameter:
      value: string
        v: final
rule:
  name:
    v: obscategory
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: category
    transform:
      v: cc
    parameter:
      value: string
        v: http://terminology.hl7.org/CodeSystem/observation-category
    parameter:
      value: string
        v: vital-signs
rule:
  name:
    v: obscode
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: code
    transform:
      v: cc
    parameter:
      value: string
        v: http://loinc.org
    parameter:
      value: string
        v: 29463-7
    parameter:
      value: string
        v: Body weight
rule:
  name:
    v: setsubject
  source:
    context:
      v: ans
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: subject
    variable:
      v: ref
    transform:
      v: create
    parameter:
      value: string
        v: Reference
  target:
    context:
      v: patient
    context type:
      v: variable
    element:
      v: id
    variable:
      v: patId
  target:
    context:
      v: ref
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append

value: string
  v: Patient/

value: id
  v: patId

name:
  v: setvalue
source:
  context:
    v: ans
target:
  context:
    v: obs
  context type:
    v: variable
  element:
    v: value
  transform:
    v: evaluate
  parameter:
    value: string
      v: ans.valueQuantity

name:
  v: extracteffective
source:
  context:
    v: weightItem
  element:
    v: item
  variable:
    v: dateItem
  condition:
    v: (linkId.contains('Date'))
rule:
  name:
    v: seteffective
  source:
    context:
      v: dateItem
    element:
      v: answer
    variable:
      v: dateAns
  target:
    context:
      v: obs
    context type:
      v: variable
    element:
      v: effective
    transform:
      v: evaluate
    parameter:
      value: string
        v: dateAns.valueDate

v: dossierGroup

v: item

v: sysItem

v: (linkId = '4160905247955')

v: processsystolic

context:
  v: sysItem
element:
  v: answer
variable:
  v: sysAns

name:
  v: extractdiastolic
source:
  context:
    v: dossierGroup
  element:
    v: item
  variable:
    v: diaItem
  condition:
    v: (linkId = '848797127998')
rule:
  name:
    v: bpobsentr
  source:
    context:
      v: diaItem
    element:
      v: answer
    variable:
      v: diaAns
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: obsEntry
  rule:
    name:
      v: createbpobs
    source:
      context:
        v: sysAns
    target:
      context:
        v: obsEntry
      context type:
        v: variable
      element:
        v: resource
      variable:
        v: obs
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: obsid
    rule:
      name:
        v: setfullUrl
    rule:
      name:
        v: obsmeta
    rule:
      name:
        v: obsstatus
    rule:
      name:
        v: obscategory
    rule:
      name:
        v: obscode
    rule:
      name:
        v: setsubject
    rule:
      name:
        v: setsystolic
    rule:
      name:
        v: setdiastolic
    rule:
      name:
        v: extracteffective

string
v: Observation

v: sysAns

v: obs

v: variable

v: id

v: uuid

v: sysAns

v: obs

v: variable

v: id

v: obsId

v: obsEntry

v: variable

v: fullUrl

v: append

value: string
  v: urn:uuid:

value: id
  v: obsId

v: sysAns

v: obs

v: variable

v: meta

v: meta

v: create

value: string
  v: Meta

v: obsprofile

context:
  v: sysAns

context:
  v: meta
context type:
  v: variable
element:
  v: profile
transform:
  v: copy
parameter:
  value: string
    v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/DMObservationBloodPressure

v: sysAns

v: obs

v: variable

v: status

v: copy

value: string
  v: final

v: sysAns

v: obs

v: variable

v: category

v: cc

value: string
  v: vital-signs

v: sysAns

v: obs

v: variable

v: code

v: cc

value: string
  v: 85354-9

value: string
  v: Blood pressure panel

v: sysAns

v: obs

v: variable

v: subject

v: ref

v: create

value: string
  v: Reference

v: patient

v: variable

v: id

v: patId

v: ref

v: variable

v: reference

v: append

value: string
  v: Patient/

value: id
  v: patId

v: sysAns

v: obs

v: variable

v: component

v: sysComp

v: create

value: string
  v: Observation

v: syscode

context:
  v: sysAns

context:
  v: sysComp
context type:
  v: variable
element:
  v: code
transform:
  v: cc
parameter:
  value: string
    v: http://loinc.org
parameter:
  value: string
    v: 8480-6
parameter:
  value: string
    v: Systolic blood pressure

v: sysvalue

context:
  v: sysAns

context:
  v: sysComp
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: sysAns.valueQuantity

v: diaAns

v: obs

v: variable

v: component

v: diaComp

v: create

value: string
  v: Observation

v: diacode

context:
  v: diaAns

context:
  v: diaComp
context type:
  v: variable
element:
  v: code
transform:
  v: cc
parameter:
  value: string
    v: http://loinc.org
parameter:
  value: string
    v: 8462-4
parameter:
  value: string
    v: Diastolic blood pressure

v: diavalue

context:
  v: diaAns

context:
  v: diaComp
context type:
  v: variable
element:
  v: value
transform:
  v: evaluate
parameter:
  value: string
    v: diaAns.valueQuantity

v: sysItem

v: item

v: dateItem

v: (linkId.contains('Date'))

v: seteffective

context:
  v: dateItem
element:
  v: answer
variable:
  v: dateAns

context:
  v: obs
context type:
  v: variable
element:
  v: effective
transform:
  v: evaluate
parameter:
  value: string
    v: dateAns.valueDate

name:
  v: CreateLaboratoryObservations
type mode:
  v: none
documentation:
  v: Group: Create Laboratory Observations
input:
  name:
    v: src
  type:
    v: QuestionnaireResponse
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: processbiology
  source:
    context:
      v: src
    element:
      v: item
    variable:
      v: bioGroup
    condition:
      v: (linkId = '7702944131447')
  rule:
    name:
      v: processrenal
    source:
      context:
        v: bioGroup
      element:
        v: item
      variable:
        v: renalGroup
      condition:
        v: (linkId = '5241323453538')
    rule:
      name:
        v: extracturea
    rule:
      name:
        v: extractcreat
    rule:
      name:
        v: extractdfg
  rule:
    name:
      v: processhemo
    source:
      context:
        v: bioGroup
      element:
        v: item
      variable:
        v: hemoGroup
      condition:
        v: (linkId = '419282985970')
    rule:
      name:
        v: extractleuko
    rule:
      name:
        v: extracthemo
    rule:
      name:
        v: extracthemat
    rule:
      name:
        v: extractery
    rule:
      name:
        v: extractvgm
    rule:
      name:
        v: extractplat
    rule:
      name:
        v: extractneut
    rule:
      name:
        v: extractlymph
    rule:
      name:
        v: extracteosi
    rule:
      name:
        v: extractmono
    rule:
      name:
        v: extracttp
    rule:
      name:
        v: extracttca
  rule:
    name:
      v: processliver
    source:
      context:
        v: bioGroup
      element:
        v: item
      variable:
        v: liverGroup
      condition:
        v: (linkId = '3893612773040')
    rule:
      name:
        v: extractasat
    rule:
      name:
        v: extractalat
    rule:
      name:
        v: extractggt
    rule:
      name:
        v: extractpal
    rule:
      name:
        v: extractbiltot
    rule:
      name:
        v: extractbilconj
  rule:
    name:
      v: processglucose
    source:
      context:
        v: bioGroup
      element:
        v: item
      variable:
        v: glucoseGroup
      condition:
        v: (linkId = '8929068894076')
    rule:
      name:
        v: extractglyc
    rule:
      name:
        v: extracthba1c

v: renalGroup

v: item

v: ureaItem

v: (linkId = '7169026818760')

v: createureaobs

context:
  v: ureaItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: ureaItem
variable:
  v: patient
variable:
  v: bundle

v: renalGroup

v: item

v: creatItem

v: (linkId = '500408205043')

v: createcreatobs

context:
  v: creatItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: creatItem
variable:
  v: patient
variable:
  v: bundle

v: renalGroup

v: item

v: dfgItem

v: (linkId = '786621340679')

v: createdfgobs

context:
  v: dfgItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: dfgItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: leukoItem

v: (linkId = '210077225604')

v: createleukoobs

context:
  v: leukoItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: leukoItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: hemoItem

v: (linkId = '304159088493')

v: createhemoobs

context:
  v: hemoItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: hemoItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: hematItem

v: (linkId = '5687959006070')

v: createhematobs

context:
  v: hematItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: hematItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: eryItem

v: (linkId = '8697447896867')

v: createeryobs

context:
  v: eryItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: eryItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: vgmItem

v: (linkId = '5584978899134')

v: createvgmobs

context:
  v: vgmItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: vgmItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: platItem

v: (linkId = '2881119993430')

v: createplatobs

context:
  v: platItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: platItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: neutItem

v: (linkId = '7408951746270')

v: createneutobs

context:
  v: neutItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: neutItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: lymphItem

v: (linkId = '809808816195')

v: createlymphobs

context:
  v: lymphItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: lymphItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: eosiItem

v: (linkId = '6451887990893')

v: createeosiobs

context:
  v: eosiItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: eosiItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: monoItem

v: (linkId = '7935935816936')

v: createmonoobs

context:
  v: monoItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: monoItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: tpItem

v: (linkId = '2055949655770')

v: createtpobs

context:
  v: tpItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: tpItem
variable:
  v: patient
variable:
  v: bundle

v: hemoGroup

v: item

v: tcaItem

v: (linkId = '2527095476817')

v: createtcaobs

context:
  v: tcaItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: tcaItem
variable:
  v: patient
variable:
  v: bundle

v: liverGroup

v: item

v: asatItem

v: (linkId = '3028330976100')

v: createasatobs

context:
  v: asatItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: asatItem
variable:
  v: patient
variable:
  v: bundle

v: liverGroup

v: item

v: alatItem

v: (linkId = '8486813893880')

v: createalatobs

context:
  v: alatItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: alatItem
variable:
  v: patient
variable:
  v: bundle

v: liverGroup

v: item

v: ggtItem

v: (linkId = '3663296044037')

v: createggtobs

context:
  v: ggtItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: ggtItem
variable:
  v: patient
variable:
  v: bundle

v: liverGroup

v: item

v: palItem

v: (linkId = '2690026606933')

v: createpalobs

context:
  v: palItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: palItem
variable:
  v: patient
variable:
  v: bundle

v: liverGroup

v: item

v: bilTotItem

v: (linkId = '9068831071023')

v: createbiltotobs

context:
  v: bilTotItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: bilTotItem
variable:
  v: patient
variable:
  v: bundle

v: liverGroup

v: item

v: bilConjItem

v: (linkId = '8893717988787')

v: createbilconjobs

context:
  v: bilConjItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: bilConjItem
variable:
  v: patient
variable:
  v: bundle

v: glucoseGroup

v: item

v: glycItem

v: (linkId = '8193929027997')

v: createglycobs

context:
  v: glycItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: glycItem
variable:
  v: patient
variable:
  v: bundle

v: glucoseGroup

v: item

v: hba1cItem

v: (linkId = '7063892830923')

v: createhba1cobs

context:
  v: hba1cItem
element:
  v: answer
variable:
  v: ans

context:
  v: bundle
context type:
  v: variable

name:
  v: CreateLabObservation
variable:
  v: ans
variable:
  v: hba1cItem
variable:
  v: patient
variable:
  v: bundle

name:
  v: CreateLabObservation
type mode:
  v: none
documentation:
  v: Helper: Create a single Laboratory Observation
input:
  name:
    v: ans
  mode:
    v: source
input:
  name:
    v: parentItem
  mode:
    v: source
input:
  name:
    v: patient
  type:
    v: Patient
  mode:
    v: target
input:
  name:
    v: bundle
  type:
    v: Bundle
  mode:
    v: target
rule:
  name:
    v: obsentry
  source:
    context:
      v: ans
  target:
    context:
      v: bundle
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: obsEntry
  rule:
    name:
      v: createobs
    source:
      context:
        v: ans
    target:
      context:
        v: obsEntry
      context type:
        v: variable
      element:
        v: resource
      variable:
        v: obs
      transform:
        v: create
      parameter:
        value: string
    rule:
      name:
        v: obsid
    rule:
      name:
        v: setfullUrl
    rule:
      name:
        v: obsmeta
    rule:
      name:
        v: obsstatus
    rule:
      name:
        v: setcategory
    rule:
      name:
        v: setsubject
    rule:
      name:
        v: setvalue
    rule:
      name:
        v: extractloinc
    rule:
      name:
        v: extracteffective

string
v: Observation

v: ans

v: obs

v: variable

v: id

v: uuid

v: ans

v: obs

v: variable

v: id

v: obsId

v: obsEntry

v: variable

v: fullUrl

v: append

value: string
  v: urn:uuid:

value: id
  v: obsId

v: ans

v: obs

v: variable

v: meta

v: meta

v: create

value: string
  v: Meta

v: obsprofile

context:
  v: ans

context:
  v: meta
context type:
  v: variable
element:
  v: profile
transform:
  v: copy
parameter:
  value: string
    v: https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/dm-observation-laboratory-generic

v: ans

v: obs

v: variable

v: status

v: copy

value: string
  v: final

v: ans

v: obs

v: variable

v: category

v: cat

v: create

value: string
  v: CodeableConcept

v: setcategorycoding

context:
  v: ans

context:
  v: cat
context type:
  v: variable
element:
  v: coding
variable:
  v: coding
transform:
  v: create
parameter:
  value: string
    v: Coding

name:
  v: catsystem
source:
  context:
    v: ans
target:
  context:
    v: coding
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://terminology.hl7.org/CodeSystem/observation-category

name:
  v: catcode
source:
  context:
    v: ans
target:
  context:
    v: coding
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: laboratory

v: ans

v: obs

v: variable

v: subject

v: ref

v: create

value: string
  v: Reference

v: patient

v: variable

v: id

v: patId

v: ref

v: variable

v: reference

v: append

value: string
  v: Patient/

value: id
  v: patId

v: ans

v: obs

v: variable

v: value

v: evaluate

value: string
  v: ans.valueQuantity

v: parentItem

v: item

v: loincItem

v: (linkId.contains('code loinc'))

v: setcode

context:
  v: loincItem
element:
  v: answer
variable:
  v: loincAns

context:
  v: obs
context type:
  v: variable
element:
  v: code
variable:
  v: code
transform:
  v: create
parameter:
  value: string
    v: CodeableConcept

name:
  v: setloinccoding
source:
  context:
    v: loincAns
target:
  context:
    v: code
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: evaluate
  parameter:
    value: string
      v: loincAns.valueCoding

v: parentItem

v: item

v: dateItem

v: (linkId.contains('Date et heure du prélèvement'))

v: seteffective

context:
  v: dateItem
element:
  v: answer
variable:
  v: dateAns

context:
  v: obs
context type:
  v: variable
element:
  v: effective
transform:
  v: evaluate
parameter:
  value: string
    v: dateAns.valueDateTime