Versions Compared

Key

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

Table of Contents

Purpose

This service is made to count an amount of declaration doctor has already made. The amount will increase (decrease) with each declaration signed (terminated) on prm and recalculated and updated every night with real amount of doctor's declarations on ops.

...

  1. Limit is set with employee_request create/update
  2. add validation on declaration approve. Return error if doctor's counter >= limit
  3. Doctor should change declaration_limit via personal cabinet (TBD)

Specification

Data structure 

Employee request

Limit of declarations that could be signed by doctor is added to create employee request

Save declaration_limit to parties

...

Global_parameters

set declaration_limit in global_parameters.

default value = 2000

Approve employee request

On creating a Party set party.declaration_limit = prm.global_parameters.declaration_limit

Employees

Declaration limit and declaration count are added to get employees list and get employee details

...

Add overlimit to declaration request. Set overlimit on create declaration request

Report DB

Add fields to report DB

Add declaration_count and declaration_limit to reports.parties

count
ParameterFieldSource
reports.parties.declaration_count
reports.parties.declaration_declaration_limitreportsprm.parties.declaration_limit

...

Count declaration

...

  1. get employee_id from request
  2. get party for employee
  3. add +1 to declaration_count for party

Terminate declaration

...

on report DB

  1. if declaration is added to report.declaration - change report.parties.declaration_count. Set declaration_count=declaration_count+1
  2. if report.declaration.status is change to terminated or closed - change report.parties.declaration_count. Set declaration_count=declaration_count-1

Approve declaration request

Check doctor's limit

Count declarations for employees

Ones a day start the process.

Calculate amount of declarations and update prm.parties.declaration_count for each employee