sara-chronister / syndrome-definition-evaluation

R code for evaluation of NSSP BioSense ESSENCE syndrome definition results using ESSENCE APIs.
13 stars 5 forks source link

Issue with no visits being shown in exported CSV files for overlapping definitions #13

Closed DOH-TJB0303 closed 10 months ago

DOH-TJB0303 commented 11 months ago

An exported .csv file in the Output_TwoDefs subfolder was not properly writing. Specificially, the .csv file displaying the overlap between def1 and def2. The file would write to the folder, but with 0 records (when the overlap had >= 1 records).

It appears that this problem does not exist for Output_ThreeDefs syndrome evaluation template, however I noticed that Output_ThreeDefs does not have a .csv file for overlap between all 3 definitions examined (def1, def2, and def3), there are only overlap data sets when comparing between 2 definitions.

DOH-TJB0303 commented 11 months ago

Error in Output_TwoDefs appears to be related in the final write_csv() chunk where the code calls:

write.csv(file = paste0("Output_TwoDefs/",def1_short," and ",def2_short," Visits.csv"), x = two_defs_table[two_defs_table$def1_def2==1,], row.names = FALSE)

However, the $def1_def2 variable does not exist (instead the variable $Both was created earlier in the script to indicate overlap between the definitions.