Showing posts sorted by relevance for query temporal. Sort by date Show all posts
Showing posts sorted by relevance for query temporal. Sort by date Show all posts

Tuesday, May 21, 2013

Temporal Relationships Again

Today I spent a bit of time with the HQMF editorial team.  One of the issues that we spent quite a bit of time on was temporal relationships.  In the RIM, temporal relationships are represented by vocabulary terms, such as SBS or EAE (Starts before Start, Ends after End).  SBS implies that X.effectiveTime.low < Y.effectiveTime.low.  So now the question of how to deal with <= comes up, and we didn't have a good answer.

To deal with relationships such as "X occured within one hour of the start of Y", you have to deal with what the HL7 RIM calls the pauseQuantity associated with the act relationship.  The pauseQuanity is defined as being of type PQ.TIME (a physical quantity using units of time).  This is incredibly complicated to get right when you have multiple relationships between two different acts and the starting times and ending times associated with them.  If you set the pauseQuantity to 1 hour, and use the SBS act relationship type between act X and act Y, you are saying that X, if paused by one hour, still starts before the start of Y.  Since that is the exact opposite of what you want, what you would do would be to set pauseQuantity to -1 hour, and then use SAS.  That means that X, if moved backwards one hour in time, starts after the start of Y.  Are you confused?  I certainly still am.


<actCriteria>
  ... Criteria for Act X ...
  <temporallyPertains typeCode='SAS'>
    <pauseQuantity value='-1' unit='h'/>
    <actCriteria>

  ... Criteria for Act Y ...
    </actCriteria>

  </temporallyPertains>

</actCriteria>


One of the participants (Marc Hadley from MITRE) proposed that we change pauseQuantity from PQ.TIME to IVL_PQ.TIME, so that we could say from 1 to 2 hours.  I started to say that doesn't work to say what we want it to say, because ... and then realized that depending on what we are comparing, it certainly could work.  The key here are four vocabulary terms covering temporal relationships, SCW, SCWE, ECW and ECWS (Starts Concurrent With Start, Starts Concurrent with End, Ends Conncurrent with End, and Ends Concurrent with Start).

Now lets look at how you could say this:  If you want act Y if it started within 0-1 hours from X, you would have X be related to Y via SCW and would set the pause quantity from 0 - 1 hour.  X.start delayed by 0 to 1 hours is concurrent with Y.start means exactly what we want.

<actCriteria>
  ... Criteria for Act X ...
  <temporallyPertains typeCode='SCW'>
    <pauseQuantity xsi:type="IVL_PQ">
       <low value='0' unit='h'/>
       <high vaue='1' unit='h'/>
    </pauseQuantity>
    <actCriteria>

  ... Criteria for Act Y ...
    </actCriteria>

  </temporallyPertains>

</actCriteria>

The latter means the same as the former, is more flexible, and also has the advantage of allowing the use of the inclusive attribute on the low and high bounds, so now we can also get into the finer details of less than vs. less than or equal to.

The problem is that pauseQuantity is defined in the HL7 RIM to be of type PQ.  We cannot just magically change it to a different type like IVL_PQ.  However, we can certainly state that the pause quantity is some value within a particular range by using the uncertainRange capability of the HL7 Version 3 Datatypes Release 2.  That gives us:


<actCriteria>
  ... Criteria for Act X ...
  <temporallyPertains typeCode='SCW'>
    <pauseQuantity>
      <uncertainRange>
        <low value='0' unit='h'/>
        <high vaue='1' unit='h'/>
      </uncertainRange>
    </pauseQuantity>
    <actCriteria>

  ... Criteria for Act Y ...
    </actCriteria>

  </temporallyPertains>

</actCriteria>


And so, we have a much simpler representation for dealing with temporal relationships, without any RIM changes.  The next step is to restrict the allowed vocabulary when the uncertainRange portion appears to be SCW, SCWE, ECW, and ECWS.  In fact, by limiting to just those four terms we can address any kind of relationship needed between the end points of two events.

We have to bounce this past the Structured Documents workgroup, because it is a variation on the original solution, and we don't want to be making stuff up that the workgroup didn't agree to in reconciliation.  I think this will be pretty straight-forward.

Saturday, June 30, 2012

An Odd-Essay through Time

