Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Dec 16, 2024
1 parent 27f56b4 commit 6b1ff76
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/regbot/fetch/clinical_trials.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,13 @@ def _format_study(study_input: dict) -> Study:


def _get_id(study_response: dict, url: str, i: int) -> str | None:
"""Extract NCT ID from study response
:param study_response: a single study response object
:param url: URL used to issue request
:param i: index of individual study within response to that URL
:return: NCT ID if available (should be, but we're being careful)
"""
study_id = (
study_response.get("protocolSection", {})
.get("identificationModule", {})
Expand All @@ -900,7 +907,6 @@ def _get_id(study_response: dict, url: str, i: int) -> str | None:
i,
url,
)
study_id = "<ID lookup failed>"
return study_id


Expand Down

0 comments on commit 6b1ff76

Please sign in to comment.