Prefix based on source IP?

  • Hi all,
    I'm hoping I can do this with Conquest...I've been using it for years but this one I'm just not sure if I can do.
    I'd like to take a look at the source IP when a study arrives, and prefix the patient's Medical Record Number with a 3 letter code based on the source IP's that we get. Would also be nice to prefix the accession number. This is to keep patients from various places separated so they don't have duplicate MRN or Accession's. Is there any way to do this?
    Tim

  • Thinking about this, I should be able to do it based on source AE too, but I'm having problems getting it working in test:



    ImportConverters = 3
    ImportStationName0 = TESTSTATION
    ImportConverter0 = Data.PatientID = 'UWH' + Data.PatientID



    Am I doing something wrong with the ImportConverter line?


    I saw some sample stuff on the forum like this:
    [lua]
    Data.PatientID = Data.PatientID + Data.StudyUID


    So I am assuming I can put in a string append if I need, right? Also, I'm not really sure if I need the "lua" things or if I can do it in the ImportConverter line itself. I've read and reread the manual but so far it's not sinking in well.
    Tim

  • It looks like I had luck with this:


    ImportConverters = 3
    ImportCallingAE0 = TESTSERVER
    ImportConverter0 = set 0010,0020 to "UWH%V0010,0020"


    Seems to be working...not sure if that is the best way, but it works.
    Tim

  • Ok, I have 1.4.17beta installed now and am working on it.


    I'm not sure I understand how to do the lua script though. I also realized now that with my ImportConverter, I could only do one operation...I could prefix the patientID, but not the patientID and AccessionNo. I'm sure the lua scripting will be much more flexible. I don't need to use source IP though, as long as I can use CallingAE, so that is ok.


    Can you give me an example of the lua scripting to prefix both the PatientID and Accession based on callingAE?


    I'll keep playing with it today and see what I can make it do.
    Tim

  • Hi,


    changing patient IDs like this is posible but not a good idea maybe (you get inconsistent images between the sender and the receiver). I added a script('newuids') to make a proper copy without conflicting UIDs.


    importconverter0 = change.lua


    change.lua

    Code
    script('newuids')
    Data.PatientID = Association.Calling .. Data.PatientID
    Data.AccessionNumber= Association.Calling .. Data.AccessionNumber


    Marcel

Participate now!

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