Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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)

  1. Create task to CareTeam that other PlanDefinition related to Library with matching input should be created or used. 

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.

  1. Rule could have fallback

  2. Create task for CareTeam to add reference range of proper type

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.

  1. Rule could have fallback

  2. Create task for CareTeam to add reference range of proper type

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.

  1. Rule could have fallback

  2. Create task for CareTeam to add reference range of proper type

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.

  1. Create task for CareTeam to correct 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.

  1. Rule could have fallback

  2. Create task for CareTeam to add reference base in force

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.

  1. Rule could have fallback

  2. Create task for CareTeam to add reference base in force

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.

  1. Create task for CareTeam to correct 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.

  1. Rule could have fallback

  2. Create task to CareTeam that other PlanDefinition with other related Library with other period of time should be considered/be applied to Patient

    1. This does not handle first Observation submitted

Library for rule expects QuestionnaireResponse with specific, required question/answer

Question/answer required by rule cannot be found

Either:

  • Rule is requiring answer for a question which is not enabled (or in path) or the question is optional

  • Rule is used with a Questionnaire where the required question/answer has been removed.

  1. Rule could have fallback, alternative handling

  2. Create task to CareTeam that answer required by the rule has not been provided.

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

...