Proposal to add Task.focus support to the FHIR2 Module Task Model

Hello all, @grace @dkayiwa @raff @mseaton @ibacher @taseew

We would like to propose a data model extension to support the Task.focus element within the openmrs-module-fhir2. We have found that the current implementation of org.openmrs.module.fhir2.model.FhirTask (v2.5.0) does not support focus.

Background

In HL7 FHIR, a Task resource is commonly used to represent workflow activities that operate on or reference another clinical or administrative resource. While:

  • Task.basedOn represents the originating or authorizing request,

  • Task.for identifies the beneficiary or subject of the task,

the Task.focus element is intended to reference the actual resource that the task is acting upon. This is part of the standard HL7 FHIR Task specification and is defined in the FHIR R4 Task resource: https://www.hl7.org/fhir/R4/task.html

Supporting Task.focus would help align the FHIR2 module more closely with standard FHIR workflow semantics and interoperability expectations.

Currently, the FHIR2 Task model does not provide native support for the Task.focus relationship.

Proposed Change

We propose extending the FHIR2 Task data model to support a generic Task.focus reference. The intention is:

  • To align more closely with HL7 FHIR Task semantics.

  • To support broader workflow interoperability.

  • To avoid overloading existing fields such as Task.input or Task.basedOn.

  • To enable Tasks to reference any supported focal FHIR resource generically.

Benefits

  • Better alignment with FHIR R4 specifications

  • Improved workflow modeling capabilities

  • Cleaner separation between workflow relationships

  • Increased flexibility for future implementations and integrations

This proposal is similar in spirit to previous community discussions around extending the FHIR2 Task model for improved workflow support and FHIR compliance. I would appreciate feedback from the community. Thank you. @angshuonline @mohant @rahu1ramesh @arshiya_sehzad @akhilmalhotra @devsingh05298 @binduak

This proposal makes lots of sense to me. Thanks @vvkpd for moving it forward. :slight_smile:

1 Like

Great, thanks @dkayiwa

Please review FM2-682 JIRA card and the associated PR: https://github.com/openmrs/openmrs-module-fhir2/pull/607.

As our Bahmni implementation is currently on OpenMRS 2.5.12 with FHIR2 2.5.0, could you please consider backporting this change to the FHIR2 2.x release line? Cc: @ibacher