Epiconcept-Paris / STRAP-epiuf

Utility function package for STRAP
0 stars 0 forks source link

whoSendsThis function added #116

Open epi-jhd opened 4 months ago

epi-jhd commented 4 months ago

' Description

' The aim of this function to is to quickly ascertain which dictionaries- in a

' specified folder contain your searchterm.

'

' This function looks into the specified file location, and then opens each dictionary

' in turn as specified by the dictionary_root_filename and filetags. Once opened it

' performs a grep search for the searchterm in the source_name and the generic_name

' colunms and lists all matching variablenames in a table.

I've tried to make this function be reasonably universal, but it does assume you have your dictionaries in one place, with the same basic filename that only changes at the end by the filetag. For this reason I'm not sure it's good for epiuf in its current state, but i'm not sure how to improve it! Love to hear your thoughts and ideas :)

(ps. I've not done documentation yet in case we don't end up including it)

epi-jhd commented 4 months ago

Real world example of usage: We are in the process of changing how we report lab data to Paco and Aryse. Half the sites are using the old method (send direct to Paco and Aryse) and half the sites are using the new method (send to us in their patients data, we collate, then send to Paco and Aryse). There is a loooong email thread with most of the sites responding/discussing what they will do - ie VERY hard to reliably extract the information. I could open and check each dictionary, but again, time consuming and error prone. So instead I type: whoSendsThis("gis", [countrylist], [my dictionary file location], [my dictionary file name]) And get this output. I can even use it to check that I have been uniform in how I name the variables!

image

epi-gde commented 1 month ago

Seem to work , could be improved (making it more generic) by using a pattern instead of a root path and a list of tags but this could be done later if it's needed.
can be merged ;)