Wednesday, January 6, 2016

A Workflow Framework

What follows is specification gobbelty-gook that flowed from my brain after the result of our FHIR Workflow discussions in HL7 earlier today.  It doesn't really explain much (specs often don't), but it's essential content somewhere, so I'm saving it here for further conjuration.

  Keith


The essential components of a workflow infrastructure for FHIR include the following:
  1. A task resource which tracks the state of a service request, and which may be referenced by other task resources (known as subtasks).
  2. A workflow system of record that keeps track of task resources.
  3. At least one requester of services (e.g., order placer) that creates task resources indicating that a task needs to be performed.
  4. At least one performer of services (e.g., order filler) that modifies task resources upon performance of a task.
  5. An optional service monitor that tracks the state of task resources.
  6. An optional service manager that can change the state of task resources.
The service requester must create task resources, and monitor the status of task resources that it creates as needed to ensure work is done.

The service performer must read task resources and monitor the status of those resources as they are updated to ensure the appropriate performance of work being requested.

The service monitor may read task resources to enable other functions (e.g., escalation, service level monitoring, dashboarding, et cetera).  Within a functioning workflow environment, it need not be present.

A service manager may write task resources to force a change in state of a task to support other functions (delegation, escalation, tie breaking, et cetera). Within a functioning workflow environment, it need not be present.

The system of record must maintain task resources in their current state.  It should support access to the history of the task resource. It should also support query and subscription to updates of a task resource. It MAY support additional capabilities, such as enforcement of certain constraints when a task is modified.  For example, it might insist that a task in the "Completed" state first be brought back to an "In Progress" state before certain properties are allowed to be modified.  It may also support storage of other resources.

The system of record may be a composition (e.g., federation) of systems, so long as all systems provide a consistent view of the current state of a task within certain limits (e.g., federation may incur some delays between synchronization of views, but these should be small).  The mechanism by which such federation is accomplished is unspecified.

The system of record for a task may migrate from one system component to another as the state of the task changes.  In this case, it must be apparent to all systems participating in the workflow environment which system is the system of record. The mechanism and model for this is not specified, and we only note that REST allows for Representational State Transfer, thus, that a task resource could be transferred from one system to another.

The mechanism by which the service requester and service performer monitor activities on tasks is unspecified.  This may occur through periodic polling, use of subscription, or even out of band communications to ensure that the information stored in the system of record is tracked by the service performer and service requester.

The results of task execution should be independent from the mechanism used for task monitoring. In other words, two systems which are cooperating in a workflow through the exchange of information in a task resource should not be able to distinguish whether the task is being processed by a system that monitors task status through polling or through a subscription mechanism.  This is not to say that there may not be advantages to the use of one mechanism or another, but that the effect should not be sufficiently distinguishable so far as the execution of the workflow is concerned.

To request that a task be performed the service requester shall create task resource on the system of record in any state less than "In Progress" (e.g., Created, Ready, Assigned).  In response to creation of such a task, a service performer may assign the task to itself, or if already assigned, may delegate or reassign the task to another system.  Once the task is in progress the service performer should mark it so.  A task can be suspended or resumed by the service performer or other system actor, or it may be cancelled.  Upon completion of the task the service performer will mark the task as complete.  If the task cannot be normally completed the service performer should mark it as failed, and provide a reason for failure.  If a task is not accepted by a service performer, this should be handled as for failure, with the reason for failure indicating the reason that the task was rejected.

Tasks can have sub-tasks.  The service performer can decide when it accepts a task how to break the work into subtasks and subsequently manage these.  The subtasks need not be stored in the same system of record as the original task, nor need they be assigned to the same task performer.  These subtasks should reference the parent task so that the entire workflow status associated with the initial task can be determined.  In BPMN parlance, a collaboration diagram represents a workflow, and within that collaboration an activity can be represented as a subprocess with seperate activities being performed by other workflow participants.  Within FHIR, the task represents a business process, either at the level of workflow collaboration, or at the subprocess level, and so comprises the functions of both the workflow and task information items.



Workflow Services vs. Storage in FHIR

The question of the day is: Should there be one resource (Task) or two (ActionRequest/ActionResponse)?

I've been a proponent of the one resource approach, but will certainly acknowledge the value of a request/response approach as well.  I think though, the real question is not about resources per se, but rather about functionality.  Today, FHIR is mostly about describing a set of common behaviors (CRUD) around resources, with a little functionality beyond storage and search.

Workflow is about the execution (behavior) of activities.  The kinds of behavior that need to be effected can be seen in the list of WS Human Task Event Types and Data.  That list describes the activities involved in workflow management: Management of the task, changing task states, assignment of tasks, capture of task related data, et cetera.

