Skip to content

Instantly share code, notes, and snippets.

@rherrick
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rherrick/b1d2a6b9a23345294293 to your computer and use it in GitHub Desktop.
Save rherrick/b1d2a6b9a23345294293 to your computer and use it in GitHub Desktop.
Site-wide split PET-MR session configuration. This should only be used to test fail-over for sessions going to projects without project-specific scripts, since it adds a big "PSYCH-" prefix to the session name, which is silly.
{
"event": "dicomImport",
"content": "import org.dcm4che2.data.Tag\n\nlogger.info(\"Now running the site-wide splitPetMrSession script, I was passed ${defaultValue}\")\ndef sopClassUID = dicom.getString(Tag.SOPClassUID)\ndef modality = dicom.getString(Tag.Modality)\ndef seriesDescription = dicom.getString(Tag.SeriesDescription)\ndef isPet = \"PT\".equals(modality) || (\"1.3.12.2.1107.5.9.1\".equals(sopClassUID) && \"PET Start\".equals(seriesDescription))\nlogger.info(\"Found sopClassUID: ${sopClassUID}\")\nlogger.info(\"Found modality: ${modality}\")\nlogger.info(\"Found seriesDescription: ${seriesDescription}\")\nlogger.info(\"Found isPet: ${isPet}\")\ndef returnValue = \"PSYCH-${defaultValue}\"\nlogger.info(\"Result: ${returnValue} (cause I'm not actually doing much)\")\n\"${returnValue}\"\n",
"language": "groovy",
"languageVersion": "2.3.6"
}
@rherrick
Copy link
Author

rherrick commented Oct 7, 2014

This can be PUT to the server with a URL like this:

http://server/data/automation/scripts/splitPetMrSessionSite

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