Posts by emmet

    Hi Marcel,


    Thanks a mill for that. I ended up with exactly as you said, I'll put the scripts below for anyone else in a similar situation.


    Here is WorkListQueryConverter0:

    And here is ModalityWorklistQueryResultConverter0:

    I'm more than happy to hear any improvements to these, so far it looks like it will do the trick quite nicely.


    Thanks again marcelvanherk !

    We have modalities that are configured to query conquest by today's date by default, and some modalities allow users to change this when querying but some don't. For those that don't it creates a situation around midnight each night where things get a little unpredictable and very time dependant, for example if a scan is scheduled for 00:10 the following day but it's only 23:50 at the moment then the operator has to wait until midnight to see the entry. Things also become very sensitive to how correct the clocks are on each modality and on conquest, and a difference of a few minutes or more will cause similar mismatching effects. To further complicate things, some modalities implement a feature where they can search for studies "within X hours of now" but in practice it's not always implemented correctly and if this window of time crosses over into a different day it results in a query to conquest like "date>=today AND time>=21:00 AND date<=tomorrow AND time<= 03:00". When this happens this query returns no results, because of the way the times are ANDed (eg >=21:00 AND <= 03:00).


    To avoid these issues I'm exploring the possibility of using a WorkListQueryConverter0 to override all date and time queries that a modality may have set, and instead set it to a rolling window that I can apply to all incoming queries, for example filter to all studies from 24 hours in the past to 24 hours in the future no matter what time/date was queried for. However to do this without falling into the wierdness around midnight mentioned above I need an OR clause, for example "(date >=today AND time>=21:00) OR (date<=tomorrow AND time<= 03:00)".


    I've tried searching in the code to see if it's possible to do an OR instead of an AND when setting fields in the query but I don't think I found the right place. I've also tried searching to see if it's even possible to define an OR in these queries but also couldn't find any guidance from the standard.


    Is this possible? Any suggestions or pointers would be greatly appreciated, thanks in advance!

    Hi Marcel!


    That worked, thank you!


    My next step will be to move this into a lua script instead of inline in dicom.ini so that I can loop over all children in the node, as at the moment this will only ignore the first in the sequence ([0]), but won't ignore a second or third element in the request. Ad edge case but worth covering.


    However I'm still a little unsure how to figure out what the name of the keys are in lua, especially when it's a nested. To illustrate with "0040,0001" as an example.


    Knowing that the tag is 0040,0001 I can look it up and find something like this, which tells me that this key is nested within Scheduled Procedure Step Sequence (nested meaning I'll have to index it using "[0]" or else loop over it) and is called Scheduled Station AE Title. However the name is with spaces here, so should I guess that the name in conquest will be the same as there but without spaces, "ScheduledProcedureStepSequence" and "ScheduledStationAETitle" in this case? Is that the right approach? Or do you recommend any other documentation to look these up or debug the actual contents of a Data object?


    Thanks again!

    Here's a log when the query comes in:


    I'm aiming to ignore (delete from the query) the DICOMWorkList.SchedPSLoc and DICOMWorkList.SchedStati fields before conquest checks it's database.

    Something else I've tried:


    Code
    [lua]
    # Add a filter of the calling AETitle to all incoming queries, also remove DICOMWorkList.SchedPSLoc
    QueryConverter0 = Data["0040,0001"] = Association.Calling; Data.ScheduledProcedureStepSequence[0].ScheduledProcedureStepLocation = nil; Data.ScheduledProcedureStepSequence[0].ScheduledStationName = nil
    RetrieveConverter0 = Data["0040,0001"] = Association.Calling; Data.ScheduledProcedureStepSequence[0].ScheduledProcedureStepLocation = nil; Data.ScheduledProcedureStepSequence[0].ScheduledStationName = nil
    WorkListQueryConverter0 = Data["0040,0001"] = Association.Calling; Data.ScheduledProcedureStepSequence[0].ScheduledProcedureStepLocation = nil; Data.ScheduledProcedureStepSequence[0].ScheduledStationName = nil

    But this results in an error:

    Code
    *** lua run error [string "Data["0040,0001"] = Association.Calling; Da..."]:1: attempt to index field 'ScheduledProcedureStepSequence' (a nil value) in 'Data["0040,0001"] = Association.Calling; Data.ScheduledProcedureStepSequence[0].ScheduledProcedureStepLocation = nil; Data.ScheduledProcedureStepSequence[0].ScheduledStationName = nil'

    Hi,


    I'm looking to delete some very specific dicom tags from the mwl queries that come in from the modalities. I'm hoping to do this on conquest in order to avoid having to reconfigure lots of modalities. However I'm having problems figuring out how to set some nested fields to nil (delete them).


    The fields I want to delete are:

    • 0040,0011
    • 0040,1001
    • 0040,0010

    Here's what I've tried in dicom.ini:


    Code
    # Add a filter of the calling AETitle to all incoming queries, also remove DICOMWorkList.SchedPSLoc
    QueryConverter0 = Data["0040,0001"] = Association.Calling; Data["0040,0011"] = nil; Data["0040,1001"] = nil; Data["0040,0010"] = nil
    RetrieveConverter0 = Data["0040,0001"] = Association.Calling; Data["0040,0011"] = nil; Data["0040,1001"] = nil; Data["0040,0010"] = nil
    workListQueryConverter0 = Data["0040,0001"] = Association.Calling; Data["0040,0011"] = nil; Data["0040,1001"] = nil; Data["0040,0010"] = nil


    The first bit is to add a new filter for the Scheduled Station AE Title by AETitle, this is working fine. However the other bits don't, I suspect it's because these are nested but I can't figure out the syntax for nested dicom tags.


    I've found info here and found some examples on this forum on how to set the data but couldn't find an example using the fields I want to manipulate.


    Any suggestions or pointers would be very welcome, thanks in advance!