StructureMapBRIPS
type: StructureMap
node role: treeRoot
id:
  v: StructureMapBRIPS
text:
  status:
    v: generated
  div: Narrativa gerada: StructureMap StructureMapBRIPS #xD; map "https://ips.saude.gov.br/fhir/StructureMap/StructureMapBRIPS" = "StructureMapBRIPS"#xD; #xD; // Mapeamento de Bundle da RNDS para o IPS#xD; #xD; uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias TLeft as source#xD; uses "http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips" alias TRight as target#xD; #xD; group RNDSIPSBundle(source src : TLeft, target tgt : TRight) {#xD; src.id as RNDSID -> tgt as IPS then {#xD; RNDSID -> tgt.identifier as IPSIdentifier then {#xD; RNDSID -> IPS.type = 'document', IPS.timestamp = (now()), IPSIdentifier.system = 'urn:ietf:rfc:3986', uuid() as uuid, IPSIdentifier.value = append('urn:uuid:', uuid) "SetDocumentTypeAndTimestampAndIdentifier";#xD; } "SetMetaData";#xD; } "SetBundleMetaData";#xD; src.entry default "empty" as RNDSEntry -> tgt.entry as IPSEntry, tgt.entry as IPSEntryCondition, tgt.entry as IPSEntryAllergyIntolerance, tgt.entry as IPSEntryMedicationStatement, uuid() as IPSPatientReference, uuid() as IPSPractitionerReference, uuid() as IPSConditionNoKnownProblemsReference, uuid() as IPSMedicationStatementNoKnownMedicationsReference, uuid() as IPSAllergyIntoleranceNoKnownAllergiesReference, uuid() as IPSVitalSignsNoKnownVitalSignsReference then {#xD; RNDSEntry where (RNDSEntry = 'empty') -> IPSEntry then {#xD; RNDSEntry -> uuid() as uuid, IPSEntry.fullUrl = append('urn:uuid:', uuid) "SetFullUrl";#xD; RNDSEntry -> create('Composition') as IPSComposition then {#xD; RNDSEntry -> IPSComposition.status = 'final', create('CodeableConcept') as cc, create('Coding') as c, c.system = 'http://loinc.org', c.code = '60591-5', c.display = 'Patient Summary Document', cc.coding = c, IPSComposition.type = cc, IPSComposition.date = (now()), IPSComposition.id = uuid(), (today()) as today, IPSComposition.title = append('Patient Summary as of:', today), IPSComposition.confidentiality = 'N', IPSComposition.text as IPSCompositionText, IPSCompositionText.status = 'generated', I…
url:
  v: https://ips.saude.gov.br/fhir/StructureMap/StructureMapBRIPS
version:
  v: 1.0.0
name:
  v: StructureMapBRIPS
title:
  v: Mapeamento de Bundle da RNDS para o IPS
status:
  v: draft
date:
  v: 2025-07-17T16:52:10+00:00
publisher:
  v: Ministério do Saúde do Brasil
contact:
  name:
    v: Ministério do Saúde do Brasil
  telecom:
    system:
      v: url
    value:
      v: https://gov.br/saude
  telecom:
    system:
      v: email
contact:
  name:
    v: Italo Macedo
  telecom:
    system:
      v: email
    use:
      v: work
description:
  v: Mapeamento de Bundle da RNDS para o IPS
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
    code:
      v: BR
    display:
      v: Brazil
structure:
  url:
    v: http://hl7.org/fhir/StructureDefinition/Bundle
    link: http://hl7.org/fhir/StructureDefinition/Bundle
  mode:
    v: source
  alias:
    v: TLeft
structure:
  url:
    v: http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips
    link: http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips
  mode:
    v: target
  alias:
    v: TRight
group:
  name:
    v: RNDSIPSBundle
  type mode:
    v: none
  input:
    name:
      v: src
    type:
      v: TLeft
    mode:
      v: source
  input:
    name:
      v: tgt
    type:
      v: TRight
    mode:
      v: target
  rule:
    name:
      v: SetBundleMetaData
    source:
      context:
        v: src
      element:
        v: id
      variable:
        v: RNDSID
    target:
      context:
        v: tgt
      context type:
        v: variable
      variable:
        v: IPS
    rule:
      name:
        v: SetMetaData
  rule:
    name:
      v: SetEmptyIPSEntries
    source:
      context:
        v: src
      default value: string
        v: empty
      element:
        v: entry
      variable:
        v: RNDSEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: IPSEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: IPSEntryCondition
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: IPSEntryAllergyIntolerance
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
      variable:
        v: IPSEntryMedicationStatement
    target:
      context type:
        v: variable
      variable:
        v: IPSPatientReference
      transform:
        v: uuid
    target:
      context type:
        v: variable
      variable:
        v: IPSPractitionerReference
      transform:
        v: uuid
    target:
      context type:
        v: variable
      variable:
        v: IPSConditionNoKnownProblemsReference
      transform:
        v: uuid
    target:
      context type:
        v: variable
      variable:
        v: IPSMedicationStatementNoKnownMedicationsReference
      transform:
        v: uuid
    target:
      context type:
        v: variable
      variable:
        v: IPSAllergyIntoleranceNoKnownAllergiesReference
      transform:
        v: uuid
    target:
      context type:
        v: variable
      variable:
        v: IPSVitalSignsNoKnownVitalSignsReference
      transform:
        v: uuid
    rule:
      name:
        v: SetEmptyComposition
    rule:
      name:
        v: SetEmptyCondition

v: RNDSID

v: tgt

v: variable

v: identifier

v: IPSIdentifier

v: SetDocumentTypeAndTimestampAndIdentifier

context:
  v: RNDSID

context:
  v: IPS
context type:
  v: variable
element:
  v: type
transform:
  v: copy
parameter:
  value: string
    v: document

context:
  v: IPS
context type:
  v: variable
element:
  v: timestamp
transform:
  v: evaluate
parameter:
  value: string
    v: now()

context:
  v: IPSIdentifier
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: urn:ietf:rfc:3986

context type:
  v: variable
variable:
  v: uuid
transform:
  v: uuid

context:
  v: IPSIdentifier
context type:
  v: variable
element:
  v: value
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: uuid

v: RNDSEntry

v: (RNDSEntry = 'empty')

v: IPSEntry

v: variable

v: SetFullUrl

context:
  v: RNDSEntry

context type:
  v: variable
variable:
  v: uuid
transform:
  v: uuid

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

v: SetComposition

context:
  v: RNDSEntry

context type:
  v: variable
variable:
  v: IPSComposition
transform:
  v: create
parameter:
  value: string
    v: Composition

name:
  v: SetCompositionFirstOrderFields
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: string
      v: final
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://loinc.org
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: 60591-5
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: Patient Summary Document
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: type
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: date
  transform:
    v: evaluate
  parameter:
    value: string
      v: now()
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: id
  transform:
    v: uuid
target:
  context type:
    v: variable
  variable:
    v: today
  transform:
    v: evaluate
  parameter:
    value: string
      v: today()
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: title
  transform:
    v: append
  parameter:
    value: string
      v: Patient Summary as of:
  parameter:
    value: id
      v: today
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: confidentiality
  transform:
    v: copy
  parameter:
    value: string
      v: N
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: text
  variable:
    v: IPSCompositionText
