Skip to main content Link Search Menu Expand Document (external link)

Table name: visit_occurrence

Reading from covid19_tpp_gp_clinical and covid19_tpp_gp_scripts

We assume that a person can have only one gp visit per day. To get all the visits, we take the union of covia19_tpp_gp_clinical and covia19_tpp_gp_scripts. Then we map each unique combination of eid and event_dt/issue_date as visit. If the event_dt or issue_date is not given, no visit is created.

Destination Field Source field Logic Comment field
visit_occurrence_id eid
covia19_tpp_gp_clinical.event_dt
covia19_tpp_gp_scripts.issue_date
Concatenate ‘5’, eid and the date in YYYYMMDD format  
person_id eid    
visit_concept_id     38004453 - Family Practice
visit_start_date covia19_tpp_gp_clinical.event_dt
covia19_tpp_gp_scripts.issue_date
If 1902-02-02 or 1903-03-3, set date to yob-07-01 (field 34 in baseline)  
visit_start_datetime covia19_tpp_gp_clinical.event_dt
covia19_tpp_gp_scripts.issue_date
   
visit_end_date covia19_tpp_gp_clinical.event_dt
covia19_tpp_gp_scripts.issue_date
If 1902-02-02 or 1903-03-3, set date to yob-07-01 (field 34 in baseline)  
visit_end_datetime covia19_tpp_gp_clinical.event_dt
covia19_tpp_gp_scripts.issue_date
   
visit_type_concept_id     32827 - ‘EHR encounter record’
provider_id      
care_site_id      
visit_source_value      
visit_source_concept_id      
admitting_source_concept_id      
admitting_source_value      
discharge_to_concept_id      
discharge_to_source_value      
preceding_visit_occurrence_id      
data_source     covid19 gp_tpp

EHDEN ETL UKB v0.1 | Copyright © The Hyve