/
Check confidant person relationship
Published Aug 29, 2023

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

Check confidant person relationship

Purpose

This algorithm is used to validate relationship between Confidant Person and Patient based on confidant_person_relationships (MPI DB table).

Key points

  1. This algorithm uses dataset data to check if relationship between two patients from mpi database is exists confidant_person_relationships table or not and what kind of verification status it has.

  2. This algorithm can be used in different processes and is not limited to specific process.

  3. At least one of ids must be set as input parameter

Specification

{ "confidant_person_id": "70a9e15b-b71b-4caf-8f2e-ff247e8a5677", "person_id": "70a9e15b-b71b-4caf-8f2e-ff247e8a5678" }

Service logic

  1. Get relationship between two persons from confidant_person_relationships table where:

    • person_id is equal to $.person_id

    • AND confidant_person_id is equal to $.confidant_person_id (if confidant_person_id exists in the dataset)

    • AND is_active=true

  2. Return result:

    • If record is found and has
      verification_status = “VERIFIED”
      OR
      verification_status = “VERIFICATION_NEEDED” AND verification_reason = “MANUAL_CREATED_BY_DOCTOR”
      return {:ok, {:approved, "Relationship is approved"}}

    • Else if record is found but has another status
      return {:ok, {:not_approved, "Relationship is not approved yet"}}

    • Else if record is not found
      return {:error, {:not_found, "Relationship is not found"}}

Related content

Create/Update person request
Create/Update person request
Read with this
RC_(CSI-1323)_Check confidant person relationship
RC_(CSI-1323)_Check confidant person relationship
More like this
Create/Update Legal Entity V2
Create/Update Legal Entity V2
Read with this
Confidant person relationship verification status model
Confidant person relationship verification status model
More like this
Вимоги до набору даних персони
Вимоги до набору даних персони
Read with this
RC_CSI-3205_Коди і обробка помилок в задачах Composition
RC_CSI-3205_Коди і обробка помилок в задачах Composition
Read with this

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