target:
  context:
    v: IPSCompositionText
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: string
      v: generated
target:
  context:
    v: IPSCompositionText
  context type:
    v: variable
  element:
    v: div
  transform:
    v: append
  parameter:
    value: string
      v: Title: International Patient Summary from Brazil, code: http://loinc.org#60591-5, status: generated, confidentiality: N

name:
  v: SetSubjectAuthorCustodianSection
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: IPSCompositionSubject
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: author
  variable:
    v: IPSCompositionAuthor
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: custodian
  variable:
    v: IPSCompositionCustodian
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSCompositionSectionActiveProblems
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSCompositionMedication
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSCompositionAllergiesAndIntolerances
target:
  context:
    v: IPSComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSCompositionVitalSigns
rule:
  name:
    v: SetReferences
  source:
    context:
      v: RNDSEntry
  target:
    context:
      v: IPSCompositionSubject
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPatientReference
  target:
    context:
      v: IPSCompositionAuthor
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPractitionerReference
  target:
    context:
      v: IPSCompositionCustodian
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPractitionerReference
rule:
  name:
    v: SetActiveProblems
  source:
    context:
      v: RNDSEntry
  target:
    context:
      v: IPSCompositionSectionActiveProblems
    context type:
      v: variable
    element:
      v: title
    transform:
      v: copy
    parameter:
      value: string
        v: Active Problems
  target:
    context type:
      v: variable
    variable:
      v: cc
    transform:
      v: create
    parameter:
      value: string
        v: CodeableConcept
  target:
    context type:
      v: variable
    variable:
      v: c
    transform:
      v: create
    parameter:
      value: string
        v: Coding
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: http://loinc.org
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: string
        v: 11450-4
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: string
        v: Problem list Reported
  target:
    context:
      v: cc
    context type:
      v: variable
    element:
      v: coding
    transform:
      v: copy

value: id
  v: c

context:
  v: IPSCompositionSectionActiveProblems
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: id
    v: cc

context:
  v: IPSCompositionSectionActiveProblems
context type:
  v: variable
element:
  v: entry
variable:
  v: IPSCompositionSectionActiveProblemsEntry

context:
  v: IPSCompositionSectionActiveProblemsEntry
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: IPSConditionNoKnownProblemsReference

name:
  v: SetTitleMedications
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSCompositionMedication
  context type:
    v: variable
  element:
    v: title
  transform:
    v: copy
  parameter:
    value: string
      v: Medications
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://loinc.org
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: 10160-0
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: History of Medication use Narrative
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSCompositionMedication
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context:
    v: IPSCompositionMedication
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSCompositionSectionMedicationEntry
target:
  context:
    v: IPSCompositionSectionMedicationEntry
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSMedicationStatementNoKnownMedicationsReference

name:
  v: SetAllergiesAndIntolerances
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSCompositionAllergiesAndIntolerances
  context type:
    v: variable
  element:
    v: title
  transform:
    v: copy
  parameter:
    value: string
      v: Allergies and Intolerances
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://loinc.org
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: 48765-2
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: Allergies and adverse reactions Document
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSCompositionAllergiesAndIntolerances
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context:
    v: IPSCompositionAllergiesAndIntolerances
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSCompositionSectionAllergiesAndIntolerancesEntry
target:
  context:
    v: IPSCompositionSectionAllergiesAndIntolerancesEntry
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSAllergyIntoleranceNoKnownAllergiesReference

name:
  v: SetVitalSigns
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSCompositionVitalSigns
  context type:
    v: variable
  element:
    v: title
  transform:
    v: copy
  parameter:
    value: string
      v: Vital Signs
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://loinc.org
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: 8716-3
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: Vital signs
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSCompositionVitalSigns
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context:
    v: IPSCompositionVitalSigns
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSCompositionVitalSignsEntry
target:
  context:
    v: IPSCompositionVitalSignsEntry
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSVitalSignsNoKnownVitalSignsReference

name:
  v: SetResourceComposition
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSEntry
  context type:
    v: variable
  element:
    v: resource
  transform:
    v: copy
  parameter:
    value: id
      v: IPSComposition

v: RNDSEntry

v: (RNDSEntry = 'empty')

v: IPSEntryCondition

v: variable

v: SetFullUrl

context:
  v: RNDSEntry

context type:
  v: variable
variable:
  v: uuid
transform:
  v: uuid

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

v: SetCondition

context:
  v: RNDSEntry

context type:
  v: variable
variable:
  v: IPSCondition
transform:
  v: create
parameter:
  value: string
    v: Condition

name:
  v: SetClinicalStatus
source:
  context:
    v: RNDSEntry
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://terminology.hl7.org/CodeSystem/condition-clinical
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: active
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSCondition
  context type:
    v: variable
  element:
    v: clinicalStatus
  transform:
    v: copy
  parameter:
    value: id
      v: cc

name:
  v: SetCode
source:
  context:
    v: RNDSEntry
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: no-problem-info
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: No information about problems
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSCondition
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: id
      v: cc

name:
  v: SetCode
source:
  context:
    v: RNDSEntry
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://terminology.hl7.org/CodeSystem/condition-ver-status
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: confirmed
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: Confirmed
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSCondition
  context type:
    v: variable
  element:
    v: verificationStatus
  transform:
    v: copy
  parameter:
    value: id
      v: cc

name:
  v: SetSubject
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSCondition
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: IPSConditionSubject
target:
  context:
    v: IPSConditionSubject
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSPatientReference

name:
  v: SetConditionNarrativeElement
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSEntryCondition
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: IPSEntryConditionResource
target:
  context:
    v: IPSEntryConditionResource
  context type:
    v: variable
  element:
    v: text
  variable:
    v: IPSEntryConditionResourceText
target:
  context:
    v: IPSEntryConditionResourceText
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: string
      v: generated
target:
  context:
    v: IPSCondition
  context type:
    v: variable
  element:
    v: code
  variable:
    v: IPSConditionCode
target:
  context:
    v: IPSConditionCode
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: IPSConditionCodeCoding
target:
  context:
    v: IPSConditionCodeCoding
  context type:
    v: variable
  element:
    v: code
  variable:
    v: IPSConditionCodeCodingCode
target:
  context:
    v: IPSCondition
  context type:
    v: variable
  element:
    v: clinicalStatus
  variable:
    v: IPSConditionClinicalStatus
target:
  context:
    v: IPSConditionClinicalStatus
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: IPSConditionClinicalStatusCoding
target:
  context:
    v: IPSConditionClinicalStatusCoding
  context type:
    v: variable
  element:
    v: code
  variable:
    v: IPSConditionClinicalStatusCodingCode
target:
  context:
    v: IPSCondition
  context type:
    v: variable
  element:
    v: verificationStatus
  variable:
    v: IPSConditionVerificationStatus
target:
  context:
    v: IPSConditionVerificationStatus
  context type:
    v: variable
  element:
    v: coding
  variable:
    v: IPSConditionVerificationStatusCoding
