Versions Compared

Key

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

Table of Contents

Anchor
Declaration Request JSON Schema
Declaration Request JSON Schema
Validate request

...

Validate Response $.data.employee_type == DOCTOR

Check "no_tax_id" flag

If "no_tax_id"= true, tax_id field should be empty, in case error return 422

If "no_tax_id"=false, tax_id should be prsent, in case error return 422

Calculate patient age

Calculate patient age

...

  • ADULT_AGE
  • DECLARATION_TERM
  • MAX_PHONE_NUMBER
Code Block
languagesql
titlecURL example
curl -X GET \
  {:host}/prm/api/global_parameters

...

Insert record to IL.declaration_request in status 'NEW'

Search MPI

...

Check "no_tax_id" flag

If "no_tax_id"= true, tax_id field should be empty, in case error return 422

If "no_tax_id"=false, tax_id should be prsent, in case error return 422

Search MPI

Search patient in MPI using personal information

...

  • in case error (found 0 or more then one) set il.declaration_request.mpi_id=null

Validate phone number limit

  • in case person is found, and person_id will be saved to declaration_request we do not count phone numbers and do not compare the phone number with global_parameters.max_phone_number
  • In case person is not found
    • Check if (SELECT count(*) from persons where authentication_methods::json->0->>'phone_number'='$.phone_number' and persons.status='active' and is_active=true)<global_parameters.max_phone_number
      in case error return 422, msg "This phone number is present more then $.global_parameters.max_phone_number times in the system"

Validate declaration  limit

  1. Count all declarations in status active where OPS.declarations.employee_id==$.declaration_request.employee_id
    1.1 If there is an active declaration with the current person, exclude it from the selection in order to let doctor resign declaration with current patient
  2. Count all declaration_requests in status approved where IL.declaration_requests.data($.employee.id) ==$.declaration_request.employee_id
  3. Get all specialities of current doctor
    1. Select speciality from PRM.employees where PRM.employees.party_id == (select PRM.employees.party_id where PRM.employees.id=$.declaration_request.employee_id)
  4. Select config parameter for declarations_limit where speciality == select 3 
  5. Compare the result of selections 1+2 with the lowest config parameter from select 4. In case count (declarations+declaration_requests )> config_parameter, return 409 "The employee has reached the declaration limit"

...

Code Block
languagejs
themeMidnight
titleUpdate auth method
{
  "authentication_method": SearchMPIResponse.$.data.authentication_method.type,
  "authentication_number": SearchMPIResponse.$.data.authentication_method.number
}


Determine Channel

  1. сhannel channel from url
    1. if url is for cabinet сhannel set declaration_request.сhannel = CABINET
      1. if not - set declaration_request.сhannel = MIS

...