Documents POST Upload - Profile Photo

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

Documents POST Upload - Profile Photo

Post by PBECKER » Mon Jan 29, 2024 5:44 am

API Team

We have found a bug in the below POST method. Scenario > After we POST under the patient profile folder using the below POST documentation the thumbnail of that patient does not get updated/shown until after we open/view the image in open dental by double the actual image.


Documents POST Upload

Version Added: 21.1

Upload the actual file as rawBase64. Specify the extension of the file. Examples could include .pdf, .jpg, .dcm, .doc, etc. rawBase64 goes into the database in document.Note as "_rawBase64_:" followed by the extension and rawBase64. Example: "_rawBase64_:.jpg_errGEreRi3fWWtB+gWWEgg..." The customer never sees this text, but when they later click on the document, the file is created and the note removed.

PatNum: Required.
rawBase64: Required.
extension: Required.

DocCategory: Optional. FK to definition.ItemName, where definition.Category=18. Default is first in DocCategory.
ImgType: Optional. Either Document, Radiograph, Photo, File or Attachment. Default is Document.
Description: Optional.
DateCreated: (Added in version 22.1) Optional. Default is today's date. String in "yyyy-MM-dd HH:mm:ss" format.
ToothNumbers: (Added in version 23.1.35) Optional. A string of numbers separated by commas and/or hyphen separated ranges.

Example Request:
POST /documents/Upload

{
"PatNum": 101,
"rawBase64": "errGEreRi3fWWtB+gWWEgg...",
"extension": ".jpg",
"DocCategory": 47,
"ImgType": "Photo",
"Description": "Extraoral",
"DateCreated": "2022-03-15 14:30:00",
"ToothNumbers": "1-32"
}

Example Response:
201 Created
(no "location" Header or object because we don't yet support GET single documents)

DerekR
Posts: 81
Joined: Wed Aug 31, 2022 1:13 pm

Re: Documents POST Upload - Profile Photo

Post by DerekR » Mon Jan 29, 2024 8:31 am

Good Morning,

The behavior you are describing is what we would expect. When using Documents POST Upload our documentation states that the document needs to be clicked from within Open Dental to finish the file creation and note removal.
PBECKER wrote:
Mon Jan 29, 2024 5:44 am
Upload the actual file as rawBase64. Specify the extension of the file. Examples could include .pdf, .jpg, .dcm, .doc, etc. rawBase64 goes into the database in document.Note as "_rawBase64_:" followed by the extension and rawBase64. Example: "_rawBase64_:.jpg_errGEreRi3fWWtB+gWWEgg..." The customer never sees this text, but when they later click on the document, the file is created and the note removed.
We would recommend using Documents POST UploadSftp, which does not require the file to be clicked from within Open Dental to completed its creation.

Thanks!

PBECKER
Posts: 125
Joined: Mon Jan 03, 2022 11:54 am

Re: Documents POST Upload - Profile Photo

Post by PBECKER » Mon Jan 29, 2024 9:48 am

Hello Derek

The Documents POST UploadSftp, does not leverage the open Dental Api but allows software vendors to successfully upload a patient profile with zero issues and the profile photo shows successfully

But if we're using Open Dental's API which is the tech stack OD has been building requires the end user to go to the actual image double click the image in order for the image to be updated for the patient profile? Is Nathan aware of this, reason we're asking is were thinking if anything the API should have the capability.

Thank you so much Derek, looking forward to your feedback.

SLeon
Posts: 482
Joined: Mon Mar 01, 2021 10:00 am

Re: Documents POST Upload - Profile Photo

Post by SLeon » Mon Jan 29, 2024 3:36 pm

Good afternoon Becker,

As DerekR mentioned, the requirement for an Open Dental user to click an object after using the Documents POST Upload endpoint is not a bug. It is described in our documentation here:
"The customer never sees this text, but when they later click on the document, the file is created and the note removed."
In this click, the raw base64 is converted into a valid file that is added to the correct location (AtoZ/Database/Cloud storage) for the correct patient.

We developed the Documents GET UploadSftp method as a way to not require the click step, as its conversion process is different. This is the method we recommend, as DerekR stated, for API developers to utilize. Most will use this method as it's the companion to the Documents GET DownloadSftp endpoint, and already manage an sftp site as part of their application.

It would be helpful for us to know your workflow for uploading images to dental office. Specifically how base64 is preferable over using the Stfp workflow.

We are going to investigate how we can "skip the click" for this Upload. I have added this to our development list. However your customers would need to update to use this new functionality, and it may still be better to use the Documents GET UploadSftp endpoint (as it is available in versions 21.2 and later).

PBECKER
Posts: 125
Joined: Mon Jan 03, 2022 11:54 am

Re: Documents POST Upload - Profile Photo

Post by PBECKER » Mon Jan 29, 2024 3:49 pm

Hello SLeon

Yes we know how to use sftp, this case has nothing to do with any software workflow. In our case since we're huge adopters of open dental's apk and we would rather leverage the api methods and not have to manage another layer sftp. We hope you understand, how this case be seen as a bug/manual click that shouldn't be needed for the view to for the patients profile in the preview windows after being uploaded via the Documents POST Upload endpoint.

Thank you, we hope a solution can be found for this, thank you so much Open Dental API Team.

Post Reply