query modelling problem ruth kidd, ian townend and meena pillai nhs connecting for health

11
Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Upload: natalie-oleary

Post on 27-Mar-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Query Modelling Problem

Ruth Kidd, Ian Townend and Meena PillaiNHS Connecting for Health

Page 2: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Business RequirementsBackground

• Two users involved: General Practitioner (GP) and Patient (P)

1. P is referred to a urologist for recurrent urinary infection by the GP.

2. GP searches for urologist service using simple keywords and operator:

3. (urologist AND West London).

3. The search criteria is saved for future use.

Page 3: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

The Modelling Problem• Review Referral Detailed Information• 1. DetailedReferralQuery• This is a query which the GP may use to

obtain all the details about a particular referral.

QueryByParameter(QueryByParameter)

ControlActProcessclassCode*: <= CACTmoodCode*: <= ActMoodCompletionTrack

0..1queryByParameter

PatientNHSNumber(ParameterItem)value*: II [1..1] (NHSNumber)semanticsText*: ST [1..1] "PatientNHSNumber"

1..1patientNHSNumber*

EnquirerRoleProfileCode(ParameterItem)value*: II [1..1] (RoleProfileCode)semanticsText*: ST [1..1] "EnquirerRoleProfileCode"

EnquirerNHSNumber(ParameterItem)value*: II [1..1] (NHSNumber)semanticsText*: ST [1..1] "EnquirerNHSNumber"

0..1enquirerRoleProfileCode

UBRN(ParameterItem)value*: II [1..1] (UBRN)semanticsText*: ST [1..1] "UBRN"

1..1uBRN*

clinicalInformationRequired(ParameterItem)value*: BL [1..1]semanticsText*: ST [1..1] "clinicalInformationRequired"

1..1clinicalInformationRequired*

0..1enquirerNHSNumber

DetailedReferralQuery(QUSC_RM000002UK01)

Used to search for the patientsspecific referral based on acombination of parameters.

Note:This class is requiredby tooling but not usedby this RMIM.

When the enquirer is not the patientthe EnquirerRoleProfileCode should be presentbut not the EnquirerNHSNumber.

Constraint: EnquirerRoleProfileCode

When the enquirer is the patientthe EnquirerNHSNumber should be presentbut not the EnquirerRoleProfileCode.

Constraint: EnquirerNHSNumber

• Return Referral Details and Change referral Detailed Information

• 2. DetailedReferralResponse• The Response to the query containing all the

referral detailed information. However the business requirement includes wanting to change the response which may lead to selecting another service.DetailedReferralResponse

(PRPA_RM000002UK01)

A response which provides outline information aboutany pending referral/s for a particular patient.

1..1

PatientclassCode*: <= PATid*: II [1..1] (NHS Number)

AppointmentRequestclassCode*: <= ENCmoodCode*: <= ARQid*: II [1..1] (UBRN)code*: CV CNE [1..1] <= ServiceTypeRequested (ReferralType)effectiveTime*: TS [1..1] (DateDecisionToRefer)activityTime*: TS [1..1] (lastActivityDT)priorityCode*: CV CNE [1..1] <= PriorityType

0..1 priorActiveAppointment *

typeCode*: <= FLFSinversionInd: BL [1..1] "true"

inFulfillmentOf