target:
  context:
    v: IPSConditionVerificationStatusCoding
  context type:
    v: variable
  element:
    v: code
  variable:
    v: IPSConditionVerificationStatusCodingCode
target:
  context:
    v: IPSEntryConditionResourceText
  context type:
    v: variable
  element:
    v: div
  transform:
    v: append
  parameter:
    value: string
      v: Condition
  parameter:
    value: id
      v: IPSConditionCodeCodingCode
  parameter:
    value: string
      v: ,clinicalStatus:
  parameter:
    value: id
      v: IPSConditionClinicalStatusCodingCode
  parameter:
    value: string
      v: ,verificationStatus:
  parameter:
    value: id
      v: IPSConditionVerificationStatusCodingCode
  parameter:
    value: string

name:
  v: SetCondition
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSEntryCondition
  context type:
    v: variable
  element:
    v: resource
  transform:
    v: copy
  parameter:
    value: id
      v: IPSCondition

name:
  v: SetEmptyAllergyIntolerance
source:
  context:
    v: RNDSEntry
  condition:
    v: (RNDSEntry = 'empty')
target:
  context:
    v: IPSEntryAllergyIntolerance
  context type:
    v: variable
rule:
  name:
    v: SetFullUrl
  source:
    context:
      v: RNDSEntry
  target:
    context type:
      v: variable
    variable:
      v: uuid
    transform:
      v: uuid
  target:
    context:
      v: IPSEntryAllergyIntolerance
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: uuid
rule:
  name:
    v: SetAllergyIntolerance
  source:
    context:
      v: RNDSEntry
  target:
    context type:
      v: variable
    variable:
      v: IPSAllergyIntolerance
    transform:
      v: create
    parameter:
      value: string
        v: AllergyIntolerance
  rule:
    name:
      v: SetClinicalStatus
    source:
      context:
        v: RNDSEntry
    target:
      context type:
        v: variable
      variable:
        v: cc
      transform:
        v: create
      parameter:
        value: string
    target:
      context type:
        v: variable
      variable:
        v: c
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: cc
      context type:
        v: variable
      element:
        v: coding
      transform:
        v: copy
      parameter:
        value: id
    target:
      context:
        v: IPSAllergyIntolerance
      context type:
        v: variable
      element:
        v: clinicalStatus
      transform:
        v: copy
      parameter:
        value: id
  rule:
    name:
      v: SetCode
    source:
      context:
        v: RNDSEntry
    target:
      context type:
        v: variable
      variable:
        v: c
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: display
      transform:
        v: copy
      parameter:
        value: string
    target:
      context type:
        v: variable
      variable:
        v: cc
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: cc
      context type:
        v: variable
      element:
        v: coding
      transform:
        v: copy
      parameter:
        value: id
    target:
      context:
        v: IPSAllergyIntolerance
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: id

string
v: CodeableConcept

string
v: Coding

string
v: active

id
v: c

id
v: cc

string
v: Coding

string
v: no-allergy-info

string
v: No information about allergies

string
v: CodeableConcept

id
v: c

id
v: cc

name:
  v: SetPatient
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSAllergyIntolerance
  context type:
    v: variable
  element:
    v: patient
  variable:
    v: IPSAllergyIntolerancePatient
target:
  context:
    v: IPSAllergyIntolerancePatient
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSPatientReference

name:
  v: SetAllergyIntolerance
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSEntryAllergyIntolerance
  context type:
    v: variable
  element:
    v: resource
  transform:
    v: copy
  parameter:
    value: id
      v: IPSAllergyIntolerance

name:
  v: SetAllergyText
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSAllergyIntolerance
  context type:
    v: variable
  element:
    v: text
  variable:
    v: IPSAllergyIntoleranceText
target:
  context:
    v: IPSAllergyIntoleranceText
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: string
      v: generated
target:
  context:
    v: IPSAllergyIntoleranceText
  context type:
    v: variable
  element:
    v: div
  transform:
    v: copy
  parameter:
    value: string
      v: No allergy information

name:
  v: SetEmptyMedicationStatement
source:
  context:
    v: RNDSEntry
  condition:
    v: (RNDSEntry = 'empty')
target:
  context:
    v: IPSEntryMedicationStatement
  context type:
    v: variable
rule:
  name:
    v: SetMedicationStatement
  source:
    context:
      v: RNDSEntry
  target:
    context type:
      v: variable
    variable:
      v: IPSMedicationStatement
    transform:
      v: create
    parameter:
      value: string
        v: MedicationStatement
  rule:
    name:
      v: SetStatus
    source:
      context:
        v: RNDSEntry
    target:
      context:
        v: IPSMedicationStatement
      context type:
        v: variable
      element:
        v: status
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: SetCode
    source:
      context:
        v: RNDSEntry
    target:
      context type:
        v: variable
      variable:
        v: c
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: code
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: c
      context type:
        v: variable
      element:
        v: display
      transform:
        v: copy
      parameter:
        value: string
    target:
      context type:
        v: variable
      variable:
        v: cc
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: cc
      context type:
        v: variable
      element:
        v: coding
      transform:
        v: copy
      parameter:
        value: id
    target:
      context:
        v: IPSMedicationStatement
      context type:
        v: variable
      element:
        v: medication
      transform:
        v: copy
      parameter:
        value: id
  rule:
    name:
      v: SetEffectivePeriod
    source:
      context:
        v: RNDSEntry
    target:
      context:
        v: IPSMedicationStatement
      context type:
        v: variable
      element:
        v: effectivePeriod
      variable:
        v: IPSMedicationStatementEffectivePeriod
    dependent:
      name:
        v: NotApplicable
      variable:
        v: RNDSEntry
      variable:
        v: IPSMedicationStatementEffectivePeriod
  rule:
    name:
      v: SetSubject
    source:
      context:
        v: RNDSEntry
    target:
      context:
        v: IPSMedicationStatement
      context type:
        v: variable
      element:
        v: subject
      variable:
        v: IPSMedicationStatementSubject
    target:
      context:
        v: IPSMedicationStatementSubject
      context type:
        v: variable
      element:
        v: reference
      transform:
        v: append
      parameter:
        value: string
      parameter:
        value: id
  rule:
    name:
      v: SetMedicationStatement
    source:
      context:
        v: RNDSEntry
    target:
      context type:
        v: variable
      variable:
        v: uuid
      transform:
        v: uuid
    target:
      context:
        v: IPSEntryMedicationStatement
      context type:
        v: variable
      element:
        v: fullUrl
      transform:
        v: append
      parameter:
        value: string
      parameter:
        value: id
    target:
      context:
        v: IPSEntryMedicationStatement

string
v: unknown

string
v: Coding

string
v: no-medication-info

string
v: No information about medications

string
v: CodeableConcept

id
v: c

id
v: cc

string
v: urn:uuid:

id
v: IPSPatientReference

string
v: urn:uuid:

id
v: uuid

v: variable

v: resource

v: copy

value: id
  v: IPSMedicationStatement

name:
  v: SetIPSEntries
