Namespaces

Documents

ovok.documents stores files such as reports and consent forms. It lists and deletes documents,

  • Stable unknown
  • Release candidate since 0.1.0-rc.3
  • Development since 0.1.0-dev.21+c43ebba

ovok.documents stores files such as reports and consent forms. It lists and deletes documents, starts uploads, updates metadata and builds download URLs.

Upload a document

create_upload() creates the document and returns where to upload its file. replace_upload() does the same for a new version of an existing document.

from ovok_sdk import Ovok

ovok = Ovok("https://api.sandbox.ovok.com", "your-tenant")
document = ovok.documents.create_upload({"name": "report.pdf", "contentType": "application/pdf"})

List, update and delete documents

documents = ovok.documents.list({"patientId": "patient-id"})
ovok.documents.update_metadata("document-id", {"name": "Discharge report"})
ovok.documents.delete("document-id")

download_url() and public_download_url() only build the URL; they send no request. A public URL takes the document's share token instead of its ID.

url = ovok.documents.download_url("document-id")
shared = ovok.documents.public_download_url("public-token")

API reference

See ovok_sdk.resources.documents for every method, parameter and error.

Last updated on

On this page