EP-Predict calculator input model

From Endeavour Knowledge Base

The input model consists of a list of requested engines and a set of variables with values as described in the below table. The table describes the various parameters and their derivation and relevance to each algorithm

For application providers that wish to calculate the defaults, a set of value sets are available either via the REST API or via the Endeavour Predict Information manager application, both of which use the EP ontology server.

For example for QRISK3 the sets can be viewed at https://im.endeavourhealth.net/#/directory/folder/http:%2F%2Fapiqcodes.org%2Fqcodes%23QPredict_331

Each concept set is universally identified with an RDF IRI (which is in the format of a URL) and the base iri namespace for Q concept sets is

"http://apiqcodes.org/qcodes#QCodeGroup_" thus in the below table the numbers following this base IRI are used for brevity

When querying records it is assumed that a reference date is used and that entry dates are relative to the reference date and that any entry after the reference date is ignored.

Input parameters needed to calculate a QRISK3® score and their handling are as follows:

Parameter Type Values Algorithms Description and query definition
Row id integer All Used by the client as a reference when a batch API is used. i.e. returned by the result.

It has no scope beyond the API request/response

Age integer All Age of the person in years at the reference date
Gender Character Male - M

Female - F

All The Gender of the patient. Note that the risk following gender

transition is unknown, and thus a clinical judgement as to whether

to use the category of male or category of female.

Cardiovascular disease boolean true

false

QRISK3 Cardiovascular disease prior to the reference date

This is an inclusion criteria and should therefore be false. A valid RISK score requires absence of cardiovascular disease. Query defined as

Condition with concept of code group 411

Atrial fibrillation boolean true

false

QRISK3 Atrial fibrillation at any time prior to reference date.

QRisk does not differentiate a single one off AF event from chronic or intermittent AF. Clinical interpretation may be required for those with a single event many years ago. Query defined as

Observation with concept of code group 24

Erectile impotence boolean true

false

QRISK3 A diagnosis of Erectile dysfunction or at least 2 prescriptions for drugs for dysfunction, one of which is within 28 days

Note that this factor is associated with a diagnosis as recorded in GP health records, and may or may not be valid as a response to a question. Query defined as

Condition with code group 59, or (Drugs such as Alprostadil, Tadalafil, Sildenafil, Vardenafil, Avanafil, Yohimbine, Aviptadil), the latest of which is within the last 28 days

Atypical anti psychotics boolean true or false QRISK3 Second generation ‘atypical’ antipsychotic - prescribed two or more issues in the previous 6 months (includes amisulpride, aripiprazole, clozapine, lurasidone, olanzapine, paliperidone, quetiapine, risperidone, sertindole, or zotepine). Query defined as

2 or more Prescriptions for code group 1169 within the last 6 months

Systemic corticosteriods boolean true or false QRISK3 Patient taking systemic corticosteroids. Query definition

2 or more prescriptions for oral corticosteroids such as Hydrocortisone, Betamethasone, Deflazacort, Dexamethasone, Methylprednisolone, Prednisolone

Migraine boolean true or false QRISK3 Diagnosis of migraine i.e. a diagnosis of migraine recorded in health records. Self reported migraines not resulting in a health record entered diagnosis is not evaluated. Query definition

Condition with concept group 39

Rheumatoid arthritis boolean true or false QRISK3 Diagnosis of Rheumatoid arthritis. Query definition is

Condition with concept group 58

Chronic renal disease boolean true or false QRISK3 Diagnosis of chronic renal disease. Query definition is:

Condition with concept group of 322

Severe mental Illness boolean true or false QRISK3 Diagnosis of severe mental illness (psychosis, severe depression, manic depression, schizophrenia). Query definition is

Condition with concept group 3187

Systemic lupus erythematosus boolean true or false QRISK3 Diagnosis of Systemic Lupus erythematosus. Query definition is :

Condition with code group 70

Treated hypertension boolean true or false QRISK3 Diagnosis of hypertension at any time in the patient’s records AND On antihypertensive treatment if 1 or more prescriptions within the last 6 months. Query definition as follows

Condition with concept group 21, and

1 or more Prescriptions for anti hypertensive drugs

within the last 6 months

Body mass index double QRISK3 The most recently recorded body mass index within the last 5 years. Query definition is

Latest Observation with code group 200 within the last 5 years

Out of range values handled by the engine are

<18 is set to 18, >47 is set to 47

