Table of Contents |
---|
Purpose
...
Page Properties | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Logic
Save new healthcare service in healthcare_services table (PRM DB) with data from request and additional fields:
id = autogenerated;
legal_entity_id = client_id from access token;
status = ACTIVE;
is_active = true;
inserted_at = now();
inserted_by = user_id from access token;
updated_at = now();
updated_by = user_id from access token;
...
Check that there is no another record with the same healthcare service, division_id, speciality type and providing condition
in case of error - return 409 (“division_id, speciality_type and providing_condition combination should be unique”)
Check that there is no another record with the same healthcare service, division_id, category and type
in case of error - return 409 (“division_id, category and type combination should be unique”)
Check that there is no another record with the same healthcare service, division_id and category = ‘PHARMACY’
in case of error - return 409 (“division_id and category = PHARMACY combination should be unique”)
Validate available time
If $.all_day = true, check that fields available_start_time and available_end_time does not exist in request
in case of error - return 422 (“Should not be present when all_day = true“)
If all_day = false, check that fields available_start_time and available_end_time exist in request
in case of error - return 422 (“Should be present when all_day = false“)
...