ActiveAppointmentclassCode*: <= ENCmoodCode*: <= APTid*: II [1..1] ((USRN)code*: CD CNE [1..1] <= SnomedCT(Appointment)effectiveTime*: IVL<TS> [1..1] (appointmentDateTimeDuration)

0..1 agent *

typeCode*: <= PRFperformer

1..1 serviceChoice *

typeCode*: <= COMPcomponent2

1..* inputServiceClassification *

typeCode*: <= DRIVderivedFrom

ServiceClassificationclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= ServiceSpecialty

1..1 agent *

typeCode*: <= LOClocation

CMET: (AGNT) R_AgentNPFITPoCOrg

[universal](UKCT_MT142001UK01)

ServiceclassCode*: <= ENCmoodCode*: <= DEFid*: II [1..1]code*: CD CNE [1..1] <= SnomedCT (Service)title*: ST [1..1] (Service Name)

UninitialisedRequestclassCode*: <= PCPRmoodCode*: <= EVNid*: II [1..1] (UBRN)code*: CD CNE [1..1] <= SnomedCT(ReferralType)effectiveTime*: TS [1..1] (DateDecisionToRefer)activityTime*: TS [1..1] (lastActivityDateTime)priorityCode*: CV CNE [1..1] <= PriorityType

1..1 patient *

typeCode*: <= SBJsubject

1..1 agent *

typeCode*: <= REFreferrer

0..1 priorPreviousRequest *

typeCode*: <= SEQLinversionInd*: BL [1..1] "true"

sequelTo1

PreviousRequestclassCode*: <= PCPRmoodCode*: <= RQOid*: II [1..1] (PreviousUBRN)code*: CD CNE [1..1] <= CaBAnnotation "PR" (fixed)

ContentSensitiveIndclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "CSI"value*: BL [1..1]

ReferralTypeChoice

RequestStatusclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= RequestStatus

DirectlyBookableclassCode*: <= PCPRmoodCode*: <= DEFcode*: CV CNE [1..1] <= CaBAnnotation "DB"activityTime*: TS [0..1] (firstAvailableSlot)

1..1 pertinentCommissionedInd *

typeCode*: <= PERTpertinentInformation2

CommissionedIndclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "CI"value*: BL [1..1]

0..1 pertinentInstructions *

typeCode*: <= PERTpertinentInformation4

InstructionsclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "IN"text*: ST [1..1] (Instructions)

1..1 pertinentVersion *

typeCode*: <= PERTpertinentInformation6

VersionclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "SV"value*: INT [1..1]

AssessmentOutcomeclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= AssessmentOutcome

ClinicTypeclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= ServiceClinicType

0..1 pertinentBreachOffset *

typeCode*: <= PERTpertinentInformation7

BreachOffsetclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "BRO"value*: INT [1..1]

1..1 representedOrganization *

AgentclassCode*: <= AGNTid*: II [1..1] (UID)

OrganizationclassCode*: <= ORGdeterminerCode*: <= INSTANCEid*: II [1..1]

1..1 *

Agent2classCode*: <= AGNTid*: II [1..1] (UID)

AdviceandGuidanceRequestclassCode*: <= INFRMmoodCode*: <= RQOid*: II [1..1] (UBRN)code*: CD CNE [1..1] <= SnomedCT (ReferralType)effectiveTime*: TS [1..1] (DateDecisionToRefer)activityTime*: TS [1..1] (lastActivityDT)priorityCode*: CV CNE [1..1] <= PriorityType

0..1 priorPreviousRequest *

sequelTo

IndirectlyBookableclassCode*: <= PCPRmoodCode*: <= DEFcode*: CV CNE [1..1] <= CaBAnnotation "IB"

ServiceChoice

1..1 service *

typeCode*: <= COMPcomponent3

DueByDateclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "DBD"activityTime*: TS [1..1] (DueByDate)

1..1 pertinentContentSensitiveInd *

typeCode*: <= PERTpertinentInformation

ContentSensitiveInd

0..1 pertinentContentSensitiveInd *

typeCode*: <= PERTpertinentInformation9

ContentSensitiveInd

1..1 contactDetails *typeCode*: <= LOC

location

1..1 locationIndirectlyBookableOrganisation *

ContactDetailsclassCode*: <= ISDLOC

IndirectlyBookableOrganisationclassCode*: <= ORGdeterminerCode*: <= INSTANCEtelecom*: TEL [1..1]

0..1 pertinentIndicativeWaitTime *

typeCode*: <= PERTpertinentInformation10

IndicativeWaitTimeclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "IWT"value*: INT [1..1]

AttachmentclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "A" (fixed)text*: ST [0..1] (Comment)effectiveTime*: TS [1..1] (Date Added)value*: ED [0..1] (URL of Attachment)

0..1 agent *

typeCode*: <= ENTdataEnterer CMET: (AGNT)

R_AgentNPFITPersonSDSWithRoleId[universal]

(UKCT_MT120901UK01)

AdviceAndGuidanceDetailsclassCode*: <= INFRMmoodCode*: <= RQOcode*: CV CNE [1..1] <= CaBAnnotation "AAGD" (fixed)text*: ST [1..1]

0..1 priorAdviceAndGuidanceResponse *

typeCode*: <= FLFSinversionInd*: [1..1] "true"

inFulfillmentOf

AdviceAndGuidanceResponseclassCode*: <= INFRMmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "AAGR" (fixed)text*: ST [1..1]effectiveTime*: TS [1..1]

1..1 responseAgent *

typeCode*: <= AUTauthor

0..1 responseAgent *

typeCode*: <= ENTdataEnterer

1..1 *

ResponseAgentclassCode*: <= AGNTid*: II [1..1]

AdditionalRequirementclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "AR" (fixed)text*: ST [1..1] (Description)

AdditionalRequirementCommentclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "ARC" (fixed)text*: ST [1..1] (Comment)effectiveTime*: TS [1..1] (Comment Date Time)

StatusDisplayValueclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= StatusDisplayValue

StatusMeaningclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= StatusMeaning

1..1 agent *

typeCode*: <= PRFperformerCMET: (AGNT)

R_AgentNPFITPoCPerson[universal]

(UKCT_MT142101UK01)

StatusDisplayValue

ActiveServiceShortlistclassCode*: <= LISTmoodCode*: <= EVNcode*: CV CNE [1..1] <=CaBAnnotation "ASS" (fixed)

SearchCriteriaclassCode*: <= OBSmoodCode*: <= EVNcode: CD CWE [0..1] <= CaBAnnotation "SC" (fixed)

CriteriaChoice

NamedClinicianclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CriteriaCode "NC" (fixed)value*: II [1..1]

KeywordclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CriteriaCode "KW" (fixed)value*: ST [1..1]

SpecialtyclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CriteriaCode "SP" (fixed)value*: CV [1..1] <= Specialty

ExtendedChoiceIndicatorclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "ECI" (fixed)value*: BL [1..1] "false"

OptionalCriteriaclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CriteriaCodevalue*: ANY [1..1]

ClinicTypeCriteriaclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CriteriaCode (Clinic Type Name)value*: CV [1..1] <= ClinicType

CodeValueclassCode*: <= OBSmoodCode*: <= EVNcode: CD CWE [0..1] <= ActCode

1..* service *

component

1..1 searchCriteria *

typeCode*: <= COMPcomponent12

ActiveServiceShortlist1..1 serviceContact *typeCode*: <= ORG

origin

0..1 pertinentCABReferral *

typeCode*: <= PERTpertinentInformation11

CMET: (INFRM) A_CABReferral

[universal](UKCT_MT170001UK01)

component2

0..* keyword *

typeCode*: <= COMPconjunctionCode*: CS CNE [1..1] <= RelationshipConjunction

1..1 contactPlace *

ContactPartyclassCode*: <= CON

1..1 agent *

typeCode*: <= RESPresponsibleParty

SuperSpecialtyclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= SuperSpecialty

1..1 activeServiceShortlist *

typeCode*: <= COMPcomponent6

CommentclassCode*: <= OBSmoodCode*: <= EVNcode*: CV CNE [1..1] <= CaBAnnotation "C" (fixed)text*: ST [1..1] (Comment)effectiveTime*: TS [1..1] (Date Added)

Comment_AttachmentChoice

1..* criteriaChoice *

typeCode*: <= COMPcomponent1

1..1 extendedChoiceIndicator *

typeCode*: <= COMPcomponent2

0..1 codeValue *

typeCode*: <= COMPcomponent1

0..* additionalRequirementComment *typeCode*: <= COMP

component10

1..1 pertinentStatusDisplayValue *

typeCode*: <= PERTpertinentInformation12

0..1 pertinentAssessmentOutcome *

typeCode*: <= PERTpertinentInformation8

1..1 pertinentStatusDisplayValue *

typeCode*: <= PERTpertinentInformation13

1..1 pertinentActiveServiceShortlist *

typeCode*: <= PERTpertinentInformation14

0..1 dueByDate *

typeCode*: <= COMPcomponent11

0..1 adviceAndGuidanceDetails *

typeCode*: <= COMPcomponent13

1..1 pertinentStatusMeaning *

typeCode*: <= PERTpertinentInformation15

1..1 agent *

typeCode*: <= AUTauthor 0..* optionalCriteria *

typeCode*: <= COMPcomponent3

0..* comment_AttachmentChoice *

typeCode*: <= COMPcomponent1

1..1 clinicType *

typeCode*: <= COMPcomponent

0..* additionalRequirement *

typeCode*: <= COMPcomponent16

0..1 clinicTypeCriteria *

typeCode*: <= COMPcomponent

Note:Optional Criteria consists of:1. Staff Mix2. Distance From and Distance from Postcode3. Indicative Wait Time4. Organisation Code5. Organisation String

1..1 agent *

typeCode*: <= AUTauthor

FocalActclassCode*: <= ACTmoodCode*: <= EVN

1..1 referralTypeChoice *typeCode*: <= COMP

component5

PlaceclassCode*: <= PLCdeterminerCode*: <= INSTANCEname*: PN [0..1]telecom*: SET<TEL> [0..*]addr*: AD [0..1]

Note:At least one of theattributes must bepresent in an instance,

1..1 pertinentRequestStatus *typeCode*: <= PERT

pertinentInformation

1..1 pertinentContentSensitiveInd *

typeCode*: <= PERTpertinentInformation

Page 4: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Problem

• The query mechanism provided within HL7 allows for the representation of a wide range of queries which can also vary in their complexity.

• The problem faced is in designing a a single query message which is able to deal a range of expressions which may vary greatly in their complexity. Take for example the following expressions:

– (A AND B) OR (C AND D)– (A AND B) OR (C AND (D OR E))

• The first expression can be expressed easily, the second may be expression but it would involved linking multiple LogicalExpressions together.

• It is not possible to create a single message which is able to express both the above as well as more complex queries.

• It is the nested logical statements which pose a problem as the query mechanism does not allow for recursion (i.e. a RelationalExpression cannot have a component which is a RelationalExpression).

Page 5: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Possible Solutions for Expression(A AND B) OR (C AND (D OR E))

• Solution 1 – Use of query to represent the Keyword / Operator relationship– The limitation to this design is that as it does not incorporate recursion; the levels of nesting need to

known prior to design and cannot be created dynamically.

• Solution 2 - Use of Acts to represent the recursive Keyword / Operator relationship.– This solution is a non-standard way to represent queries. – It is included to show how the required functionality can be achieved within the HL7 RIM. – It is also included to demonstrate the functionality which could be added to the Query Mechanism

to allow for complex queries to be expressed.

• Solution 3 – Use of query which has been amended to include choice box and recursion– This method demonstrates how the problem can be solved by combining solutions 1 and 2.

Page 6: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Problem 1 - Solution 1 Use a query to model the keyword/operator relationship.(A AND B) OR (C AND D)This model allows us to easily represent the above expression.

1 <ControlActEvent xmlns="urn:hl7-org:v3">

2 <queryBySelection>

3 <joinExpression>

3 <relationalConjunctionCode code="OR"/>

3 </joinExpression>

4 <leftJoin>

4<relationalConjunctionCode code="AND"/>

5<leftExpression>

5<elementName>A</elementName>

5<value>A</value>

5</leftExpression>

6<rightExpression>

6<elementName>B</elementName>

6<value>B</value>

6</rightExpression>

4</leftJoin>

7<rightJoin>

7<relationalConjunctionCode code="AND"/>

8<leftExpression>

8<elementName>C</elementName>

8<value>C</value>

8</leftExpression>

9<rightExpression>

9<elementName>D</elementName>

9<value>D</value>

9</rightExpression>

7</rightJoin>

2</queryBySelection>

1</ControlActEvent>

ControlActEventclassCode*: <= CACTmoodCode*: <= EVN

QueryLogical Expression(QUPC_RM000099UK01)

Description

QueryBySelection(QueryBySelection)

JoinExpression(LogicalExpression)relationalConjunctionCode*: CS CNE [0..1] <= SQLConjunction

0..1queryBySelection

0..*joinExpression

LeftJoin(LogicalExpression)relationalConjunctionCode*: CS CNE [1..1] <= SQLConjunction

RightJoin(LogicalExpression)relationalConjunctionCode*: CS CNE [1..1] <= SQLConjunction

1..1leftJoin* 0..1rightJoin*

LeftExpression(RelationalExpression)elementName*: SC CWE [1..1] <= RelationalNamevalue*: ST [1..1]

1..1leftExpression*

RightExpression(RelationalExpression)elementName*: SC CWE [1..1] <= RelationalNamevalue*: ST [1..1]

1..1rightExpression*LeftExpression(RelationalExpression)

RightExpression(RelationalExpression)

1..1leftExpression* 1..1rightExpression*

1

2 3

4

5 6 8 9

7

Page 7: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Problem 2 - Solution 1 Use a query to model the keyword/operator relationship.

(A AND B) OR (C AND (D OR E))

This model does not allow us to represent the final section of this query. It is

not possible to express the nested statement.

1 <ControlActEvent xmlns="urn:hl7-org:v3">

2 <queryBySelection>

3 <joinExpression>

3 <relationalConjunctionCode code="OR"/>

3 </joinExpression>

4 <leftJoin>

4<relationalConjunctionCode code="AND"/>

5<leftExpression>

5<elementName>A</elementName>

5<value>A</value>

5</leftExpression>

6<rightExpression>

6<elementName>B</elementName>

6<value>B</value>

6</rightExpression>

4</leftJoin>

7<rightJoin>

7<relationalConjunctionCode code="AND"/>

8<leftExpression>

8<elementName>C</elementName>

8<value>C</value>

8</leftExpression>

9<rightExpression>

9<elementName>D</elementName>

9<value>D</value>

9</rightExpression>

7</rightJoin>

2</queryBySelection>

1</ControlActEvent>

ControlActEventclassCode*: <= CACTmoodCode*: <= EVN

QueryLogical Expression(QUPC_RM000099UK01)

Description

QueryBySelection(QueryBySelection)

JoinExpression(LogicalExpression)relationalConjunctionCode*: CS CNE [0..1] <= SQLConjunction

0..1queryBySelection

0..*joinExpression

LeftJoin(LogicalExpression)relationalConjunctionCode*: CS CNE [1..1] <= SQLConjunction

RightJoin(LogicalExpression)relationalConjunctionCode*: CS CNE [1..1] <= SQLConjunction

1..1leftJoin* 0..1rightJoin*

LeftExpression(RelationalExpression)elementName*: SC CWE [1..1] <= RelationalNamevalue*: ST [1..1]

1..1leftExpression*

RightExpression(RelationalExpression)elementName*: SC CWE [1..1] <= RelationalNamevalue*: ST [1..1]

1..1rightExpression*LeftExpression(RelationalExpression)

RightExpression(RelationalExpression)

1..1leftExpression* 1..1rightExpression*

1

2 3

4

5 6 8 9

7

Page 8: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

QueryclassCode*: <= OBSmoodCode*: <= EVN

component

0..* statement

typeCode*: <= COMPconjunctionCode: CS CNE [0..1] <= RelationshipConjunction

Query(UUTE_RM12345)

Description

CMET: (OBS) Statement[universal]

(UUCT_MT12345)

1

2

3

StatementclassCode*: <= OBSmoodCode*: <= EVN

KeywordclassCode*: <= OBSmoodCode*: <= EVNvalue*: ANY [1..1]

component

0..* choice

typeCode*: <= COMPconjunctionCode: CS CNE [0..1] <= RelationshipConjunction

Statement(UUCT_MT12345)

Description

Choice

CMET: (OBS) A_Statement

[universal](UUCT_MT12345)

Problem 1 - Solution 2Use a query to model the keyword/operator relationship.(A AND B) OR (C AND D)This model allows us to easily represent the above expression.

<Query><!--(A AND B) OR (C AND D)--> <component> <Statement classCode="OBS" moodCode="EVN"> <component> <choiceKeyword> <value xsi:type="ST">a</value> </choiceKeyword> </component> <component> <conjunctionCode code="AND"/> <choiceKeyword> <value xsi:type="ST">b</value> </choiceKeyword> </component> </Statement> </component> <component> <conjunctionCode code="OR"/> <Statement> <component> <choiceKeyword> <value xsi:type="ST">c</value> </choiceKeyword> </component> <component> <conjunctionCode code="AND"/> <choiceKeyword> <value xsi:type="ST">d</value> </choiceKeyword> </component> </Statement> </component></Query>

1

2

3

3

3

2

3

Page 9: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

QueryclassCode*: <= OBSmoodCode*: <= EVN

component

0..* statement

typeCode*: <= COMPconjunctionCode: CS CNE [0..1] <= RelationshipConjunction

Query(UUTE_RM12345)

Description

CMET: (OBS) Statement[universal]

(UUCT_MT12345)

1

1

2

2

3

3

3

3

33

StatementclassCode*: <= OBSmoodCode*: <= EVN

KeywordclassCode*: <= OBSmoodCode*: <= EVNvalue*: ANY [1..1]

component

0..* choice

typeCode*: <= COMPconjunctionCode: CS CNE [0..1] <= RelationshipConjunction

Statement(UUCT_MT12345)

Description

Choice

CMET: (OBS) A_Statement

[universal](UUCT_MT12345)

2

2

<Query><!--(A AND B) OR (C AND (D OR E))--> <component> <Statement classCode="OBS" moodCode="EVN"> <component> <choiceKeyword> <value xsi:type="ST">a</value> </choiceKeyword> </component> <component> <conjunctionCode code="AND"/> <choiceKeyword> <value xsi:type="ST">b</value> </choiceKeyword> </component> </Statement> </component> <component> <conjunctionCode code="OR"/> <Statement> <component> <choiceKeyword> <value xsi:type="ST">c</value> </choiceKeyword> </component> <component> <conjunctionCode code="AND"/> <Statement> <component> <choiceKeyword> <value xsi:type="ST">d</value> </choiceKeyword> </component> <component> <conjunctionCode code="OR"/> <choiceKeyword> <value xsi:type="ST">e</value> </choiceKeyword> </component> </Statement> </component> </Statement> </component></Query>

Problem 2 - Solution 2Use a query to model the keyword/operator relationship.

(A AND B) OR (C AND (D OR E))This model allows us to easily represent the above expression.

Page 10: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

ResponseWithQuery(UUDD_RMnnnnnn)

Description

ControlActEventclassCode*: <= CACTmoodCode*: <= EVN

QueryBySelection(QueryBySelection)

0..1queryBySelection

component

0..*

typeCode*: <= COMPconjunctionCode*: CS CNE [1..1] <= RelationshipConjunction

QueryStatement(LogicalExpression)

0..*1..1

queryStatementqueryBySelection

CMET: (OBS) A_QueryStatement

[universal](UKCT_MTxxxxxxuk01)

LeftExpression(RelationalExpression)value*: ST [1..1]

0..*

CHOICE

Problems 1 and 2 - Solution 3Amend Query Mechanism to cater for recursion and choice.

(A AND B) OR (C AND D) - (A AND B) OR (C AND (D OR E))In a similar way to Solution 2, this method allows for the representation of both statements.

Page 11: Query Modelling Problem Ruth Kidd, Ian Townend and Meena Pillai NHS Connecting for Health

Questions