...
Validate digital sign as described on sign patient request process
Check signed content
Check decoded signed content with previously created on IL.db.
|
In case if they are not equal - generate 422 error (message: "Signed content does not match the previously created content")
Validate schema
Validate request using schema (TBD)
...
Validate merge request id exists in DB
In case of error - return 404
Check merge request status is APPROVED
In case of error - return 422 (Incorrect status to sign merge request)
Check signed content
Get previously request data from il.merge_requests.data.
Compare it with request data_ to_be_signed field.
In case they are not equal - return 422 error (Signed content does not match the previously created content)
Check patient_signed = true. It means that person signed printout content.
In case of error - return 422 error (Patient must sign merge request form).
...