In an object oriented model, these events are the operations that can be performed on a task.  In FHIR, these could be treated as operations on a Task resource that made appropriate changes to the resource, or responded with error messages when those changes could not be made due to required behaviors of the object.  These operations are where we get into a "Request/Response model".  The operation is the request, and the updates to the Task resource, or the error raised in response to the request is the response.

There are a number of different ways to deal with workflow.  As I've previously mentioned, there are different models for collaboration on workflows, notably around the differences between orchestration and choreography.  I like the discussion in the previous link about Orchestration being intra-institutional vs. choreography being inter-institutional.  I think it helps to narrow the discussion a bit.

As a resource, Task serves to record the status and progress of a workflow, but does not imply a specific workflow structure or rules around how it might be choreographed or orchestrated.  If multiple organizations are able to create and update task resource, that would enable choreography. Task operations could effect request/response behavior patterns to support enforcement of a limited set of allowed task state changes and workflow controls (e.g., per WS Human Task requirements), but still enable either kind of workflow.  Implementation Guides on the use of the Task resource would assist in defining specific institutional or orchestrated workflows in a more refined way.

The only net benefit I see behind the request/response resource pattern is that of supporting separate maintenance of resources, such that the initiator of a workflow can create and maintain the request resource, and the responder can create and maintain the response resource.  But frankly, I don't see a lot of value in that because there's never a single resource that tells you what the state of the task is at any point in time.  Instead, you must look at a sequence of requests and responses, and manage the state yourself.  I know that's a bad idea.  Anytime you have multiple systems implementing complex logic like that, you'll have multiple systems looking at sequences, and come, based on their interpretation of how workflow is supposed to work, different opinions about what the state of the system is.  It is much better to say "this is the state of the system", and allow the maintainer of that state (resource) to impose rules on how it might be changed if it feels a need to, or alternatively, allow it to be completely ignorant of any transition rules.

We don't have to choose between choreography and orchestration, and we don't need to choose between a task resource or request/response patterns.  We can simply say: Here is the resource.  Here are operations that work in this way on the resource.  And a system can say: I implement this resource, and I implement these operations, and you get both.

Tuesday, January 5, 2016

The Age of Innovation

This is the week that everyone wants to predict the next Uber for Healthcare, the new Amazon for the Patient, the ...

Last year, the next big thing was ...

And this year it will be ...

Well, you get it.

The new kid on the block, by the time most of us are reading about it, has usually been around for quite a few years, and is just now getting noticed. Let's look at the age of some innovative things from our past that we see talked about in the headlines as being icons of innovation:

Twitter is 7 years old, it just entered First grade, and sits right next to Uber.  The iPhone is 8, no, 9 years old -- several years away from Middle School age.  Facebook at 10 years isn't even old enough to have its own account, let alone a page. Amazon is studying for it's learner's permit. REpresentational State Transfer (Fielding's original paper giving RESTful architecture its name) is old enough to drive. The MP3 player is a decade older than the iPhone and is old enough to vote. The Innovator's Dilemma is just a bit older. Windows 95 is old enough to drink.  Big Data is a thing.  It has been for decades.  It's been around long enough to collect a master's degree (probably in data science).  The web is about the same age as Big Data.  e-Mail is positively middle-aged.  And if your in-box is like mine, showing it around the middle girth too.

Innovation, true innovation, takes time to be successful.  The next big thing (e.g., FHIR), has already been around for half a decade.  It's younger than Twitter, Uber, Facebook, Amazon and all the REST (pun intended).  It's not just the next big thing. It's the next big think, and I cannot wait to see what it becomes when it grows up.

   Keith



Monday, January 4, 2016

In Hindsight

In Nobody Knows, I raised several questions about the coming year:

The US national program is at a time of transition, from the carrot to the stick. Incentives are no more. Penalties kick in this year. Will that work?

Ha. No. Meaningful Use is largely irrelevant according to some, a problem still for vendors and providers according to others, and mostly unsuccessful in moving the US healthcare system beyond basic EHR functionality.

At the same time, many hope that the incoming congress will pass new laws changing the way the Meaningful Use program works. Will that happen?
Not yet, maybe this year.  There have been several attempts.

Meaningful Use Stage 3 proposed rule, which many and projected to drop December 23rd as usually is still waiting in the wings, Clearly it is no longer business as usual at ONC. What's in the proposed rule?
Now we know.  Except funny thing is, we still don't.  Not exactly.  There's some stuff waiting in the wings based on the comment period.

ONC now hosts at most three of the original people staffing it under ARRA. Few really have a clue what is going to happen here either. What will ONC look like when it grows up?
Hasn't happened yet, and probably won't even begin until later in 2017.  Face it, ONC still has no effective leadership and won't until well into 2017 due to elections.

