DetectedIssue
Introduction #
The DetectedIssue model represents an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient.
Basic usage #
To get a detected issue by identifier, use the get method on the DetectedIssue model manager:
from canvas_sdk.v1.data.detected_issue import DetectedIssue
detected_issue = DetectedIssue.objects.get(id="b80b1cdc-2e6a-4aca-90cc-ebc02e683f35")
If you have a patient object, the detected issues for a patient can be accessed with the detected_issues attribute on a Patient object:
from canvas_sdk.v1.data.patient import Patient
patient = Patient.objects.get(id="1eed3ea2a8d546a1b681a2a45de1d790")
detected_issues = patient.detected_issues.all()
Evidence #
The codings for the evidence of a detected issue can be accessed with the evidence attribute on a DetectedIssue object:
from canvas_sdk.v1.data.detected_issue import DetectedIssue
from logger import log
detected_issue = DetectedIssue.objects.get(id="b80b1cdc-2e6a-4aca-90cc-ebc02e683f35")
for coding in detected_issue.evidence.all():
log.info(f"system: {coding.system}")
log.info(f"code: {coding.code}")
log.info(f"display: {coding.display}")
Filtering #
Detected issues can be filtered by any attribute that exists on the model.
Filtering for detected issues is done with the filter method on the DetectedIssue model manager.
By attribute #
Specify an attribute with filter to filter by that attribute:
from canvas_sdk.v1.data.detected_issue import DetectedIssue
detected_issues = DetectedIssue.objects.filter(status="active")
Committed detected issues #
The committed method returns detected issues that have been committed and not entered in error:
from canvas_sdk.v1.data.detected_issue import DetectedIssue
committed_detected_issues = DetectedIssue.objects.committed()
Attributes #
DetectedIssue #
| Field Name | Type |
|---|---|
| id | UUID |
| dbid | Integer |
| created | DateTime |
| modified | DateTime |
| identified | DateTime |
| originator | CanvasUser |
| committer | CanvasUser |
| entered_in_error | CanvasUser |
| patient | Patient |
| code | String |
| status | DetectedIssueStatus |
| severity | DetectedIssueSeverity |
| reference | String |
| issue_identifier | String |
| issue_identifier_system | String |
| detail | String |
| evidence | DetectedIssueEvidence[] |
| assessed_coding_gap_events | AssessCodingGapEvent[] |
| created_coding_gap_events | CreateCodingGapEvent[] |
| deferred_coding_gap_events | DeferCodingGapEvent[] |
| validated_coding_gap_events | ValidateCodingGapEvent[] |
DetectedIssueEvidence #
| Field Name | Type |
|---|---|
| id | UUID |
| dbid | Integer |
| system | String |
| version | String |
| code | String |
| display | String |
| user_selected | Boolean |
| detected_issue | DetectedIssue |
DetectedIssueStatus #
Available on the model as DetectedIssue.Status, so a comparison reads detected_issue.status == DetectedIssue.Status.FINAL.
| Enum | Value | Label |
|---|---|---|
| REGISTERED | registered | Registered |
| PRELIMINARY | preliminary | Preliminary |
| CANCELLED | cancelled | Cancelled |
| AMENDED | amended | Amended |
| FINAL | final | Final |
| CORRECTED | corrected | Corrected |
| ENTERED_IN_ERROR | entered-in-error | Entered in Error |
DetectedIssueSeverity #
Available on the model as DetectedIssue.Severity. A detected issue that carries no severity holds an empty string rather than None.
| Enum | Value | Label |
|---|---|---|
| HIGH | high | High |
| MODERATE | moderate | Moderate |
| LOW | low | Low |