PROCEDURE-from-procedure_observation

Source file: PROCEDURE-from-procedure_observation.py

Root XPath

./hl7:component/hl7:structuredBody/hl7:component/hl7:section/hl7:templateId[@root='2.16.840.1.113883.10.20.22.2.7' or @root='2.16.840.1.113883.10.20.22.2.7.1']/../hl7:entry/hl7:observation[@moodCode='EVN']/hl7:statusCode[@code='active' or @code='completed']/..

Expected OMOP domain: Procedure

Fields

Field

Type

Order

Details

procedure_occurrence_id

HASH

1

hash(person_id, provider_id, procedure_concept_code, procedure_concept_codeSystem, procedure_date, procedure_datetime, procedure_occurrence_id_root, procedure_occurrence_id_extension)

person_id

FK

2

FK → person_id

procedure_concept_id

DERIVED

3

VT.codemap_xwalk_concept_id(concept_code=procedure_concept_code, vocabulary_oid=procedure_concept_codeSystem)

procedure_date

PRIORITY

4

coalesce candidates by priority

procedure_datetime

PRIORITY

5

coalesce candidates by priority

procedure_type_concept_id

CONSTANT

6

32817

modifier_concept_id

None

7

quantity

None

8

provider_id

FK

9

FK → provider_id

visit_occurrence_id

FK

10

FK → visit_occurrence_id

visit_detail_id

None

11

procedure_source_value

DERIVED

12

VT.concat_fields(first_field=procedure_concept_code, second_field=procedure_concept_codeSystem)

procedure_source_concept_id

DERIVED

13

VT.codemap_xwalk_source_concept_id(concept_code=procedure_concept_code, vocabulary_oid=procedure_concept_codeSystem)

modifier_source_value

CONSTANT

14

data_partner_id

DERIVED

20

VT.get_data_partner_id(filename=filename)

filename

FILENAME

100

source XML filename

cfg_name

CONSTANT

101

PROCEDURE-from-procedure_observation

domain_id

DERIVED

VT.codemap_xwalk_domain_id(concept_code=procedure_concept_code, vocabulary_oid=procedure_concept_codeSystem)

procedure_concept_code

FIELD

hl7:code @code

procedure_concept_codeSystem

FIELD

hl7:code @codeSystem

procedure_date_eT

FIELD

hl7:effectiveTime @value [DATE] → priority [‘procedure_date’, 1]

procedure_date_high

FIELD

hl7:effectiveTime/hl7:high @value [DATE] → priority [‘procedure_date’, 3]

procedure_date_low

FIELD

hl7:effectiveTime/hl7:low @value [DATE] → priority [‘procedure_date’, 2]

procedure_datetime_eT

FIELD

hl7:effectiveTime @value [DATETIME] → priority [‘procedure_datetime’, 1]

procedure_datetime_high

FIELD

hl7:effectiveTime/hl7:high @value [DATETIME] → priority [‘procedure_datetime’, 3]

procedure_datetime_low

FIELD

hl7:effectiveTime/hl7:low @value [DATETIME] → priority [‘procedure_datetime’, 2]

procedure_occurrence_id_extension

FIELD

hl7:id[not(@nullFlavor="UNK")] @extension

procedure_occurrence_id_root

FIELD

hl7:id[not(@nullFlavor="UNK")] @root

Config type reference

config_type

Meaning

ROOT

Defines the XPath root element for this config

FIELD

Extracts an XML attribute value via XPath

DERIVED

Computed by a Python function from other fields

HASH

MD5/hash of a set of fields, used as a surrogate key

FK

Foreign key copied from a joined dataset

CONSTANT

Fixed literal value written to every row

PRIORITY

Coalesces the first non-null value from prioritized candidates

FILENAME

The source XML filename

None

Not populated (placeholder)