Workaround for "bug" in Agfa Impax 6.6 (maybe also other versions)

Issue #627 resolved
Luuk created an issue

While performing a c-find for studies (I only have this issue with CT studies) based on

ModalitiesInStudy='CT' Impax returns 41 studies for the past week

Modality = 'CT' Impax returns 464 studies for the past week

ModalitiesInStudy='CT' AND Modality='' (empty string) Impax returns 538 studies for the past week.

Based on the information from the PACS client the last one seems to be correct.

Now the interesting part is although it seems to match on ModalitiesInStudy correctly Impax returns an empty value for this tag using the last request.

Comments (12)

  1. Luuk reporter

    I would suggest (and I did locally on our production OpenREM server) to add in qrscu.py, in _query_for_each_modality, after d.ModalitiesInStudy = mod (line 553):

    d.Modality = ""
    

    To handle the empty values for ModalitiesInStudy and set the right value for modalities_returned and modality_matching, I would suggest to add after line 563 (modality_matching = False):

    if len(rsp.get_modalities_in_study()) == 0 or rsp.get_modalities_in_study()[0] == u'':
        modalities_returned = False  # At least no usefull return of modalities
    
  2. Ed McDonagh

    Were your tests in the description done using Offis DCMTK or similar @LuukO?

    I will need to check, but I think that with Sectra PACS, if you have a query with an inappropriate term in (such as Modality at study level), it will return nothing. If this is the case, in order to satisfy both systems there would need to be an optional flag!

    For the second code suggestion, would it not be the case that the code would never be executed? If rsp.get_modalities_in_study were a zero length or empty string, then it would be considered false, and therefore would not get past line 559 if rsp.get_modalities_in_study():?

  3. Luuk reporter

    Just an update for now. It seems that if modalities in study is returned with an empty value you get a list with one empty value and this is considered True.

    Added on line 598 in qrscu.py:

    logger.debug(u"Value of modalities_in_study: {0}, bool of modalities_in_study: {1}".format(rsp.get_modalities_in_study(), bool(rsp.get_modalities_in_study())))
    

    returns in log:

    [18/Jun/2018 09:19:28] DEBUG [remapp.netdicom.qrscu:598] Value of modalities_in_study: [u''], bool of modalities_in_study: True

    So the second code suggestion seems to be necessary.

  4. Luuk reporter

    Refs Issue 627: Workaround for "bug" in Agfa Impax 6.6

    Extra setting added determines if OpenREM should use the Modality tag at study level. Default value is False so default behaviour isn't changed.

    Added extra check to see if first value in modalities_in_study is not empty. If it is empty modalities_in_study the variable modalities_returned is considered false.

    → <<cset 513b4e9f3032>>

  5. Log in to comment