FHIR will soon be launching its second DSTU. The first pilots of FHIR using DSTU 1 will soon be appearing. Will it work, or won't it?
I'm betting it will, in a big way. More on that later.

IHE and HL7 will soon have a joint workgroup. There is a lot of opportunity here to bring together these two organizations which have had an on-again off-again love-like-hate-envy-love relationship. , will it be successful?
The joint workgroup has been created, and we've even initiated some joint projects, but there's still plenty of untapped potential.  Way too much in my opinion.

I'm looking forward to 2016 in ways that I haven't previously.  With advances in Meaningful Use mostly behind us, it's time to start executing on real interoperability.  And I'm about to kick some ...

   Keith

Tuesday, December 15, 2015

OK Everybody, Synchronize your Resources

You know how in secret agent TV shows in the 70's and 80's, where at the start of a major intervention the agents all synchronize their watches to ensure that they knew what was to happen and when?  And if you failed to do that, you could really mess things up, because you wouldn't be doing the appropriate things at the right time.  Inevitably something messes up in those shows [the target gets back on the elevator to collect a forgotten item], and somehow a message needs to be sent from one party to another to ensure that everyone keeps on track and out of trouble [after seeing a morse code flash from a car mirror at the street level, someone posing as a secretary on the 11th floor distracts the target long enough for the agent to finish his data download].  And of course the communicated signal might have requested "Abort!", but that's not what actually happens, but everything works out in the end.

We have similar problems in healthcare when dealing with workflows.  The problem is really in how we communicate and ensure that the processes of two different organizations involved in a workflow remain synchronized.  Let's look at a sample set of communications in a workflow to produce a laboratory report:

Physician/Order PlacerLab/Order Filler
I need lipids, an A1C, and a cardiac panel for this patient and sample.

OK, got it.

Hey, can you send me a new sample, this one is spoiled.
OK, got it.
Here's a new sample.

Thanks, got it.

Tests are in progress.
......
How are those tests doing?

Lipids are in progress.  A1C in progress.  Cardiac Panel completed, awaiting final review.

Here are the lipids results.

Here's the A1C results.
I need those results STAT!

Tests are all done.

Here's the cardiac panel.

Tests are all done.

Here's the cardiac panel again, the results were amended.

