Pages

Thursday, May 10, 2012

Time Relationships and HQMF

Anyone who has developed a project schedule using one of the common project management tools has run across the number of different ways you can describe the relationship of  two activities with each other.  For example:
  • Activity X starts after the start of Activity Y
  • Activity X and Y start at the same time.
  • Activity X starts after the end of Activity Y
  • Activity X ends after the start of Activity Y
Et cetera (and note that the above is not a complete list).

One of the challenges in Query Health is being able to describe the relationship of two events with respect to each other:  For example, in the case where you want to find all cases where the patient was diagnosed with some particular disease within the measurement period.

There are a number of different ways to look at this.  The simplest is to understand that you have two events, X and Y, with a start and end time.  Thus, you can compare X.start or X.end to Y.start or Y.end.  You also have three atomic comparative operations, less than <, greater than > and equals (which you can combine to product less than or equal to, greater than or equal to, or not equals).

You can combine these into a relationship in the form X.time operator Y.time.  You have 2 choices for time on X and Y (start or end), and three choices for the operator (<, > or =).  That gives 2 x 2 x 3 or 12 different possible comparisons.  We've already eliminated some duplication by saying that X is first, and Y is second.  That way X.start > Y.start and Y.start < X.start are eliminated as duplicates.

The table below pretty much describes all possible atomic relationships, along with a short code to describe it.

X starts before start of Y (SBS)
X starts concurrent with start of Y (SCS)
X starts after start of Y (SAS)
X starts before end of Y (SBE)
X starts concurrent with end of Y (SCE)
X starts after end of Y (SAE)
X ends before start of Y (EBS)
X ends concurrent with start of Y (ECS)
X ends after start of Y (EAS)
X ends before end of Y (EBE)
X ends concurrent with end of Y (ECE)
X ends after end of Y (EAE)

We can combine some of these to form other interesting cases.  For example, event X occurs during event Y if X starts after or concurrently with Y starting, and ends before on concurrently with Y ending.  Event X and Y are concurrent if they start and end at the same time, et cetera.

SBS and SAS, SBE and EAS, SAE and EBS, EBE and EAE, SCE and ECS are inverses.  If X SBS Y, then Y SAS X, and so on.  We could remove the inverse and still be able to express any relationship just by swapping the position of X and Y.  I've marked the ones I suggest we keep and throw away in the table above.

(Just for fun, you might note that SCS and ECS are self inverses: X SCS Y implies Y SCS X, and so on).

Here is the HL7 Vocabulary for time relationships:

CodeDisplay NameDefinition
CONCURRENT concurrent with A relationship in which the source act's effective time is the same as the target act's effective time.
DURING occurs during A relationship in which the source act's effective time is wholly within the target act's effective time.
EAE ends after end of
EAS ends after start of
EBS ends before start of
ECW ends concurrent with A relationship in which the source act's effective time ends with the end of the target act's effective time.
EDU ends during
OVERLAP overlaps with A relationship in which the source act's effective time overlaps the target act's effective time in any way.
SAE starts after end of
SAS starts after start of The source Act starts after the start of the target Act (i.e. if we say "ActOne SAS ActTwo", it means that ActOne starts after the start of ActTwo, therefore ActOne is the source and ActTwo is the target).
SBS starts before start of
SCW starts concurrent with A relationship in which the source act's effective time starts with the start of the target act's effective time.
SDU starts during

The non-atomic codes are underlined in the above (they are combinations of two relationships)
To simplify things, I've mapped the HL7 atomic codes to my atomic codes in the table below:

X starts before start of Y (SBS) SBS starts before start of
X starts concurrent with start of Y (SCS) SCW starts concurrent with
X starts after start of Y (SAS) SAS starts after start of
X starts before end of Y (SBE)
X starts concurrent with end of Y (SCE)  Missing
X starts after end of Y (SAE) SAE starts after end of
X ends before start of Y (EBS) EBS ends before start of
X ends concurrent with start of Y (ECS)  Missing
X ends after start of Y (EAS) EAS ends after start of
X ends before end of Y (EBE)
X ends concurrent with end of Y (ECE) ECW ends concurrent with
X ends after end of Y (EAE) EAE ends after end of

Looking at the table, you can see lines where my code is in italic and HL7 has a code, and other places where my code is in bold, and HL7 doesn't have a code.  These are discrepancies in the HL7 Vocabulary for comparing the time sequence of two events.  Missing codes represent conditions that cannot be expressed simply using an atomic relationship.  Added codes indicate cases which can be represented in more than one way.

For Query Health, we probably don't need the missing codes, but HL7 might consider adding them to address other use cases where the time relationship value set is used.   With respect to the extra code (SAS), I believe that we'll advise the use of SBS with the inversion indicator rather than SAS just for consistency.  Ideally, I'd like to avoid the inversion indicator all-together, and would propose that all twelve of these conditions be allowed to express time relationships in a natural way.

As for the non-atomic relatioships that HL7 has provided, I believe that they are fine for Query Health, and don't care to get into a deep analysis.  The number of meaningful ways that you could combine two or more of these atomic comparisons is more than I want to deal with right now.  When HQMF goes forward, I suspect that several harmonization proposals will be made, and deeply argued.  Might as well get it out of the way now.

1 comment:

  1. Thanks for the wonderful post Keith. I am somewhat puzzled with respect to the relationship between NQF's QDM and HL7's HQMF -- Some of the temporal operators listed here (e.g., concurrent, ends during etc.) are also part of QDM -- are they same? Will appreciate some clarification. Thanks.

    ReplyDelete