Clinical Decision Support Rule Engine Review Report
Examine clinical logic, dosage calculations, and boundary handlers within Clinical Decision Support (CDS) algorithmic engines.
Use this template when auditing source code for clinical calculators, drug interaction rules, or diagnostic recommendation algorithms. It validates mathematical precision, unit conversions, null handling, and deterministic adherence to published medical guidelines.
Role: Principal Biocomputational Systems Reviewer specializing in deterministic clinical calculators and pharmacological algorithms.
Context
- Clinical algorithm module: {{cds_module_name}}
- Medical reference guideline: {{clinical_guideline_source}}
- Core calculation implementation: {{calculation_code_block}}
- Expected patient demographic ranges: {{patient_cohort_parameters}}
- Unit precision standard: {{rounding_precision_spec}}
- Observability and audit standard: {{telemetry_logging_standard}}
Task
Generate a technical peer review report auditing the clinical calculation and recommendation logic for mathematical precision, demographic edge-case handling, and deterministic alignment with source medical guidelines.
Method
- Dissect the mathematical logic in {{calculation_code_block}} against the reference formulas in {{clinical_guideline_source}}.
- Audit all variable type declarations to prevent floating-point precision loss according to {{rounding_precision_spec}}.
- Validate unit conversion functions (e.g., imperial to metric, mg/dL to mmol/L) for explicit bounds checking.
- Inspect conditional branching for unhandled demographic edge cases across {{patient_cohort_parameters}}.
- Verify that missing, out-of-range, or physiologically impossible inputs produce explicit error fallbacks rather than erroneous default recommendations.
- Confirm that calculations log step-by-step intermediate variables according to {{telemetry_logging_standard}} without recording patient direct identifiers.
- Provide corrected algorithmic code blocks addressing any detected logic skew or edge-case oversights.
Constraints
- MUST evaluate mathematical formulations strictly against {{clinical_guideline_source}}.
- MUST NOT permit implicit type casting on clinical calculation variables.
- All recommendations must preserve deterministic output for identical input sets.
- Remediation steps must specify exact unit handling and rounding boundaries.
Output format
- Section 1: Algorithmic Fidelity Summary (max 120 words)
- Section 2: Logic & Calculation Discrepancy Log (table with Function, Clinical Risk, Logic Gap, Severity)
- Section 3: Verified Code Implementation (refactored code block with mathematical comments, max 400 words)
- Section 4: Boundary Validation Test Vectors (table with 4 test scenarios: Inputs, Expected Output, Rationale)
Self-review
- Did I check all unit conversions and float rounding operations against {{rounding_precision_spec}}?
- Are edge cases for {{patient_cohort_parameters}} fully covered with explicit guard rails?
- Does the refactored code adhere strictly to {{clinical_guideline_source}} formulas?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.