Retrieving dicom tag info

  • Hi,


    I am trying to update our SQL Server DB with the Dicom tag info. I need to do this whenever the conquest server receives Dicom data.

    I am looking to achieve this without disturbing conquest code, any existing dynamic feature I can use to receive a notification that contains Dicom tag info and that can be used to update my DB.


    Please share your options.


    Thanks

    akhsuser.

  • Hi,


    The ImportConverter functionality is designed for this. If you define an ImportConverter in dicom.ini it gets called for every object coming in. If you use lua as language for the ImportConverter, you can actually use third party libraries. If you SQL server DB is the same that is used for the dicom images you can access it directly from Lua with the sql() function.


    Marcel

  • thanks. in my case SQL server is the target DB, i am planning to create a Lua script that can receive tags values and update info into SQL server DB by calling a specific stored procedure,

    If you have any sample Lua script that does SQL updates, please share.


    thanks

    akhsuser

  • Hi,


    such a script is called for each image.


    To call something per study use e.g.:


    ImportConverer1 = process study by file.lua(%VStudyInstanceUID)


    Note that this exampkle is not lua (I edited for clarity above)


    Marcel

  • ImportConverters = 1

    ImportConverter0 = save to d:\Processed\%o.dcm;


    I am able to get the file save into d:\Processed\ folder fine.,

    but I want the file to be saved like d:\processed\studyuid\seriesuid\sopuid.dcm


    Please help me with the syntax.


    Thanks

    akhsuser

  • Something like:


    ImportConverter0 = sql('INSERT data INTO extratable VALUES "'..Data.PatientID.."')


    See manual and overview.lua


    Marcel


    Referring to your reply, I have conquest runs on MySQL DB and with import converter, I am also trying to update SQL Server DB when a new slice comes in. In this case, the above ImportConverter line works?



    Thanks

    akhsuser

  • No,


    conquest has a single database type and connection. So it can update any table the same database. For your request you would have to find a lua5.1 SQL server driver such as luasql. However, I find these hard to compile. However ado.lua uses luacom, which I have compiled and can share. Otherwise I cannot support external libraries.


    Marcel

  • I attached the files - Lua files go into the lua folder and the dll goes into the clibs folder of the dicomserver.


    I have never used this so cannot help you as I said above. You will have to use the internet for the rest.


    Marcel

    Files

    • luacom.zip

      (100.73 kB, downloaded 178 times, last: )
    • ado.zip

      (1.82 kB, downloaded 179 times, last: )

    Marcel van Herk is developer of the Conquest DICOM server together with Lambert Zijp.

  • ok, thanks. I will give it a try with these files.

    Please help me with syntax to call application exe on import converter.

    and also what are the files I need to look at in the DGATE source that updates database tables.


    Thanks

    akhsuser.

  • Hi,


    I checked global variable imagereceived , but its complete total images received so far with all the studies.

    is it possible to know the total image received in a study in the lua script being used in importconverter.


    Thanks

    akhsuser

  • No,


    But you can create a local variable e,g,


    [lua]

    Association = local countimages=0

    ImportConverter10 = countimages=countimages+1


    To count the images.


    Of course this does work for delayed "process study by" - there you should use a dicomquery or dbquery to count images.


    Marcel

  • Hi,

    I tried to insert data into conquest mysql db via lua script


    local suid =

    sql("INSERT INTO mytest (studyuid) values (suid)");


    the above didn't work.


    I tried this and it didn't work.

    sql("INSERT INTO mytest (studyuid) values (Data.StudyInstanceUID)");


    if i use const string it works, sql("INSERT INTO mytest (studyuid) values ('1.2.3.4.5.6.7.323.3.3.33.23.232323.2323')");


    Am I missing any syntax here...


    Thanks

    akhsuser

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!