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, Corti can partner with you to pre-define the relevant number of sections that could map back to relevant fields in the EHR or documentation. Then, those sections can be assembled to form the relevant documentation template.
You can also query the available sections via the /templateSections endpoint.
Instead of providing the templateKey in the request, you need to provide the array of sectionKeys like below.
Any of the context types works with this method. The below 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
Document from assembled sections
  curl --request POST \
  --url https://api.$environment.corti.app/v2/interactions/$id/documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-Name: <tenantname>' \
    --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": {
          "sectionKeys": [
              "signs-and-symptoms",
              "allergies",
              "clinical-history",
              "social-history-including-smoking-and-alcohol",
              "assessment-bowel-ultrasound"
          ] 
      },
    "outputLanguage": "en",
      "name": "Test from assembled sections"  
    }'

Assemble a Template with Extra Instructions

Consider the following use case:
  • A pre-defined template is not desired for a dictated clinical note; however, the note should always include a few standardized elements that are selected based on the context of the encounter.
  • Corti partnered with the customer to pre-define around 50 sections for use in the documentation workflow
  • Based on the specialty and encounter type, a subset of the pre-defined sections are selected at the time of generating the document.
  • Additional instructions need to be followed in addition to using the assembled sections
Let’s look at the payload request in that scenario:
Document from transcript - dynamic template
curl --request POST \
--url https://api.$environment.corti.app/v2/interactions/$id/documents \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-Name: <tenantname>' \
  --header 'Content-Type: application/json' \
  --data '{
  "context": [
    {
    "type": "transcript",
    "data": {
      "text": "<dictated transcript content as string>"
      }
    }
  ],
  "templateKey": "template-for-dynamic-sections",
  "template": {
        "sectionKeys": [
            "signs-and-symptoms",
            "allergies",
            "clinical-history",
            "social-history-including-smoking-and-alcohol",
            "assessment-bowel-ultrasound"
        ] 
    },
  "outputLanguage": "en", # BCP-47 code
    "name": "Test from dynamic sections"  
  }'
Any of the context types works with this method. The above request is for context.type: transcript. Check the API reference for the different request formats depending on context being facts, transcript or string.

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: <tenantname>' \
  --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
I