Prefetching

Greetings All,

Has anyone set up their Orthanc installs to manage prefetching? I am looking to set up a server predominantly for prefetching mammo exams and pushing them to our mammo reading station. The vendor has a tool for it, however, it is WAY overpriced for this simple function. I’d appreciate any insights on how you were able to get it done or some healthy alternatives.

Hello,

Orthanc comes with a REST API that can notably be used to implement prefetching rules from an external script (written e.g. in Python):
https://book.orthanc-server.com/users/rest.html

Hi Scott,

I made this in orthanc tools.
https://github.com/salimkanoun/Orthanc_Tools
When orthanc recieve a study it can pre fetch patient history
Didn't made the auto routing part to push the results to a specific destination.

I'm rewriting all the app in NodeJS, I should be able to add the auto routing feature but it will take time

Thanks Salim,

I will check it out.

Thanks Seb,

I will take a look at this. I will say I am not great with the scripting part, but I will give it a shot nontheless!

Salim,

I tried to check this out. However, I don’t know if there are any other instructions that are clearer? The download seems incomplete when compared to the provided information in the instructions. It mentions running “Orthanc Tools” but I do not see that anywhere in the download.

There’s no indication of how to install or an executable to launch. I am probably missing something.

Dear Scott,

Just download the .jar at https://github.com/salimkanoun/Orthanc_Tools/releases/download/1.6.2/Orthanc_Tools.jar
You need only Java installed in your computer.
Then the software will run by simple double click on the jar.

Salim

Hi Scott,
I have done this using Orthanc in combination with Mirth. I used Mirth as the engine to drive the prefetch and identification of relevant studies based on study description mapping. (For example several destinations in a channel each with a filter rule which reviewed the study description, and if it met the required criteria, request a move of that study.)
Ping me and I can probably provide more information.

Hey Bryan,

Thanks for the follow-up. I will shoot you an email.

Thanks Salim, I will keep checking.

FYI, I’ve just added a setup sample to demonstrate how pre-fetching can be implemented in lua: https://bitbucket.org/osimis/orthanc-setup-samples/src/master/windows/prefetching/

Hi Alian,

I was able to play with this yesterday. It appears to be a very clean method to implement prefetching. I’d like to try to see if it would work in our environment.

I did have a question, I know the Lua can be added into a running Orthanc install, but what I wasn’t sure about, is how do I integrate the other components. I noticed that the middleman referenced executables, it looked like the PowerShell script errored out when it didn’t find those executables.

So I guess what I am confused about is, would something like this function as a standalone function or would it be fully integrated into an already running install? I did modify the IP addresses in all three parts to match our dicom nodes, but I think I am missing the “glue” that connects them all together.

Thanks for all your help. I hope you and yours are staying safe in this crazy climate we’re in right now! Be well.

Hi Scott,

Hi Alian,

I was able to play with this yesterday. It appears to be a very clean method to implement prefetching. I’d like to try to see if it would work in our environment.

I did have a question, I know the Lua can be added into a running Orthanc install, but what I wasn’t sure about, is how do I integrate the other components. I noticed that the middleman referenced executables, it looked like the PowerShell script errored out when it didn’t find those executables.

Well, the powershell script is just a way to start Orthanc for the purpose of the demo; it’s not supposed to be very robust. You can start it your prefered way (Orthanc Service, Docker, …). The only important part of this demo is the lua script.

You can install a lua script in a running Orthanc through the tools/execute-script route (which is however now disabled by default) but in a production environment, you should just install the script through the configuration file.

So I guess what I am confused about is, would something like this function as a standalone function or would it be fully integrated into an already running install? I did modify the IP addresses in all three parts to match our dicom nodes, but I think I am missing the “glue” that connects them all together.

In your setup, you probably only need the middleman part, the other 2 orthancs are there to simulate your pacs and a workstation.

HTH

Thanks for the follow-up Alain.

I will keep playing with it.

Hi Alain,

I was finally able to get back into this. So I got the Lua into the prod environment and updated “workstation” to the AET of my station. The errors stopped when I got all of them updated. I attempted to upload some images to see if it worked, however, it didn’t appear to pull the priors or post anything in the logs. From what I can see at the bottom of the lua, there’s a section where it appears to delete the job after completion, am I reading that correctly? I did try to pull that out, but it didn’t seem to do anything.

Any ideas on how I can track that the Lua is running? Secondly, I do have a routing job already in place, would these two Luas conflict with each other? I was wondering that based upon the “forward this current study” component. My thinking was that this already occurs based on the forwarding Lua. If the prefetch Lua also forwards, would that be problematic?

Finally, I know too many questions, can it be customized for a specific modality? I only really need this for mammos at the moment.

Thank you so much for entertaining my questions and the patience you offer with your solutions. After this pandemic nonsense is all done, you and Seb should consider a week-long crash course. I for one would be interested in that. Orthanc is such a useful system and you guys work so hard, you should be well compensated for your time. Thanks again! Be safe and be well!

Hi Scott,

Yes, the prefetching script might conflict with your current forwarding script. i.e., you can only install one OnStableStudy handler.

Don’t hesitate to add print() and PrintRecursive() statements in your lua scripts to debug them (the output is displayed in the logs).

You’re scaring me out when you say you modify your scripts in your production environment … your should probably modify the orthanc-setup-sample to match your production environment so you can test everything before going into production…

To request only for past MG, you can modify the query as is:

queryBody[“Query”] = {}
queryBody[“Query”][“PatientID”] = PatientID
queryBody[“Query”][“ModalitiesInStudy”] = “MG”

Hi Bryan,

Would you have a sample Mirth Channel available to share for prefetching?

Thanks,

Chris