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 generating documents from facts vs transcripts.This feature requires human oversight of its outputs
Steps to Generate Documents
- Review and Finalize Input:
- Using FactsR™: If you extract facts from an ambient conversation or an existing transcript or document, you can enable the clinician to review and make final edits to the extracted facts, or discard irrelevant ones. You can then exclude discarded and only include the finalized facts to generate the document. You can also include additional facts derived from the EHR/EMR in your request.
- Using transcript: You can generate documents based only on the transcript as input. We recommend utilising only the stringified text of the returned transcript. In contrast to the next option, the LLM is made aware of the input source being a transcript.
- Using other text: You can generate documents also based on any other stringified text.
-
Make a POST Request: Send a
POSTrequest to the/interactions/{id}/documentsendpoint, and include the data input according to the chosencontext.type,templateKey, andoutputLanguagein the request payload.- The ‘templateKey’ parameter defines the format of the output document.
- The ‘outputLanguage’ parameter defines the language the output note will be written in.
- Please see this page for a list of supported language codes.
- Use the
GET /templatesrequest to see available templates; add?lang=to the request to filter for available languages. - Retention Policy:
If you do not want the generated document to be saved to the database, you can add the headerX-Corti-Retention-Policy: noneto your request. When this header is set, the API will generate and return the document as usual, but will not persist it. The response will include the headerX-Corti-Retention-Policy: acknowledgedto confirm that your retention preference was respected.
-
Processing the Request and Receiving the Document: The API processes the submitted data, applying the specified template to generate the structured document. If the request is successful, the API returns a
200 OKstatus along with the formatted document in markdown text.
Generate Document from Facts vs. from Transcript
For the typical real-time ambient documentation workflow, summary documentation can be generated either on the basis of facts or the transcript. If your integration is centered around facts, those would typically have been extracted automatically during the live stream (source: core) but you might have also created facts to pipe over relevant pre-chart information, e.g. demographics (source: system), or have given the clinician the ability to add and edit live notes (source: user). In the end, you decide which facts to use as the basis to generate a document.
If you workflow is not centred around a real-time ambient conversation, you can also extract facts from a text input, or generate the transcript based on an existing audio recording.
Let’s look at the differences in the request payload when generating a document on the basis of facts vs. a transcript.
Generate Document from Facts as Input
Document from facts - static template
Generate Document from Transcript as Input
Document from transcript - static template
Document generation based on a transcript supports definition of one “data” object and one “text” object in the request, as seen above. If your transcript contains multiple text strings, they will need to be combined into a single string.