Linking INSTRUCTION / ACTION archetypes in a workflow

Hi all,

I have been investigating referral workflows using Service request and Service archetypes. Does anyone have any best practice guidance for this type of INSTRUCTION and ACTION workflow? For example:

  1. Should Service request and Service archetypes be in the same template together or separate templates?

  2. Should the shared fields across both archetypes such as Description be copied over from Service request to Service and kept in sync - i.e. with edits and deletions?

  3. Is there a proposed field to link the archetypes together - i.e. a referral identifier

  4. Is there a suggested link between status of Service Request and ism transitions in service - i.e. Composition containing Service request archetype submitted and Service set to ism transition of Service request received

  1. Both ways could work, and I think this is an implementation choice. For the initial order/request, I usually put both the INSTRUCTION and the ACTION together, with the ACTION in an appropriate current_state, usually planned or scheduled. This makes it easier to reuse the information for any later ACTION instances detailing the further process.
  2. This is the way I do it, for the order composition. I haven’t seen need for a lot of updating the INSTRUCTION and hence the (initial) ACTION, but that may just be the use cases I’ve worked on.
  3. There are several:
    1. The RM technical method is using the ACTION.instruction_details
    2. It’s also possible to use archetyped identifier elements which are usually put in the protocol of both INSTRUCTION and ACTION archetypes.
  4. The status of an INSTRUCTION is held in the ism_transitionof its corresponding ACTION. Maybe I misunderstood the question?
1 Like

Agree @silje that there can definitely be slightly different approaches and also agree with your preferred approach. Put the ‘first instance’ of the ACTION in the same COMPOSITION of the INSTRUCTION to capture ‘initiation’ of the order, then separate ACTIONS in one or more other COMPOSITIONS.

Agree too that the use of ACTION.instruction_details is the correct way for the different ACTIONS to link back to the original INSTRUCTION but in a distributed system where there are different CDRs or e.g a typical non openEHR lab system, that is where the Order Identifiers come in (in line with HL7). Some sort of common shared ‘external’ order number that both parties in the process use and would appear e.g lab messages. @Ian_Bennett - that is your ‘order identifier’

There are 2 flavours:

  1. Requester Order Identifier (HL7 Placer Order number): This is issued by the system/app making the order.
  2. Receiver IOrder Identifier (HL7 Filler Order nyumber): This is issued by the system/app that is receiving the order, and handed back to the requesting app as an initial message.

Often both are carried in HL7 messages, and I would probably record them even if also using the internal openEHR instruction_details ot manage the ‘links’ internally.

The issue about whether to replicate details like ‘description’ is really a local one, and is really about local governance, and exactly what might have changed in the ACTION versus the original INSTRUCTION e.g. if a referral is being triaged, it is possible that the service name as well as the description might need to be changed if the referral is re-routed to a more appropriate place - does this mean that the original INSTUCTION is changed or is this essentially a New INSTRUCTION, issued by the triage service. Often however, replicating the description (and indeed the service name) is really just about providing an easy way for the ACTION ‘provider’ to have the key aspects of the original order without having to navigate complex queries, or where the original instruction is not actually available.

2 Likes

Thanks @siljelb and @ian.mcnicoll . We were exploring the “hidden” RM attributes today in @ian.mcnicoll ‘s openEHR Fellowship talk which I believe instruction_details falls into.
The example of the laboratory result is interesting as that is an Observation archetype with more explicit identifiers (i.e not derived from RM attributes).

1 Like

Indeed - these identifiers are the Requester and Receiver Order Identifiers that also appear in the Service Request and Action archetypes, used for external identifiers ‘assigned by the system’ not internal RM instruction_details.

It is not unusual to capture the lab results without any supporting INST/ACTION details, since the client is only really interested in the result, not in trackingthe process but in a full Order comms/lab report scenario you would want both, and in the Lab Report composition you might well have both the ACTION.service_request and the Lab OBSERVATION.

2 Likes

Agree many labs requests and results can be handled as a direct INSTRUCTION → OBSERVATION. The main role of an ACTION in this scenario in a clinical system is for the specimen collection and initial handling.

2 Likes

Just coming back to this one…

From what part of INSTRUCTION archetype do you typically set to ACTION.instruction_details? Is this a frontend workflow that needs to be implemented whereby you set ACTION.instruction_details from a certain element within INSTRUCTION archetype?

What archetyped identifier elements do these refer to?

ACTION.instruction_details points to the INSTRUCTION.activity

