diff --git a/README.md b/README.md index a85227b..9e729cb 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Conversion notes: WillisAPI Client is the python interface for Brooklyn Health’s WillisAPI. -Official documentation for WillisAPI Client can be found in the [Github Wiki](www.github.com/bklynhlth/willisapi_client/wiki). +Official documentation for WillisAPI Client can be found in the [Github Wiki](http://www.github.com/bklynhlth/willisapi_client/wiki). To learn more about Brooklyn Health or WillisAPI, visit [brooklyn.health](https://www.brooklyn.health) or [getintouch@brooklyn.health](mailto:getintouch@brooklyn.health). @@ -70,10 +70,10 @@ measures = willisapi.download(key, 'project_name') ``` -If you run into trouble while using the client, please raise it in the [Issues](www.github.com/bklynhlth/willisapi_client/issues) tab. +If you run into trouble while using the client, please raise it in the [Issues](http://www.github.com/bklynhlth/willisapi_client/issues) tab. *** Brooklyn Health is a small team of clinicians, scientists, and engineers based in Brooklyn, NY. -We develop and maintain [OpenWillis](www.github.com/bklynhlth/openwillis), an open source python library for digital health measurement. +We develop and maintain [OpenWillis](http://www.github.com/bklynhlth/openwillis), an open source python library for digital health measurement. diff --git a/tests/test.json b/tests/test.json index 5587526..32a4847 100644 --- a/tests/test.json +++ b/tests/test.json @@ -7,6 +7,15 @@ "participant": [ { "participant_Id": "pt_id_external", + "age": "age", + "sex": "sex", + "race": "race", + "study_arm": "study_arm", + "clinical_score_a": "clinical_score_a", + "clinical_score_b": "clinical_score_b", + "clinical_score_c": "clinical_score_c", + "clinical_score_d": "clinical_score_d", + "clinical_score_e": "clinical_score_e", "results": [ { "file_name": "test_video.mp4", diff --git a/willisapi_client/__version__.py b/willisapi_client/__version__.py index abda6a2..890f6f9 100644 --- a/willisapi_client/__version__.py +++ b/willisapi_client/__version__.py @@ -2,7 +2,7 @@ """ __client__ = "willisapi_client" -__latestVersion__ = "1.9" +__latestVersion__ = "1.9.1" __url__ = "https://github.com/bklynhlth/willsiapi_client" __short_description__ = "A Python client for willisapi" __content_type__ = "text/markdown" diff --git a/willisapi_client/services/download/download_utils.py b/willisapi_client/services/download/download_utils.py index 7209d8d..82a4365 100644 --- a/willisapi_client/services/download/download_utils.py +++ b/willisapi_client/services/download/download_utils.py @@ -91,6 +91,15 @@ def _get_pt_id_ext_and_num_records(response, pt): """ return ( response["project"]["participant"][pt]["participant_Id"], + response["project"]["participant"][pt]["age"], + response["project"]["participant"][pt]["sex"], + response["project"]["participant"][pt]["race"], + response["project"]["participant"][pt]["study_arm"], + response["project"]["participant"][pt]["clinical_score_a"], + response["project"]["participant"][pt]["clinical_score_b"], + response["project"]["participant"][pt]["clinical_score_c"], + response["project"]["participant"][pt]["clinical_score_d"], + response["project"]["participant"][pt]["clinical_score_e"], len(response["project"]["participant"][pt]["results"]), ) @@ -133,7 +142,21 @@ def _get_defined_columns(): column_names: A list of static column names of the dataframe ------------------------------------------------------------------------------------------------------ """ - return ["project_name", "pt_id_external", "filename", "time_collected"] + return [ + "project_name", + "pt_id_external", + "filename", + "time_collected", + "age", + "sex", + "race", + "study_arm", + "clinical_score_a", + "clinical_score_b", + "clinical_score_c", + "clinical_score_d", + "clinical_score_e", + ] def _get_summary_df_from_json(response, pt, rec, workflow_tag): """ @@ -226,16 +249,42 @@ def generate_response_df(data) -> Tuple[pd.DataFrame, str]: data ) for pt in range(0, num_pts): - (pt_id_ext, num_records) = DownloadUtils._get_pt_id_ext_and_num_records( - data, pt - ) + ( + pt_id_ext, + age, + sex, + race, + study_arm, + clinical_score_a, + clinical_score_b, + clinical_score_c, + clinical_score_d, + clinical_score_e, + num_records, + ) = DownloadUtils._get_pt_id_ext_and_num_records(data, pt) for rec in range(0, num_records): ( filename, time_collected, ) = DownloadUtils._get_filename_and_timestamp(data, pt, rec) main_df = pd.DataFrame( - [[project_name, pt_id_ext, filename, time_collected]], + [ + [ + project_name, + pt_id_ext, + filename, + time_collected, + age, + sex, + race, + study_arm, + clinical_score_a, + clinical_score_b, + clinical_score_c, + clinical_score_d, + clinical_score_e, + ] + ], columns=DownloadUtils._get_defined_columns(), )