Magentus Practice Management FHIR Implementation Guide
1.2.35 - ci-build
Magentus Practice Management FHIR Implementation Guide - Local Development build (v1.2.35) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
The FHIR Resources used by the Magentus Requesting Service are shown in the diagram below.
Some features to note:
ServiceRequest
/Task
pattern that is defined as Option F in within the FHIR Workflow description. This uses a Task
to track the fulfillment status of a ServiceRequest
.Task
for each ServiceRequest
, we also allocate a Group Task
that provides a resource representing a set of individual Task
s for each ServiceRequest
(each individual test or service where multiple may constitute a single order). In addition to the explicit Group Task
, they are also implicitly bound together through their common groupIdentifier
attribute. The reason for an explicit Group Task
resource is to aid searching and discovery of complete orders rather than needing to discover each in isolation.Task
s are also used to track the workflow associated with CommunicationRequest
s. These are used for communication with a patient about their diagnostic service or with a clinician for urgent results.While our use of individual ServiceRequest
s and Task
s could allow for unique attributes such as Status
, Note
, etc., we currently require that all child ServiceRequest
and Task
share common values, including that within the Group Task
.
The FHIR Resources generated by the Magentus Requesting Service are listed below.
It should be noted that Diagnostic Service Request should be regarded as a legacy profile and instead replaced by explicit Pathology Request and Radiology Request use as these are more specific to each of their domains of use.
Magentus Profile | Abstract | FHIR® Resource |
---|---|---|
Diagnostic Service Request (legacy) | No | ServiceRequest |
Pathology Request | No | ServiceRequest |
Radiology Request | No | ServiceRequest |
Diagnostic Request Base | Yes | ServiceRequest |
Diagnostic Request Group Task | No | Task |
Diagnostic Request Task | No | Task |
Diagnostic Request Task Base | Yes | Task |
Magentus Profile | FHIR® Resource |
---|---|
Communication Request to Patient | CommunicationRequest |
Communication Request to Provider | CommunicationRequest |
Communication Request Task | Task |
Additional resources are contained within the Requesting resources above, the FHIR profiles for these resources are listed below.
The eRequesting workflow describes the interactions between a placer
and a filler
(or alternate filler
) via the eRequesting FHIR Service.
In order to receive subcription notifications from the FHIR Server when resources of interest are created or updated, a subscription is registered. A subscription request includes the following properties.
Property | Description | Example |
---|---|---|
criteria | Search criteria to match resources of interest | Task?status=requested,cancelled&_tag=fulfillment-task-group&owner.identifier=http://ns.electronichealth.net.au/id/hi/hpio/1.0|8003123456789123 |
status | Fixed: requested | requested |
channel.type | Fixed: rest-hook | rest-hook |
channel.endpoint | Web service URL where webhook is posted | https://webhook.site/bbd78ee4-e267-4633-8acc-38a5e1dc54a0 |
channel.header | Authorization header to be used in the subscription notification | Authorization: Bearer secret-token-abc-123 |
In this case we are interested in Task
resources that are
Task
group, not an individual Task
fulfillment, andOrganization
with HPI-O of 8003123456789123
.Example
The following example creates a new Subscription for the Task
resource with criteria as described above.
POST /Subscription
{
"resourceType": "Subscription",
"criteria": "Task?status=requested,cancelled&_tag=fulfillment-task-group&owner.identifier=http://ns.electronichealth.net.au/id/hi/hpio/1.0|8003123456789123",
"status": "requested",
"reason": "Task requested and cancelled subscription",
"channel": {
"type": "rest-hook",
"endpoint": "https://webhook.site/bbd78ee4-e267-4633-8acc-38a5e1dc54a0",
"header": ["Authorization: Bearer secret-token-abc-123"]
}
}
The Subscription endpoint can also be used to Search, Read, Update and Delete as per the standard FHIR REST API pattern.
A subcription notification is received as a POST request on the endpoint specified in the subscription registration request. The POST request has an empty body.
Example
POST https://webhook.site/bbd78ee4-e267-4633-8acc-38a5e1dc54a0
Authorization: Bearer secret-token-abc-123
The subscription notification shall respond as quickly as possible with a success status of 200 OK or 202 Accepted, and an empty body. The latter is normally returned when the request is accepted for processing but processing will commence after the response has been returned, which is the preferred approach for subscription notifications.
Any error response may result in a subsequent retry by the FHIR Server to submit the Subscription Notification until the number of retires is exceed at which time the FHIR Server will stop the subscription. See Managing Subscriptions and Errors for more details.
When a subscription notification is received, perform a Search request with the corresponding criteria along with a _lastUpdated parameter with the timestamp when the last search request was performed with the gt prefix (see https://hl7.org/fhir/r4/search.html#prefix).
Example
GET /Task?status=requested,cancelled&\
owner.identifier=http://ns.electronichealth.net.au/id/hi/hpio/1.0|8003123456789123&\
_lastUpdated=gt2022-12-13T12:30:00Z
In order to retrieve the entire Orders, use the following _include and _revinclude parameters.
Parameter | Value | Description |
---|---|---|
_include | Task:patient | Patient |
_include | Task:owner | Organization as the designated filler |
_include | Task:requester | Clinician creating the request |
_revinclude | Task:part-of | Group task for an individual Task |
_revinclude:iterate | CommunicationRequest:about:Task | Communication with patient or requesting clinician |
_include | Task:focus | ServiceRequest associated with Task |
_revinclude:iterate | ServiceRequest:copiesTo | PractitionerRole s where reports should be sent |
_include:iterate | PractitionerRole:practitioner | Practitioner associated with the requester |
_include:iterate | PractitionerRole:organization | Organization associated with the requester |
_revinclude:iterate | Consent:data:ServiceRequest | Consent s linked to the ServiceRequest s |
Example
GET /Task?status=requested,cancelled&\
owner.identifier=http://ns.electronichealth.net.au/id/hi/hpio/1.0|8003123456789123&\
_lastUpdated=gt2022-12-13T12:30:00Z&\
_include=Task:patient&_include=Task:owner&_include=Task:requester&_revinclude=Task:part-of&\
_revinclude:iterate=CommunicationRequest:about:Task&\
_include=Task:focus&_revinclude:iterate=ServiceRequest:copiesTo\
_include:iterate=PractitionerRole:practitioner&_include:iterate=PractitionerRole:organization&\
_revinclude:iterate=Consent:data:ServiceRequest
The claim operation is used create a new fulfilment Task
for an alternate filler. It cancels the original fulfilment Task
, if it exists, but leaves the ServiceRequest
unchanged. The original filler can determine that the order is being alternatively filled but not who is the alternative filler and similarly the alternate filler cannot determine who was the original filler.