Skip to content

Commit

Permalink
Update documentation to include visit tables
Browse files Browse the repository at this point in the history
  • Loading branch information
burrowse committed Dec 1, 2023
1 parent fa75978 commit fbb7557
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/articles/Measurement.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/articles/visit_detail.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions docs/articles/visit_occurrence.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion vignettes/Measurement.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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 | | |
Expand Down
6 changes: 3 additions & 3 deletions vignettes/visit_detail.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |

8 changes: 4 additions & 4 deletions vignettes/visit_occurrence.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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) | |

0 comments on commit fbb7557

Please sign in to comment.