I've been working on trying to clean up HL7's temporal vocabulary for HQMF.  The problem is with boundary conditions as it is relevant to time relationships.  We have two boundaries, the start and end of an event, and three comparison operations (less than, equal to and greater than), which gets me to twelve different vocabulary terms, which gives me all the atoms needed, right?

Wrong.  We are dealing with intervals, and intervals can be open or closed. While < and = together make up <=,  we cannot use two vocabulary terms to specify a SINGLE relationship.  So in order to describe the <= relationship between two items, we actually need to have five different comparators, <, <=, =, >= and >.  This is still NOT a closed set of relationships over the inverse operator, because we are missing <> (or != if you prefer that notation).

So we now have two choices from the source of the relationship, either the start or the end, six comparison operators, and two choices for the target of the relationship (again, start or end) = 2 x 6 x 2 = 24 different terms.


One of my desires is to avoid complexity for implementers.  Twenty-four vocabulary terms seems to be too complex.  Do we really need to support >=, <= and != ?  After all, these are just the same as NOT <, NOT > and NOT =, and we could achieve NOT with the negationInd attribute in the RIM.  But using negationInd doesn't make it any simpler, and in fact, divides the problem up across two different attributes (negationInd and typeCode).  We already have existing vocabulary supporting >= and <=, because we have terms for OVERLAP which needs to deal with these operation.


So, I decided to look at it a different way.  In a time range, there are five discrete parts.  Before the start, the start, after the start and before the end, the end, and after the end.  We need to be able to talk about any of these five parts in sequence.  If we label the parts A, B, C, D and E, we need to be able to talk about:

  1. A
  2. AB
  3. ABC
  4. ABCD
  5. ABCDE
  6. B
  7. BC
  8. BCD
  9. BCDE
  10. C
  11. CD
  12. CDE
  13. D
  14. DE
  15. E
The range identified by ABCDE is "all time" and so can be dropped.  It is unnecessary because all acts are related to all other acts with respect to all time, and so this is a meaningless relationship.

I'm going to reorganize the remaining acts, and show how they relate to temporal comparisons in the following diagram:


Each of these defines a time range related to a target act.  We can indicate that the start of the source act occurs within each of these ranges, or the end of the source act occurs within them to define some useful relationships.  The names of these relationships would be something like SAS or EAS to represent Start after Start, or End after Start.  That's nice because those are already HL7 vocabulary terms.  So, now we can apply S and E to each of the above, and get 28 relationships.  Hmm, this is a dead end isn't it.  After all, didn't we want something smaller than 24?


It gets worse.  If you've been swift, you might also note that there are some tests where you want to test both start and end of the source act.  The existing OVERLAP, DURING and CONCURRENT are examples of temporal relationships that do this.  So now we are up to 31 or more.  Yech.


I'm sorry to report, it doesn't get better (at least yet).  After some more digging, I found a paper (which I should have looked for first).  James F. Allen published a paper in 1983 that reports that there are 213 = 8192 possible relationships that can be described between two definite intervals.  Dr. Thomas Alspaugh provides a great explanation of Allen's paper.  You should probably read that summary to understand the rest of this post.


Dr. Alspaugh explains that there are 13 basic relationships between two intervals.  These 13 basic relationships are distinct (meaning each can be distinguished from the other), exhaustive (because the relationship between any two intervals A and B can always be identified as following one of these patterns), and is purely qualitative.


Where things get interesting in Allen's algebra is when Alspaugh produces a table that shows what happens when you "compose" a relationship.   Composition of a relationship describes the how to compute the relationship r.s that between A and C, when A r B and B s C.   As it turns out, there are 27 "composite" relations when you perform composition over the original set of 13 basic relationships.

So, I looked over the 27 different relationships, and this is what I found:

  1. One of the resulting relationships (full), is true for all intervals, and so is not worth addressing.
  2. Ten of the relationships already existed in the HL7 ActRelationshipTemporallyPertains Value Set.
  3. Only one of the relationships in the HL7 ActRelationshipTemporallyPertains Value set (Ends After Start) doesn't appear in the list of 27 relationships generated through composition (its inverse doesn't appear in either place).
Then I went back to the original discussion to see whether I'd been able to, using this method, match the requirements.  There are two terms in NQF's Quality Data Model which aren't covered in the current vocabulary.

