Skip to content

Commit

Permalink
Merge pull request #2354 from opensafely-core/rw/decision-support-tidyup
Browse files Browse the repository at this point in the history
Removed the `algorithm_type` from the `decision_support_values` table
  • Loading branch information
rw251 authored Jan 14, 2025
2 parents 5e4a16a + 33016fe commit 5646fb9
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 24 deletions.
12 changes: 0 additions & 12 deletions docs/includes/generated_docs/schemas/tpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -1196,18 +1196,6 @@ Returns values computed by decision support algorithms, for example the
<div markdown="block" class="definition-list-wrapper">
<div class="title">Columns</div>
<dl markdown="block">
<div markdown="block">
<dt id="decision_support_values.algorithm_type">
<strong>algorithm_type</strong>
<a class="headerlink" href="#decision_support_values.algorithm_type" title="Permanent link">🔗</a>
<code>integer</code>
</dt>
<dd markdown="block">
A unique id for the decision support algorithm. Currently, the only option is '1' for the electronic frailty index.

</dd>
</div>

<div markdown="block">
<dt id="decision_support_values.calculation_date">
<strong>calculation_date</strong>
Expand Down
1 change: 0 additions & 1 deletion ehrql/backends/tpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ def _risk_cohort_format(risk_cohort):
"""
SELECT
decval.Patient_ID AS patient_id,
decval.AlgorithmType AS algorithm_type,
CAST(NULLIF(decval.CalculationDateTime, '9999-12-31T00:00:00') AS date) AS calculation_date,
decval.NumericValue AS numeric_value,
decvalref.AlgorithmDescription AS algorithm_description,
Expand Down
4 changes: 0 additions & 4 deletions ehrql/tables/tpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,10 +816,6 @@ class decision_support_values(EventFrame):
"""

algorithm_type = Series(
int,
description="A unique id for the decision support algorithm. Currently, the only option is '1' for the electronic frailty index.",
)
calculation_date = Series(
datetime.date,
description="Date of calculation for the decision support algorithm.",
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/backends/test_tpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,31 +1009,27 @@ def test_decision_support_values(select_all_tpp):
assert results == [
{
"patient_id": 1,
"algorithm_type": 1,
"calculation_date": date(2010, 1, 1),
"numeric_value": 37.5,
"algorithm_description": "UK Electronic Frailty Index (eFI)",
"algorithm_version": "1.0",
},
{
"patient_id": 1,
"algorithm_type": 1,
"calculation_date": date(2011, 1, 1),
"numeric_value": 40.5,
"algorithm_description": "UK Electronic Frailty Index (eFI)",
"algorithm_version": "1.0",
},
{
"patient_id": 1,
"algorithm_type": 1,
"calculation_date": date(2012, 1, 1),
"numeric_value": 45.0,
"algorithm_description": "UK Electronic Frailty Index (eFI)",
"algorithm_version": "1.0",
},
{
"patient_id": 1,
"algorithm_type": 1,
"calculation_date": date(2013, 1, 1),
"numeric_value": 47.0,
"algorithm_description": "UK Electronic Frailty Index (eFI)",
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/tables/test_tpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,23 +230,20 @@ def test_decision_support_values_electronic_frailty_index(
tpp.decision_support_values: [
dict(
patient_id=1,
algorithm_type=1,
calculation_date=date(2012, 1, 1),
numeric_value=25.0,
algorithm_description="UK Electronic Frailty Index (eFI)",
algorithm_version="1.0",
),
dict(
patient_id=1,
algorithm_type=1,
calculation_date=date(2010, 1, 1),
numeric_value=30.0,
algorithm_description="UK Electronic Frailty Index (eFI)",
algorithm_version="1.5",
),
dict(
patient_id=1,
algorithm_type=2,
calculation_date=date(2010, 1, 1),
numeric_value=25.0,
algorithm_description="A different index",
Expand Down

0 comments on commit 5646fb9

Please sign in to comment.