finding a pt name with the API

This forum is for programmers who have questions about the source code.
Post Reply
cthulu
Posts: 10
Joined: Sat Nov 21, 2020 7:04 am

finding a pt name with the API

Post by cthulu » Wed Dec 23, 2020 6:01 am

I try this curl string to look up a name and it won't accept spaces. The percent code isn't working so I was wondering about a workaround. Getting a partial match here isn't an option and I need to just get only that patient's record.

curl --location --request GET 'https://api.opendental.com/fhir/v2/pati ... lowenstein' --header 'Authorization: ODFHIR 04KBfUMsB2yXGClp/XOx0ePQSmMIcGhl2' --header 'Accept: application/json'

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

Re: finding a pt name with the API

Post by jordansparks » Thu Dec 31, 2020 9:49 am

We are working every day on the API. Today, we were finally able to track down your issue. Basically, our documentation does not have good enough examples. I hope to be able to upload better documentation for your issue within a day or two. The "name" parameter that you used would only be for a portion of a name, not first and last. Instead, use a combination of "family", "given", and "birthdate" to search for a unique patient. But like I said, the documentation for that will improve significantly.
Jordan Sparks, DMD
http://www.opendental.com

cthulu
Posts: 10
Joined: Sat Nov 21, 2020 7:04 am

Re: finding a pt name with the API

Post by cthulu » Tue Jan 05, 2021 9:14 am

I figured that part out eventually, but now have a different issue. Can I look up a patient by partial match for a birthday. I want to find all patients who have a birthday on November 2 for example. I need to do this without including a year and the API won't let me do it.

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

Re: finding a pt name with the API

Post by jordansparks » Fri Jan 08, 2021 8:25 am

Queries are far more powerful for read-only than the API will ever be. The purpose of the API is to let users make changes to data in the database without running forbidden Update and Insert commands. We will add as many Select functions as we can, but it's never going to be more than the tip of the iceberg. This particular example does look like it might make its way into the API because sending birthday cards is something that third parties will want to do. But it will be a while. We're rebuilding the API to not use FHIR, which I'm pretty excited about. So the terminology and style will match our database and UI, and the learning curve will be lower.
Jordan Sparks, DMD
http://www.opendental.com

cthulu
Posts: 10
Joined: Sat Nov 21, 2020 7:04 am

Re: finding a pt name with the API

Post by cthulu » Fri Jan 08, 2021 9:05 am

So basically, I can do the same thing by running a direct SQL select statement and parsing through those results?

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

Re: finding a pt name with the API

Post by jordansparks » Fri Jan 08, 2021 11:05 am

Right. Now that you mention it, we might add a function to our API to allow a query to be passed in, and a table to be returned. That way, queries could be done through the API, solving a lot of these kinds of issues.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply