-
Notifications
You must be signed in to change notification settings - Fork 49
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
Added fuzzymatching to AttributesUtil.java #91
Changes from 2 commits
2c67d6f
2a12abe
7e72202
6f40a19
095b210
a7816fc
3e9a940
9e0a97d
411efa0
2e881f8
5ccd1a3
567129d
bc47573
7acbd07
fb20575
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ public class AttributesUtil { | |
|
||
private static final int INSTANCES_LIMIT = 50000; | ||
private static final int STUDIES_SERIES_LIMIT = 5000; | ||
|
||
private static final String FUZZY_MATCHING = "true"; | ||
|
||
public static String getTagValue(JSONObject json, String tag) throws JSONException { | ||
JSONObject jsonTag = json.getJSONObject(tag); | ||
|
@@ -118,9 +120,19 @@ public static String attributesToQidoPath(Attributes attrs, String... includeFie | |
switch (attrs.getString(Tag.QueryRetrieveLevel)) { | ||
case "STUDY": | ||
qidoPath.append("studies?limit=" + STUDIES_SERIES_LIMIT + "&"); | ||
|
||
if (FUZZY_MATCHING == "true") { | ||
qidoPath.append("fuzzymatching=true" + "&"); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can also append fuzzy matching for an instances level retrieval, so I think this if statement could be moved outside of the switch statement, since it would apply for all query retrieve levels There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I have tried adding it out of the switch, but I got a build failure for doing fuzzy matching at INSTANCE level. That's why I put it inside STUDY and SERIES level. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the build failure? It might be a unit test that needs to be updated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is a unit test. expected: instances?limit=50000&00080061=MG& There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, can you please update the tests as well so that the build passes with fuzzy matching enabled for all three retrieval levels? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per our discussion I have added the fuzzymatching attribute to Flags and referenced it in code. Let me know if everything looks OK after you reviewed my changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please add unit tests to check what url is have or have not fuzzymatching parameter on different retrieval levels? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1, please add a unit test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good overall though. I'm not sure why the contributor license agreement presubmit check isn't running, I'll need to figure that out before we submit this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added unit test for fuzzy matching. |
||
break; | ||
case "SERIES": | ||
qidoPath.append("series?limit=" + STUDIES_SERIES_LIMIT + "&"); | ||
|
||
if (FUZZY_MATCHING == "true") { | ||
qidoPath.append("fuzzymatching=true" + "&"); | ||
} | ||
|
||
break; | ||
case "IMAGE": | ||
qidoPath.append("instances?limit=" + INSTANCES_LIMIT + "&"); | ||
|
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 we make this a boolean flag registered in https://github.com/GoogleCloudPlatform/healthcare-dicom-dicomweb-adapter/blob/master/import/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/Flags.java so that users could enable or disable it if their backend doesn't support the fuzzy matching parameter?
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.
Yes that's a good idea, I'll make that change and will request your review.