measurement_id |
|
Autogenerated |
|
person_id |
patient |
Map by mapping person.person_source_value to patient. Find
person.person_id by mapping encouters.patient to
person.person_source_value. |
|
measurement_concept_id |
code |
Use code to lookup target_concept_id in CTE_TARGET_VOCAB_MAP: select
ctvm.target_concept_id from observations o join cte_target_vocab_map
ctvm on ctvm.source_code = o.code and ctvm.target_domain_id =
‘Measurement’ and ctvm.target_standard_concept = ‘S’ and
ctvm.target_invalid_reason is NULL |
|
measurement_date |
date |
|
|
measurement_datetime |
date |
Use 00:00:00 as time. |
|
measurement_time |
|
|
|
measurement_type_concept_id |
|
|
Use concept_id 32827 (EHR encounter record) for all records |
operator_concept_id |
|
Set as 0 for all records |
|
value_as_number |
value |
|
|
value_as_concept_id |
value |
units |
Use code to lookup target_concept_id in CTE_TARGET_VOCAB_MAP: select
ctvm.target_concept_id from observations o join cte_target_vocab_map
ctvm on ctvm.source_code = o.value and ctvm.target_domain_id = ‘Meas
value’ and ctvm.target_standard_concept = ‘S’ and
ctvm.target_invalid_reason is NULL |
unit_concept_id |
units |
Use code to lookup target_concept_id in CTE_TARGET_VOCAB_MAP: select
ctvm.target_concept_id from observations o join cte_target_vocab_map
ctvm on ctvm.source_code = o.units and ctvm.target_vocabulary_id =
‘UCUM’ and ctvm.source_vocabulary_id = ‘UCUM’ and
ctvm.target_standard_concept = ‘S’ and ctvm.target_invalid_reason is
NULL |
|
range_low |
|
cast(null as float) |
|
range_high |
|
cast(null as float) |
|
provider_id |
encounters.provider_id |
|
|
visit_occurrence_id |
code |
Lookup visit_occurrence_id using encounter, joining to temp table
defined in final_visit_ids.sql. |
|
visit_detail_id |
code |
Lookup visit_occurrence_id using encounter, joining to temp table
defined in final_visit_ids.sql and add 1000000 |
|
measurement_source_value |
code |
|
|
measurement_source_concept_id |
code |
Use code to lookup source_concept_id in CTE_SOURCE_VOCAB_MAP: select
csvm.source_concept_id from cte_source_vocab_map csvm join observations
o on csvm.source_code = o.code and csvm.source_vocabulary_id =
‘SNOMED’ |
|
unit_source_value |
units |
|
|
value_source_value |
value |
|
|