Starts before or during
A relationship in which the source act's effective time starts before the start of the target or starts during the target’s effective time. An Act is defined by HL7 as: “A record of something that is being done, has been done, can be done, or is intended or requested to be done.”

  • A pacemaker is present at any time starts before or during the measurement period: [Diagnosis active: pacemaker in situ] starts before or during [measurement period]
  • A condition [diagnosis] that starts before or during [measurement end date], that means the diagnosis occurred any time before the measurement end date including the possibility that the diagnosis was established on the measurement end date itself.

Ends before or during
A relationship in which the source act terminates before the target act terminates.

  • To state that intravenous anticoagulant medication is stopped before inpatient hospital discharge: [Medication administered: anticoagulant medication (route = IV)] ends before or during [Encounter: encounter inpatient]

The challenge with these two is that they alter the meaning of during in the use of the term for "Starts Before or During". According to HL7, DURING as a vocabulary term means wholly contained within the time period of the target.  So, Starts During would mean that the start time is bounded by the range of (target.start through target.end), using the non-inclusive forms of the boundaries.

What NQF did was redefine during so that an event (e.g., pacemaker present or diagnosis occured) would be considered to be in the measure period even if the event occured on 20121231.  Why?  Because, like just about everyone else (including me until Grahame corrected us all), we didn't know how to record the time boundary correctly.  Remember the proper way to bound a time expression lasting one year is [20120101, 20130101).  This means: Starting on January 1st of 2012 [inclusive], up to, but no including January 1st of the following year.


So, let's go back and fix the definition of Starts before or During so that it could be changed.  Now it is simply "Starts before End."  Surely that code is present?  Actually, it isn't.  And similarly, Ends before or during becomes Ends before End (EBE).


And so, the two codes we need to add to the HL7 Vocabulary to support everything that's been asked of for HQMF are SBE (Starts before End) and EBE (Ends before End).  Which puts us back to the original 12 operators that I started with in this post.  And the realization that there are 8180 more relationships that we cannot handle simply, and likely don't need to, and that there are quite a few different ways to look at temporal relationships.


It seems that we don't need to worry to much about the differences between < and <= after all.  Especially if we can readily control one of the boundaries to make sure it is open or closed as necessary.


There's probably a whole post in this on the proper handling of intervals in software in general.  But I'll save that for a later date.  I have a harmonization proposal to finish.

  -- Keith


Thursday, April 4, 2013

It means what I want it to

We struggled for the longest time today trying to figure out how to say the following in HQMF:

Find me the first instance of this medication (e.g., Aspirin), in these kinds of encounters (e.g., ED visits where DX = MI).

The challenge wasn't the medication, or the type of encounter, or even encounters where DX = MI, but rather how to apply FIRST and DURING operations at the same time so that FIRST returned more than one item.  E.g., it was the first item of its type in the time period expressed by the temporal relationship.

We struggled with it for quite a while, and I'd written something on the board, and then Dragon pointed out that we'd added the <subsetCode> attribute to the <temporallyRelated> act relationship and it all came together.

I don't know what that means I said, but we can define it to mean what we want it to.  Marc said "Wait, let me see if I can make this work before I agree." and he started digging into code.  The rest of use looked at it some more to poke more holes in it.  "Does it still work if we change LAST to FIRST?" I asked, and yes it did.  "Does it work if we use a different temporal relationship?" I asked again, "Like BEFORE?" Chimed in Dragon.  Yep, that worked too.  And Marc said, "Yes, I can make it work.  I like this."

And so, even though we weren't sure what it meant when we looked at it at first, by the time we were done, it meant exactly what we wanted it to, and it wasn't even a stretch to believe that someone had actually designed it to work that way.

So now, if you want to know what the average time is for a patient who needs it to be given Aspirin in the ED if they are having a heart attack, we know how to A) specify that measure, and B) compute it from the specification.  Being able to do A is nice, but the biggest change in HQMF Release 2 is that we can do so much more of B from A.

   Keith

Wednesday, December 7, 2011

Some principles for creating an HQMF

