...
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 complete 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 complete activity with active Medication requests).
if activity activity kind = service_request:
Check there is no no service requests in in status
active
,in_progress
based =active
AND program_processing_status !=completed
based on the activity:in case of error - return 409 (Unable to complete activity with <active/in_progress> Service requests in status <status value> and program processing status not completed or undefined).
Validate outcome
Validate value in the field $.outcome_codeable_concept, required
...