//CANONICAL FORMAT
 
 "instruction_details": {
      "_type": "INSTRUCTION_DETAILS",
      "instruction_id": {
          "_type": "LOCATABLE_REF",
          "id": {
              "_type": "HIER_OBJECT_ID",
              "value": "a2602224-d4ed-4e75-bd51-dd81a1b49837"  //compositionID
          },
          "namespace": "local",
          "type": "INSTRUCTION",
          "path": "//content[openEHR-EHR-INSTRUCTION.service_request.v1 and uid/value='55cb0a82-e2bb-4017-a0f2-be6457e536e5']" //path to the INSTRUCTION with a specific INSTRUCTION.uid
      },
      "activity_id": "activities[at0001]"
  }

Structured format allows a specific instructionId` to be expressed but ‘path + instructionId’ points to exactly the same place as

"//content[openEHR-EHR-INSTRUCTION.service_request.v1 and uid/value='55cb0a82-e2bb-4017-a0f2-be6457e536e5']"
//STRUCTURED FORMAT
"_instruction_details": [
	  {
	  "|composition_uid": "a2602224-d4ed-4e75-bd51-dd81a1b49837",
      "|instruction_uid": "55cb0a82-e2bb-4017-a0f2-be6457e536e5",
      "|activity_id": "activities[at0001]",
      "|path": "//content[openEHR-EHR-INSTRUCTION.service_request.v1']"
    }
]
1 Like

Note you need to be careful with that because the path is not really an ID of an instance (single occurrence) of an ACTIVITY in the INSTRUCTION: the INSTRUCTION could have many ACTIVITIES at that path in a single COMPOSITION instance, and what you might want is to have an activity_id that is actually an identifier of a single ACTIVITY instance in the data.

I raised this some time ago https://openehr.atlassian.net/issues?jql=textfields%20~%20"activity_id"&selectedIssue=SPECPR-221

Note I have an update in the description since I was talking about the instruction_id but the problem is in the activity_id definition (see at the bottom of the original description).

“The issue is the INSTRUCTION_DETAILS.activity_id: String which is in fact an archetype path, because the INSTRUCTION_DETAILS.instruction_id: LOCATABLE_REF has the id field that allows to identify the INSTRUCTION instance without any problems and the LOCATABLE_REF.id is actually mandatory.

But to fully know the exact status we need to be able to reference one exact ACTIVITY within the INSTRUCTION, even if multiple ACTIVITY instances specified by the same C_OBJECT appear in an INSTRUCTION object.“

Iagree but I had assumed that the activity_id should be seen in context of the INSTRUCTION

So essentially the full path is compositionID + InstructionId + activity_id

@ian.mcnicoll consider the case where an INSTRUCTION archetype defines an ACTIVITY at the activities[at0001] path, and ACTIVITY at0001 has occurrences = 0..*

Then in the data you can have:

COMPO uid = 123…
INSTRUCTION uid = 456…
ACTIVITY [at0001] (occurrence 0)
ACTIVITY [at0001] (occurrence 1)

Then your instruction details is ambiguous since the path can refer to either ACTIVITY. We actually need, at least, activity_id to be unique in the context of the INSTRUCTION.

What we currently use is the ACTIVITY data path, which is unique: /activities(0), /activities(1), etc. Though this is not a good solution if the CDR doesn’t control the order o the items in a multiple attribute like activities. A more solid solution would be to use the ACTIVITY.uid in the activity_id.

For example “Requester order identifier” and “Requestor identifier” in INSTRUCTION.service_request and ACTION.service, respectively.

1 Like

Right now, we would need to do something like

ACTIVITY [at0001 and name/value = ‘Referral‘] (occurrence 0)
ACTIVITY [at0001 and name/value =’Review’] (occurrence 1)

in ADL2 we are able to code these

ACTIVITY [at0001.1 (occurrence 0)
ACTIVITY [at0001 .2] (occurrence 1)

The issue is really how the spec defines activity_id on INSTRUCTION_DETAILS.

For instance, I think the current spec doesn’t allow a path like /activities[at0001 and name/value=’xxx’], though others might think different @thomas.beale @sebastian.iancu @sebastian.garde @Seref @yampeku @damoca

On the other hand, that also requires that different instances of ACTIVITY[at0001] have different names. The spec allows multiple occurrences with the same name at that path in the data instance. If it’s allowed, then the current activity_id doesn’t point to a single ACTIVITY instance, that’s the main issue, currently it’s not an ID.

Also, I don’t think the issue is in the AOM/ADL, it’s in the RM.

NOTE: current definition is EHR Information Model

“activity_id: Identifier of Activity within Instruction, in the form of its archetype path.“

What I understand as “archetype path” is the path of a node in an archetype, and those don’t contain dynamic predicates like dynamic paths used in AQL do. So the archetype path alone is referencing both ACTIVITIES inside the INSTRUCTION instance. (I mentioned that in the JIRA ticket).

1 Like