Connecting application

This forum is for programmers who have questions about the source code.
Post Reply
sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Connecting application

Post by sunnyag » Tue Dec 09, 2014 12:21 am

Hi,

I new to this system and looking forward to buy for my client.

I have my own website and want to connect to dentists database to get the schedules. Below are some of my queries

1. The Open Dental database is hosted at dentist's server or Open Dental has centralised location for database?
2. Does Open Dental has some web service so that outsiders can interact with dentist's database?
3. If yes, then by default this service is enabled for all dentist?
4. Can we insert data into dentist's database?
5. How do we get list of all dentist using Open Dental, so that we list them on our website?
6. If two patients scheduling same time and if priority is given on first come first serve basis then what error will it return for other patient?
7. I have downloaded the source code but I did not get any database file. How can I create database?

It would be great id someone helps me on this.

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

Re: Connecting application

Post by jsalmon » Tue Dec 09, 2014 12:04 pm

This is a loaded question and I will eventually write a full response to your post as soon as I have the free time to address it.

The short version is you'd have to expose their MySQL service and directly query it with a MySQL connector of sorts (php has one, etc) or create a mediator like you mentioned because we do not provide a way to access the database via a website. If you were to create a mediator in C# (asp.net or something), you could take advantage of our middle tier framework to access our database through our dlls or through your own plugin dll.

We spent a lot of time and money on developing a service mediator between Open Dental and the web and will actually be releasing applications that will give users the functionality that you are thinking about developing but we will have it built directly into Open Dental. There aren't any current plans to make the mediator that we created open source due to the security risks that could introduce after releasing such code.

Some of the projects that we are currently working on baking straight into Open Dental are accepting patient payments, scheduling appointments and sending secure emails from patient to doctors (and visa versa) all via the web.

Eventually we will release a "light" version of Open Dental that can be used completely via the web thus requiring minimal software (if any) to be installed.
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

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Tue Dec 09, 2014 7:58 pm

Thanks for your response it helped me lot in understanding.

As you said MySQL service needs to be exposed so is there anyway to expose this through Open Dental.
The OpenDentServer project is the middle tier in source code?

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

Re: Connecting application

Post by jsalmon » Tue Dec 09, 2014 11:42 pm

sunnyag wrote:The OpenDentServer project is the middle tier in source code?
Correct. This page gives a good breakdown of how it works with Open Dental.
http://www.opendental.com/manual/middletier.html
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

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Wed Dec 10, 2014 2:29 am

If suppose I create mediator as web service on my server then dentists has to consume that web service. But, here I want to connect to their database and get result back which means dentists need to host this web service. This means dentists have to host OpenDentServer separately?

Other option is that dentists can expose mysql service as you suggested.
Is there any other option?

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

Re: Connecting application

Post by jsalmon » Wed Dec 10, 2014 7:14 am

If they want the middle tier (typical small offices do not use the middle tier) then yes they would run the web service side by side with yours. Once one web service is running on a web server it is extremely easy to add additional services.

There are probably other options but I wouldn't recommend using the ones that I can think of off the top of my head.
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

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

Re: Connecting application

Post by jsalmon » Wed Dec 10, 2014 7:30 am

sunnyag wrote:1. The Open Dental database is hosted at dentist's server or Open Dental has centralised location for database?
2. Does Open Dental has some web service so that outsiders can interact with dentist's database?
3. If yes, then by default this service is enabled for all dentist?
4. Can we insert data into dentist's database?
5. How do we get list of all dentist using Open Dental, so that we list them on our website?
6. If two patients scheduling same time and if priority is given on first come first serve basis then what error will it return for other patient?
7. I have downloaded the source code but I did not get any database file. How can I create database?
1. Typically hosted at dentist office. It is a popular feature request for us to host databases for offices which will most likely happen one of these days. Some offices are set up to have a centralized location without us (HQ) hosting it:
http://www.opendental.com/manual/multiplelocations.html
http://www.opendental.com/manual/googlecloud.html
2. No.
4. Yes you can, we call this type of process a "reverse bridge". We highly encourage using our methods via a plugin so that certain things (like audit trails, etc) happen and so that we are not surprised when the customer calls us for support wondering where certain data came from. However, it's open source so you may do what you please. Several companies have very successful reverse bridges to our software, just keep in mind since we don't know intricate details regarding the reverse bridge, we cannot guarantee future version compatibility and that would be left up to you.
5. We do not give out our customer information. I think the best I could give you is a rough estimate of the number of customers that are signed up right now which is also not an accurate number because we are open source and many customers drop support after so long because they get the hang of Open Dental and don't need constant support.
6. That would be up to you since we do not have such a mechanism in place.
7. The second sentence on our source code page says "It is a REQUIREMENT that you first install the Trial Version so you can see the files involved in the installation process."
That is how you get the databases onto your computer.
http://www.opendental.com/manual/sourcecode.html
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

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Thu Dec 11, 2014 6:39 am

