Skip to main content
Resource Publishing

Clinical Target Rule Schema

A clinical target rule creates the same clinical target for every patient in a cohort. It targets patients through an external or inline patient query, and defines exactly one target: an observable, the thresholds the patient's latest value should stay within, and how recent that value must be.

Once a rule is enabled, Medicus creates a target for each matching patient who doesn't already have one from this rule, and removes the targets of patients who no longer match. This runs when the rule is enabled, when a new version is published, and every night.

See the Patient Query Language reference for inline patient query syntax, and Patient Query Schema for the formal schema an inline patientQuery is validated against.

Examples​

Blood pressure target​

A blood pressure target sets systolic thresholds in lowerValue1/upperValue1 and diastolic thresholds in lowerValue2/upperValue2. Thresholds come in systolic and diastolic pairs: upperValue1 needs upperValue2, and lowerValue1 needs lowerValue2. At least one pair is required. The unit is always mmHg, so unitOfMeasure must be left out.

<?xml version="1.0" encoding="UTF-8"?>
<clinicalTargetRule>
<identifier>my-org/hypertension-bp-target</identifier>
<name>Hypertension blood pressure target</name>
<description>Blood pressure below 140/90 for patients with hypertension.</description>
<targetPatientQuery id="my-org/hypertension-register"/>
<patientQueryRuntimeValue name="Today">
<runtimeValue name="ACHV_DAT">today</runtimeValue>
</patientQueryRuntimeValue>
<clinicalTarget
type="75367002 |Blood pressure (observable entity)|"
upperValue1="140"
upperValue2="90"
evaluationWindowValue="3"
evaluationWindowUnit="weeks"
additionalInformation="Recheck within three weeks of a high reading."
/>
</clinicalTargetRule>

Any other target​

Every other target uses only lowerValue1 and upperValue1, and at least one of them is required. unitOfMeasure is required: the SNOMED CT concept ID of the unit the thresholds are in.

<?xml version="1.0" encoding="UTF-8"?>
<clinicalTargetRule>
<identifier>my-org/resting-heart-rate-target</identifier>
<name>Resting heart rate target</name>
<targetPatientQuery id="my-org/heart-failure-register"/>
<clinicalTarget
type="364075005"
unitOfMeasure="258983007 |Beats/minute|"
lowerValue1="50"
upperValue1="70"
evaluationWindowValue="1"
evaluationWindowUnit="years"
/>
</clinicalTargetRule>

Schema​

This schema includes the patient query schema by filename. To validate against it yourself, download clinical-target-rule.xsd and patient-query.xsd into one folder.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="patient-query.xsd"/>
<xs:complexType name="clinicalTargetRuleTargetPatientQueryType">
<xs:sequence>
<xs:element name="patientQuery" minOccurs="0">
<xs:complexType>
<xs:complexContent>
<xs:extension base="patientQueryContentType">
<xs:attribute name="focus" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="patients"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="clinicalTargetRuleRuntimeValueEntryType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="clinicalTargetRulePatientQueryRuntimeValueType">
<xs:sequence>
<xs:element name="runtimeValue" type="clinicalTargetRuleRuntimeValueEntryType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<xs:simpleType name="evaluationWindowUnitType">
<xs:restriction base="xs:string">
<xs:enumeration value="days"/>
<xs:enumeration value="weeks"/>
<xs:enumeration value="years"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="clinicalTargetType">
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="unitOfMeasure" type="xs:string" use="optional"/>
<xs:attribute name="lowerValue1" type="xs:decimal" use="optional"/>
<xs:attribute name="upperValue1" type="xs:decimal" use="optional"/>
<xs:attribute name="lowerValue2" type="xs:decimal" use="optional"/>
<xs:attribute name="upperValue2" type="xs:decimal" use="optional"/>
<xs:attribute name="evaluationWindowValue" type="xs:positiveInteger" use="required"/>
<xs:attribute name="evaluationWindowUnit" type="evaluationWindowUnitType" use="required"/>
<xs:attribute name="additionalInformation" type="xs:string" use="optional"/>
</xs:complexType>
<xs:element name="clinicalTargetRule">
<xs:complexType>
<xs:sequence>
<xs:element name="identifier" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="description" type="xs:string" minOccurs="0"/>
<xs:element name="targetPatientQuery" type="clinicalTargetRuleTargetPatientQueryType"/>
<xs:element name="patientQueryRuntimeValue" type="clinicalTargetRulePatientQueryRuntimeValueType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="clinicalTarget" type="clinicalTargetType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Key elements​

Element / AttributeRequiredDescription
identifierYesMust exactly match the identifier of the rule the version belongs to, including its organisation prefix, e.g. my-org/hypertension-bp-target. Use the identifier returned by list-clinical-target-rules.
nameYesHuman-readable name for the rule definition. Targets show the name the rule was created with.
descriptionNoLonger description of what the rule does.
targetPatientQuery @idOne of id or inlineReferences an external patient query by its identifier.
targetPatientQuery > patientQueryOne of id or inlineEmbeds an inline patient query with focus="patients".
patientQueryRuntimeValueWhen the target query declares runtime valuesPasses runtime values (e.g. today's date) into the target patient query. Every runtime value the target query declares must be supplied here.
clinicalTargetYesThe target to create. A rule has exactly one.
clinicalTarget @typeYesSNOMED CT concept ID of the observable being targeted, optionally followed by its term, e.g. 75367002 |Blood pressure (observable entity)|.
clinicalTarget @unitOfMeasureYes, except blood pressureSNOMED CT concept ID of the unit, optionally followed by its term. Must be left out for blood pressure.
clinicalTarget @lowerValue1 / @upperValue1At least oneLower and upper thresholds. For blood pressure, these are systolic.
clinicalTarget @lowerValue2 / @upperValue2Blood pressure only, paired with value 1Diastolic lower and upper thresholds. lowerValue2 is required with lowerValue1, and upperValue2 with upperValue1.
clinicalTarget @evaluationWindowValueYesPositive whole number. How recent the patient's latest value must be to count.
clinicalTarget @evaluationWindowUnitYesdays, weeks or years.
clinicalTarget @additionalInformationNoFree text shown on each target the rule creates.

A rule can't set a linked problem or third-party confidentiality on the targets it creates.