Page 1 of 1

API or short query GET patient profile photo

Posted: Sun Mar 06, 2022 2:50 pm
by PBECKER
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!

Re: API or short query GET patient profile photo

Posted: Sun Mar 06, 2022 4:11 pm
by jordansparks
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.