IF RECEIVE FROM ONE AET SEND TO OTHER

  • Hello all,


    I'm trying to implement this function that check and insert in x variable the AET from they come, and with rulles change PatientID and forward to other PACS


    My dificult is in (setifempty x to "%V0008,0055") i don't find any tag that have this that i want, someone can help?


    Thanks


  • Hi,


    the calling AE (sender) is "%u". Hope this helps.


    ImportConverter1 = ifequal "%u", "1_PACS"; set 0010,0020 to "PACS1%V0010,0020[0,59]"; forward to PACS1
    ImportConverter2 = ifequal "%u", "2_PACS"; set 0010,0020 to "PACS2%V0010,0020[0,59]"; forward to PACS2
    ImportConverter3 = ifequal "%u", "3_PACS"; set 0010,0020 to "PACS2%V0010,0020[0,59]"; forward to PACS2


    Marcel

  • Hello Marcel


    Yes your answer helps and works

    Quote

    %u


    But now i have another problem:


    By conditions forward, but with my code the conquest always execute and send to all forwards, i try to use : stop in the end of each line but now works, the first PACS receive always all images, because the condition pass there and give false but the forward is executed.


    Can you help? Thanks for all your work with conquest.


    Code
    ImportConverters = 3ImportConverter0 = ifequal "%u", "1_PACS"; set 0010,0020 to "%u[0,2]%V0010,0020[0,60]"; forward to PACS1ImportConverter1 = ifequal "%u", "2_PACS"; set 0010,0020 to "%u[0,3]%V0010,0020[0,59]"; forward to PACS2ImportConverter2 = ifequal "%u", "3_PACS"; set 0010,0020 to "PACS2%V0010,0020[0,59]"; forward to PACS2


    or

    Code
    ImportConverters = 3
    ImportConverter0 = ifequal "%u", "1_PACS"; set 0010,0020 to "%u[0,2]%V0010,0020[0,60]"; forward to PACS1; stop
    ImportConverter1 = ifequal "%u", "2_PACS"; set 0010,0020 to "%u[0,3]%V0010,0020[0,59]"; forward to PACS2; stop
    ImportConverter2 = ifequal "%u", "3_PACS"; set 0010,0020 to "PACS2%V0010,0020[0,59]"; forward to PACS2; stop


    So:
    if i send from 1_PACS i only receive in PACS1


    if i send from 2_PACS i will receive in PACS1 and PACS2


    if i send from 3_PACS i will receive in PACS1 and PACS2 and PACS2 again


    I only want to receive in the correct line of code like this:


    if i send from 2_PACS i want to receive only one time in PACS2


    if i send from 3_PACS i want to receive only one time in PACS2




    Thanks for your help

  • Hi,


    The if skips a single statement; e.g. you will want to do:


    ifequal "%u", "1_PACS"; { set 0010,0020 to "%u[0,2]%V0010,0020[0,60]"; forward to PACS1; }


    or


    ifnotequal "%u", "1_PACS"; stop; set 0010,0020 to "%u[0,2]%V0010,0020[0,60]"; forward to PACS1;


    I would suggest to use Lua for ImportConverters to make the code more readable:


    [lua]
    ImportConverter0 = if Associated.Called == '1_PACS' then Data.PatientName = string.sub(Associated.Called, 1, 3)..Data.PatientName; script('forward to PACS1') end


    Note that e.g. ImportConverter0 can occur only once, either in lua form or in the old scripting form.


    Marcel

  • Hello Marcel


    Thanks for your answer.


    So, with Conquest i will not be able to have a lot of tests and send only to the correct line. I'm right?



    For now my code only send to one PACS with this 2 lines, but my propose is to send for multiple pacs folowing rulles like the previou algorithm


    ImportConverters = 2
    ImportConverter0 = ifnotequal "%V0010,0020[0,3]", "ABC"; { set 0010,0020 to "ABC%V0010,0020[0,60]"; forward to PACS1; }
    ImportConverter1 = ifequal "%V0010,0020[0,3]", "ABC"; { forward to PACS1; }


    but i need more pacs and more tests..



    Thanks for your help.

Participate now!

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