Diabetes Category Enumerated None, type1, type2 QRISK3 Diagnosis of diabetes mapped to a category. Note that resolved diabetes or well controlled diabetes) is not accounted for in the algorithm. Judgement should be used as to how the risk is applied. Query definition as follows

From latest diagnosis of code groups 1913,2411

Map code group 1913 Type1, Map code group 2411 Type2

Ethnicity Enumerated NotRecorded, British, Irish, OtherWhiteBackground, WhiteAndBlackCaribbeanMixed, WhiteAndBlackAfricanMixed, WhiteAndAsianMixed, OtherMixed, Indian, Pakistani, Bangladeshi, OtherAsian,Caribbean, BlackAfrican,OtherBlack, Chinese,OtherEthnicGroup, NotStated QRISK3 Most recent ethnicity. Query definition is

latest entry for code groups 17071, 17072, 17073, 17074, 17075,17076,

   17077, 17089, 17079, 17080, 17081, 17090, 17985,17086, 17087)

Maps

17071 White british, 17072 White Irish, 17073 Other White Background

17074 White & Black Caribbean

17075 White & Black African

17076 White & Asian

17077 other mixed

17089 Indian

17079 Pakistani

17080 Bangladeshi

17081 Other Asian

17090 Caribbean

17083 Black African

17091 Other Black

17985 Chinese

17086 Other ethnic group

qr:17087 Not stated and not classified

Family history of Coronary heart disease boolean true or false QRISK3 Family history of coronary heart disease in a first degree relative under the age of 60 years. Query definition is

Entry for concept group 404

Total cholesterol HDL ratio double QRISK3 The latest ratio of total serum cholesterol/HDL recorded in the last 5 years. The ratio is either directly directly recorded can be calculated using total cholesterol divided by hdl. Query definition is:

latest Observation with concept group 16 (TC)

Latest concept group 367 (HDL)


Latest concept group 405 (TCHDL)


If TCHDL effective date > TC effective date OR TCHDL effective date >HDL effective date

   then value= TCHDL numeric value

else if TC effective date > TCHDL AND HDL effective date >TCHDL effective date


   then value = TC / HDL

else

   value = null


Handling of out of range values by calculator <1 is set to 1, >12 is set to 12

Smoking category Enumerated NonSmoker, ExSmoker,

LightSmoker, ModerateSmoker,

HeavySmoker, NotKnown

QRISK3 The most recently recorded smoking status with 5 levels

This categorisation has one group for ex-smokers rather than trying to distinguish between ex light, ex moderate and ex heavy smokers.

This categorisation does not distinguish between cigarette/cigar and pipe smokers

Special consideration should be given to records that contain both numeric values for the number of cigarettes smoked, and concepts that categorise into light moderate or heavy.

The logic on non smoker is that from the entry of the most recent if it has a numeric value or if there other codes on the same day with numerics take the numeric value on the same day as the most recent, unless the most recent is non smoker

Query definition is

Observation with concept group,2239 -(NONE), 2238 (EX)

      2244 (LIGHT), 2242 (MODERATE),2243 (HEAVY) as ENTRIES

GET latest from ENTRIES with Numeric Value >0 (LATESTWITHVALUE)

GET latest from ENTRIES (LATESTSMOKING)

IF Date of LATESTWITHVALUE == Date of LATESTSMOKING

   use SmokingValueMap

ELSE

nbsp;  use Smoking concept group Map


Smoking concept Map

2239 None smoker

2238 Ex Smoker

2244 light smoker

2242 Moderate smoker

2243 Heavy smoker

Numeric value map 0-9 Light Smoker

10-19 Moderate smoker

>=20 Heavy smoker


Systolic blood pressure integer QRISK3 The most recent systolic blood pressure within 5 years. Query definition is


Numeric value of Most recent Observation with concept group 198 within the last 5 years and numeric value not null

Handling of values out of range

<70 is set to 70, >210 is set to 210

Standard deviation of systolic blood pressures double QRISK3 The SAMPLE style Standard deviation of all of the available systolic blood pressures prior to the reference date recorded in the last 5 years. Note that EP QRISK3 will calculate the spb 5 from a list of values. Query definition is

Observation with concept group 198 and numerivc value not null


Return Standard deviation (sample) (Systolics) or list of values

Townsend score double QRISK3 The Townsend score associated with the output area of a patient’s postcode based on the 2001 census data.
Available via API

Default handling of unknown is 0 (the mean of the national scores)