Deactivate Team Member

https://www.hl7.org/fhir/STU3/operations.html

https://www.hl7.org/fhir/STU3/operationdefinition.html

Status

In development. API spec subject to change.

Overview

This operation allows:

  • a Team Coordinator to deactivate an existing member of staff in their team.

  • a System user to deactivate an existing member of staff in a specified team.

  • a System user to deactivate an existing member of staff in a specified organisation...recursive deactivate within all teams within that organisation.

Endpoints

Interaction

HTTP

URL

Supported Parameters

Permitted User Types

Description

operation

POST

/Organization/<id>/$deactivate-team-member

mandatory:

  • email-address

optional:

  • user-type



Reference 'in' mappings below.

  • Team Coordinator

  • System

Deactivates an existing user.



If <id> matches a [[Team]] then user is deactivated from that [[Team]] only.  The user will remain in their current state in any other [[Team]]'s.



If <id> matches an [[Organisation]] then user is deactivated from all [[Team]]'s in that [[Organisation]]. Only a system user can call the operation with an [[Organisation]].



If user-type is included then only deactivate a user matching that user-type.  If user-type is excluded then all user types that match the email-address are deactivated - team coordinator and/or professional.

Mappings

FHIR

PKB

Notes

OperationDefinition.url

"http://fhir.patientsknowbest.com/operation/deactivate-team-member"

 

OperationDefinition.name

"deactivate-team-member"

 

OperationDefinition.status

"active"

 

OperationDefinition.kind

"operation"

 

OperationDefinition.code

"deactivate-team-member"

 

OperationDefinition.resource

  • "Organization"

 

OperationDefinition.system

false

 

OperationDefinition.type

false

 

OperationDefinition.instance

true

 

OperationDefinition.parameter



  • parameter[x]: BackboneElement

    • name =  "email-address"

    • use =  "in"

    • min = " 1"

    • max =  "1"

    • type =  "string"

  • parameter[x]: BackboneElement

    • name =  "user-type"

    • use =  "in"

    • min = "0"

    • max =  "1"

    • type =  "string"

    • binding.valueSet =  " PKB PractitionerRole.code   codeset "

    • documentation = " " The code that will match the PracitionerRole.code "

  • parameter[x]: BackboneElement

    • name =  "message"

    • use =  "out"

    • min =  1

    • max =  "1"

    • type =  "string"

 

 

 

 

 

 

user-type options:

  • PKB_TEAM_PRO

  • PKB_TEAM_COORD

 

 

 


message - (static success message). "Invitation sent"

Examples

Deactivate team member from Team 'A'

As user-type is not specified in the example then the user is deactivated from all roles within Team A.

Request

/Organization/<Team A UUID>/$deactivate-team-member body: { "resourceType": "Parameters", "parameter": [{ "name": "deactivate-team-member", "email-address": "jock.jones@mydomain.com" }]

}

The response indicates that the team member has been deactivated.

Response

{ "resourceType": "Parameters", "parameter": [ { "message": "Deactivated from 1 team" } ] }

Deactivate the same team member from Team 'B'

As user-type is not specified in the example then the user is deactivated from all roles within Team B.

Request

/Organization/<Team B UUID>/$deactivate-team-member body: { "resourceType": "Parameters", "parameter": [{ "name": "deactivate-team-member", "email-address": "jock.jones@mydomain.com" }]

}

The response indicates that the team member has been deactivated.

Response

{ "resourceType": "Parameters", "parameter": [ { "message": "Deactivated from 1 team" } ] }

Deactivate a user from Org A (all teams that are partOf Org A). System User only.

As user-type is not specified in the example then the user is deactivated from all roles in all teams that are part of the org.

Request

/Organization/<Org A UUID>/$deactivate-team-member body: { "resourceType": "Parameters", "parameter": [{ "name": "deactivate-team-member", "email-address": "david.lawson@mydomain.com" }]}

The response indicates that the team member has been deactivated from multiple teams.

Response

{ "resourceType": "Parameters", "parameter": [ { "message": "Deactivated from 10 teams" } ] }