source:
  context:
    v: src
  element:
    v: entry
  variable:
    v: RNDSEntry
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntry
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryCondition
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryVitalSigns
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryResults
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntrySpecimen
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryImmunization
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryProcedures
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryMedicationRequests
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryMedications
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryAllergyIntolerance
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryMedicationStatement
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryPatient
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryPractitioner
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryCustodian
target:
  context type:
    v: variable
  variable:
    v: IPSPatientReference
  transform:
    v: uuid
target:
  context type:
    v: variable
  variable:
    v: IPSPractitionerReference
  transform:
    v: uuid
rule:
  name:
    v: SetIPSEntryResourceComposition
  source:
    context:
      v: RNDSEntry
    element:
      v: resource
    variable:
      v: RNDSEntryResource
  target:
    context type:
      v: variable
    variable:
      v: IPSEntryResourceComposition
    transform:
      v: create
    parameter:
      value: string
        v: Composition
  rule:
    name:
      v: SetCompositionFirstOrderFields
    source:
      context:
        v: RNDSEntry
    target:
      context:
        v: IPSEntryResourceComposition
      context type:
        v: variable
      element:
        v: status
      transform:
        v: copy
      parameter:
        value: string
    target:
      context type:
        v: variable
      variable:
        v: cc
      transform:
        v: create
      parameter:
        value: string
    target:
      context type:
        v: variable
      variable:
        v: c
      transform:
        v: create
      parameter:
        value: string

string
v: final

string
v: CodeableConcept

string
v: Coding

context:
  v: c
context type:
  v: variable
element:
  v: system
transform:
  v: copy
parameter:
  value: string
    v: http://loinc.org

context:
  v: c
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: string
    v: 60591-5

context:
  v: c
context type:
  v: variable
element:
  v: display
transform:
  v: copy
parameter:
  value: string
    v: Patient Summary Document

context:
  v: cc
context type:
  v: variable
element:
  v: coding
transform:
  v: copy
parameter:
  value: id
    v: c

context:
  v: IPSEntryResourceComposition
context type:
  v: variable
element:
  v: type
transform:
  v: copy
parameter:
  value: id
    v: cc

context:
  v: IPSEntryResourceComposition
context type:
  v: variable
element:
  v: date
transform:
  v: evaluate
parameter:
  value: string
    v: now()

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

context type:
  v: variable
variable:
  v: today
transform:
  v: evaluate
parameter:
  value: string
    v: today()

context:
  v: IPSEntryResourceComposition
context type:
  v: variable
element:
  v: title
transform:
  v: append
parameter:
  value: string
    v: Patient Summary as of
parameter:
  value: id
    v: today

context:
  v: IPSEntryResourceComposition
context type:
  v: variable
element:
  v: confidentiality
transform:
  v: copy
parameter:
  value: string
    v: N

context:
  v: IPSEntryResourceComposition
context type:
  v: variable
element:
  v: text
variable:
  v: IPSEntryResourceCompositionText

context:
  v: IPSEntryResourceCompositionText
context type:
  v: variable
element:
  v: status
transform:
  v: copy
parameter:
  value: string
    v: generated

context:
  v: IPSEntryResourceCompositionText
context type:
  v: variable
element:
  v: div
transform:
  v: append
parameter:
  value: string
    v: Title: International Patient Summary from Brazil, code: http://loinc.org#60591-5, status: generated, confidentiality: N

name:
  v: SetSubjectAuthorCustodianSection
source:
  context:
    v: RNDSEntryResource
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: IPSEntryResourceCompositionSubject
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: author
  variable:
    v: IPSEntryResourceCompositionPractitioner
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: custodian
  variable:
    v: IPSEntryResourceCompositionCustodian
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSEntryResourceCompositionSectionActiveProblems
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSEntryResourceCompositionSectionMedications
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSEntryResourceCompositionSectionAllergiesAndIntolerances
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSEntryResourceCompositionSectionResults
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: section
  variable:
    v: IPSEntryResourceCompositionSectionVitalSigns
rule:
  name:
    v: SetResourceCompositionReferences
  source:
    context:
      v: RNDSEntryResource
  target:
    context:
      v: IPSEntryResourceCompositionSubject
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPatientReference
  target:
    context:
      v: IPSEntryResourceCompositionPractitioner
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPractitionerReference
  target:
    context:
      v: IPSEntryResourceCompositionCustodian
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPractitionerReference
rule:
  name:
    v: SetActiveProblems
  source:
    context:
      v: RNDSEntryResource
  target:
    context:
      v: IPSEntryResourceCompositionSectionActiveProblems
    context type:
      v: variable
    element:
      v: title
    transform:
      v: copy
    parameter:
      value: string
        v: Active Problems
  target:
    context type:
      v: variable
    variable:
      v: cc
    transform:
      v: create
    parameter:
      value: string
        v: CodeableConcept
  target:
    context type:
      v: variable
    variable:
      v: c
    transform:
      v: create
    parameter:
      value: string
        v: Coding
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: http://loinc.org
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: string
        v: 11450-4
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: string
        v: Problem list Reported

context:
  v: cc
context type:
  v: variable
element:
  v: coding
transform:
  v: copy
parameter:
  value: id
    v: c

context:
  v: IPSEntryResourceCompositionSectionActiveProblems
context type:
  v: variable
element:
  v: code
transform:
  v: copy
parameter:
  value: id
    v: cc

name:
  v: CreateNoKnownConditions
