...
If something goes wrong during the triage of incoming measurements, it is important to inform the clinicians that they need to manually evaluate the received measurement. Depending on the type of failure, a task should be created to fix the problem.
The following types of exceptional situations have been identified during early testing of rules with clinicians.
Situation | Error | Cause | Handling |
---|---|---|---|
Library rule expects Observation or QuestionnaireResponse | Wrong input | Library linked with activity producing Observation where QuestionnaireResponse expected (or vice versa) |
|
Library for rule requires reference range, none defined. | No reference range | Could be caused by wrong configuration (by PlanDefinition editor) or because CareTeam for particular CarePlan has removed the reference range. |
|
Library for rule requires relative reference range type, only absolute reference range currently defined. | No reference range of proper type | Could be caused by wrong configuration (by PlanDefinition editor) or because CareTeam for particular CarePlan has removed the proper reference range. |
|
Library for rule requires reference ranges for components (Observation.component), none or only one defined. | No reference range for particular component (code) | Could be caused by wrong configuration (by PlanDefinition editor) or because CareTeam for particular CarePlan has removed the proper reference range. |
|
Library for rule requires reference range, wrong unit defined | Unit mismatch | Could be caused by wrong configuration (by PlanDefinition editor) or because CareTeam for particular CarePlan has updated reference range with wrong unit. |
|
Library for rule is relative and requires an active reference base to compare to. | No reference base / Reference base code mismatch | Could be caused by wrong configuration (by PlanDefinition editor) or because CareTeam for particular CarePlan has removed the reference base. |
|
Library for rule is relative and requires an active reference base to compare to. | No active reference base | Could be caused by reference base expiry. |
|
Library for rule requires reference base, wrong unit defined | Unit mismatch | Could be caused by wrong configuration (by PlanDefinition editor) or because CareTeam for particular CarePlan has updated reference base with wrong unit. |
|
Library for rule is relative and expects historic (previous) Observation within period of time | No historic Observation found | First Observation submitted or no Observation submitted in period. |
|
Library for rule expects QuestionnaireResponse with specific, required question/answer | Question/answer required by rule cannot be found | Either:
|
|
Coding error in rule/unforeseen and unhandled error situation | NullPointerException | Missing guards | Log entry |
To help handle these situtions situations a number of RuleExecutionExcptions has have been defined and made available to the rules:
...
This rule expects a QuestionnaireResponse as the primary input. If it is not found - for example because an observation was provided instead - then a MismatchedInputException
is thrown with a detailed error description and the ServiceRequest as the focus.
DefinedQuestions in rules for QuestionnaireResponses example
This is a map of questions and answers that results in red alerts. The key is the Questionnaire.item.definition
url URL without business version. A similar map exists for yellow alerts. The rule can be expanded with more questions and answers without changing anything else.
...
Code Block |
---|
function String getVersionlessDefinition(String definition) { if (definition.contains("|")) { return definition.substring(0,definition.indexOf("|")); } return definition; } |
The url URL is found by using the link from the answer in the QuestionnaireResponse to lookup look at the corresponding question in the Questionnaire
...