highmed / highmed-dsf

HiGHmed Data Sharing Framework funded by the German Federal Ministry of Education and Research (BMBF, grant ids: 01ZZ1802E and 01ZZ1802A)
Apache License 2.0
32 stars 20 forks source link

Implement ActivityDefinition Resources to Publish Executable Tasks / Processes #58

Closed hhund closed 4 years ago

hhund commented 5 years ago

http://hl7.org/fhir/activitydefinition.html#bnc

An ActivityDefinition is a shareable, consumable description of some activity to be performed. It may be used to specify actions to be taken as part of a workflow, order set, or protocol, or it may be used independently as part of a catalog of activities such as orderables.

...

http://hl7.org/fhir/activitydefinition.html#12.17.2

Note that this is conceptually similar to the Task resource as well, with the distinction being that ActivityDefinition represents the description of a task in the abstract, while the Task resource is used to track a specific instance of a task as it moves through the steps of a workflow.

We might want to use ActivityDefinition resources to publish executable tasks or rather processes. This could be used to establish a mechanism to activate or deactivate specific processes per site by allowing Task resource to only be written if the used profile is publish via a ActivityDefinition as an executable Task.

Unfortunately we might need to extend the ActivityDefinition resource in order to differentiate between processes that are allowed to be started by external Organizations or only by local users.

hhund commented 4 years ago

Proposed Field Mapings:

ActivityDefinition.url - URL of the process, already used in Task.instantiatesUri
ActivityDefinition.version - Version of the process, already used in Task.instantiatesUri
ActivityDefinition.name - Name of the process (computer friendly)
ActivityDefinition.title - Name of the process (human friendly)
ActivityDefinition.subtitle - Subtitle of the process (if needed)
ActivityDefinition.status - Status of the process, should be one of (draft , active, retired)
ActivityDefinition.experimental - Usually false, true if used for testing only (like the ping/pong process?)
ActivityDefinition.date - Date last changed
ActivityDefinition.publisher - "HiGHmed" for processes used within the consortium, might be the local organization or MII otherwise
ActivityDefinition.contact - Contact of publisher ActivityDefinition.description - Description of the process and its purpose ActivityDefinition.kind - fixed to Task ActivityDefinition.profile - The Task profile used to start this process

hhund commented 4 years ago

To configure if the process can be started by external organizations or only by local users, ActivityDefinition.jurisdiction kind of fits.

A legal or geographic region in which the activity definition is intended to be used.

But isn't used in this way typically. A boolean extension "localRequestOnly" might be a better fit.

Another solution would be to have a Organization reference extension "allowedRequestor". Since organizations are hierarchical and Practitioners (aka local users) are part of the local organization, we could allow all members of the medical informatics initiative (MII), only one consortium (e.g. HiGHmed) or only users associated to the local organization.

hhund commented 4 years ago

Started implementing this in branch processAuthorization_ActivityDefinition