GoRules Version 2 is here - redesigned, now with managed cloud.GoRules Version 2 is here!
Watch the launch videoWatchClinical Lab Results Interpreter
Automated system that evaluates laboratory test results against patient context to determine abnormalities and urgent follow-up actions.
Solution
This clinical decision support system analyzes laboratory test results to flag abnormal values and recommend appropriate follow-up actions. The solution evaluates key lab parameters such as glucose, potassium, hemoglobin, and creatinine against established medical thresholds, identifying critical values that require immediate intervention versus those needing routine monitoring.
The system enhances clinical decision-making by incorporating patient-specific context, including medical conditions, current medications, and known allergies. For patients with diabetes, the system evaluates glucose readings alongside medication regimens to assess risk levels. Similarly, for patients with kidney conditions, creatinine values trigger specialized recommendations. Based on this comprehensive analysis, the solution assigns urgency levels to each case-from routine to urgent-providing clear guidance on required follow-up timeframes and actions, ensuring critical abnormalities receive prompt attention while preventing unnecessary escalations.
How it works
The decision system follows a structured evaluation process:
- Lab Data Input: Processes incoming test results along with patient history including existing conditions, medications, and allergies.
- Basic Lab Evaluation: Analyzes each test result against standard clinical thresholds to identify abnormal or critical values.
- Patient Context Analysis: Evaluates abnormal results within the context of the patient's medical history and current medications.
- Risk Assessment: Assigns risk levels based on the combination of test results and patient-specific factors.
- Urgency Determination: Classifies cases from routine to urgent based on the presence of critical values and risk assessment.
- Follow-up Recommendation: Provides specific action steps and timeframes for clinical follow-up, ranging from immediate provider notification to routine review at next visit.
Where teams use it
- Primary care clinics processing daily lab results
- Hospital settings for inpatient monitoring
- Specialty clinics managing chronic disease patients
- Telehealth platforms for remote patient monitoring
- Emergency departments for rapid triage of lab results
- Clinical laboratories for automated flagging of critical values
Inside the decision model
Clinical Lab Results Interpreter ships as a JDM decision graph with 5 nodes, 4 decision tables and 19 rules. Download it, load it into GoRules, and run it as-is on Zen Engine.
Lab Results
inputLab data arrives as a testResults array, each entry carrying a testType, value, and date, plus a patientHistory object whose conditions, medications, and allergies later put abnormal readings into clinical context.
Sample requestJSON
{
"testResults": [
{
"testType": "glucose",
"value": 260,
"date": "2025-03-15"
},
{
"testType": "potassium",
"value": 3.2,
"date": "2025-03-15"
},
{
"testType": "hemoglobin",
"value": 10.2,
"date": "2025-03-15"
},
{
"testType": "creatinine",
"value": 1.7,
"date": "2025-03-15"
}
],
"patientHistory": {
"conditions": [
"diabetes",
"hypertension"
],
"medications": [
"metformin",
"lisinopril",
"atorvastatin"
],
"allergies": [
"penicillin"
]
}
}Basic Lab Evaluation
tableEach entry in testResults is evaluated separately because the table runs in loop mode over that array, writing flag, condition, and recommendation back onto every result. Potassium below 3.5 or above 6.0 is 'critical' ('Hypokalemia', 'Hyperkalemia') with urgent electrolyte and cardiac-monitoring guidance, glucose below 70 is critical 'Hypoglycemia' while above 200 is 'abnormal' 'Hyperglycemia', hemoglobin outside 8.5 to 18.0 flags 'Anemia' or 'Polycythemia', and creatinine above 1.5 flags 'Elevated Creatinine' with a prompt to reassess kidney function and dosing.
The thresholds sit at recognized reference-range boundaries: 70 is the standard hypoglycemia line and 3.5 the lower limit of normal potassium, and reserving the 'critical' flag for potassium and low glucose reflects the arrhythmia and neuroglycopenia risks that develop within hours. Automated flagging of this kind supports the critical-results reporting that laboratory accreditation and Joint Commission patient-safety goals require, though the exact cutoffs here are template simplifications of a lab's own critical-value list.
| Valuevalue | Test TypetestType | Flagflag | Conditioncondition | Recommendationrecommendation |
|---|---|---|---|---|
| < 3.5 | 'potassium' | 'critical' | 'Hypokalemia' | 'Urgent electrolyte replacement; ECG monitoring required' |
| > 6.0 | 'potassium' | 'critical' | 'Hyperkalemia' | 'Urgent intervention required; cardiac monitoring advised' |
| < 8.5 | 'hemoglobin' | 'abnormal' | 'Anemia' | 'Evaluate for blood loss or chronic disease' |
| > 18.0 | 'hemoglobin' | 'abnormal' | 'Polycythemia' | 'Evaluate for underlying conditions' |
| > 200 | 'glucose' | 'abnormal' | 'Hyperglycemia' | 'Monitor closely; adjust diabetes management if applicable' |
| < 70 | 'glucose' | 'critical' | 'Hypoglycemia' | 'Immediate glucose administration; evaluate medication regimen' |
+1 more row in the downloadable template
Patient Context Evaluation
tableCondition, medication, and result combine in each row: 'diabetes' in patientHistory.conditions plus a glucose-lowering drug ('metformin', 'insulin', 'glipizide') and a glucose above 250 yields 'high-risk' with follow-up inside 48 hours; 'heart_failure' pairs 'furosemide' or 'spironolactone' with a potassium reading above 3.0 to trigger electrolyte replacement and a diuretic review; 'kidney_disease' with creatinine above 2.0 calls for a nephrology consult; and 'warfarin' with an INR above 3.5 holds the next dose and watches for bleeding. There is no default row, so riskAssessment.level only appears when a recognized pattern fires.
Drug-lab interaction checks like these are standard clinical pharmacology: diuretics disturb potassium in both directions, furosemide wasting it and spironolactone retaining it, so heart failure patients on them get the tightest electrolyte scrutiny, and holding warfarin for a supratherapeutic INR above 3.5 matches routine anticoagulation-clinic protocol. The 250 and 2.0 cutoffs are stricter follow-up triggers than the generic flags upstream, which is the point: known chronic disease lowers the bar for action.
| ConditionpatientHistory.conditions | MedicationspatientHistory.medications | Additional condition | Risk LevelriskAssessment.level | Clinical RecommendationriskAssessment.clinicalRecommendation |
|---|---|---|---|---|
| 'diabetes' in $ | some($, # in ['metformin', 'insulin', 'glipizide']) | some(testResults, #.testType == 'glucose' and #.value > 250) | 'high-risk' | 'Schedule follow-up within 48 hours; consider insulin adjustment' |
| 'heart_failure' in $ | some($, # in ['furosemide', 'spironolactone']) | some(testResults, #.testType == 'potassium' and #.value > 3.0) | 'high-risk' | 'Urgent electrolyte replacement; evaluate diuretic dosage' |
| 'kidney_disease' in $ | - | some(testResults, #.testType == 'creatinine' and #.value > 2.0) | 'high-risk' | 'Nephrology consult; adjust medication dosages' |
| - | 'warfarin' in $ | some(testResults, #.testType == 'inr' and #.value > 3.5) | 'high-risk' | 'Hold next warfarin dose; monitor for bleeding' |
Urgency Assessment
tableEscalation runs on the derived flags: some(testResults, #.flag == 'critical') maps straight to 'urgent', riskAssessment.level == 'high-risk' to 'high', any 'abnormal' flag to 'moderate', and the empty final row to 'routine'. Row order encodes precedence, so a critical lab value outranks the patient-context assessment no matter what it concluded.
Collapsing everything into a single four-tier urgencyLevel mirrors how critical-value escalation works in practice, where a panic value always takes priority over chronic-disease context, and it gives downstream consumers one field to route on. Four tiers rather than a numeric score is a sensible business choice that keeps the follow-up table trivially auditable.
| Condition | Urgency LevelurgencyLevel |
|---|---|
| some(testResults, #.flag == 'critical') | 'urgent' |
| riskAssessment.level == 'high-risk' | 'high' |
| some(testResults, #.flag == 'abnormal') | 'moderate' |
| - | 'routine' |
Follow Up Determination
tableTimeframes attach last: 'urgent' cases require 'Immediate provider notification required' within '24 hours', 'high' recommends notification within '72 hours', 'moderate' folds into routine review inside '1 week', and 'routine' waits for the 'Next scheduled visit'. Both outputs land under followUp, giving the caller an action and a deadline in one place.
Putting explicit windows on follow-up reflects how clinics operationalize results-management policies, where notification and review times are documented and auditable rather than left to individual judgment. The specific 24-hour and 72-hour windows are program-level choices, tightened or relaxed per organization rather than set by regulation.
| UrgencyurgencyLevel | Action RequiredfollowUp.actionRequired | TimeframefollowUp.timeframe |
|---|---|---|
| 'urgent' | 'Immediate provider notification required' | '24 hours' |
| 'high' | 'Provider notification recommended' | '72 hours' |
| 'moderate' | 'Include in routine provider review' | '1 week' |
| 'routine' | 'No immediate action required' | 'Next scheduled visit' |
Other Healthcare templates
View all templatesPatient Triage System
Rules-based medical triage system that prioritizes patients in emergency departments based on vital signs, symptoms, and chief complaints.
HealthcareClinical Pathway Selection
Decision system that determines optimal treatment pathways based on diagnosis severity, comorbidities, and patient characteristics for personalized care plans.
HealthcareMedication Dosage Calculator
Clinical decision system that calculates precise medication dosages based on patient weight, age, and organ function to maximize safety and efficacy.
Make this template
your own.
Load Clinical Lab Results Interpreter into GoRules, adjust the rules to your policy, and ship it behind your own API.