feat: ✨ add ability to download data dict from REDCap#33
feat: ✨ add ability to download data dict from REDCap#33martonvago wants to merge 8 commits intomainfrom
Conversation
scripts/redcap.py
Outdated
|
|
||
| def get_data_dict_from_redcap() -> dict[str, str]: | ||
| """Gets the data dictionary from REDCap.""" | ||
| token = os.environ.get("REDCAP_TOKEN") |
There was a problem hiding this comment.
Currently, the token has CPH_API_KEY in the name on GenomeDK. Should we keep the reference to CPH? I went with a more general name here.
There was a problem hiding this comment.
I think for the generic code we should use the more general name, for the implementation of this code on ON LiMiT Feasibility we'll need to know that this is the code for the instance on REDCap in Copenhagen. Later there will be tokens for Copenhagen, Aarhus and Odense.
There was a problem hiding this comment.
Will all the locations be in the same repo or different repos?
There was a problem hiding this comment.
All the REDCap locations will pull into this one Data Package repo, as far I know.
There was a problem hiding this comment.
Ah okay! The metadata will be exactly the same, right (it's enough to get it from one location)? Then I will change the token name back to the CPH-specific one.
lwjohnst86
left a comment
There was a problem hiding this comment.
Nice, just some minor comments
scripts/redcap.py
Outdated
|
|
||
| def get_data_dict_from_redcap() -> dict[str, str]: | ||
| """Gets the data dictionary from REDCap.""" | ||
| token = os.environ.get("REDCAP_TOKEN") |
There was a problem hiding this comment.
All the REDCap locations will pull into this one Data Package repo, as far I know.
|
@martonvago you can also include the downloaded |
| if __name__ == "__main__": | ||
| save_data_dict() |
There was a problem hiding this comment.
To be able to run it from the justfile nicely. We can also call other functions (e.g., getting form metadata) from here later.
@lwjohnst86 as in include it in the repo? Oh I'm stupid I was thinking why would I include the test metadata. But you meant the real metadata 🤦 |
| "format": "json", | ||
| "returnFormat": "json", | ||
| } | ||
| response = requests.post("https://redcap.au.dk/api/", data=data, timeout=30) |
There was a problem hiding this comment.
Is this the address of the real API?
I tried running the script on GenomeDK with the CPH token and got forbidden. The test setup works on GenomeDK.
Description
This PR adds the ability to download the data dict from REDCap.
Closes #24
This PR needs an in-depth review.
Checklist
just run-all