---
title: "Deactivate Team Member"
canonical: "https://wiki.patientsknowbest.com/space/api/3364618430/Deactivate%20Team%20Member"
format: markdown
---
[https://www.hl7.org/fhir/STU3/operations.html](https://www.hl7.org/fhir/STU3/operations.html)

[https://www.hl7.org/fhir/STU3/operationdefinition.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](https://www.hl7.org/fhir/STU3/operations.html) | POST | /Organization/<id>/$deactivate-team-member | mandatory:<br>- email-address<br>optional:<br>- user-type<br>Reference 'in' mappings below. | - Team Coordinator
- System | Deactivates an existing user.<br>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.<br>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]].<br>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](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"<br>- 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 "<br>- parameter[x]: BackboneElement
  - name =  "message"
  - use =  "out"
  - min =  1
  - max =  "1"
  - type =  "string" | user-type options:<br>- PKB_TEAM_PRO
- PKB_TEAM_COORD<br>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.

<u>Request</u>

/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.

<u>Response</u>

{ "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.

<u>Request</u>

/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.

<u>Response</u>

{ "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.

<u>Request</u>

/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.

<u>Response</u>

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