Document Category clarification

For requests or help with our API
Post Reply
darcockerell
Posts: 11
Joined: Mon Jan 31, 2022 8:51 am

Document Category clarification

Post by darcockerell » Mon Mar 07, 2022 6:56 am

We are working with the Document API and had some questions we couldn't find answers.

1) What is the correct way (SQL command?) to get the DocCategory ID numbers.

2) Are Category ID's the same for all Open Dental accounts? -- if we use the "Patient Information" category ID will that number be the same for every instance of Open Dental?

3) Do the Category ID's ever change?

We want to make sure that if we define what category a document is placed into that will not change or get messed up along the way for an account.

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

Re: Document Category clarification

Post by SLeon » Mon Mar 07, 2022 8:24 am

The DocCategory field for Documents can be any definition.DefNum where the definition.Category=18. This Definition category will always be 18 and will never change, however the dental office has control over the definitions in that category. They can add new ones as they see fit, and hide (not delete) existing ones, although this is uncommon.

1. There are two ways to get the definitions in this category.
  • By using Definitions GET and include the category in the url: /definitions?Category=18. This excludes hidden definitions.
  • By using Queries PUT ShortQuery, with "SqlCommand": "SELECT * FROM Definition WHERE Category=18"
2. While the definition.DefNum values could be the same across dental offices for some of the default definitions, it should not be assumed.

3. Because these definitions cannot be deleted, the definition.DefNum associated with defintion.ItemName="Patient Information" will always be the same for that dental office.

These links may provide additional information:
https://www.opendental.com/OpenDentalDo ... definition
https://www.opendental.com/site/apidefinitions.html
https://opendental.com/manual/definitionsimagecat.html

darcockerell
Posts: 11
Joined: Mon Jan 31, 2022 8:51 am

Re: Document Category clarification

Post by darcockerell » Wed Mar 09, 2022 8:19 am

Thank you!

Has anyone experienced two document items being created when importing? We tried both methods below - and both created one listing with the date and description - but when you click on it, it creates a second listing that is the actual file. How do we keep it one listing?

Documents POST Upload 
Documents POST SetByUrl 

You will see in the screen shot the two listing for each file the First listing is date and description - when you double click, the file is created in the folder and it creates a second item that is actually the file -- but with no description and the first item listing is still there.

screenshot: https://prnt.sc/AE7J7Sdi8Rhw

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

Re: Document Category clarification

Post by SLeon » Wed Mar 09, 2022 9:33 am

This issue was originally reported here https://www.opendentalsoft.com:8085/for ... 580#p34116 and a fix has been implemented. Updating to 21.4.22 should resolve this issue.

darcockerell
Posts: 11
Joined: Mon Jan 31, 2022 8:51 am

Re: Document Category clarification

Post by darcockerell » Tue Mar 15, 2022 12:06 pm

Thanks! I missed that thread when looking.

I've searched for anything on here about a size limit for placing documents/images/etc -- it looks like it starts erroring out at about 3MB but we can't find anything that officially gives a file size limit for what can be placed using the API.

Can you confirm the limit size and whether it is the same for all supported file types?

darcockerell
Posts: 11
Joined: Mon Jan 31, 2022 8:51 am

Re: Document Category clarification

Post by darcockerell » Mon Mar 21, 2022 8:18 am

Any answer about this?
I've searched for anything on here about a size limit for placing documents/images/etc -- it looks like it starts erroring out at about 3MB but we can't find anything that officially gives a file size limit for what can be placed using the API.

Can you confirm the limit size and whether it is the same for all supported file types?

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

Re: Document Category clarification

Post by SLeon » Mon Mar 21, 2022 8:31 am

Open Dental does not have a size limit for documents or images in the Image module. The only limitation you may encounter is if you are using the Documents POST Upload method, which takes a very large Base64 string. This string is stored the document.Note field, which is limited to 16 million characters. Any characters exceeding this length will be truncated.

Documents POST DownloadSftp is another way to transfer files with the API, and does not run into a size issue. I just used method this with a 12mb file without issue.

darcockerell
Posts: 11
Joined: Mon Jan 31, 2022 8:51 am

Re: Document Category clarification

Post by darcockerell » Thu Mar 24, 2022 9:11 am

Hm - when we test the limit is 3 million not 16 million

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

Re: Document Category clarification

Post by SLeon » Thu Mar 24, 2022 3:49 pm

I have confirmed there is an issue with transferring files greater than 3MB when using the Documents POST Upload method. We will investigate this immediately. In the meantime, Documents POST UploadSftp was added in 21.2 and easily handles larger files.

darcockerell
Posts: 11
Joined: Mon Jan 31, 2022 8:51 am

Re: Document Category clarification

Post by darcockerell » Tue Mar 29, 2022 9:09 am

Ok cool thanks for looking into this. We prefer to stick with the POST Upload method because moving to sftp would require that we change how we deal with attached files.

We are finding that when moving files using POST Upload method the Date Created changes when you actually open the file. Currently - if you move a document in using POST Upload and then click on that document days later the Date Created date changes to today's date - we assume this is because the document is not created into the images folder until you actually click on it in OD. This will be a problem for files that are uploaded in but not opened or referenced until weeks or months later.

I see in another thread that you made it possible to send a Date Created usingthe sftp Upload method. Is it possible for Date Created to be added for the regular POST Upload method?

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

Re: Document Category clarification

Post by SLeon » Tue Mar 29, 2022 9:21 am

We can absolutely add DateCreated to the Document POST Upload method. I have added it to our list and should be able start development rather shortly.

justine
Posts: 168
Joined: Tue Dec 28, 2021 7:59 am

Re: Document Category clarification

Post by justine » Wed Apr 06, 2022 10:30 am

darcockerell wrote:
Thu Mar 24, 2022 9:11 am
Hm - when we test the limit is 3 million not 16 million
darcockerell,

Documents POST Upload can now handle request lengths up to 16.8 million characters. This increased request length is available for use now.

A return message stating you have exceeded this limit has been implemented and will be available in 22.1.19.

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

Re: Document Category clarification

Post by SLeon » Wed Apr 13, 2022 9:48 am

darcockerell wrote:
Tue Mar 29, 2022 9:09 am
I see in another thread that you made it possible to send a Date Created usingthe sftp Upload method. Is it possible for Date Created to be added for the regular POST Upload method?
DateCreated has been added as an optional field in Documents POST Upload. This will be available in version 22.1.21. For more information, see https://www.opendental.com/site/apidocuments.html.

Post Reply