ЕСОЗ - публічна документація

RC_(GraphQL) Update Person manual rules verification status (DMS)

Purpose

This WS allows to set verification status for persons' records using Admin panel.

NHS verification statuses for coded rules:

Key points

  1. This graphQl method is used in Administration panel only

  2. Only authenticated and authorized NHS employee with appropriate scope can verify persons.

  3. If person was marked as NOT VERIFIED by NHS employee - there will be some limitations for such record. It is not possible to create new declaration and some medical events until appropriate changes conducted and documents provided.

  4. NHS employee is obliged to provide comment if he is setting NOT VERIFIED verification status.

Specification

"Updates manual rules verification status for a single `Person` by NHS using its globally unique ID." updatePersonManualRulesVerificationStatus( input: UpdatePersonManualRulesVerificationStatusInput! ): UpdatePersonManualRulesVerificationStatusPayload

 

""" Input for `updatePersonManualRulesVerificationStatus` mutation. """ input UpdatePersonManualRulesVerificationStatusInput { "Person unique identifier." personId: ID! "Person verification status according to manual rules" manualRulesVerificationStatus: PersonVerificationStatus! "Description about person verification status" verificationComment: String } """ Return type for `updatePersonManualRulesVerificationStatus` mutation. In order to verify person user must have a scope `person:verify`. """ type UpdatePersonManualRulesVerificationStatusPayload { "Payload for person." person: Person }

 

Authorization

  • Verify the validity of access token

    • in case of error - return 401 (“Invalid access token”) in case of validation fails

  • Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”)

  • Check user scopes in order to perform this action (scope = 'person:verify')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: person:verify”) in case of invalid scope(s)

Validate legal entity

  • Extract client_id from token.

  • Check client scopes in order to perform this action (scope = 'person:verify')

    • in case of error - return 403 (“Your scope does not allow to access this resource. Missing allowances: person:verify”)

  • Check legal entity status (status = ACTIVE)

    • In case of error - return 409 ('client_id refers to legal entity that is not active')

Validate request

Field personId, required. Check if it is present.

  • in case of error, return "Argument "input" has invalid value $input. In field "personId": Expected type "ID!", found null."

Check $.personId is ID from MPI.person.id

  • validate $.personId is UUID and UUID is version 4

    • in case of error, return 422

  • search person $.personId in MPI.person.(id = $.personId) and MPI.person.(id = $.personId).is_active = true then ok

    • in case of error, return 404, "Such person doesn't exist"

  • validate that person is active MPI.person.(id = $.personId).status = ‘active’

    • in case of error, return 409, "Such person isn't active"

Field verificationStatus, required

Field verificationComment , required at specific case

  • if verification_status = NOT_VERIFIED

    • in case of error - return 409 ('verification status comment is required')

Service logic

  1. Set fields person_verifications table (mpi database):

    1. nhs_verification_status = $.verification_status

    2. nhs_verification_comment = $.verification_comment

    3. nhs_verification_reason = MANUAL

    4. updated_by = user_id (from token)

    5. updated_at = current timestamp

  2. Calculate cumulative verification status based on persons verification status in each stream:
    Manual NHS verification, DRFO registry verification, DRACS death acts registry verification according to logic described at Person verification status model_EN | Cumulative verification status :

    • Set calculated status to persons.verification_status field

    • Create StatusChangeEvent in event manager with new verification status if it was changed

  3. Create StatusChangeEvent in event manager with verification_status

ЕСОЗ - публічна документація