Skip to main content

Overview

In the Corti API, Templates define the structure for document that are generated by Corti AI models from various inputs, such as conversational transcripts, facts, or other medical documents. Read more about Templates. This page walks through advanced document generation workflows to cater to more specific needs.
This feature requires human oversight of its outputs

Assemble Templates with Existing Sections

If templates are difficult to predefine upfront due to the large variety in clinical documentation use cases, it might be better to approach things more flexibly. To do so, you can map the existing template sections to the relevant fields in the EHR or documentation. Then, assemble at run-time only the relevant sections to produce the documentation.
You can query the available sections via the /templateSections endpoint.
Instead of providing the templateKey in the request, you need to provide the array of sections you want to use, see the example request below.
We are deprecating sectionKeys in favour of sections. Read all details here
Document from assembled sections
  curl --request POST \
  --url https://api.$environment.corti.app/v2/interactions/$id/documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-Name: <tenant-name>' \
    --header 'Content-Type: application/json' \
    --data '{
    "context": [
      {
        "type": "facts",
        "data": [
          {
            "text": "32 year-old female",
            "group": "demographics",
          "source": "system"
          },
          {
            "text": "itchy rash, started last week",
            "group": "history-of-present-illness",
          "source": "core"
          },
          {
            "text": "allergic to birch pollen since childhood",
            "group": "allergies",
            "source": "core"
          },
          {
            "text": "typical eczema appearance",
            "group": "assessment",
            "source": "core"
          },
          {
            "text": "corticosteroid treatment, follow-up in 4 weeks",
            "group": "plan",
          "source": "user"
          }        
        ]
      }
    ],
    "template": {
          "sections": [
                        {"key": "corti-hpi"},
                        {"key": "corti-allergies"},
                        {"key": "corti-social-history"},
                        {"key": "corti-plan"},
          ] 
      },
    "outputLanguage": "en",
    "name": "Test from assembled sections",
    "documentationMode": "routed_parallel"
    }'
Any of the context types works with this method. The above request is for context.type: facts. Check the API reference for the different request formats depending on context being facts, transcript or string or see our guide here
Take things further by customizing existing sections

Working with Other Existing Documents

Your use case might also involve already existing documents such as reports, referral letters, etc. The Corti API was designed to offer such flexibility. Some of the use cases Corti has facilitated via the /documents endpoint include:
  • Summarizing an existing document or multiple documents
  • Identifying a match of an existing document based on defined criteria
  • Extracting action items for clinicians out of existing documents
Let’s look at the payload request in such a scenario:
Summary document based on historical notes
curl --request POST \
  --url https://api.$environment.corti.app/v2/interactions/$id/documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-Name: <tenant-name>' \
  --header 'Content-Type: application/json' \
  --data '{
  "context": [
    {
      "type": "string",
      "data": "<contents of documents or notes as string>"
    }
  ],
  "templateKey": "summary-of-notes",
    "outputLanguage": "en", # BCP-47 code
    "name": "Test summary of past notes"
  }'
The template used here is for demonstration purposes and will need tailoring for your specific use case. If you are interested in such a use case, please contact your Corti representative