This script integrates data from two different sources: design files and patient data collected from various sites. After flattening the data, it produces four distinct tables: Results, Variables, Scales, and Triggers. These tables can be exported as either CSV or XLSX files.
- Install
requirements.txtand further libraries when required.
pip install -r requirements.txt
- Load the JSON files into "input" folder located in "graphql-server".
- In
server.py, modify the version of design file to load, "Design_1_0_0" or "Design_1_0_1" (the specific lines to modify are clearly commented in the code), and run:
python server.py
-
Playground environment (optional). This environment enables to make customized queries from all JSON files directly from browser. To query directly from browser, select the main "query_design" and customize as required.
-
DESIGN Data. Copy the "query_design" content between ''' ... ''', located in the
main.pyinto the "URL for design data" and load.- URL for design data: http://localhost:8000/graphql/design_data
-
USERS Data. Copy the "query_JSON" content between ''' ... ''', located in the
main.pyinto the "URL for users data" and load.- URL for users data : http://localhost:8000/graphql/JSON_data
-
-
From
notes.txt, verify that all IDs included are present in the "design files." When needed, add any missing IDs to the design files and updatemain.py(the specific lines to modify are clearly commented in the code). -
Run
main.py.
python main.py