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
Attribute | Type |
---|---|
content | string |
responses | TemplateQuestion[] |
summaryRequired | boolean |
TemplateQuestion
Attribute | Type | Required | Comment |
---|---|---|---|
questionId | string | true | |
question | string | true | |
answer | string[] | false | No need for input request, the answer will be returned in structured data response |
answerType | AnswerType | true | Please refer to the enum below |
answerOptions | string[] | true | If AnswerType is TextArea or DateResponse, should be empty array; If AnswerType is SingleResponse or MultipleResponse, should be provided. |
dateFormat | string | false | If 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';