One of the things mentioned at the Query Health face to face last week was that we were going to need some implementation guidance on how to create an HQMF that works with Query Health.  These are some of the issues that I have to wrestle with right now:
  1. Most queries will need to identify patients in a particular age group, what is the best way to represent that in the HQMF?  There are at least four different "technically accurate" options for representing this:
    1. Assume that the age of a patient will be represented as a (computed) observation in the system performing the query.  This seems to be the simplest, as it allows the age groups to be defined in criteria in a fairly easily readable manner.
    2. Represent birth as an observation, with the effective time of the observation giving the DOB, and representing the age range as a pause quantity between the time of the measure period and the birth observation.  This is challenging because it requires comparison of two separate observations, the measure period and the birth observation, using a variety of HL7 Vocabulary terms to reflect the difference (as a pause quantity).
    3. Represent date of birth (as opposed to birth) as an observation, with the value of the observation being the date of birth, and representing the age range as a pause quantity between the time of the measure period and the value of the date of birth observation.
    4. Represent the age range as a Date of Birth range, and specify that range an interval on the subject's birthdate in the query critieria.  This is very awkward, especially given that the Person class in HL7 V3 is not designed to be "queried by example" using the critieria indicator.  That is to say, you cannot specify an interval on birth date or date of death. 
  2. Other demographics may also be of interest, including gender, race, ethnicity, marital status, religious affiliation, place of birth and place of residence.  There are at least two options for many of these:
    1. Representing demographic criteria as observations.  This allows the typical things to be done on the observation, and supports specification of value ranges for geographic criteria.  We can certainly find LOINC and SNOMED codes to represent the various concepts found on Person  to address the kinds of queries that need to be made.
    2. Representation on the appropriate model elements for the subject, again, with a similar challenges as date of birth/death in that PERSON is not designed to support query by example in the V3 model.  For the coded critieria, it can easily bend this way, but in dealing with geographic designations (postal code, city, state, country and county), it also gets challenging.
  3. Time dependency.  All of the "expressions" I've dealt with have to do with relationship of different acts in time.  There are a couple of ways to handle these expressions:
    1. Using expressions in effectiveTime, activityTime or other act time intervals.  While the XML is simpler to read, the resulting expressions are difficult to interpret and transform to an implementation technology.
    2. Using pause quantity and the HL7 specific value set TemporallyPertains which relates acts by their temporal relationships.  While the pause quantity is clear on the time spent between two acts, what isn't clear is to what this applies.  Is it the clinically effective time (effectiveTime), or the activity time (activityTime), or some other time.  This also leads to complex XML expressions.
  4. Model Relationships.  There needs to be some way to relate data criteria to a stratospheric view of a data model.  
    1. I used the instance of (INST) relationship and very bare details to represent that an act was an instance of a certain type in my prototypes.
    2. The NQF Measures adopt the LOINC codes for information categories used in the CCD and similar guides to identify what elements are being considered, and the detailed act was represented using the Component of (COMP) relationship.
  5. Data Criteria or Data Elements.  While it's described as the data criteria section in the HQMF specification, some implementations have simply used it to identify the data elements, and applied further criteria in the Patient Population Section.  This is reflected in the NQF Measure 59 where the Encounter data element is used in two different places in the patient population section to represent two different things.
    1. I like fully specified criteria in the data criteria section.  That way I can distinguish between different data elements of interest.
    2. Other measure implementations have simply identified data elements.
  6. Counting things.  The MAT generated NQF measures use a rather complex way to express the idea that there have been two encounters for a patient in the measure period.  There are at least three ways to express this:
    1. Use summary criteria to count the number of events meeting a particular criterion.  See this post for details.
    2. Use repeatNumber in the encounter criteria to indicate the specific encounter.  This is a simplification of the previous method.
    3. Use temporal criteria to relate an event to another event.  To identify the second event, you could ask for an event meeting particular criteria within the measurement period that starts after the start of another event that meets that same criteria.  This is OK for second, not great for third, and uglier and uglier after that.  It's a unary counting method.
    4. Use specific subset codes to identify FIRST, SECOND, et cetera.  In this case, you could simply ask for the "SECOND" encounter meeting particular criteria.  I don't like this at all because it isn't generalizable beyond the values provided in the vocabulary, and it's pretty clear that there are an infinite number of ordinal positions.
So far, my preferred solutions are the first option of each of the alternatives listed above, but I haven't considered all the details. Somewhere, these sorts of details will need to be addressed.  IHE QRPH is working on some guidance for population measures, and I will be bringing these issues up there as well as in other places.


Dec-9-2011: Updated the title and added content about Counting Things

Friday, September 3, 2010

A Change of Mood Revisited (by a professional linguist)!