source:
  context:
    v: RNDSEntryResource
  condition:
    v: (RNDSEntryResource.entry.resource.entry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRCondicaoSaude').empty())
target:
  context type:
    v: variable
  variable:
    v: IPSEntryEmptyCondition
  transform:
    v: create
  parameter:
    value: string
      v: Condition
target:
  context type:
    v: variable
  variable:
    v: IPSEntryEmptyConditionId
  transform:
    v: uuid
target:
  context:
    v: IPSEntryEmptyCondition
  context type:
    v: variable
  element:
    v: id
  transform:
    v: copy
  parameter:
    value: id
      v: IPSEntryEmptyConditionId
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://terminology.hl7.org/CodeSystem/condition-clinical
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: active
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSEntryEmptyCondition
  context type:
    v: variable
  element:
    v: clinicalStatus
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: no-problem-info
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: No information about problems
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSEntryEmptyCondition
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context:
    v: IPSEntryEmptyCondition
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: IPSEntryEmptyConditionSubject
target:
  context:
    v: IPSEntryEmptyConditionSubject
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append

value: string
  v: urn:uuid:

value: id
  v: IPSPatientReference

context:
  v: IPSEntryCondition
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: IPSEntryEmptyConditionId

context:
  v: IPSEntryCondition
context type:
  v: variable
element:
  v: resource
transform:
  v: copy
parameter:
  value: id
    v: IPSEntryEmptyCondition

context:
  v: IPSEntryResourceCompositionSectionActiveProblems
context type:
  v: variable
element:
  v: entry
variable:
  v: IPSEntryResourceCompositionSectionActiveProblemsEntry

context:
  v: IPSEntryResourceCompositionSectionActiveProblemsEntry
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: IPSEntryEmptyConditionId

name:
  v: SetAllergiesAndIntolerances
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSEntryResourceCompositionSectionAllergiesAndIntolerances
  context type:
    v: variable
  element:
    v: title
  transform:
    v: copy
  parameter:
    value: string
      v: Allergies and Intolerances
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://loinc.org
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: 48765-2
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: Allergies and adverse reactions Document
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSEntryResourceCompositionSectionAllergiesAndIntolerances
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: id
      v: cc

name:
  v: CreateNoKnownConditions
source:
  context:
    v: RNDSEntryResource
  condition:
    v: (RNDSEntryResource.entry.resource.entry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRAlergiaReacaoAdversa').empty())
target:
  context type:
    v: variable
  variable:
    v: IPSEntryEmptyAllergyIntolerance
  transform:
    v: create
  parameter:
    value: string
      v: AllergyIntolerance
target:
  context type:
    v: variable
  variable:
    v: IPSEntryEmptyAllergyIntoleranceId
  transform:
    v: uuid
target:
  context:
    v: IPSEntryEmptyAllergyIntolerance
  context type:
    v: variable
  element:
    v: id
  transform:
    v: copy
  parameter:
    value: id
      v: IPSEntryEmptyAllergyIntoleranceId
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: active
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSEntryEmptyAllergyIntolerance
  context type:
    v: variable
  element:
    v: clinicalStatus
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: no-allergy-info
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: No information about allergies
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSEntryEmptyAllergyIntolerance
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context:
    v: IPSEntryEmptyAllergyIntolerance
  context type:
    v: variable
  element:
    v: patient
  variable:
    v: IPSEntryEmptyAllergyIntolerancePatient
target:
  context:
    v: IPSEntryEmptyAllergyIntolerancePatient
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append

value: string
  v: urn:uuid:

value: id
  v: IPSPatientReference

context:
  v: IPSEntryEmptyAllergyIntolerance
context type:
  v: variable
element:
  v: text
variable:
  v: IPSEntryEmptyAllergyIntoleranceText

context:
  v: IPSEntryEmptyAllergyIntoleranceText
context type:
  v: variable
element:
  v: status
transform:
  v: copy
parameter:
  value: string
    v: generated

context:
  v: IPSEntryEmptyAllergyIntoleranceText
context type:
  v: variable
element:
  v: div
transform:
  v: copy
parameter:
  value: string
    v: No known allergies

context:
  v: IPSEntryAllergyIntolerance
context type:
  v: variable
element:
  v: fullUrl
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: IPSEntryEmptyAllergyIntoleranceId

context:
  v: IPSEntryAllergyIntolerance
context type:
  v: variable
element:
  v: resource
transform:
  v: copy
parameter:
  value: id
    v: IPSEntryEmptyAllergyIntolerance

context:
  v: IPSEntryResourceCompositionSectionAllergiesAndIntolerances
context type:
  v: variable
element:
  v: entry
variable:
  v: IPSEntryResourceCompositionSectionAllergiesAndIntolerancesEntry

context:
  v: IPSEntryResourceCompositionSectionAllergiesAndIntolerancesEntry
context type:
  v: variable
element:
  v: reference
transform:
  v: append
parameter:
  value: string
    v: urn:uuid:
parameter:
  value: id
    v: IPSEntryEmptyAllergyIntoleranceId

name:
  v: CreateNoKnownMedications
source:
  context:
    v: RNDSEntryResource
  condition:
    v: (RNDSEntryResource.entry.resource.entry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRMedicamento').empty())
target:
  context type:
    v: variable
  variable:
    v: IPSEntryEmptyMedicationStatement
  transform:
    v: create
  parameter:
    value: string
      v: MedicationStatement
target:
  context type:
    v: variable
  variable:
    v: IPSEntryEmptyMedicationStatementId
  transform:
    v: uuid
target:
  context:
    v: IPSEntryEmptyMedicationStatement
  context type:
    v: variable
  element:
    v: id
  transform:
    v: copy
  parameter:
    value: id
      v: IPSEntryEmptyMedicationStatementId
target:
  context type:
    v: variable
  variable:
    v: c
  transform:
    v: create
  parameter:
    value: string
      v: Coding
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: system
  transform:
    v: copy
  parameter:
    value: string
      v: http://hl7.org/fhir/uv/ips/CodeSystem/absent-unknown-uv-ips
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: code
  transform:
    v: copy
  parameter:
    value: string
      v: no-medication-info
target:
  context:
    v: c
  context type:
    v: variable
  element:
    v: display
  transform:
    v: copy
  parameter:
    value: string
      v: No information about medications
target:
  context type:
    v: variable
  variable:
    v: cc
  transform:
    v: create
  parameter:
    value: string
      v: CodeableConcept
target:
  context:
    v: cc
  context type:
    v: variable
  element:
    v: coding
  transform:
    v: copy
  parameter:
    value: id
      v: c
target:
  context:
    v: IPSEntryEmptyMedicationStatement
  context type:
    v: variable
  element:
    v: medication
  transform:
    v: copy
  parameter:
    value: id
      v: cc
target:
  context:
    v: IPSEntryEmptyMedicationStatement
  context type:
    v: variable
  element:
    v: status
  transform:
    v: copy
  parameter:
    value: string
      v: unknown
target:
  context:
    v: IPSEntryEmptyMedicationStatement
  context type:
    v: variable
  element:
    v: subject
  variable:
    v: IPSEntryEmptyMedicationStatementSubject
target:
  context:
    v: IPSEntryEmptyMedicationStatementSubject
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSPatientReference
target:
  context:
    v: IPSEntryMedicationStatement
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSEntryEmptyMedicationStatementId
target:
  context:
    v: IPSEntryMedicationStatement
  context type:
    v: variable
  element:
    v: resource
  transform:
    v: copy
  parameter:
    value: id
      v: IPSEntryEmptyMedicationStatement
target:
  context:
    v: IPSEntryResourceCompositionSectionMedications
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryResourceCompositionSectionMedicationEntry
target:
  context:
    v: IPSEntryResourceCompositionSectionMedicationEntry
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSEntryEmptyMedicationStatementId

name:
  v: IterateRNDSEntry
source:
  context:
    v: RNDSEntry
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: IterateRNDSEntryResource
  source:
    context:
      v: RNDSEntry
    element:
      v: resource
    variable:
      v: RNDSEntryResource
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: tgt

v: variable

v: entry

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetResource
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRCondicaoSaude').empty().not())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: AddEntry
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
    element:
      v: id
    variable:
      v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: IPSEntryResourceCompositionSectionActiveProblems
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: IPSEntryResourceCompositionSectionActiveProblemsEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionActiveProblemsEntry
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: AddEntry
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: IterateRNDSEntry
source:
  context:
    v: RNDSEntry
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: IterateRNDSEntryResource
  source:
    context:
      v: RNDSEntry
    element:
      v: resource
    variable:
      v: RNDSEntryResource
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: tgt

v: variable

v: entry

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetResource
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRAlergiaReacaoAdversa').empty().not())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: AddEntry
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
    element:
      v: id
    variable:
      v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: IPSEntryResourceCompositionSectionAllergiesAndIntolerances
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: IPSEntryResourceCompositionSectionAllergiesAndIntolerancesEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionAllergiesAndIntolerancesEntry
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: AddEntry
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: CreateSectionResultsIfExist
source:
  context:
    v: RNDSEntryResource
  condition:
    v: (RNDSEntryResource.entry.resource.entry.resource.meta.where((profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRDiagnosticoCOVID19-TesteRapido') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRDiagnosticoLaboratorioClinico') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRObservacaoDescritiva')).empty().not())
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
rule:
  name:
    v: CreateSectionResults
  source:
    context:
      v: RNDSEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionResults
    context type:
      v: variable
  rule:
    name:
      v: SetCompositionSectionResults
    source:
      context:
        v: RNDSEntryResource
    target:
      context:
        v: IPSEntryResourceCompositionSectionResults
      context type:
        v: variable
    rule:
      name:
        v: SetResultsNarrative

v: RNDSEntryResource

v: IPSEntryResourceCompositionSectionResults

v: variable

v: title

v: copy

value: string
  v: Results

v: variable

v: cc

v: create

value: string
  v: CodeableConcept

v: variable

v: c

v: create

value: string
  v: Coding

v: c

v: variable

v: system

v: copy

v: c

v: variable

v: code

v: copy

value: string
  v: 30954-2

v: c

v: variable

v: display

v: copy

value: string
  v: Relevant diagnostic tests/laboratory data Narrative

v: cc

v: variable

v: coding

v: copy

value: id
  v: c

v: IPSEntryResourceCompositionSectionResults

v: variable

v: code

v: copy

value: id
  v: cc

name:
  v: IterateRNDSEntry
source:
  context:
    v: RNDSEntry
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: IterateRNDSEntryResource
  source:
    context:
      v: RNDSEntry
    element:
      v: resource
    variable:
      v: RNDSEntryResource
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: tgt

v: variable

v: entry

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetResource
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where((profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRDiagnosticoCOVID19-TesteRapido') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRDiagnosticoLaboratorioClinico') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRObservacaoDescritiva')).empty().not())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: AddEntry
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
    element:
      v: id
    variable:
      v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: IPSEntryResourceCompositionSectionResults
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: IPSEntryResourceCompositionSectionResultsEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionResultsEntry
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: AddEntry
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: IterateRNDSEntry
source:
  context:
    v: RNDSEntry
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: IterateRNDSEntryResource
  source:
    context:
      v: RNDSEntry
    element:
      v: resource
    variable:
      v: RNDSEntryResource
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: tgt

v: variable

v: entry

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetResource
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRAmostraBiologica').empty().not())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: AddEntry
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
    element:
      v: id
    variable:
      v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: AddEntry
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: CreateSectionResultsIfExist
source:
  context:
    v: RNDSEntryResource
  condition:
    v: (RNDSEntryResource.entry.resource.entry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRMedidaObservada').empty().not())
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
rule:
  name:
    v: CreateSectionResults
  source:
    context:
      v: RNDSEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionVitalSigns
    context type:
      v: variable
  rule:
    name:
      v: SetCompositionSectionResults
    source:
      context:
        v: RNDSEntryResource
    target:
      context:
        v: IPSEntryResourceCompositionSectionVitalSigns
      context type:
        v: variable
    rule:
      name:
        v: SetResultsNarrative

v: RNDSEntryResource

v: IPSEntryResourceCompositionSectionVitalSigns

v: variable

v: title

v: copy

value: string
  v: Vital Signs

v: variable

v: cc

v: create

value: string
  v: CodeableConcept

v: variable

v: c

v: create

value: string
  v: Coding

v: c

v: variable

v: system

v: copy

v: c

v: variable

v: code

v: copy

value: string
  v: 8716-3

v: c

v: variable

v: display

v: copy

value: string
  v: Vital signs

v: cc

v: variable

v: coding

v: copy

value: id
  v: c

v: IPSEntryResourceCompositionSectionVitalSigns

v: variable

v: code

v: copy

value: id
  v: cc

name:
  v: IterateRNDSEntry
source:
  context:
    v: RNDSEntry
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: IterateRNDSEntryResource
  source:
    context:
      v: RNDSEntry
    element:
      v: resource
    variable:
      v: RNDSEntryResource
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: tgt

v: variable

v: entry

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetResource
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRMedidaObservada').empty().not())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: AddEntry
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
    element:
      v: id
    variable:
      v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: IPSEntryResourceCompositionSectionVitalSigns
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: IPSEntryResourceCompositionSectionVitalSignsEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionVitalSignsEntry
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: AddEntry
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: CreateSectionImmunizationsIfExists
source:
  context:
    v: RNDSEntryResource
  condition:
    v: (RNDSEntryResource.entry.resource.entry.resource.meta.where((profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRImunobiologicoAdministrado') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRImunobiologicoAdministradoCarga') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRImunobiologicoAdministradoCampanha')).empty().not())
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
rule:
  name:
    v: CreateSectionImmunizations
  source:
    context:
      v: RNDSEntry
  target:
    context:
      v: IPSEntryResourceComposition
    context type:
      v: variable
    element:
      v: section
    variable:
      v: IPSEntryResourceCompositionSectionImmunizations
  rule:
    name:
      v: SetCompositionSectionImmunizations
    source:
      context:
        v: RNDSEntryResource
    target:
      context:
        v: IPSEntryResourceCompositionSectionImmunizations
      context type:
        v: variable
    rule:
      name:
        v: SetImmunizationsNarrative
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResource

v: IPSEntryResourceCompositionSectionImmunizations

v: variable

v: title

v: copy

value: string
  v: Immunizations

v: variable

v: c

v: create

value: string
  v: Coding

v: c

v: variable

v: system

v: copy

v: c

v: variable

v: code

v: copy

value: string
  v: 11369-6

v: c

v: variable

v: display

v: copy

value: string
  v: History of Immunization Narrative

v: variable

v: cc

v: create

value: string
  v: CodeableConcept

v: cc

v: variable

v: coding

v: copy

value: id
  v: c

v: IPSEntryResourceCompositionSectionImmunizations

v: variable

v: code

v: copy

value: id
  v: cc

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: tgt

v: variable

v: entry

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetResource
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where((profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRImunobiologicoAdministrado') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRImunobiologicoAdministradoCarga') or (profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRImunobiologicoAdministradoCampanha')).empty().not())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: AddEntry
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
    element:
      v: id
    variable:
      v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: IPSEntryResourceCompositionSectionImmunizations
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: IPSEntryResourceCompositionSectionImmunizationsEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionImmunizationsEntry
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: AddEntry
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: CreateSectionProceduresIfExists
source:
  context:
    v: RNDSEntryResource
  condition:
    v: (RNDSEntryResource.entry.resource.entry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRProcedimentoRealizado').empty().not())
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
rule:
  name:
    v: CreateSectionProcedures
  source:
    context:
      v: RNDSEntry
  target:
    context:
      v: IPSEntryResourceComposition
    context type:
      v: variable
    element:
      v: section
    variable:
      v: IPSEntryResourceCompositionSectionProcedures
  rule:
    name:
      v: SetCompositionSectionProcedures
    source:
      context:
        v: RNDSEntryResource
    target:
      context:
        v: IPSEntryResourceCompositionSectionProcedures
      context type:
        v: variable
    rule:
      name:
        v: SetProceduresNarrative
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: tgt
      context type:
        v: variable
      element:
        v: entry
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResource

v: IPSEntryResourceCompositionSectionProcedures

v: variable

v: title

v: copy

value: string
  v: History of procedures

v: variable

v: cc

v: create

value: string
  v: CodeableConcept

v: variable

v: c

v: create

value: string
  v: Coding

v: c

v: variable

v: system

v: copy

v: c

v: variable

v: code

v: copy

value: string
  v: 47519-4

v: c

v: variable

v: display

v: copy

value: string
  v: History of Procedures Narrative

v: cc

v: variable

v: coding

v: copy

value: id
  v: c

v: IPSEntryResourceCompositionSectionProcedures

v: variable

v: code

v: copy

value: id
  v: cc

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: tgt

v: variable

v: entry

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetResource
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRProcedimentoRealizado').empty().not())
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
rule:
  name:
    v: AddEntry
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
    element:
      v: id
    variable:
      v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: IPSEntryResourceCompositionSectionProcedures
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: IPSEntryResourceCompositionSectionProceduresEntry
  target:
    context:
      v: IPSEntryResourceCompositionSectionProceduresEntry
    context type:
      v: variable
    element:
      v: reference
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: entry
    variable:
      v: AddEntry
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResourceId
  target:
    context:
      v: AddEntry
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: SetCompositionSectionMedications
source:
  context:
    v: RNDSEntryResource
target:
  context:
    v: IPSEntryResourceCompositionSectionMedications
  context type:
    v: variable
rule:
  name:
    v: SetMedicationsNarrative
  source:
    context:
      v: RNDSEntryResource
  target:
    context:
      v: IPSEntryResourceCompositionSectionMedications
    context type:
      v: variable
    element:
      v: title
    transform:
      v: copy
    parameter:
      value: string
        v: Medication
  target:
    context type:
      v: variable
    variable:
      v: c
    transform:
      v: create
    parameter:
      value: string
        v: Coding
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: system
    transform:
      v: copy
    parameter:
      value: string
        v: http://loinc.org
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: string
        v: 10160-0
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: display
    transform:
      v: copy
    parameter:
      value: string
        v: History of Medication use Narrative
  target:
    context type:
      v: variable
    variable:
      v: cc
    transform:
      v: create
    parameter:
      value: string
        v: CodeableConcept
  target:
    context:
      v: cc
    context type:
      v: variable
    element:
      v: coding
    transform:
      v: copy
    parameter:
      value: id
        v: c
  target:
    context:
      v: IPSEntryResourceCompositionSectionMedications
    context type:
      v: variable
    element:
      v: code
    transform:
      v: copy
    parameter:
      value: id
        v: cc
rule:
  name:
    v: IterateRNDSEntryResourceEntry
  source:
    context:
      v: RNDSEntryResource
    element:
      v: entry
    variable:
      v: RNDSEntryResourceEntry
  target:
    context:
      v: IPSEntryMedicationRequests
    context type:
      v: variable
  rule:
    name:
      v: IterateRNDSEntryResourceEntryResource
    source:
      context:
        v: RNDSEntryResourceEntry
      element:
        v: resource
      variable:
        v: RNDSEntryResourceEntryResource
    target:
      context:
        v: IPSEntryMedicationRequests
      context type:
        v: variable
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResourceEntry
rule:
  name:
    v: IterateRNDSEntryResourceEntry
  source:
    context:
      v: RNDSEntryResource
    element:
      v: entry
    variable:
      v: RNDSEntryResourceEntry
  target:
    context:
      v: IPSEntryMedications
    context type:
      v: variable
  rule:
    name:
      v: IterateRNDSEntryResourceEntryResource
    source:
      context:
        v: RNDSEntryResourceEntry
      element:
        v: resource
      variable:
        v: RNDSEntryResourceEntryResource
    target:
      context:
        v: IPSEntryMedications
      context type:
        v: variable
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResourceEntry

v: RNDSEntryResourceEntryResource

v: entry

v: RNDSEntryResourceEntryResourceEntry

v: SetResource

context:
  v: RNDSEntryResourceEntryResourceEntry
element:
  v: resource
variable:
  v: RNDSEntryResourceEntryResourceEntryResource
condition:
  v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRPrescricaoMedicamento').empty().not())

context:
  v: IPSEntryMedicationRequests
context type:
  v: variable
element:
  v: resource
variable:
  v: IPSEntryMedicationRequestsResource

name:
  v: AddEntry
source:
  context:
    v: RNDSEntryResourceEntryResourceEntryResource
  element:
    v: id
  variable:
    v: RNDSEntryResourceEntryResourceEntryResourceId
target:
  context:
    v: IPSEntryResourceCompositionSectionMedications
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: IPSEntryResourceCompositionSectionMedicationsEntry
target:
  context:
    v: IPSEntryResourceCompositionSectionMedicationsEntry
  context type:
    v: variable
  element:
    v: reference
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: RNDSEntryResourceEntryResourceEntryResourceId
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: AddEntry
target:
  context:
    v: AddEntry
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: RNDSEntryResourceEntryResourceEntryResourceId
target:
  context:
    v: AddEntry
  context type:
    v: variable
  element:
    v: resource
  transform:
    v: copy
  parameter:
    value: id
      v: RNDSEntryResourceEntryResourceEntryResource

v: RNDSEntryResourceEntryResource

v: entry

v: RNDSEntryResourceEntryResourceEntry

v: SetResource

context:
  v: RNDSEntryResourceEntryResourceEntry
element:
  v: resource
variable:
  v: RNDSEntryResourceEntryResourceEntryResource
condition:
  v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRMedicamento').empty().not())

context:
  v: IPSEntryMedications
context type:
  v: variable
element:
  v: resource
variable:
  v: IPSEntryMedicationsResource

name:
  v: AddEntry
source:
  context:
    v: RNDSEntryResourceEntryResourceEntryResource
  element:
    v: id
  variable:
    v: RNDSEntryResourceEntryResourceEntryResourceId
target:
  context:
    v: tgt
  context type:
    v: variable
  element:
    v: entry
  variable:
    v: AddEntry
target:
  context:
    v: AddEntry
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: RNDSEntryResourceEntryResourceEntryResourceId
target:
  context:
    v: AddEntry
  context type:
    v: variable
  element:
    v: resource
  transform:
    v: copy
  parameter:
    value: id
      v: RNDSEntryResourceEntryResourceEntryResource

name:
  v: IterateRNDSEntry
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSEntryPatient
  context type:
    v: variable
rule:
  name:
    v: IterateRNDSEntryResource
  source:
    context:
      v: RNDSEntry
    element:
      v: resource
    variable:
      v: RNDSEntryResource
  target:
    context:
      v: IPSEntryPatient
    context type:
      v: variable
  rule:
    name:
      v: IterateRNDSEntryResourceEntry
    source:
      context:
        v: RNDSEntryResource
      element:
        v: entry
      variable:
        v: RNDSEntryResourceEntry
    target:
      context:
        v: IPSEntryPatient
      context type:
        v: variable
    rule:
      name:
        v: IterateRNDSEntryResourceEntryResource

v: RNDSEntryResourceEntry

v: resource

v: RNDSEntryResourceEntryResource

v: IPSEntryPatient

v: variable

v: IterateRNDSEntryResourceEntryResourceEntry

context:
  v: RNDSEntryResourceEntryResource
element:
  v: entry
variable:
  v: RNDSEntryResourceEntryResourceEntry

name:
  v: SetPatient
source:
  context:
    v: RNDSEntryResourceEntryResourceEntry
  element:
    v: resource
  variable:
    v: RNDSEntryResourceEntryResourceEntryResource
  condition:
    v: (RNDSEntryResourceEntryResourceEntry.resource.meta.where(profile = 'http://www.saude.gov.br/fhir/r4/StructureDefinition/BRIndividuo').empty().not())
target:
  context:
    v: IPSEntryPatient
  context type:
    v: variable
  element:
    v: resource
  variable:
    v: IPSEntryPatientResource
rule:
  name:
    v: SetPatientFullUrl
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
  target:
    context:
      v: IPSEntryPatient
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPatientReference
rule:
  name:
    v: SetPatientResource
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
  target:
    context:
      v: IPSEntryPatient
    context type:
      v: variable
    element:
      v: resource
    transform:
      v: copy
    parameter:
      value: id
        v: RNDSEntryResourceEntryResourceEntryResource
rule:
  name:
    v: SetPatientId
  source:
    context:
      v: RNDSEntryResourceEntryResourceEntryResource
  target:
    context:
      v: IPSEntryPatientResource
    context type:
      v: variable
    element:
      v: id
    transform:
      v: copy
    parameter:
      value: id
        v: IPSPatientReference

name:
  v: SetEmptyAuthor
source:
  context:
    v: RNDSEntry
target:
  context:
    v: IPSEntryPractitioner
  context type:
    v: variable
rule:
  name:
    v: SetFullUrl
  source:
    context:
      v: RNDSEntry
  target:
    context:
      v: IPSEntryPractitioner
    context type:
      v: variable
    element:
      v: fullUrl
    transform:
      v: append
    parameter:
      value: string
        v: urn:uuid:
    parameter:
      value: id
        v: IPSPractitionerReference
rule:
  name:
    v: SetAuthor
  source:
    context:
      v: RNDSEntry
  target:
    context type:
      v: variable
    variable:
      v: IPSOrganization
    transform:
      v: create
    parameter:
      value: string
        v: Organization
  rule:
    name:
      v: SetId
    source:
      context:
        v: RNDSEntry
    target:
      context:
        v: IPSOrganization
      context type:
        v: variable
      element:
        v: id
      transform:
        v: copy
      parameter:
        value: id
  rule:
    name:
      v: SetIdentifier
    source:
      context:
        v: RNDSEntry
    target:
      context type:
        v: variable
      variable:
        v: IPSPractitionerIdentifier
      transform:
        v: create
      parameter:
        value: string
    target:
      context:
        v: IPSPractitionerIdentifier
      context type:
        v: variable
      element:
        v: system
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: IPSPractitionerIdentifier
      context type:
        v: variable
      element:
        v: value
      transform:
        v: copy
      parameter:
        value: string
    target:
      context:
        v: IPSOrganization
      context type:
        v: variable
      element:
        v: identifier
      transform:
        v: copy
      parameter:
        value: id
  rule:
    name:
      v: SetName
    source:
      context:
        v: RNDSEntry
    target:
      context:
        v: IPSOrganization
      context type:
        v: variable
      element:
        v: name
      transform:
        v: copy
      parameter:
        value: string
  rule:
    name:
      v: SetAuthor
    source:
      context:
        v: RNDSEntry
    target:
      context:
        v: IPSEntryPractitioner
      context type:
        v: variable
      element:
        v: fullUrl
      transform:
        v: append
      parameter:
        value: string
      parameter:
        value: id
    target:
      context:
        v: IPSEntryPractitioner
      context type:
        v: variable
      element:
        v: resource
      transform:
        v: copy
      parameter:
        value: id

id
v: IPSPractitionerReference

string
v: Identifier

string
v: 00394544000185

id
v: IPSPractitionerIdentifier

string
v: Ministério da Saúde do Brasil

string
v: urn:uuid:

id
v: IPSPractitionerReference

id
v: IPSOrganization

name:
  v: SetResourceComposition
source:
  context:
    v: RNDSEntryResource
  element:
    v: id
  variable:
    v: RNDSEntryResourceId
target:
  context:
    v: IPSEntryResourceComposition
  context type:
    v: variable
  element:
    v: id
  variable:
    v: IPSEntryResourceCompositionId
target:
  context:
    v: IPSEntry
  context type:
    v: variable
  element:
    v: fullUrl
  transform:
    v: append
  parameter:
    value: string
      v: urn:uuid:
  parameter:
    value: id
      v: IPSEntryResourceCompositionId
target:
  context:
    v: IPSEntry
  context type:
    v: variable
  element:
    v: resource
  transform:
    v: copy
  parameter:
    value: id
      v: IPSEntryResourceComposition

name:
  v: DataAbsentReason
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: Element
  mode:
    v: source
input:
  name:
    v: tgt
  type:
    v: Element
  mode:
    v: target
rule:
  name:
    v: SetExtension
  source:
    context:
      v: src
  target:
    context type:
      v: variable
    variable:
      v: TgtExtension
    transform:
      v: create
    parameter:
      value: string
        v: Extension
  target:
    context type:
      v: variable
    variable:
      v: c
    transform:
      v: create
    parameter:
      value: string
        v: code
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: string
        v: unknown
  target:
    context:
      v: TgtExtension
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://hl7.org/fhir/StructureDefinition/data-absent-reason
  target:
    context:
      v: TgtExtension
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: id
        v: c
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: extension
    transform:
      v: copy
    parameter:
      value: id
        v: TgtExtension

name:
  v: NotApplicable
type mode:
  v: none
input:
  name:
    v: src
  type:
    v: Element
  mode:
    v: source
input:
  name:
    v: tgt
  type:
    v: Element
  mode:
    v: target
rule:
  name:
    v: SetExtension
  source:
    context:
      v: src
  target:
    context type:
      v: variable
    variable:
      v: TgtExtension
    transform:
      v: create
    parameter:
      value: string
        v: Extension
  target:
    context type:
      v: variable
    variable:
      v: c
    transform:
      v: create
    parameter:
      value: string
        v: code
  target:
    context:
      v: c
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: string
        v: not-applicable
  target:
    context:
      v: TgtExtension
    context type:
      v: variable
    element:
      v: url
    transform:
      v: copy
    parameter:
      value: string
        v: http://hl7.org/fhir/StructureDefinition/data-absent-reason
  target:
    context:
      v: TgtExtension
    context type:
      v: variable
    element:
      v: value
    transform:
      v: copy
    parameter:
      value: id
        v: c
  target:
    context:
      v: tgt
    context type:
      v: variable
    element:
      v: extension
    transform:
      v: copy
    parameter:
      value: id
        v: TgtExtension