As you can see, there are several points where control passes from one system to another in order to complete the workflow, and, in order to remain synched up, the two systems may need to signal each other in some way.  One way is to query for information [e.g., how are those tests doing] to be sure that the current state is recorded (you might have missed a message somewhere).  Another way is to respond to a "request" with an acknowledgement that you have accepted work [OK, got it], or moved it to a new state [Tests are in progress].  Out of band, even though one system might be "in control", another system could assert privileges to regain control (e.g., an out of band message to change priority [I need those results STAT!], or not shown: [Cancel that order]).  And you may tap someone on the shoulder to say, whoops, something changed [Here's the cardiac panel again ...].

The challenge here is that the Test Order as a resource is actually two (or more) information objects. The physicians "Order" resource is managed at the Order Placer system.  The Lab's "Order" resource is managed at the Order Filler system.  These two systems could communicate using their own resources, but then you have to worry about how gets to edit which resource when, and that gets complicated.  Some have suggested that there are two resources: The Request and the Response, and that the request is owned and managed by the placer, and the response by the filler.  All that does is hide the fact that there are two information objects that need to be synchronized, it's simply the whack-a-mole problem.  We hide the complexity over here, and it pops up over there.  Others, like myself are saying: There's one or two resources, and how you use them to manage your workflow depends on how your systems are integrated, and that your "internal" workflow management infrastructure and your "external" workflow management infrastructure could be looking like the same things, but be managed differently.

FHIR needs to support order management workflows in environments where the norm is Choreography [collaborating systems], and in environments where the norm is Orchestration [centrally controlled systems].  

I'm still trying to figure how to address this.  I think the first step is to acknowledge that the step of "Synchronizing our workflows" has to occur, and that some communications may need to be exchanged which may NOT be a full resource.

The real trick in all of this is making sure that whatever the workflow is, it all works out in the end.

   Keith

Thursday, December 10, 2015

Finding the problem is ONLY the first step

There's something just not right with this model. I don't know what it is, but ... It niggles at the back of my brain. It doesn't work.  It's missing these properties that I expect, but I don't know how to get them out of it, or bake them into it.  And I should... it's just math.

I fuss and fight with it, and finally, I see what I'm missing. It should have been obvious all along.  I no longer wonder about what is wrong with the model, but now have to go and fix it.  I don't know how to do that yet, but I know where I can go find out.

Sometimes finding out what the problem doesn't immediately lead to a solution, but it's a good first start. Now to go find some more magic smoke.

    -- Keith

P.S. Technology is just like normal stuff this way.  The other day I headed out for an appointment, but the bike wouldn't start (and my eldest had the truck). It's cold out I thought... battery probably needs to be put on the trickle charger these days.  So I was going to roll it down the driveway and start it that way, but it wouldn't roll easily.  Thinking I was in gear, I turned the key on (there was enough juice to operate the controls, just not enough to start it), but was in neutral.  I checked more closely, and sure enough the rear tire was flat.  Must be a slow leak I thought, have to fix that, let's grab the compressor to put air in it.  Picked up the compressor and the handle broke off the plastic hose.  So I cancelled my appointment, fixed the compressor, started to put air in the tire, found that air was leaking out the valve stem.  Tried to find a valve stem online, failed.  Called the shop, they explained that the valve is attached to the tube (not a tubeless tire as I'd though), and so I arranged for them to come get it and replace the tube.  I could do it myself, but I got other stuff people pay me to fix (like the problem above) so that I can pay others to fix my stuff.


Monday, December 7, 2015

What is a Standard?

In my spare time [yes, such a thing does exist], I've been thinking about how my "PubMed for Standards" capstone project should index standards.  Which leads to the question in the title of this posting.

It's not the usual form of this question, but rather, what I'm trying to figure out is what is teh "unit of indexing" in the database.  Let's take some examples:  IHE Cross Enterprise Document Sharing (XDS), Web Access to DICOM Objects (WADO), DICOM Key Object Selection Document, HL7 Messaging Standard Version 2.3.1 (HL7 V2.3.1), HL7 V2.3.1 Patient Administration Message, HL7 Version 3, HL7 Clinical Document Architecture Release 2, HL7 Version 3 Person Registry, the IHE PCC Technical Framework, HL7 Consolidated CDA, HL7 CCD Version 1.1, and FHIR.

Now, how would you like to see these indexed in a retrieval system?  Each of these "publications" works in different ways.  XDS lives in the ITI Technical Framework, and is described in Section (Chapter) 10 of Volume 1, and several sections in Volumes 2a, 2b, and nearly all of 2x.  Web Access to DICOM Objects is the last of 18 sections in the DICOM Standard.  A Key Object Selection Document is a DICOM Information Object found in section A.35.4.1 of Part 3 of the DICOM standard.  HL7 Version 2.3.1 is 1026 page document with 12 chapters and 5 appendices, Patient Administration Messages make up one of these chapters (chapter 3). HL7 Version 3 is an aggregation of several standards published on the web by HL7 under the Version 3 title.  Clinical Document Architecture is one of those several standards published under the Universal Domains section of the previous publication, where Person Registry is a topic are under the Patient Administration domain of the Universal Domains section in the same.  The IHE PCC Technical framework is a collection of profiles developed by the Patient Care Coordination Domain.  HL7 Consolidated CDA is an implementation guide, the HL7 CCD Version 1.1 is a type of document described in the previous. FHIR is a standards framework: a collection of data types, resources, and protocols used for the development of health IT interfaces and systems.

Every single one of these may be relevant in a query for information about relevant standards.  As a system designer I may want to learn about all of FHIR, or just a single resource, all of CDA, or just a single template, all of DICOM or just a single part or part of a part, et cetera.

The challenge this creates for developing an appropriate index is trying to understand the granularity. Publication unit is just one level of granularity.  What makes the unit size is perhaps best understood as the smallest invariant unit size for provenance of the information: what is the smallest unit to which you'd provide author information about, or even better, what requires a briefer explanation of the thing being described as a whole.

What I've finally worked out is that an indexable unit is something to which I can identify some form of abstract: A subsection labeled abstract, description, introduction, purpose, scope or some similar heading is what I'm going to call a "Standard" -- for the purpose of indexing them.  Because that's the level at which they can be used or reused.

Where I won't go is in indexing templates beyond those of a document in CDA, or publication units below Implemetation Guide in FHIR, because the degree of proliferation once I break that level of granularity becomes unreasonable ... at least for the scope of my capstone project.

So, if I can reasonably find an abstract, and it isn't a fine grained data object, I would index it.  Where does that leave FHIR resources or OpenEHR templates?  Honestly, I don't know.  Both are as fine grained as CCDA or IHE PCC templates, and yet, they are also considered by some to be primary standards with some level of separately maintained provenance.  I think what I want to do is leave them out for now.

The next area for me to address is vocabularies and value sets, but the real answer for that is that it is out of scope.  I'm trying to fill a gap, and for value sets and vocabulary, UMLS, VSAC, and PHINVADS all address the location problem for these resources.  I don't need to do something to address that non-gap.

   Keith