Thanks for your valuable reply.

Can you share sample on how data (DtoGetTable) looks like before serializing and passing into ProcessRequest method of OpenDentalServer.ServiceMain ?

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

Re: Connecting application

Post by jsalmon » Thu Dec 11, 2014 12:54 pm

sunnyag wrote:Thanks for your valuable reply.

Can you share sample on how data (DtoGetTable) looks like before serializing and passing into ProcessRequest method of OpenDentalServer.ServiceMain ?
I could but something tells me you are wanting to pass it a query and that's not how the web methods work. E.g. DtoGetTable is used to call a method that returns a DataTable, not to run a query passed in and return the results as a table.
Therefore, depending on what method you are wanting to call and the parameters that method accepts, the payload will look different.
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

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Thu Dec 11, 2014 8:20 pm

what I have thought is to add the particular dll of dto in my service and will send accordingly. There is method call GetPeriods which will give me schedule of a particular day.
I will manipulate the Dto in my service and send data back to website.

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Tue Dec 16, 2014 5:59 am

I am stuck at one location please help.

I have passed DtoGetTable object from my app to Open Dental Service(middle tier). Every method calls goes well only thing is I am not able to populate DataConnection, it remains blank.
Is there any way that I can populate connection settings? Or do I have to make changes to middle tier(customize)?

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

Re: Connecting application

Post by jsalmon » Tue Dec 16, 2014 9:01 am

The middle tier gets its connection settings from a config file:
6. Download this file (right click, Save As): OpenDentalServerConfig.xml, and place it in the application directory of Open Dental on the middle tier server. Edit the file (right click, "Open with..." Notepad) to set the usernames and passwords.
http://www.opendental.com/manual/middletier.html
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

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Wed Dec 17, 2014 2:12 am

I am not using OD application and trying from source code.

I will explain what I have done. I am using source code of OD and not trial application.
1. I have hosted OpenDentalServer on local IIS and its working fine.
2. Then created a WinForms application which references OpenDentBusiness.dll and Web service from above step.
3. Then in WinForms application I filled DtoGetTable object and passed it to ProcessRequest method of "OpenDentalServer.ServiceMain"
4. In ProcessRequest the method "OpenDentBusiness.Appointments.GetForPeriod()" is called perfectly but further the DataConnection class could not load the connection string and we get error "No database selected."

As I can see the connection strings are loaded either from OpenDental or xODR project. So, is there any way I can load connection if requesting from my application?
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For trial version, I have copied "OpenDentalServerConfig.xml" with all parameters but I am getting below error

<?xml version="1.0" encoding="utf-16"?><DtoException xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Message>No database selected</Message></DtoException>

OD application and OpenDentalServer is hosted on same machine and OD app is directly connected to DB which is working fine. Now I am trying to connect my WinForms application to OpenDentalServer which given above error message.

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

Re: Connecting application

Post by jsalmon » Wed Dec 17, 2014 7:03 am

Is your OpenDentalServerConfig.xml sitting in the same directory as your ServiceMain.asmx?
After pasting it there with the correct settings inside, have you recycled your IIS application pool that contains your OpenDentalServer app so that your incorrect db connection settings get refreshed?
Is MySQL running?
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

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Wed Dec 17, 2014 8:01 am

For source code its in D:\Projects\OpenDental\OpenDentalServer

for application its in C:\Program Files (x86)\Open Dental

Settings are correct and yes i did iisreset

And mysql is also running

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

Re: Connecting application

Post by jsalmon » Fri Dec 19, 2014 9:01 am

How are you running your middle tier service? Are you debugging in visual studio or are you manually running your own in IIS.
That will determine which ServiceMain.asmx is being looked at and that will determine where you need to put the OpenDentalServerConfig.xml
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

sunnyag
Posts: 9
Joined: Mon Dec 08, 2014 8:35 am

Re: Connecting application

Post by sunnyag » Tue Dec 23, 2014 8:36 am

The OpenDentalServer project is hosted on local IIS

I have got two issues

1. To resolve above issue I have first called "OpenDentBusiness.Security.LogInWeb" method which maintained the connection and then called "Appointments.GetForPeriod" from my application. The problem is OpenDental has no connection pooling.
So if many users try and connect there could be system failure.

2. With the above point I tried calling "GetPeriodApptsTable" instead of "GetForPeriod" and I received serialization error. The problem is when you pass zero for long type parameter you get "Specified cast is not valid." error.

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

Re: Connecting application

Post by jsalmon » Wed Dec 24, 2014 7:17 am

The middle tier just isn't really designed to do what you're wanting to do. I don't really know how to help you much more than I have.
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

Post Reply