FHIR © HL7.org  |  Server Home  |  XIG Home  |  Server Source  |  FHIR  

FHIR IG Statistics: StructureMap/ConditionMap

Packagehl7.fhir.uv.omop
TypeStructureMap
IdConditionMap
FHIR VersionR5
Sourcehttp://hl7.org/fhir/uv/omop/https://build.fhir.org/ig/HL7/fhir-omop-ig/StructureMap-ConditionMap.html
URLhttp://hl7.org/fhir/uv/omop/StructureMap/ConditionMap
Version1.0.0-ballot
Statusdraft
Date2025-07-22T19:48:02+00:00
NameConditionMap
TitleMapping Condition resource to Condition Occurrence OMOP Domain
Realmuv
Authorityhl7
DescriptionThis mapping maps FHIR Condition instances to OMOP Condition Occurence Table objects.

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Generated Narrative: StructureMap ConditionMap

/// url = 'http://hl7.org/fhir/uv/omop/StructureMap/ConditionMap'
/// name = 'ConditionMap'
/// title = 'Mapping Condition resource to Condition Occurrence OMOP Domain'
/// status = 'draft'

uses "http://hl7.org/fhir/StructureDefinition/Condition" alias Condition as source
uses "http://hl7.org/fhir/uv/omop/StructureDefinition/ConditionOccurrence" alias ConOccTable as target

group ConditionOccurrence(source src : Condition, target tgt : ConOccTable) {
  src.code as s -> tgt then {
    s.coding as sc -> tgt then {
      sc.code as a -> tgt.condition_concept_id = a;
    };
  }; // src.id as id -> tgt.condition_occurrence_id = cast(id, "integer");
  src.recordedDate as rd ->  tgt.condition_start_datetime = cast(rd, 'dateTime'),  tgt.condition_start_date = rd;
  src.onset : dateTime as osd ->  tgt.condition_start_datetime = osd,  tgt.condition_start_date = cast(osd, 'date');
  src.abatement : dateTime as abdt ->  tgt.condition_end_datetime = adt,  tgt.condition_end_date = cast(abdt, 'date');
  src.category as s -> tgt then {
    s.coding as sc -> tgt then {
      sc.code as a -> tgt.condition_type_concept_id = a;
    };
  };
  src.clinicalStatus as s -> tgt then {
    s.coding as sc -> tgt then {
      sc.code as a -> tgt.condition_status_concept_id = a;
    };
  };
  src.evidence as s -> tgt then {
    s.concept as sc -> tgt then {
      sc.coding as sci -> tgt then {
        sci.code as a -> tgt.condition_source_concept_id = a;
      };
    };
  }; // src.encounter as s -> tgt then {
}


Source

