Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIG-1803, DIG-1810: query fixes #55

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Query API for Katsu and HTSGet that allows for caching and pagination of calls.

[openapi spec on Swagger](https://editor.swagger.io/?url=https://raw.githubusercontent.com/CanDIG/query/main/query_server/openapi.yaml)

## Stack

- [Flask](http://flask.pocoo.org/)
Expand Down
13 changes: 8 additions & 5 deletions query_server/query_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ def query(treatment="", primary_site="", drug_name="", systemic_therapy_type="",
(systemic_therapy_type, "systemic_therapy_type"),
(exclude_cohorts, "exclude_cohorts")
]
params = {}
params = {
'page_size': PAGE_SIZE
}
for param in param_mapping:
if param[0] == "" or param[0] == []:
continue
Expand Down Expand Up @@ -430,7 +432,7 @@ def discovery_programs():
return fix_dicts(ret_val), 200

@app.route('/discovery/query')
def discovery_query(treatment="", primary_site="", systemic_therapy="", systemic_therapy_type="", chrom="", gene="", assembly="hg38", exclude_cohorts=[]):
def discovery_query(treatment="", primary_site="", drug_name="", chrom="", gene="", assembly="hg38", exclude_cohorts=[]):
url = f"{config.KATSU_URL}/v3/explorer/donors/"
headers = {}
for k in request.headers.keys():
Expand All @@ -440,11 +442,12 @@ def discovery_query(treatment="", primary_site="", systemic_therapy="", systemic
param_mapping = [
(treatment, "treatment_type"),
(primary_site, "primary_site"),
(systemic_therapy, "systemic_therapy_drug_name"),
(systemic_therapy_type, "systemic_therapy_type"),
(drug_name, "systemic_therapy_drug_name"),
(exclude_cohorts, "exclude_cohorts")
]
params = {}
params = {
"page_size": PAGE_SIZE
}
for param in param_mapping:
if param[0] == "" or param[0] == []:
continue
Expand Down