...
if activity kind = medication_request:
Check there is no medication request requests in status
NEW
based on the activityin case of error - return 409 (Unable to cancel activity with new Medication Request requests).
Check there is no medication requests in status
ACTIVE
based on the activityin case of error - return 409 (Unable to cancel activity with active Medication requests).
if activity kind = service_request:
Check there is no availability of service requests in with status =
in case of error - returnactive
AND active.If such service requests exist, then needs to check availability of service requests with program_processing_status !=completed
based on the activity::
if program_processing_status is undefined (NULL), then return error 409 (Unable to cancel activity with Service requests in status <status value> and program processing status is NULL or not completed)
if program_processing_status is defined, then needs to check that program_processing_status = complete. Otherwise, return error 409 (Unable to
cancel activity with Service requests in status <status value> and program processing status is NULL or not completed
)
Validate content
Signed content must match with activity in DB in order to be changed
...