From fbb7557b6fd85b97648673d7c732e21c22f20c4c Mon Sep 17 00:00:00 2001 From: Evanette Burrows Date: Fri, 1 Dec 2023 15:07:51 -0500 Subject: [PATCH] Update documentation to include visit tables --- docs/articles/Measurement.html | 2 +- docs/articles/visit_detail.html | 8 ++++---- docs/articles/visit_occurrence.html | 11 ++++++----- docs/pkgdown.yml | 2 +- vignettes/Measurement.Rmd | 2 +- vignettes/visit_detail.Rmd | 6 +++--- vignettes/visit_occurrence.Rmd | 8 ++++---- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/articles/Measurement.html b/docs/articles/Measurement.html index ad91a09..7dede44 100644 --- a/docs/articles/Measurement.html +++ b/docs/articles/Measurement.html @@ -292,7 +292,7 @@

Reading from observations.csv measurement_id - +Autogenerated diff --git a/docs/articles/visit_detail.html b/docs/articles/visit_detail.html index 6152872..f7d8a25 100644 --- a/docs/articles/visit_detail.html +++ b/docs/articles/visit_detail.html @@ -199,7 +199,7 @@

Reading from Synthea table en provider_id -encounters.provider_id +encounters.provider @@ -236,13 +236,13 @@

Reading from Synthea table en preceding_visit_detail__id -lag(av.visit_occurrence_id) over(partition by p.person_id order by -av.visit_start_date) + 1000000 +lag(all_visits.visit_occurrence_id) over(partition by +person.person_id order by all_visits.visit_start_date) + 1000000 visit_detail_source_value -encounter_id +all_visits.encounter_id diff --git a/docs/articles/visit_occurrence.html b/docs/articles/visit_occurrence.html index 6a5dbcd..a8ce8df 100644 --- a/docs/articles/visit_occurrence.html +++ b/docs/articles/visit_occurrence.html @@ -151,7 +151,8 @@

STEP 1 Sort data in ascending order by PATIENT, START, END. 2. Then by PERSON_ID take START as VISIT_START_DATE, MAX(END) as VISIT_END_DATE, and ‘OP’ as PLACE_OF_SERVICE_SOURCE_VALUE.

-

Use logic found here: https://github.com/OHDSI/ETL-Synthea/blob/main/inst/sql/sql_server/cdm_version/v540/AllVisitTable.sql

+

Use logic found here (depending on cdm version - CDM v5.4 provided as +example): https://github.com/OHDSI/ETL-Synthea/blob/main/inst/sql/sql_server/cdm_version/v540/AllVisitTable.sql

@@ -216,9 +217,9 @@

STEP 1

- + @@ -234,7 +235,7 @@

STEP 1

- + @@ -271,8 +272,8 @@

STEP 1

- + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index aa3658f..1e7b41f 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -16,5 +16,5 @@ articles: provider: provider.html visit_detail: visit_detail.html visit_occurrence: visit_occurrence.html -last_built: 2023-11-30T22:40Z +last_built: 2023-12-01T20:06Z diff --git a/vignettes/Measurement.Rmd b/vignettes/Measurement.Rmd index c3913f6..d864072 100644 --- a/vignettes/Measurement.Rmd +++ b/vignettes/Measurement.Rmd @@ -40,7 +40,7 @@ vignette: > | Destination Field | Source field | Logic | Comment field | | --- | --- | --- | --- | -| measurement_id | | | | +| 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 | | | diff --git a/vignettes/visit_detail.Rmd b/vignettes/visit_detail.Rmd index 9beca9c..ad159db 100644 --- a/vignettes/visit_detail.Rmd +++ b/vignettes/visit_detail.Rmd @@ -27,13 +27,13 @@ https://github.com/OHDSI/ETL-Synthea/blob/main/inst/sql/sql_server/cdm_version/v | 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). | | -| provider_id | encounters.provider_id | | | +| provider_id | encounters.provider | | | | care_site_id | | Set to null for all records | | | admitted_from_source_concept_id | | Set to 0 for all records | | | admitted_from_source_value | | Set to null for all record | | | discharged_to_concept_id | | Set to 0 for all records | | | discharged_to_source_value | | Set to null for all record | | -| preceding_visit_detail__id | | lag(av.visit_occurrence_id) over(partition by p.person_id order by av.visit_start_date) + 1000000 | | -| visit_detail_source_value | encounter_id | | | +| preceding_visit_detail__id | | lag(all_visits.visit_occurrence_id) over(partition by person.person_id order by all_visits.visit_start_date) + 1000000 | | +| visit_detail_source_value | all_visits.encounter_id | | | | visit_detail_source_concept_id | | Set to 0 for all record | | diff --git a/vignettes/visit_occurrence.Rmd b/vignettes/visit_occurrence.Rmd index 104635a..cc6c83c 100644 --- a/vignettes/visit_occurrence.Rmd +++ b/vignettes/visit_occurrence.Rmd @@ -33,7 +33,7 @@ For claim type in ('ambulatory', 'wellness', 'outpatient') (OP) 1. Sort data in ascending order by PATIENT, START, END. 2. Then by PERSON_ID take START as VISIT_START_DATE, MAX(END) as VISIT_END_DATE, and ‘OP’ as PLACE_OF_SERVICE_SOURCE_VALUE. -Use logic found here: +Use logic found here (depending on cdm version - CDM v5.4 provided as example): https://github.com/OHDSI/ETL-Synthea/blob/main/inst/sql/sql_server/cdm_version/v540/AllVisitTable.sql | Destination Field | Source field | Logic | Comment field | @@ -45,14 +45,14 @@ 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 44818517 (Visit derived from encounter on claim). | | | provider_id |encounters.provider | | | | care_site_id | | Set to null for all records | | -| visit_source_value | encounters.id | | | +| visit_source_value | all_visits.encounters_id | | | | visit_source_concept_id | | Set to 0 for all records | | | admitted_from_concept_id | | Set to 0 for all records | | | admitted_from_source_value | | Set to null for all records | | | discharge_to_concept_id | | Set to 0 for all records | | | discharge_to_source_value | | Set to null for all records | | -| preceding_visit_occurrence_id | |lag(av.visit_occurrence_id) over(partition by p.person_id order by av.visit_start_date) | | +| preceding_visit_occurrence_id | |lag(all_visits.visit_occurrence_id) over(partition by person.person_id order by all_visits.visit_start_date) | |
visit_type_concept_id Set all records as concept_id 44818517 (Visit derived from encounter on claim).
provider_id
visit_source_valueencounters.idall_visits.encounters_id
preceding_visit_occurrence_id lag(av.visit_occurrence_id) over(partition by p.person_id order by -av.visit_start_date)lag(all_visits.visit_occurrence_id) over(partition by +person.person_id order by all_visits.visit_start_date)