Table of Contents |
---|
...
This WS is designed to create new healthcare service for division of legal entity.
Key points
Only authenticated and authorized user with appropriate scope can create healthcare service.
Healthcare service can be created for PRIMARY_CARE, EMERGENCY, OUTPATIENT or PHARMACY legal entity.
Healthcare service can be created for legal entities in ACTIVE or SUSPENDED statuses.
It can be only one active healthcare service for the single healthcare service, division, category, speciality and providing condition.
It can be only one active healthcare service for the single healthcare service, division, category and type.
Specification
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;
Preconditions
API paragraph not found
...
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“)
...