Program Link Optional Command Line

This forum is for programmers who have questions about the source code.
Post Reply
PDCsupport
Posts: 3
Joined: Tue Sep 07, 2021 3:59 pm

Program Link Optional Command Line

Post by PDCsupport » Tue Sep 07, 2021 4:26 pm

Hello,
I have written a quick Java application that, when launched on the workstation given a patient number, reads that patient's demographic information and writes that data into a communication web application we use among our 14 different practices.
I have created a new Program Link that will launch the java program. It does launch the application but I cannot seem to include the PatNum as an argument.

Path of file to open is correct (the application launches but without data)
[PatNum] is in Optional command line.
As far as I can tell the link does not provide the PatNum argument

I can launch the app without an argument and get the same blank behavior.

Have run an output file and included [PatNum]. It writes the correct patient number to the the file every time.

What am I doing wrong? Would love to take advantage of this simple added button to avoid retyping all of the patient demographics.

Thanks in advance for your help.

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Program Link Optional Command Line

Post by jordansparks » Wed Sep 08, 2021 10:32 am

My guess is that it is getting sent and that you are not capturing it properly. I'm assuming you are selecting a patient in Open Dental before trying to use your button. If you can't get it, then the next step would be for one of our programmers to write a small C# app proving that it is getting sent. The app would basically just be a window that shows any CLA string sent in.
Jordan Sparks, DMD
http://www.opendental.com

PDCsupport
Posts: 3
Joined: Tue Sep 07, 2021 3:59 pm

Re: Program Link Optional Command Line

Post by PDCsupport » Wed Sep 08, 2021 3:17 pm

Can you give me an example of the command it sends?
My application is called pwexport.jar and I'm trying to pass an argument of patient number [PatNum]
I'm looking for
pwexport.jar 19

Is that how it is passed? are there any other characters included
Thank you

PDCsupport
Posts: 3
Joined: Tue Sep 07, 2021 3:59 pm

Re: Program Link Optional Command Line

Post by PDCsupport » Wed Sep 08, 2021 3:59 pm

I wrote a routine to inspect the passed argument
It was indeed just a number as expected.
The problem turned out to be that it was trying to run in the wrong folder. I wrote a batch file to launch the java script with the passed argument.
calling the batch file made it work
Thank you for your help.

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Program Link Optional Command Line

Post by jordansparks » Thu Sep 09, 2021 8:58 am

You can include other characters if you want. For example, you could set up your command line argument in OD as follows:
PatNum=[PatNum]
Or, you can just send the number.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply