Document
A document is a catch-all term for a PDF uploaded, an image uploaded, or a custom document created from a document-template.
The document model
Properties
- Name
id- Type
- string
- Description
Unique identifier for the document.
- Name
object- Type
- string
- Description
Always 'document'.
- Name
type- Type
- string
- Description
Type of document.
pdfimagetemplate
Possible values:- Name
document_template- Type
- string
- Description
Template this document is based on.
- Name
document_template_version- Type
- string
- Description
Template version this document is based on.
- Name
patient- Type
- string
- Description
Patient this document is for.
- Name
sections- Type
- array of strings
- Description
List of sections in the document.
- Name
score- Type
- number
- Description
Score of the document.
- Name
filename- Type
- string
- Description
Name of the document.
- Name
file- Type
- string
- Description
File of the document in base64 format.
- Name
name- Type
- string
- Description
Name of the document.
- Name
share_with_patient- Type
- boolean
- Description
Whether this document should be shared with the patient.
- Name
sections- Type
- array of objects
- Description
List of sections in the document.
- Name
comments- Type
- array of objects
- Description
List of comments added to the document.
- Name
addendums- Type
- array of objects
- Description
List of addendums appended to the document after the document has been signed and locked.
- Name
tags- Type
- array of objects
- Description
- List of tags associated with this document.
- Name
reviews- Type
- array of objects
- Description
- Review history of the document.
- Name
signers- Type
- array of objects
- Description
- Signing history of the document.
- Name
external_id- Type
- string
- Description
A client-specified unique ID to associate with this document.
- Name
created_by- Type
- string
- Description
Creator of the document.
- Name
created_at- Type
- date-time
- Description
Timestamp (in ISO 8601 format) of when the document was created.
- Name
last_updated_at- Type
- date-time
- Description
Timestamp (in ISO 8601 format) of when the document was last updated.
Response
{
"id": "doc_2UxtAULYUrX7GVsTKePy",
"object": "document",
"type": "template",
"document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
"document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
"patient": "user_Z1zXZKvqrpwxbznuW6lJ",
"score": 8,
"filename": "Group Meeting Notes — 9/18/22.pdf",
"file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
"name": "Group Meeting Notes — 9/18/22",
"share_with_patient": false,
"sections": [{
"id": "dsec_U8xtAULYUrX7GVsTKePy",
"object": "document_section",
"name": "Section 1",
"logic": [{
"field": "dqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}],
"answers": [
{
"id": "dans_U8xtAULYUrX7GVsTKePy",
"object": "document_answer",
"document": "doc_841JtjV1QEYFv395Hl7h",
"question": "dqst_1JtjV1QEY84Fv395Hl7h",
"patient": "user_3951JtjV1QEY84FvHl7h",
"type": "short_answer",
"name": "What's your first name?",
"response": "Sally Chen"
}
],
}],
"comments": [{
"id": "cmmt_op0jVVAdR23DgkQPpdX8",
"object": "comment",
"comment": "This is a comment.",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"addendums": [{
"id": "addm_pdX8op0jVVAdR23DgkQP",
"object": "addendum",
"addendum": "This is an addendum.",
"committed_to_record": true,
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"tags": [{
"id": "tag_VAdR23Dp0jVVAdR23DgkQP",
"name": "Lab Result",
}]
"reviews": [],
"signers": [{
"status": "signed_by_provider",
"signed_by": "user_xeDpGyt67wTor93qKtS7",
"signed_at": "2024-04-10T13:20:21.724Z"
}],
"external_id": "tS7xeDpGytFHKJK01ksjnfwwro",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
Create a document
Creates a new visit document.
Required attributes
- Name
patient- Type
- string
- Description
Patient this document is for.
- Name
type- Type
- string
- Description
Type of document.
pdfimagetemplate
Possible values:- Name
filename- Type
- string
- Description
Only applies to PDFs. Name of the document.
- Name
file- Type
- string
- Description
Only applies to PDFs and images. File of the document in base64 format.
- Name
document_template- Type
- string
- Description
Only applies to templates. Template this document is based on.
Optional attributes
- Name
name- Type
- string
- Description
Name of the document.
- Name
share_with_patient- Type
- boolean
- Description
Whether this document should be shared with the patient.
- Name
review- Type
- object
- Description
- Review of document.
- Name
signer- Type
- string
- Description
Signer of document.
- Name
tags- Type
- array of objects
- Description
- List of tags associated with this document.
- Name
external_id- Type
- string
- Description
A client-specified unique ID to associate with this document.
Response
{
"id": "doc_2UxtAULYUrX7GVsTKePy",
"object": "document",
"type": "template",
"document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
"document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
"patient": "user_Z1zXZKvqrpwxbznuW6lJ",
"score": 8,
"filename": "Group Meeting Notes — 9/18/22.pdf",
"file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
"name": "Group Meeting Notes — 9/18/22",
"share_with_patient": false,
"sections": [{
"id": "dsec_U8xtAULYUrX7GVsTKePy",
"object": "document_section",
"name": "Section 1",
"logic": [{
"field": "dqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}],
"answers": [
{
"id": "dans_U8xtAULYUrX7GVsTKePy",
"object": "document_answer",
"document": "doc_841JtjV1QEYFv395Hl7h",
"question": "dqst_1JtjV1QEY84Fv395Hl7h",
"patient": "user_3951JtjV1QEY84FvHl7h",
"type": "short_answer",
"name": "What's your first name?",
"response": "Sally Chen"
}
],
}],
"comments": [{
"id": "cmmt_op0jVVAdR23DgkQPpdX8",
"object": "comment",
"comment": "This is a comment.",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"addendums": [{
"id": "addm_pdX8op0jVVAdR23DgkQP",
"object": "addendum",
"addendum": "This is an addendum.",
"committed_to_record": true,
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"tags": [{
"id": "tag_VAdR23Dp0jVVAdR23DgkQP",
"name": "Lab Result",
}]
"reviews": [],
"signers": [{
"status": "signed_by_provider",
"signed_by": "user_xeDpGyt67wTor93qKtS7",
"signed_at": "2024-04-10T13:20:21.724Z"
}],
"external_id": "tS7xeDpGytFHKJK01ksjnfwwro",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
Retrieve a document
Retrieves the specified document.
Response
{
"id": "doc_2UxtAULYUrX7GVsTKePy",
"object": "document",
"type": "template",
"document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
"document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
"patient": "user_Z1zXZKvqrpwxbznuW6lJ",
"score": 8,
"filename": "Group Meeting Notes — 9/18/22.pdf",
"file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
"name": "Group Meeting Notes — 9/18/22",
"share_with_patient": false,
"sections": [{
"id": "dsec_U8xtAULYUrX7GVsTKePy",
"object": "document_section",
"name": "Section 1",
"logic": [{
"field": "dqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}],
"answers": [
{
"id": "dans_U8xtAULYUrX7GVsTKePy",
"object": "document_answer",
"document": "doc_841JtjV1QEYFv395Hl7h",
"question": "dqst_1JtjV1QEY84Fv395Hl7h",
"patient": "user_3951JtjV1QEY84FvHl7h",
"type": "short_answer",
"name": "What's your first name?",
"response": "Sally Chen"
}
],
}],
"comments": [{
"id": "cmmt_op0jVVAdR23DgkQPpdX8",
"object": "comment",
"comment": "This is a comment.",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"addendums": [{
"id": "addm_pdX8op0jVVAdR23DgkQP",
"object": "addendum",
"addendum": "This is an addendum.",
"committed_to_record": true,
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"tags": [{
"id": "tag_VAdR23Dp0jVVAdR23DgkQP",
"name": "Lab Result",
}]
"reviews": [],
"signers": [{
"status": "signed_by_provider",
"signed_by": "user_xeDpGyt67wTor93qKtS7",
"signed_at": "2024-04-10T13:20:21.724Z"
}],
"external_id": "tS7xeDpGytFHKJK01ksjnfwwro",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
Update a document
Update the specified document object by setting the values of the parameters passed. Any other parameters not provided will not be modified.
Required attributes
Optional attributes
- Name
filename- Type
- string
- Description
Only applies to PDFs. Name of the document.
- Name
file- Type
- string
- Description
Only applies to PDFs and images. File of the document in base64 format.
- Name
name- Type
- string
- Description
Name of the document.
- Name
share_with_patient- Type
- boolean
- Description
Whether this document should be shared with the patient.
- Name
review- Type
- object
- Description
- Review of document.
- Name
signer- Type
- string
- Description
Signer of document.
- Name
external_id- Type
- string
- Description
A client-specified unique ID to associate with this document.
Response
{
"id": "doc_2UxtAULYUrX7GVsTKePy",
"object": "document",
"type": "template",
"document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
"document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
"patient": "user_Z1zXZKvqrpwxbznuW6lJ",
"score": 8,
"filename": "Group Meeting Notes — 9/18/22.pdf",
"file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
"name": "Group Meeting Notes — 9/18/22",
"share_with_patient": false,
"sections": [{
"id": "dsec_U8xtAULYUrX7GVsTKePy",
"object": "document_section",
"name": "Section 1",
"logic": [{
"field": "dqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}],
"answers": [
{
"id": "dans_U8xtAULYUrX7GVsTKePy",
"object": "document_answer",
"document": "doc_841JtjV1QEYFv395Hl7h",
"question": "dqst_1JtjV1QEY84Fv395Hl7h",
"patient": "user_3951JtjV1QEY84FvHl7h",
"type": "short_answer",
"name": "What's your first name?",
"response": "Sally Chen"
}
],
}],
"comments": [{
"id": "cmmt_op0jVVAdR23DgkQPpdX8",
"object": "comment",
"comment": "This is a comment.",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"addendums": [{
"id": "addm_pdX8op0jVVAdR23DgkQP",
"object": "addendum",
"addendum": "This is an addendum.",
"committed_to_record": true,
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"tags": [{
"id": "tag_VAdR23Dp0jVVAdR23DgkQP",
"name": "Lab Result",
}]
"reviews": [],
"signers": [{
"status": "signed_by_provider",
"signed_by": "user_xeDpGyt67wTor93qKtS7",
"signed_at": "2024-04-10T13:20:21.724Z"
}],
"external_id": "tS7xeDpGytFHKJK01ksjnfwwro",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
Sign a document
Signs a document. The user whose jwt is passed in the header is set as the signer.
Response
{
"id": "doc_2UxtAULYUrX7GVsTKePy",
"object": "document",
"type": "template",
"document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
"document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
"patient": "user_Z1zXZKvqrpwxbznuW6lJ",
"score": 8,
"filename": "Group Meeting Notes — 9/18/22.pdf",
"file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
"name": "Group Meeting Notes — 9/18/22",
"share_with_patient": false,
"sections": [{
"id": "dsec_U8xtAULYUrX7GVsTKePy",
"object": "document_section",
"name": "Section 1",
"logic": [{
"field": "dqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}],
"answers": [
{
"id": "dans_U8xtAULYUrX7GVsTKePy",
"object": "document_answer",
"document": "doc_841JtjV1QEYFv395Hl7h",
"question": "dqst_1JtjV1QEY84Fv395Hl7h",
"patient": "user_3951JtjV1QEY84FvHl7h",
"type": "short_answer",
"name": "What's your first name?",
"response": "Sally Chen"
}
],
}],
"comments": [{
"id": "cmmt_op0jVVAdR23DgkQPpdX8",
"object": "comment",
"comment": "This is a comment.",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"addendums": [{
"id": "addm_pdX8op0jVVAdR23DgkQP",
"object": "addendum",
"addendum": "This is an addendum.",
"committed_to_record": true,
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"tags": [{
"id": "tag_VAdR23Dp0jVVAdR23DgkQP",
"name": "Lab Result",
}]
"reviews": [],
"signers": [{
"status": "signed_by_provider",
"signed_by": "user_xeDpGyt67wTor93qKtS7",
"signed_at": "2024-04-10T13:20:21.724Z"
}],
"external_id": "tS7xeDpGytFHKJK01ksjnfwwro",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
List all documents
Returns a list of all documents. The full base64 encoded file may not be returned in the list.
Optional query parameters
- Name
document_template- Type
- string
- Description
Document template to filter by.
- Name
document_template_version- Type
- string
- Description
Document template version to filter by.
- Name
patient- Type
- string
- Description
Patient to filter by.
Request
curl https://{{base_subdomain}}.avonhealth.com/v2/documents?document_template=dtmp_NOIYLBGOBNhSwTWCUzfu&document_template_version=dtmv_1JtjV1QEY84Fv395Hl7h&patient=user_Z1zXZKvqrpwxbznuW6lJ \
-H "Authorization: Bearer {{token}}" \
-H "x-jwt: {{jwt}}"
Response
{
"object": "list",
"data": [
{
"id": "doc_2UxtAULYUrX7GVsTKePy",
"object": "document",
"type": "template",
"document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
"document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
"patient": "user_Z1zXZKvqrpwxbznuW6lJ",
"score": 8,
"filename": "Group Meeting Notes — 9/18/22.pdf",
"file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
"name": "Group Meeting Notes — 9/18/22",
"share_with_patient": false,
"sections": [{
"id": "dsec_U8xtAULYUrX7GVsTKePy",
"object": "document_section",
"name": "Section 1",
"logic": [{
"field": "dqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}],
"answers": [
{
"id": "dans_U8xtAULYUrX7GVsTKePy",
"object": "document_answer",
"document": "doc_841JtjV1QEYFv395Hl7h",
"question": "dqst_1JtjV1QEY84Fv395Hl7h",
"patient": "user_3951JtjV1QEY84FvHl7h",
"type": "short_answer",
"name": "What's your first name?",
"response": "Sally Chen"
}
],
}],
"comments": [{
"id": "cmmt_op0jVVAdR23DgkQPpdX8",
"object": "comment",
"comment": "This is a comment.",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"addendums": [{
"id": "addm_pdX8op0jVVAdR23DgkQP",
"object": "addendum",
"addendum": "This is an addendum.",
"committed_to_record": true,
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
}],
"tags": [{
"id": "tag_VAdR23Dp0jVVAdR23DgkQP",
"name": "Lab Result",
}]
"reviews": [],
"signers": [{
"status": "signed_by_provider",
"signed_by": "user_xeDpGyt67wTor93qKtS7",
"signed_at": "2024-04-10T13:20:21.724Z"
}],
"external_id": "tS7xeDpGytFHKJK01ksjnfwwro",
"created_by": "user_xeDpGyt67wTor93qKtS7",
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
},
]
}