Table of Contents

Specification

...

  1. Only authenticated and authorized user can use this service
  2. Only NEW APPROVED patient request can be activatedsigned
  3. The request can be activated signed only by the employee who works in the same legal entity in which the request was made.

...

Decode content that is encrypted in an electronic digital signature.
Use Digital signature WS. Method checks digital signature and returns result.
See service specification

Validate DRFO

  1. Check that DRFO in Certificate details exists and not empty
  2. Check that DRFO in Certificate details is equal to DRFO in Party
    1. Get party.tax_id using employee_id in person payload
    2. Compare DRFO in Certificate with party.tax_id
      1. Convert DRFO and TAX_ID to uppercase
      2. Compare DRFO and TAX_ID as Cyrillic letters
      3. Convert DRFO to Cyrillic and compare as Cyrillic letters
    3. In case validation fails - generate 422 error

...

Patient request can be signed by any employee with necessary scopes in equal legal_entity_id.

  1. Check that ID in URL exists in the system
    1. Return 401 in case validation fails
  2. Check that patient request belongs to the same legal entity as the user
    1. In case of error - return 403

Create/update person

If person.id is in request then add mpi_id to patient request. Update MPI.persons with new parameters.

If person.id is not in request then create new person in status ACTIVE or APPROVED)

Update patient request

Update patient request:

  1. Change entity status in IL_DB.patient_request to SIGNED
  2. Set updated_at - now() (Get current date-time)

  3. Set updated_by - user_id (Extract user from token)

Create person

After singed patient request create new person on DB.mpi.

Add person to Connection_confidant

If person request has information of confidant person - add row to table Connection_confidant in db.mpi after signed patient request

Name
Type
M/O
iduuidM
person_iduuidM

confidant_person_id

uuidM
is_activebooleanM
inserted_attimestampM
inserted_byuuidM
updated_attimestampM
updated_byuuidM