Skip to content

Commit 95d0ad6

Browse files
authored
[ALS-5979] AIM-AHEAD PIC-SURE: Downloaded dataset seems incorrect (#161)
* 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
1 parent 174913e commit 95d0ad6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/auth/FENCEAuthenticationService.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,18 @@ private Privilege upsertClinicalPrivilege(String studyIdentifier, String project
514514
+"\":[\""
515515
+studyIdentifierField
516516
+"\"]},"
517-
+"\"numericFilters\":{},\"requiredFields\":[],"
518-
+"\"fields\":[\"" + parentAccessionField + "\"],"
519-
+"\"variantInfoFilters\":[{\"categoryVariantInfoFilters\":{},\"numericVariantInfoFilters\":{}}],"
517+
+"\"numericFilters\":{},\"requiredFields\":[],";
518+
519+
if("fence".equalsIgnoreCase(JAXRSConfiguration.idp_provider)) {
520+
queryTemplateText += "\"fields\":[\"" + parentAccessionField + "\"],";
521+
} else {
522+
queryTemplateText += "\"fields\":[],";
523+
}
524+
525+
queryTemplateText+="\"variantInfoFilters\":[{\"categoryVariantInfoFilters\":{},\"numericVariantInfoFilters\":{}}],"
520526
+"\"expectedResultType\": \"COUNT\""
521527
+"}";
528+
522529
priv.setQueryTemplate(queryTemplateText);
523530
if(isHarmonized) {
524531
priv.setQueryScope("[\"" + conceptPath + "\",\"_\",\"" + fence_harmonized_concept_path + "\"]");

0 commit comments

Comments
 (0)