A few days ago I wrote a post called "A Change of Mood", describing HL7 Mood Codes and comparing them to some existing linguistic moods, mostly for fun.  It looked like book fodder, except that I didn't know what I was going to do with it.  Now I do, so I had a professional linguist review and comment on my post.

I've known Dr. Win Carus since 1992 when I joined the Software Division at Houghton Mifflin to work on spelling correction. He was the brains behind much of the linguisting technology we developed there.  All I really had asked Win for was a little feedback.  This is what I got, in his rather normal expansive manner.  It was too good to keep to myself.

Win's comments appear below.

(a) Etymology: The term "mood" -- like many other incomprehensible English grammatical terms -- has its origin in Latin grammar (Latin 'modus', measure, manner). This is the same etymology for the term "modality" as used in logic. English has borrowed a lot of terms for linguistic and literary phenomena, especially from Latin and Greek, but you will find many French and German technical terms, and even Sanskrit here and there.

"Mood" is a technical linguistic term, so saying "it doesn't make sense" is a bit over the top. Yes, it has an unfamiliar sense, a sense with which your readers are probably not acquainted.

(b) Conflation: This term is used in the Wikipedia article you provide a link to, but I think it needs some clarification.

First, it is not at all uncommon for linguistic forms to carry multiple pieces of linguistic information. A simple example in English: the 's' ending of verbs indicates "third (person) singular (number) present (tense)". Keep in mind, however, that this phenomenon is found rather regularly in "fusional" or "inflecting" (more generally, "synthetic") languages, such as Indo-European languages.

Conflation of this sort is far less common in "agglutinative" languages such as -- Finnish, Hungarian, and Turkish -- in which the grammatical information of a lexeme is constructed by stringing together sequences of grammatical morphs.

And there's another linguistic phenomenon often at play in synthetic languages: "syncretism". This is where a single form can have multiple grammatic functions. For example, the "bare" English verbal form performs the functions of an infinitive and a non-third-person-singular present tense form (for example, the Brown Corpus tag set uses a single "VB" tag for both of these functions while the Penn tag set uses "VB' and "VBP", respectively).

"Unmarked" grammatical categories (such as the indicative mode; see the discussion in the next section) are by their very nature syncretic.

(c) Definitions of "mood": The great linguist Roman Jakobson gave an interesting way of thinking about mood years ago in his "Shifters, Verb Categories and the Russian Verb". He starts by distinguishing between three things:

(1) the narrated event (basically, what the speaker is talking about, the unadorned "just-the-facts-m'am")
(2) the speech event itself (the speech event occurs "here" and "now"; this is clearly a fundamental frame of reference for all sorts of ["deictic" and "indexical"] grammatical and semantic categories such as tense, locational prepositions and personal pronouns)
(3) the participants in the speech event (the speech event is produced by "me" and is directed to "you" and sometimes talks about "him", "her", "it" and "them")

Jakobson describes mood as how the speaker presents the narrated event to the listener, the speaker's overlay on the more or less objective facts of the narrated event. Mood presents the facts from different perspectives, divided most prominently between "real" ('realis') and "unreal" ('irrealis'). The "indicative" form is the basic "real" mood sub-type. (Jakobson also considers the indicative to be a semantically "unmarked" category: indicative forms can be used when speaking about both real and unreal narrative events, such as in the English "I hope that Johnny eats his vegetables.")

