Overview
This web service is designed to dismiss episode in case it was entered in error
Specification
Validation
Validate token
- Verify the validity of access token
- Return 401 in case validation fails
- Verify token is not expired
- in case of error return 401
Validate scopes
- Check user scopes in order to perform this action (scope = 'episode:write')
- Return 403 in case invalid scope(s)
Validate declaration
In order to perform this action, primary doctor must have active declaration with the patient
- Validate declaration using Method
- in case of error 403
Validate request
- Validate all encounters in patient.episode.encouners (MedicalEvents DB) array are in status `entered_in_error`
- in case of error - "Episode can not be dismissed while it has not dismissed encounters"
Request processing
- Change episode.status to "entered_in_error"