-
Notifications
You must be signed in to change notification settings - Fork 0
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
#162 add study id for runs #163
base: develop
Are you sure you want to change the base?
Conversation
Updated schema file for adding study id
Updated Data fetcher code to incorporate study id filter
Updated Search fields with study id
Updated Analysis with study id field
Updated Run repository to include study id related fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks like a couple places where changes are needed.
if (analysisId instanceof String) { | ||
return Mono.just(new Analysis((String) analysisId)); | ||
final Object studyId = values.get("studyId"); | ||
if (analysisId instanceof String && studyId instanceof String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to handle the cases with just analysisId or just studyId? I think they are both optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both are optional but for the Analysis object creation we need both the arguments..
|
||
// short circuit here since can't find runs for invalid analysisId | ||
if (isNullOrEmpty(analysisId) || !analysisId.equals(filerAnalysisId)) { | ||
if ((isNullOrEmpty(analysisId) || !analysisId.equals(filerAnalysisId)) | ||
&& (isNullOrEmpty(studyId) || !analysisId.equals(filterStudyId))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&& (isNullOrEmpty(studyId) || !analysisId.equals(filterStudyId))) { | |
&& (isNullOrEmpty(studyId) || !studyId.equals(filterStudyId))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the code. Can you please review.
.put( | ||
STUDY_ID, | ||
value -> { | ||
val q = new MultiMatchQueryBuilder(value, STUDY_SEARCH_FIELDS.toArray(String[]::new)); | ||
q.minimumShouldMatch("100%"); | ||
return q; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be TermQueryBuilder
instead of a MultiMatchQueryBuilder
? I think a run can have multiple analysis_id
s but only a single Study ID ever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a TermQueryBuilder also I have made the changes accordingly.
Updated Data fetchers code based on the review comments
Updated Run repository code based on the review comments
return Mono.just(new Analysis((String) analysisId, (String) studyId)); | ||
final Object studyId = values.get("studyId"); | ||
if (analysisId instanceof String || studyId instanceof String) { | ||
return Mono.just(new Analysis((String) analysisId, (String) studyId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just confirming before approval, will this handle properly null
values for analysisId and studyId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I have updated the Analysis.java constructor logic to check the null values.
Updated null check for analysisId and studyId
public Analysis(String analysisId, String studyId) { | ||
if (null!=analysisId) { | ||
this.analysisId = analysisId; | ||
} else { | ||
this.analysisId = ""; | ||
} | ||
if (null!=studyId) { | ||
this.studyId = studyId; | ||
} else { | ||
this.studyId = ""; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be accomplished with @AllArgsConstructor
and some annotations for default values? Its also possible that for the filters having null works better than empty string, might change the matching behavior.
Updated the code to incorporate the study id in runs filter and in runs method along with current analysis id filter