There are a wide range of "unreal" mood sub-types: imperative (which can be viewed as a demand or request that a narrative event come into being or be realized); conditional (a counterfactual or hypothetical narrative event); optative (a narrative event we wish or hope to be come the case or be realized); interrogative (asking about the truth of the given narrative event); potential (a narrative event that is considered probably or likely); jussive (requesting or exhorting the listener to accept the narrative event as true and possibly act on that knowledge); and so on (there are lots more, as you've learned already).

Most languages make a grammatical distinction between real and unreal; most languages don't have a large number of grammatical sub-types.

(Intellectual History Note: Jakobson's view on grammatical categories was strongly influenced by both C.S. Peirce's theory of signs, de Saussure's theory of linguistic signs and the Shannon-Weaver theory of communication.

(d) How mood is expressed: As you noted, mood is a property of verbs. But this is really a simplification. It's really a property of verbal linguistic expressions and more generally predications. Mood may be expressed:

(1) by a verb form (for example, indicative and subjunctive forms in Spanish)
(2) by a syntactic pattern (for example, English inverted interrogative word order ["Can you help me?"])
(3) by verb modifiers (for example, "particles" such as the Russian particle "by" used with preterite verb forms to express the subjunctive);
(4) periphrastically (for example, "[I would be very pleased if you would] help me"); and
(5) by differences in verbal intonation ("HELP me!" "Help ME?")

Many grammatical phenomena can be expressed in multiple ways (think, for example, about the ways you can express plurality in English).

American English has almost entirely lost purely morphological mood. Mood is now usually expressed by syntactic pattern, periphrastically or by intotation.

(e) What's the value of grammatical mood to your discussion of HL7 mood? In my opinion, the range of sub-types of grammatical mood does give you starting frame of reference about distinctions between real and unreal narrative events. But you must keep in mind that the distinctions talked about are about how languages have *grammaticalized* mood. You can see this wide range of grammaticalized mood in the two main Wikipedia articles on mood (Grammatical Mood and Eventive Mood). But you must always remember that this is just what it is: a list of grammatical categories.

The grammar of a language enforces certain ways of expressing certain kinds of information (this is what we think of as its grammar; and, of course, you really don't speak the language correctly or even intelligibly if you don't follow these grammatical prescriptions). But, by its very nature, language provides the linguistic tools to express notions that are not enforced or required by the grammar. There's a wonderfully clear discussion of this point in a recent New York Times article: "Does Your Language Shape How You Think?" by Guy Deutscher.
This is a very condensed presentation of his soon-to-appear book, “Through the Language Glass: Why the World Looks Different in Other Languages". This idea is not really that new. It was already apparent to Peirce that a sign has the property that it can be used as the basis to generate more complex signs (what's called "infinite semiosis").

Outside of the grammatical moods prescribed by a language, there are essentially unlimited and arbitrary ways to express moods in a language.

The discussions of grammatical mood can be used to identify a rich "starter kit" of narrative "moods" in HL7. However, what's most important should be a HL7-specific goal: What are the most useful sub-types (and these will undoubtedly fall into the "unreal" bucket) for describing medical narrative events? Keep in mind that the most important distinction is between "real" and "unreal" moods; and that you can define -- at will and entirely arbitrarily -- how many sub-types you wnat to use. What these grammatical mood descriptions help you to do, in addition, is to determine how one mood sub-type can be distinguished from another.

There is no reason to shoehorn the definitions you make for HL7 moods into grammatical moods. Note that you gave some one-to-many and many-to-one mappings in your attempts. My opinion is that grammatical moods per se don't matter for this work. Your goal should be to make sure that you've set up reasonable distinctions for characterizing medical assertions.

(f) Some Observations about HL7 moods:

(1) Actor/Patient Roles Unspecified: Reading through the list of HL7 moods (http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/ActMood.htm), it is unclear who is the actor and who is the acted-upon of these assertions. For instance, a physician proposes a drug to treat the patients disorder and a patient proposes to be more diligent in taking his medications. Is it assumed that only medical staff can be an actor? Is only the physician case allowed?
(2) Heterogeneity: the HL7 moods are extremely heterogenous. (Many clearly could never be matched by something like a grammatical mood.) Take, for instance, OPT and ActMoodPredicate. These are not moods; they are organizational labels for relating moods.
(3) Name/Description Mismatch: ActMoodPromise is characterized thoroughly as a "commitment". Why not call it ActMoodCommitment?
(4) Temporal and Locational Intermixed: The specification of some moods (e.g., EVN, SLOT and APT) have temporal or locational constraints.
(5) Contextual Dependence: Some moods (e.g., ActMoodActRequest) depend on other moods.
(6) Definitional: The mood DEF is a definition (probably some kind of communally accepted and mandated description) that holds independent of time, place or event. This seems to something that stands apart from act-oriented moods.
(7) Act as Uniform Basis for Moods: It seems very odd to base moods uniformaly on an "act". For EXPEC, for instance, how is the prognosis of a condition interpretable as an "act"?

I could write much more about the HL7 moods.

Suggestion:

(1) Operational Rules: With respect to distinguishing one type of mood from another, I would suggest that you use "operational" questions for making these distinctions. These are questions that can be answered "yes" or "no" about how a narrative event is being viewed, to place it in one mood or another (sometimes in more than one). For instance, to determine that you're dealing with hortative mood, you could ask: "Is the physician or medical staff [speaker] speaking to the patient [listener] and strongly asking or requesting the patient to do something?" (Here "speaking" stands for communication in general; and there are a wide range of medical "exhortations" -- stopping smoking, taking medicines regularly, and so forth.) Similar formulas with examples could be constructed for each type of mood.

(g) And to help you think more about how we communicate, I'd suggest that you also think about two further subjects:

(1) "speech acts"
To quote from the Wikipedia article on "Speech acts":

"Speech acts can be analysed on three levels: A locutionary act , the performance of an utterance: the actual utterance and its ostensible meaning, comprising phonetic, phatic and rhetic acts corresponding to the verbal, syntactic and semantic aspects of any meaningful utterance; an illocutionary act: the semantic 'illocutionary force' of the utterance, thus its real, intended meaning (see below); and in certain cases a further perlocutionary act: its actual effect, such as persuading, convincing, scaring, enlightening, inspiring, or otherwise getting someone to do or realize something, whether intended or not (Austin 1962)."

This work arose from a short book by J.L. Austin, "How to Do Things With Words".

Thinking about "speech acts" shows how complex the underlying act of communication really is; and that there are a lot of unstated inferences we can draw and implications we can make from even apparently very simple statements.

(2) Grice's Conversational Maxims
Grice is interested in the link between our utterances and what we're talking about. Here's a short description from the Wikipedia article:

"The Maxims are based on his cooperative principle , which states, ‘Make your conversational contribution such as is required, at the stage at which it occurs, by the accepted purpose or direction of the talk exchange in which you are engaged,’ and is so called because listeners and speakers must speak cooperatively and mutually accept one another to be understood in a particular way. The principle describes how effective communication in conversation is achieved in common social situations and is further broken down into the four Maxims of Quality, Quantity, Relevance and Manner."

These maxims give a different way to analyze how the medical information for an encounter is constructed.

Win

Win Carus is the President and Founder of Information Extraction Systems.  InfoExtract has developed a suite of high-performance, multilingual, adaptive, platform-independent natural language and semantic processing tools which they license and use to develop applications that combine structured, semi-structured and unstructured information. Their medical informatics application suite includes applications for physician referrals, patient selection, medical terminology servers, and patient problem list processing.

Wednesday, August 30, 2017

An Ongoing Problem in FHIR

How do you find a problem that was occurring during a particular time span?  This is relevant if you are doing a search for Conditions (problems) that are active within a particular time period for something like a quality measure or clinical decision support rule. As I've previously discussed here, temporal searching is subtle.

So, if you have a time period with start and endpoints, and you want to find those conditions which were happening in that time period.  There are only two rules you need to care about:

  1. You can rule out anything where the onset was after the end of the time period.
  2. You can rule out anything where abatement was before the time period started.
What's left?  In the following analysis, I'm ignoring "things that happen at the boundary points". For the sake of argument, we'll assume that time is infinitely divisible and that no two things occur at "exactly the same time".  Obviously we quantize time, and boundary conditions are inevitable.  But they aren't IMPORTANT to this discussion.
  1. Things that had an onset within the time period, or before the time period started.
    1. For those items that had an onset within the time period, clearly its in the time period!
    2. For those items that had an onset before the time period started, one of three things must have occurred:
      1. The problem abated before the time period started (which is ruled out by rule #2 above).
      2. The problem abated during the time period, in which case it clearly was occurring within the time period for some point in that period.
      3. The problem abated after the time period ended, in which case, the time period is wholly contained within the period in which the problem is active, and therefore was occurring during the time period.
  2. Things that abated within the time period, or after the time period ended.
    1. For those items with an abatement within the time period, the are clearly withing the time period.
    2. For those items abated after the time period ended, one of three things must have occurred.
      1. The problem onset was after the time period that ended, in which case it is ruled out by rule #1 above.
      2. The problem had an onset during the time period, in which case it clearly was occurring within the time period for some point in that period.
      3. The problem onset was before the time period started, in which case, the time period is wholly contained within the period in which the problem is active, and therefore was occurring during the time period.

So your FHIR query is Condition?onset=le$end&abatement=ge$start

Done.  Simple ... err yeah, I'm going to stand by that.

   Keith

P.S. Yeah, so easy I had to come back and reverse the le/ge above.  Duh.