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

DIMGeneric can output arbitrary JSON values in string properties #530

Open
Enet4 opened this issue Nov 25, 2021 · 0 comments
Open

DIMGeneric can output arbitrary JSON values in string properties #530

Enet4 opened this issue Nov 25, 2021 · 0 comments

Comments

@Enet4
Copy link
Collaborator

Enet4 commented Nov 25, 2021

In the event that one of the DICOM properties in the DIM output is the string of a valid JSON object, the DIMGeneric construct interprets that string as a JSON object when printing the aggregation result to JSON.

For instance, if the patient's name happens to be {"PatientName":"Anonymous"} by mistake, the output of a searchDIM request could be the following:

{
  "numResults": 1,
  "results": [
   {
      "id": "PID123",
      "name": {"PatientName": "Anonymous"},
      "gender": "O",
      "nStudies": 1,
      "birthdate": ""
    }
  ]
}

This is not likely to happen, but if it does, it affects the entire output schema of the /searchDIM service, thus breaking the search user interface.

This happens because json-lib reinterprets values in JSONObject too freely as JSON values if they fulfill certain criteria, and there doesn't appear to be an easy way to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant