Importing name of selected patient

This forum is for programmers who have questions about the source code.
Post Reply
ujjwal singh
Posts: 39
Joined: Mon Jun 16, 2014 7:33 am

Importing name of selected patient

Post by ujjwal singh » Wed Apr 15, 2015 3:46 am

Hi,

I want to import the selected patient full name on new customized form. How can i do this?


All let me know the code to make it trail version limit of 30 patient( Code and where to put it?)

Thanks

User avatar
jsalmon
Posts: 1553
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Importing name of selected patient

Post by jsalmon » Wed Apr 15, 2015 7:43 am

ujjwal singh wrote:I want to import the selected patient full name on new customized form. How can i do this?
What exactly do you mean by "new customized form"? Are you referring to a sheet (commonly referred to as patient form / forms within OD)? If so, I think you are interested in importing sheets:
http://www.opendental.com/manual/patien ... mport.html
ujjwal singh wrote:All let me know the code to make it trail version limit of 30 patient( Code and where to put it?)
You shouldn't need to add any additional code. In order to get your compiler ready to make a trial version, set the Conditional Compilation Symbols of the OpenDental project to TRIALONLY.
The 30 patient limit will automatically take affect once TRIALONLY is set. See FormPatientSelect.butAddPt_Click() for details on the 30 patient limit.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

ujjwal singh
Posts: 39
Joined: Mon Jun 16, 2014 7:33 am

Re: Importing name of selected patient

Post by ujjwal singh » Wed Apr 15, 2015 8:28 am

I mean, i just had made a new form for prescription on code side. Now i want that in a label the selected patient name and age should automatically appers. what code i have to implement ?

User avatar
jsalmon
Posts: 1553
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Importing name of selected patient

Post by jsalmon » Wed Apr 15, 2015 9:04 am

ujjwal singh wrote:I mean, i just had made a new form for prescription on code side. Now i want that in a label the selected patient name and age should automatically appers. what code i have to implement ?
If I'm understanding correctly you want to do something like this in your Form_Load:

Code: Select all

Label myLabel=new Label();//The label that is on your form.
myLabel.Text="Name: "+selectedPatient.GetNameFL()+" - Age: "+selectedPatient.Age;
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

ujjwal singh
Posts: 39
Joined: Mon Jun 16, 2014 7:33 am

Re: Importing name of selected patient

Post by ujjwal singh » Wed Apr 15, 2015 9:57 am

Error: Error 45 The name 'selectedPatient' does not exist in the current context D:\od12.2.44\OpenDental\Forms\FormRxS.cs 35 13 OpenDental


Does i m missing any directive assembly or any other reference?

User avatar
jsalmon
Posts: 1553
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Importing name of selected patient

Post by jsalmon » Wed Apr 15, 2015 10:06 am

Sorry, I didn't specify that the variable "selectedPatient" needs to be your Patient object. So just use the patient object that you used when you created your prescription. Most likely you passed in the currently selected patient from a plugin hook? If not, you can probably just use FormOpenDental.PatNumCur to get your patient object OR if you came from a module you can just use its Patient object that they often keep around. E.g. ContrChart.PatCur
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

ujjwal singh
Posts: 39
Joined: Mon Jun 16, 2014 7:33 am

Re: Importing name of selected patient

Post by ujjwal singh » Wed Apr 15, 2015 7:25 pm

Soory Jasalmon,

This is not working, i m unable to get the selected patient name. I m stating my problem again hoping the fruitful result.

I had made a new form and under the forms module, I have taken some text boxes on it, Now i m trying to get the selected patient name in one of the text box should appear automatically on form load.

tgriswold
Posts: 122
Joined: Fri Jun 07, 2013 8:52 am

Re: Importing name of selected patient

Post by tgriswold » Mon Apr 20, 2015 3:15 pm

As Jason mentioned, you will either need to have a patient object set outside of the form, or you can use the patnum in Jason's other examples and call patients.GetPat(INSERT PATNUM HERE);. The patient object that function returns will contain the patient's name. I hope this helps, however any additional help is most likely beyond our scope, as we are venturing into C# and general programming concepts, and not issues directly related to OpenDental.
Travis Griswold
Open Dental Software
http://www.opendental.com

Post Reply