Heidi widget
Custom templates

Custom Templates

One of the most powerful aspects of the Heidi Widget is the ability to use a custom template.

We recognise that many EHRs allow users to create custom templates that have a diverse set of fields and question types.

When the Heidi Widget is launched, you can pass through a template using the Widget open parameters.

If this is done, then after transcription, Heidi will generate answers to all the questions in this template.

When Heidi.onPushData(callback) is triggered, Heidi will send back a JSON template with all the answers included. These answers can then be placed back into the relevant fields in your EHR.

Note that these templates are passed when Heidi is launched. It is a dynamic process that will require you to take the active EHR template and transform it into a JSON format that Heidi can accept.

Template

AttributeType
contentstring
responsesTemplateQuestion[]
summaryRequiredboolean

TemplateQuestion

AttributeTypeRequiredComment
questionIdstringtrue
questionstringtrue
answerstring[]falseNo need for input request, the answer will be returned in structured data response
answerTypeAnswerTypetruePlease refer to the enum below
answerOptionsstring[]trueIf AnswerType is TextArea or DateResponse, should be empty array;
If AnswerType is SingleResponse or MultipleResponse, should be provided.
dateFormatstringfalseIf AnswerType is DateResponse, this field is required. Please provide the date format you want. E.G. YYYY/MM/DD

AnswerType Enum

Attribute
'SingleResponse'
'MultipleResponse'
'TextArea'
'DateResponse'

TypeScript Interface

interface Template {
  content: string;
  responses: TemplateQuestion[];
  summaryRequired: boolean;
}
 
interface TemplateQuestion {
  questionId: string;
  question: string;
  answer: string[];
  answerType: AnswerType;
  answerOptions: string[];
  dateFormat: string;
}
 
type AnswerType = 'SingleResponse' | 'MultipleResponse' | 'TextArea' | 'DateResponse';