diff --git a/inst/sql/sql_server/cdm_version/v531/insert_death.sql b/inst/sql/sql_server/cdm_version/v531/insert_death.sql index 8f61553..9c280cb 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_death.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_death.sql @@ -22,7 +22,7 @@ insert into @cdm_schema.death ( select p.person_id person_id, e.start death_date, e.start death_datetime, - 38003566 death_type_concept_id, + 32817 death_type_concept_id, srctostdvm.target_concept_id cause_concept_id, e.reasoncode cause_source_value, srctostdvm.source_concept_id cause_source_concept_id diff --git a/inst/sql/sql_server/cdm_version/v531/insert_device_exposure.sql b/inst/sql/sql_server/cdm_version/v531/insert_device_exposure.sql index 44a02cf..9cc4e4d 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_device_exposure.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_device_exposure.sql @@ -25,7 +25,7 @@ d.start device_exposure_start_date, d.start device_exposure_start_datetime, d.stop device_exposure_end_date, d.stop device_exposure_end_datetime, -38000267 device_type_concept_id, +32827 device_type_concept_id, d.udi unique_device_id, cast(null as int) quantity, pr.provider_id provider_id, diff --git a/inst/sql/sql_server/cdm_version/v531/insert_drug_exposure.sql b/inst/sql/sql_server/cdm_version/v531/insert_drug_exposure.sql index ec89516..ee97d2e 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_drug_exposure.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_drug_exposure.sql @@ -60,7 +60,7 @@ m.start drug_exposure_start_datetime, coalesce(m.stop,m.start) drug_exposure_end_date, coalesce(m.stop,m.start) drug_exposure_end_datetime, m.stop verbatim_end_date, -32869 drug_type_concept_id, +32838 drug_type_concept_id, cast(null as varchar) stop_reason, 0 refills, 0 quantity, @@ -105,7 +105,7 @@ i.date drug_exposure_start_datetime, i.date drug_exposure_end_date, i.date drug_exposure_end_datetime, i.date verbatim_end_date, -32869 drug_type_concept_id, +32827 drug_type_concept_id, cast(null as varchar) stop_reason, 0 refills, 0 quantity, diff --git a/inst/sql/sql_server/cdm_version/v531/insert_measurement.sql b/inst/sql/sql_server/cdm_version/v531/insert_measurement.sql index b50cca0..40718b5 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_measurement.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_measurement.sql @@ -59,7 +59,7 @@ select pr.start measurement_time, } - 38000267 measurement_type_concept_id, + 32827 measurement_type_concept_id, 0 operator_concept_id, cast(null as float) value_as_number, 0 value_as_concept_id, @@ -101,7 +101,7 @@ select o.date measurement_date, o.date measurement_datetime, o.date measurement_time, - 38000267 measurement_type_concept_id, + 32827 measurement_type_concept_id, 0 operator_concept_id, case when isnumeric(o.value) = 1 diff --git a/inst/sql/sql_server/cdm_version/v531/insert_observation.sql b/inst/sql/sql_server/cdm_version/v531/insert_observation.sql index 5aa917b..9c821c8 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_observation.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_observation.sql @@ -44,7 +44,7 @@ p.person_id person_id, srctostdvm.target_concept_id observation_concept_id, a.start observation_date, a.start observation_datetime, -38000280 observation_type_concept_id, +32827 observation_type_concept_id, cast(null as float) value_as_number, cast(null as varchar) value_as_string, 0 value_as_concept_id, diff --git a/inst/sql/sql_server/cdm_version/v531/insert_observation_period.sql b/inst/sql/sql_server/cdm_version/v531/insert_observation_period.sql index ca1b8f2..7c901b8 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_observation_period.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_observation_period.sql @@ -11,7 +11,7 @@ select row_number()over(order by person_id), person_id, start_date, end_date, - 44814724 period_type_concept_id + 32882 period_type_concept_id from ( select p.person_id, min(e.start) start_date, diff --git a/inst/sql/sql_server/cdm_version/v531/insert_procedure_occurrence.sql b/inst/sql/sql_server/cdm_version/v531/insert_procedure_occurrence.sql index 9a8aeb6..82abb4e 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_procedure_occurrence.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_procedure_occurrence.sql @@ -30,7 +30,7 @@ pr.start procedure_date, pr.start procedure_datetime, } -38000267 procedure_type_concept_id, +32827 procedure_type_concept_id, 0 modifier_concept_id, cast(null as integer) quantity, prv.provider_id provider_id, diff --git a/inst/sql/sql_server/cdm_version/v531/insert_visit_detail.sql b/inst/sql/sql_server/cdm_version/v531/insert_visit_detail.sql index 008a9cf..855347f 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_visit_detail.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_visit_detail.sql @@ -42,7 +42,7 @@ select av.visit_start_date visit_detail_start_datetime, av.visit_end_date visit_detail_end_date, av.visit_end_date visit_detail_end_datetime, - 44818517 visit_detail_type_concept_id, + 32827 visit_detail_type_concept_id, pr.provider_id provider_id, null care_site_id, 0 admitting_source_concept_id, diff --git a/inst/sql/sql_server/cdm_version/v531/insert_visit_occurrence.sql b/inst/sql/sql_server/cdm_version/v531/insert_visit_occurrence.sql index a35b58c..567f856 100644 --- a/inst/sql/sql_server/cdm_version/v531/insert_visit_occurrence.sql +++ b/inst/sql/sql_server/cdm_version/v531/insert_visit_occurrence.sql @@ -35,7 +35,7 @@ select av.visit_start_date, av.visit_end_date, av.visit_end_date, - 44818517, + 32827, pr.provider_id, null, av.encounter_id, diff --git a/inst/sql/sql_server/cdm_version/v540/insert_death.sql b/inst/sql/sql_server/cdm_version/v540/insert_death.sql index 8f61553..9c280cb 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_death.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_death.sql @@ -22,7 +22,7 @@ insert into @cdm_schema.death ( select p.person_id person_id, e.start death_date, e.start death_datetime, - 38003566 death_type_concept_id, + 32817 death_type_concept_id, srctostdvm.target_concept_id cause_concept_id, e.reasoncode cause_source_value, srctostdvm.source_concept_id cause_source_concept_id diff --git a/inst/sql/sql_server/cdm_version/v540/insert_device_exposure.sql b/inst/sql/sql_server/cdm_version/v540/insert_device_exposure.sql index ad7fbb4..e60d6dc 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_device_exposure.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_device_exposure.sql @@ -29,7 +29,7 @@ d.start device_exposure_start_date, d.start device_exposure_start_datetime, d.stop device_exposure_end_date, d.stop device_exposure_end_datetime, -38000267 device_type_concept_id, +32827 device_type_concept_id, d.udi unique_device_id, cast(null as varchar) production_id, cast(null as int) quantity, diff --git a/inst/sql/sql_server/cdm_version/v540/insert_drug_exposure.sql b/inst/sql/sql_server/cdm_version/v540/insert_drug_exposure.sql index ec89516..ee97d2e 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_drug_exposure.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_drug_exposure.sql @@ -60,7 +60,7 @@ m.start drug_exposure_start_datetime, coalesce(m.stop,m.start) drug_exposure_end_date, coalesce(m.stop,m.start) drug_exposure_end_datetime, m.stop verbatim_end_date, -32869 drug_type_concept_id, +32838 drug_type_concept_id, cast(null as varchar) stop_reason, 0 refills, 0 quantity, @@ -105,7 +105,7 @@ i.date drug_exposure_start_datetime, i.date drug_exposure_end_date, i.date drug_exposure_end_datetime, i.date verbatim_end_date, -32869 drug_type_concept_id, +32827 drug_type_concept_id, cast(null as varchar) stop_reason, 0 refills, 0 quantity, diff --git a/inst/sql/sql_server/cdm_version/v540/insert_measurement.sql b/inst/sql/sql_server/cdm_version/v540/insert_measurement.sql index 223a0b4..1b80ee4 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_measurement.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_measurement.sql @@ -65,7 +65,7 @@ select pr.start measurement_time, } - 38000267 measurement_type_concept_id, + 32827 measurement_type_concept_id, 0 operator_concept_id, cast(null as float) value_as_number, 0 value_as_concept_id, @@ -111,7 +111,7 @@ select o.date measurement_date, o.date measurement_datetime, o.date measurement_time, - 38000267 measurement_type_concept_id, + 32827 measurement_type_concept_id, 0 operator_concept_id, case when isnumeric(o.value) = 1 diff --git a/inst/sql/sql_server/cdm_version/v540/insert_observation.sql b/inst/sql/sql_server/cdm_version/v540/insert_observation.sql index fad1aa2..495ffdf 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_observation.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_observation.sql @@ -51,7 +51,7 @@ p.person_id person_id, srctostdvm.target_concept_id observation_concept_id, a.start observation_date, a.start observation_datetime, -38000280 observation_type_concept_id, +32827 observation_type_concept_id, cast(null as float) value_as_number, cast(null as varchar) value_as_string, 0 value_as_concept_id, diff --git a/inst/sql/sql_server/cdm_version/v540/insert_observation_period.sql b/inst/sql/sql_server/cdm_version/v540/insert_observation_period.sql index ca1b8f2..7c901b8 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_observation_period.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_observation_period.sql @@ -11,7 +11,7 @@ select row_number()over(order by person_id), person_id, start_date, end_date, - 44814724 period_type_concept_id + 32882 period_type_concept_id from ( select p.person_id, min(e.start) start_date, diff --git a/inst/sql/sql_server/cdm_version/v540/insert_procedure_occurrence.sql b/inst/sql/sql_server/cdm_version/v540/insert_procedure_occurrence.sql index 1e3b809..344888a 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_procedure_occurrence.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_procedure_occurrence.sql @@ -36,7 +36,7 @@ pr.stop procedure_end_date, pr.stop procedure_end_datetime, } -38000267 procedure_type_concept_id, +32827 procedure_type_concept_id, 0 modifier_concept_id, cast(null as integer) quantity, prv.provider_id provider_id, diff --git a/inst/sql/sql_server/cdm_version/v540/insert_visit_detail.sql b/inst/sql/sql_server/cdm_version/v540/insert_visit_detail.sql index ee03f0f..36ef00f 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_visit_detail.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_visit_detail.sql @@ -42,7 +42,7 @@ select av.visit_start_date visit_detail_start_datetime, av.visit_end_date visit_detail_end_date, av.visit_end_date visit_detail_end_datetime, - 44818517 visit_detail_type_concept_id, + 32827 visit_detail_type_concept_id, pr.provider_id provider_id, null care_site_id, 0 admitted_from_source_concept_id, diff --git a/inst/sql/sql_server/cdm_version/v540/insert_visit_occurrence.sql b/inst/sql/sql_server/cdm_version/v540/insert_visit_occurrence.sql index 6e5850a..055c663 100644 --- a/inst/sql/sql_server/cdm_version/v540/insert_visit_occurrence.sql +++ b/inst/sql/sql_server/cdm_version/v540/insert_visit_occurrence.sql @@ -35,7 +35,7 @@ select av.visit_start_date, av.visit_end_date, av.visit_end_date, - 44818517, + 32827, pr.provider_id, null, av.encounter_id, diff --git a/vignettes/Device_exposure.Rmd b/vignettes/Device_exposure.Rmd index 9e162e6..005d369 100644 --- a/vignettes/Device_exposure.Rmd +++ b/vignettes/Device_exposure.Rmd @@ -22,7 +22,7 @@ vignette: > | device_exposure_start_datetime | start | | | | device_exposure_end_date | stop | | | | device_exposure_end_datetime | stop | | | -| device_type_concept_id | | Set to 38000267 (Outpatient Detail) for all records | | +| device_type_concept_id | | Set to 32827 (EHR encounter record) for all records | | | unique_device_id |udi | | | | quantity | | cast(null as integer) | | | provider_id | provider | Look up provider_id using provider, joining to the provider.provider_source_value field in the omop table | | diff --git a/vignettes/Drug_exposure.Rmd b/vignettes/Drug_exposure.Rmd index 2ae41bf..3dcdc01 100644 --- a/vignettes/Drug_exposure.Rmd +++ b/vignettes/Drug_exposure.Rmd @@ -23,7 +23,7 @@ vignette: > | drug_exposure_end_date | stop start | (coalesce(stop,start)) | | | drug_exposure_end_datetime | stop start |coalesce(stop,start) Use 00:00:00 as the time. | | | verbatim_end_date | stop | | | -| drug_type_concept_id | | |Use the concept_id 32869 (Pharmacy Claim). | +| drug_type_concept_id | | |Use the concept_id 32838 (EHR prescription). | | stop_reason | | | | | refills | | | | | quantity | | | | @@ -51,7 +51,7 @@ vignette: > | drug_exposure_end_date | date | | | | drug_exposure_end_datetime | date | Use 00:00:00 as the time. | | | verbatim_end_date | date | | | -| drug_type_concept_id | | | Use the concept_id 32869 (Pharmacy Claim). | +| drug_type_concept_id | | | Use the concept_id 32827 (EHR encounter record). | | stop_reason | | cast(null as varchar) | | | refills | | Set to 0 for all records | | | quantity | |Set to 0 for all record | | diff --git a/vignettes/Measurement.Rmd b/vignettes/Measurement.Rmd index d864072..9eb7a74 100644 --- a/vignettes/Measurement.Rmd +++ b/vignettes/Measurement.Rmd @@ -21,7 +21,7 @@ vignette: > | measurement_date | date (v2.7.0) start (v3.0.0) | | | | measurement_datetime | date (v2.7.0) start (v3.0.0) | Use 00:00:00 as the time. | | | measurement_time | date (v2.7.0) start (v3.0.0) | | | -| measurement_type_concept_id | | | Use concept_id 38000267 (Outpatient detail - 1st position) for all records | +| measurement_type_concept_id | | | Use concept_id 32827 (EHR encounter record) for all records | | operator_concept_id | | Set to 0 for all records | | | value_as_number | |cast(null as float) | | | value_as_concept_id | | Set to 0 for all records | | @@ -46,7 +46,7 @@ vignette: > | measurement_date | date | | | | measurement_datetime | date | Use 00:00:00 as time. | | | measurement_time | | | | -| measurement_type_concept_id | | | Use concept_id 38000267 (Outpatient detail - 1st position) for all records | +| 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 | | diff --git a/vignettes/death.Rmd b/vignettes/death.Rmd index e6b7464..a35aa5d 100644 --- a/vignettes/death.Rmd +++ b/vignettes/death.Rmd @@ -20,7 +20,7 @@ vignette: > | person_id | patient | Map by mapping person.person_source_value to patient. Find person.person_id by mapping encounters.patient to person.person_source_value. | | | | | death_date| start| | | | death_datetime | start | | | -| death_type_concept_id | | Set to 38003566 (Medical claim discharge status "Died") for all records | | +| death_type_concept_id | | Set to 32817 (EHR) for all records | | | cause_concept_id | reasoncode | Use the following SQL code to lookup target_concept_id in CTE_SOURCE_VOCAB_MAP: select csvm.target_concept_id from encounters e join cte_source_vocab_map csvm on csvm.source_code = e.reasoncode and csvm.target_domain_id = 'Condition' and csvm.source_domain_id = 'Condition' and csvm.target_vocabulary_id = 'SNOMED' and csvm.source_vocabulary_id = 'SNOMED' and csvm.target_invalid_reason is NULL and csvm.target_standard_concept = 'S' | | | cause_source_value | reasoncode | | | | cause_source_concept_id | reasoncode | Use the following SQL code to lookup source_concept_id in CTE_SOURCE_VOCAB_MAP: select csvm.source_concept_id from encounters e join cte_source_vocab_map csvm on csvm.source_code = e.reasoncode and csvm.target_domain_id = 'Condition' and csvm.source_domain_id = 'Condition' and csvm.target_vocabulary_id = 'SNOMED' and csvm.source_vocabulary_id = 'SNOMED' and csvm.target_invalid_reason is NULL and csvm.target_standard_concept = 'S' | | diff --git a/vignettes/observation.Rmd b/vignettes/observation.Rmd index 67e0bfa..02db7f4 100644 --- a/vignettes/observation.Rmd +++ b/vignettes/observation.Rmd @@ -72,7 +72,7 @@ vignette: > | observation_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 = 'Observation' and ctvm.target_vocabulary_id = 'LOINC' and ctvm.standard_concept_id = 'S' and ctvm.target_invalid_reason is null | | | observation_date | date | | | | observation_datetime | date | | | -| observation_type_concept_id | | Set as 38000280 (Observation recorded from EHR) for all records. | | +| observation_type_concept_id | | Set as 32827 (EHR encounter record) for all records. | | | value_as_number | | cast(null as float) | | | value_as_string | | cast(null as varchar) | | | value_as_concept_id | | Set as 0 for all records | | diff --git a/vignettes/observation_period.Rmd b/vignettes/observation_period.Rmd index 70227f8..a0681fd 100644 --- a/vignettes/observation_period.Rmd +++ b/vignettes/observation_period.Rmd @@ -19,4 +19,4 @@ vignette: > | 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. | | | observation_period_start_date | start | min(start) group by patient Take the earliest START per patient | | | observation_period_end_date | stop | max(stop) group by patient Take the latest STOP per patient | | -| period_type_concept_id | | Set as concept 44814724 (Period covering healthcare encounters) for all records | | +| period_type_concept_id | | Set as concept 32882 (Standard algorithm from EHR) for all records | | diff --git a/vignettes/procedure_occurrence.Rmd b/vignettes/procedure_occurrence.Rmd index d9fcd35..1a4d4d2 100644 --- a/vignettes/procedure_occurrence.Rmd +++ b/vignettes/procedure_occurrence.Rmd @@ -22,7 +22,7 @@ vignette: > | procedure_datetime | date, start(v3.0.0) | Use 00:00:00 as the time. | | | procedure_end_date | stop(v3.0.0) | | | | procedure_end_datetime | stop(v3.0.0) | Use 00:00:00 as the time. | | -| procedure_type_concept_id | | | Use concept_id 38000267 (Outpatient detail - 1st position) for all records. | +| procedure_type_concept_id | | | Use concept_id 32827 (EHR encounter record) for all records. | | modifier_concept_id | | Set to 0 for all records | | | quantity | |cast(null as integer) | | | provider_id | encounters.provider | | | diff --git a/vignettes/visit_detail.Rmd b/vignettes/visit_detail.Rmd index ad159db..a135199 100644 --- a/vignettes/visit_detail.Rmd +++ b/vignettes/visit_detail.Rmd @@ -26,7 +26,7 @@ https://github.com/OHDSI/ETL-Synthea/blob/main/inst/sql/sql_server/cdm_version/v | visit_detail__start_datetime | start | | | | visi_detail_t_end_date | stop | | | | visit_detail__end_datetime | stop | | | -| visit__detail_type_concept_id | | Set all records as concept_id 44818517 (Visit derived from encounter on claim). | | +| visit__detail_type_concept_id | | Set all records as concept_id 32827 (EHR encounter record). | | | provider_id | encounters.provider | | | | care_site_id | | Set to null for all records | | | admitted_from_source_concept_id | | Set to 0 for all records | | diff --git a/vignettes/visit_occurrence.Rmd b/vignettes/visit_occurrence.Rmd index cc6c83c..8c17606 100644 --- a/vignettes/visit_occurrence.Rmd +++ b/vignettes/visit_occurrence.Rmd @@ -45,7 +45,7 @@ https://github.com/OHDSI/ETL-Synthea/blob/main/inst/sql/sql_server/cdm_version/v | visit_start_datetime | start | | | | visit_end_date | stop | | | | visit_end_datetime | stop | | | -| visit_type_concept_id | | Set all records as concept_id 44818517 (Visit derived from encounter on claim). | | +| visit_type_concept_id | | Set all records as concept_id 32827 (EHR encounter record). | | | provider_id |encounters.provider | | | | care_site_id | | Set to null for all records | | | visit_source_value | all_visits.encounters_id | | |