Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page Properties
idpage_properties_method_REST API

Document type

Метод REST API

Document title

[DRAFT] PIS. Initialize Person documents upload [API-010-001-018-0474]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD)

Date of update

ХХ.ХХ.ХХХХ (дата зміни версії)

Method API ID

API-010-001-018-0474

Microservices (namespace)

MPI

Component

Master Patient Index

Component ID

COM-010-001

Link на API-специфікацію

https://pisapi1.docs.apiary.io/#reference/public.-patient-information-system/approvals/initialize-person-documents-upload

Resource

{{host}}/api/pis/documents/actions/complete

Scope

person_documents:write_pis

Protocol type

REST

Request type

PATCHPOST

Sync/Async

Sync

Public/Private

Public

Purpose

This WS is designed to complete initialize person documents uploading proccess through person information system (PIS).

...

  1. This method is used only by PIS.

  2. This method checks returns list of documents that needs to be uploaded for person and urls. In case all person no documents were must be uploaded - persons nhs verification status is updatedempty list is returned.

  3. Person is obtained from user that performs method.

Logic

Service logic

  1. GService logic

    1. Get list of person documents that must be uploaded to media content storage (for each type of documents, if couple of rules worked - only one file is expected):

      1. Call /wiki/spaces/PCAB/pages/17415995422 , send person_id = person.id and confidant_person_id = applicant_person_id (from token)
        in case if method returns “ok”:

        1. Check for documents with name confidant_person.{confidant_person_id}.documents_relationship.[:].{type}

      2. If one of persons document has type = ‘BIRTH_CERTIFICATE_FOREIGN’ and there is no same document in {person.confidant_person.[:].documents_relationship.[:]}

        and persons age < no_self_auth_age global parameter value then

        1. Check for document with name person.BIRTH_CERTIFICATE_FOREIGN

      3. If one of persons document has type = ‘PERMANENT_RESIDENCE_PERMIT’ and persons age >= no_self_auth_age global parameter value then

        1. Check for document with name person.PERMANENT_RESIDENCE_PERMIT

      4. If persons authentication method = ‘OFFLINE’ or ‘THIRD_PERSON’ authentication method = ‘OFFLINE’

        1. Check for documents with name person.{documents.[:].type} or third_person.{third_person.documents.[:].type}

      5. If person.unzr field is not empty and first 8 digits of unzr != persons birth_date

        1. Check for document with name person.unzr

      6. If persons age is greater then no_self_registration_age global parameter, but less then person_full_legal_capacity_age global parameter
        and one of persons documents has type from PIS_PERSON_LEGAL_CAPACITY_DOCUMENT_TYPESconfig parameter then

        1. Get type of document that has been found
          AND check for documents with name person.{type}

    2. Check existence of each document in existing media content storages for person:

      1. persons

      2. person_requests

      3. authentication_method_requests

    3. Generate signed urls for each document that must be uploaded but does not exist in persons media content storage.

    If all expected person documents exist in persons media content storage and persons nhs_verification_status = ‘NOT_VERIFIED’ and nhs_verification_reason = ‘DOCUMENTS_TRIGGERED’, update persons nhs verification status according to logic described https://e-health-ua.atlassian.net/wiki/spaces/DRACS/pages/17249206422
    1. Render a response according to specification.

Configuration parameters

N/A

...