Only retrieve entire CT study when:

#62 Merged at bc690a7
  1. Tim de Wit
  • not containing SR series AND
  • not containing series with seriesdescription "dose info" AND
  • seriesdescriptions retrieved from PACS are supported (not Null)
Code Quality

Comments (9)

  1. Tim de Wit author

    Remaining bug (also present in previous version):'Now have {0} studies'.format(study_rsp.count()))

    does not report the correct number of remaining studies (studies containing no series were deleted and shouldn't not be counted).
    Movescu does use the correct list of series though, so it's merely a cosmetical issue.
    Note: without study.delete() movescu retrieves 1 series for all studies; also the ones where all series were deleted (!?)

  2. Ed McDonagh

    Thanks @tcdewit. I think your if statement could have an else for the following, to make it even better:

    • If has SR: delete other series
    • Else, If series description not null: keep just 'dose info'
    • Else for s in series: if NumberOfSeriesRelatedInstances >5, delete.

    This way Philips CT from PACS that don't return series descriptions should still be retrieved, whilst limiting the number of objects.

      1. Ed McDonagh

        That should probably be number_of_series_related_instances

        Serves me right for trying to collaborate from my phone!

        1. Tim de Wit author

          Ok, I'll change it immediately :) Strange though that python didn't give any error/warning message?

          1. Ed McDonagh

            I guess that depends on your development environment, otherwise you won't find out till you run the code and hit that statement!

  3. Ed McDonagh

    The other thing we need to be wary of is PACS systems that have radiologists reports saved as structured reports in PACS. I'm thinking that I need a setting per remote host as to whether one should assume a single SR is just the report. But I think that's a job for a different ticket!

  4. Ed McDonagh

    Merged in 63f3a79 to branch issue473testqueries so I can begin to set up some tests to look at this. I'll need to start breaking the function up to do that...