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.

    Possible values:
    pdf
    image
    template
  • 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 strings
    Description

    List of sections in the document.

  • Name
    comments
    Type
    array of strings
    Description

    List of comments added to the document.

  • Name
    addendums
    Type
    array of strings
    Description

    List of addendums appended to the document after the document has been signed and locked.

  • 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
    created_by
    Type
    string
    Description

    Creator of the document.

  • Name
    created_at
    Type
    number
    Description

    Timestamp (in ISO 8601 format) of when the document was created.

  • Name
    last_updated_at
    Type
    number
    Description

    Timestamp (in ISO 8601 format) of when the document was last updated.

Response

{
    "id": "document_2UxtAULYUrX7GVsTKePy",
    "object": "document",

    "type": "template",
    "document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
    "document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",

    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
    "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],
    "score": 8,

    "filename": "Group Meeting Notes — 9/18/22.pdf",
    "file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
    "name": "Group Meeting Notes — 9/18/22",
    "share_with_patient": false,

    "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],

    "comments": [
        "cmmt_op0jVVAdR23DgkQPpdX8"
    ],
    "addendums": [
        "addm_pdX8op0jVVAdR23DgkQP"
    ],

    "reviews": [],
    "signers": [{
        "status": "signedByProvider",
        "signed_by": "user_xeDpGyt67wTor93qKtS7",
        "signed_at": 1653798303000
    }],

    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}


POST/v2/documents

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.

    Possible values:
    pdf
    image
    template
  • 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. Defaults to whatever the default for this document template is. Only applies if the document template allows the default to be overridden.

  • Name
    review
    Type
    object
    Description
    Review of document.
  • Name
    signer
    Type
    string
    Description

    Signer of document.

Response

{
   "id": "document_2UxtAULYUrX7GVsTKePy",
    "object": "document",

    "type": "template",
    "document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
    "document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",

    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
    "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],
    "score":8,

    "filename": "Group Meeting Notes — 9/18/22.pdf",
    "file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
    "name": "Group Meeting Notes — 9/18/22",
    "share_with_patient": false,

    "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],

    "comments": [
        "cmmt_op0jVVAdR23DgkQPpdX8"
    ],
    "addendums": [
        "addm_pdX8op0jVVAdR23DgkQP"
    ],

    "reviews": [],
    "signers": [],
    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}

GET/v2/documents/:id

Retrieve a document

Retrieves the specified document.

Response

{
    "id": "document_2UxtAULYUrX7GVsTKePy",
    "object": "document",

    "type": "template",
    "document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
    "document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",

    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
    "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],
    "score":8,

    "filename": "Group Meeting Notes — 9/18/22.pdf",
    "file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
    "name": "Group Meeting Notes — 9/18/22",
    "share_with_patient": false,

    "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],

    "comments": [
        "cmmt_op0jVVAdR23DgkQPpdX8"
    ],
    "addendums": [
        "addm_pdX8op0jVVAdR23DgkQP"
    ],

    "reviews": [],
    "signers": [{
      "status": "signedByProvider",
      "signed_by": "user_xeDpGyt67wTor93qKtS7",
      "signed_at": 1653798303000
    }],
    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}

POST/v2/documents/:id

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. Defaults to whatever the default for this document template is. Only applies if the document template allows the default to be overridden.

    • Name
      review
      Type
      object
      Description
      Review of document.
    • Name
      signer
      Type
      string
      Description

      Signer of document.

    Response

    {
        "id": "document_2UxtAULYUrX7GVsTKePy",
        "object": "document",
    
        "type": "template",
        "document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
        "document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
    
        "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
        "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],
        "score":8,
    
        "filename": "Group Meeting Notes — 9/18/22.pdf",
        "file": "JVBERi0xLjQKJeLjz9MNCjQgMCBvYm...",
        "name": "Group Meeting Notes — 9/18/22",
        "share_with_patient": false,
    
        "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],
    
        "comments": [
            "cmmt_op0jVVAdR23DgkQPpdX8"
        ],
        "addendums": [
            "addm_pdX8op0jVVAdR23DgkQP"
        ],
    
        "reviews": [],
        "signers": [{
          "status": "signedByProvider",
          "signed_by": "user_xeDpGyt67wTor93qKtS7",
          "signed_at": 1653798303000
        }],
    
        "created_by": "user_xeDpGyt67wTor93qKtS7",
        "created_at": 1653798303000,
        "last_updated_at": 1653798303000
    }
    

    GET/v2/documents

    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

    GET
    /v2/documents
    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": "document_2UxtAULYUrX7GVsTKePy",
            "object": "document",
    
            "type": "template",
            "document_template": "dtmp_NOIYLBGOBNhSwTWCUzfu",
            "document_template_version": "dtmv_1JtjV1QEY84Fv395Hl7h",
    
            "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
            "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],
            "score":8,
    
            "filename": "Group Meeting Notes — 9/18/22.pdf",
            "name": "Group Meeting Notes — 9/18/22",
            "share_with_patient": false,
    
            "sections": ["dsec_2UxtAULYUrX7GVsTKePy"],
    
            "comments": [
                "cmmt_op0jVVAdR23DgkQPpdX8"
            ],
            "addendums": [
                "addm_pdX8op0jVVAdR23DgkQP"
            ],
    
            "reviews": [],
            "signers": [{
              "status": "signedByProvider",
              "signed_by": "user_xeDpGyt67wTor93qKtS7",
              "signed_at": 1653798303000
            }],
    
            "created_by": "user_xeDpGyt67wTor93qKtS7",
            "created_at": 1653798303000,
            "last_updated_at": 1653798303000
        },
      ]
    }