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

RC_Create full medication registry (EPRX-921)

Create full medication registry source link

 

Service logic

  1. Validate input according to schema

  2. Create job with type create_medication_registry

  3. For each line of input file create separate task of job

  4. Each task must validate existing and create new entities of medications registry:

    1. Extract and search connected program medication by:
      In case registry_number = NULL then search by medication_id (with type = BRAND) and program_medications.medical_program_id and program_medication.registry_number IS NULL;
      In case registry_number has id then search by medication_id (with type = BRAND) and program_medications.medical_program_id and program_medication.registry_number;

      1. in case more than one program medication with such params is found - return FAILED task status with error ('More than one PROGRAM_MEDICATION with such fields exist in program_medications table')

      2. in case program medication is not found - insert program medication with brand according to Create full medication registry | program_medication

      3. in case program medication is found - return FAILED task status with error ('Such medication already exist')

  5. Return job identifier with result.

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