API or short query GET patient profile photo

For requests or help with our API
Post Reply
PBECKER
Posts: 125
Joined: Mon Jan 03, 2022 11:54 am

API or short query GET patient profile photo

Post by PBECKER » Sun Mar 06, 2022 2:50 pm

Jordan


Request: Can the api be updated to allow us to do a GET or perhaps a short query to pull patient profile photo? If we have to go the short query route is there an existing query that we can utilize?

Thank you so much Jordan, love the route your taking with building out the Open Dental API!

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

Re: API or short query GET patient profile photo

Post by jordansparks » Sun Mar 06, 2022 4:11 pm

It sounds like you first need a query to know which document. Then, you could use POST DownloadSftp to get that image.

Code: Select all

SELECT DefNum
FROM definition
WHERE Category=18
AND ItemValue LIKE '%P%';
If you get a valid DefNum (190 in this example), then use:

Code: Select all

SELECT DocNum
FROM document
WHERE DocCategory=190
AND PatNum=10
ORDER BY DateCreated DESC
LIMIT 1;
That will get you the most recent one. You could get fancier and combine those two queries.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply