Skip to content

Commit

Permalink
[ALS-5979] AIM-AHEAD PIC-SURE: Downloaded dataset seems incorrect (#161)
Browse files Browse the repository at this point in the history
* Refactor FENCEAuthenticationService to customize query fields

Different fields for queryTemplateText are set based on the idp_provider in FENCEAuthenticationService. The "?fields" parameter of the query is now conditionally filled, with it being set to the parentAccessionField if idp_provider equals "fence", and empty otherwise. This change provides more flexibility for FENCE authentication depending on the provider setting.

* Remove empty string for fields

* Flip equals to avoid npe
  • Loading branch information
Gcolon021 authored Mar 26, 2024
1 parent 174913e commit 95d0ad6
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,18 @@ private Privilege upsertClinicalPrivilege(String studyIdentifier, String project
+"\":[\""
+studyIdentifierField
+"\"]},"
+"\"numericFilters\":{},\"requiredFields\":[],"
+"\"fields\":[\"" + parentAccessionField + "\"],"
+"\"variantInfoFilters\":[{\"categoryVariantInfoFilters\":{},\"numericVariantInfoFilters\":{}}],"
+"\"numericFilters\":{},\"requiredFields\":[],";

if("fence".equalsIgnoreCase(JAXRSConfiguration.idp_provider)) {
queryTemplateText += "\"fields\":[\"" + parentAccessionField + "\"],";
} else {
queryTemplateText += "\"fields\":[],";
}

queryTemplateText+="\"variantInfoFilters\":[{\"categoryVariantInfoFilters\":{},\"numericVariantInfoFilters\":{}}],"
+"\"expectedResultType\": \"COUNT\""
+"}";

priv.setQueryTemplate(queryTemplateText);
if(isHarmonized) {
priv.setQueryScope("[\"" + conceptPath + "\",\"_\",\"" + fence_harmonized_concept_path + "\"]");
Expand Down

0 comments on commit 95d0ad6

Please sign in to comment.