{
  "resourceType": "StructureMap",
  "id": "ConditionMap",
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "brr"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 1,
      "_valueInteger": {
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical": "http://hl7.org/fhir/uv/omop/ImplementationGuide/hl7.fhir.uv.omop"
          }
        ]
      }
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "informative",
      "_valueCode": {
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical": "http://hl7.org/fhir/uv/omop/ImplementationGuide/hl7.fhir.uv.omop"
          }
        ]
      }
    }
  ],
  "url": "http://hl7.org/fhir/uv/omop/StructureMap/ConditionMap",
  "version": "1.0.0-ballot",
  "name": "ConditionMap",
  "title": "Mapping Condition resource to Condition Occurrence OMOP Domain",
  "status": "draft",
  "date": "2025-07-22T19:48:02+00:00",
  "publisher": "HL7 International / Biomedical Research and Regulation",
  "contact": [
    {
      "name": "HL7 International / Biomedical Research and Regulation",
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/rcrim"
        }
      ]
    }
  ],
  "description": "This mapping maps FHIR Condition instances to OMOP Condition Occurence Table objects.",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "structure": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/Condition",
      "mode": "source",
      "alias": "Condition"
    },
    {
      "url": "http://hl7.org/fhir/uv/omop/StructureDefinition/ConditionOccurrence",
      "mode": "target",
      "alias": "ConOccTable"
    }
  ],
  "group": [
    {
      "name": "ConditionOccurrence",
      "input": [
        {
          "name": "src",
          "type": "Condition",
          "mode": "source"
        },
        {
          "name": "tgt",
          "type": "ConOccTable",
          "mode": "target"
        }
      ],
      "rule": [
        {
          "name": "code",
          "source": [
            {
              "context": "src",
              "element": "code",
              "variable": "s"
            }
          ],
          "target": [
            {
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "tgt"
                }
              ]
            }
          ],
          "rule": [
            {
              "name": "coding",
              "source": [
                {
                  "context": "s",
                  "element": "coding",
                  "variable": "sc"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "code",
                  "source": [
                    {
                      "context": "sc",
                      "element": "code",
                      "variable": "a"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "element": "condition_concept_id",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation": "src.id as id -> tgt.condition_occurrence_id = cast(id, \"integer\");"
        },
        {
          "name": "recordedDate",
          "source": [
            {
              "context": "src",
              "element": "recordedDate",
              "variable": "rd"
            }
          ],
          "target": [
            {
              "context": "tgt",
              "element": "condition_start_datetime",
              "transform": "cast",
              "parameter": [
                {
                  "valueId": "rd"
                },
                {
                  "valueString": "dateTime"
                }
              ]
            },
            {
              "context": "tgt",
              "element": "condition_start_date",
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "rd"
                }
              ]
            }
          ]
        },
        {
          "name": "onsetDateTime",
          "source": [
            {
              "context": "src",
              "type": "dateTime",
              "element": "onset",
              "variable": "osd"
            }
          ],
          "target": [
            {
              "context": "tgt",
              "element": "condition_start_datetime",
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "osd"
                }
              ]
            },
            {
              "context": "tgt",
              "element": "condition_start_date",
              "transform": "cast",
              "parameter": [
                {
                  "valueId": "osd"
                },
                {
                  "valueString": "date"
                }
              ]
            }
          ]
        },
        {
          "name": "abatementDateTime",
          "source": [
            {
              "context": "src",
              "type": "dateTime",
              "element": "abatement",
              "variable": "abdt"
            }
          ],
          "target": [
            {
              "context": "tgt",
              "element": "condition_end_datetime",
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "adt"
                }
              ]
            },
            {
              "context": "tgt",
              "element": "condition_end_date",
              "transform": "cast",
              "parameter": [
                {
                  "valueId": "abdt"
                },
                {
                  "valueString": "date"
                }
              ]
            }
          ]
        },
        {
          "name": "category",
          "source": [
            {
              "context": "src",
              "element": "category",
              "variable": "s"
            }
          ],
          "target": [
            {
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "tgt"
                }
              ]
            }
          ],
          "rule": [
            {
              "name": "coding",
              "source": [
                {
                  "context": "s",
                  "element": "coding",
                  "variable": "sc"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "code",
                  "source": [
                    {
                      "context": "sc",
                      "element": "code",
                      "variable": "a"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "element": "condition_type_concept_id",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "clinicalStatus",
          "source": [
            {
              "context": "src",
              "element": "clinicalStatus",
              "variable": "s"
            }
          ],
          "target": [
            {
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "tgt"
                }
              ]
            }
          ],
          "rule": [
            {
              "name": "coding",
              "source": [
                {
                  "context": "s",
                  "element": "coding",
                  "variable": "sc"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "code",
                  "source": [
                    {
                      "context": "sc",
                      "element": "code",
                      "variable": "a"
                    }
                  ],
                  "target": [
                    {
                      "context": "tgt",
                      "element": "condition_status_concept_id",
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "a"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "evidence",
          "source": [
            {
              "context": "src",
              "element": "evidence",
              "variable": "s"
            }
          ],
          "target": [
            {
              "transform": "copy",
              "parameter": [
                {
                  "valueId": "tgt"
                }
              ]
            }
          ],
          "rule": [
            {
              "name": "concept",
              "source": [
                {
                  "context": "s",
                  "element": "concept",
                  "variable": "sc"
                }
              ],
              "target": [
                {
                  "transform": "copy",
                  "parameter": [
                    {
                      "valueId": "tgt"
                    }
                  ]
                }
              ],
              "rule": [
                {
                  "name": "coding",
                  "source": [
                    {
                      "context": "sc",
                      "element": "coding",
                      "variable": "sci"
                    }
                  ],
                  "target": [
                    {
                      "transform": "copy",
                      "parameter": [
                        {
                          "valueId": "tgt"
                        }
                      ]
                    }
                  ],
                  "rule": [
                    {
                      "name": "code",
                      "source": [
                        {
                          "context": "sci",
                          "element": "code",
                          "variable": "a"
                        }
                      ],
                      "target": [
                        {
                          "context": "tgt",
                          "element": "condition_source_concept_id",
                          "transform": "copy",
                          "parameter": [
                            {
                              "valueId": "a"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "documentation": "src.encounter as s -> tgt then {"
        }
      ]
    }
  ]
}