Table of Contents | ||||
---|---|---|---|---|
|
...
Link | https://app.swaggerhub.com/apis/ehealthua/compositions/2.32.2#/main/signComposition |
Resource | /patients/composition/{compositionId}/sign |
Scope | composition:sign |
Components | |
Using Dictionaries | eHealth/resources |
Using Microservices | API paragraph not found |
Protocol type | REST |
Request type | PATCH |
Sync/Async | Async |
Public/Private/Internal | Public |
...
Content-Type: application/json
Authorization: Bearer {token}
api-key: {secret}
Validation data request
...
Checking the existence of other Composition tasks for signing
Search in task_queue other tasks with SIGN_COMPOSITION type and status isn’t FAILED
In case of error (such task is found) - return 1142 (ANOTHER_SIGN_TASK_ALREADY_EXIST)
Checking the signing delay
If signing time does not match with value in EMAL_FILTER_SIGN_CREATE_DELAY_DISABILITY, EMAL_FILTER_SIGN_CREATE_DELAY_NEWBORN - return 1124 (CREATE_SIGN_DELAY_EXCEEDED)
Verification of signature overlay
The body of the signature in the request transfers to the DS service by RPC method “decode_signed_content”
If service:
Returned a null field “content” - return error 1019 (SIGVER_FAILED_NO_PAYLOAD) with explanation "content is null or blank"
Did not return a response (or returned a response of an inappropriate structure) - return error 1099 (SIGVER_FAILED_BAD_CONTENT)
Returned any value in the "validation_error_message" field - return error 1020 (SIGVER_FAILED_BAD_CERT)
Did not return any signature - return error 1021 (SIGVER_FAILED_NO_SIGNATURES)
Returned several signatures - return error 1022 (SIGVER_FAILED_MULTIPLE_SIGNATURES)
For every signatures that were overlayed
Check the value of the "is_valid field" in the RPC service response
If there is at least one invalid signature - return 1023 (SIGVER_FAILED_INVALID_SIGNATURE)
Validation of signed content
Checks the status of the signing object
If the status is not equal to PRELIMINARY - return error 1041 (
CANT_SIGN_NON_PRELIMINARY_COMPOSITION
)
Checks the content in the signed object and compares it to the Composition object
If the content does not match - return 1042 (
SIGNING_CONTENT_MISMATCH
)
Signer Check. The application receives information about the signer from the certificate of qualified electronic signature from the service (the value of the field corresponding to the RNOCPP from the certificate)
Processing
Checking the existence of other Composition tasks for signing. Logic - to check if there are other tasks in the system for the same Composition waiting for signature verification. Such a procedure is necessary to prevent several parallel requests for signing the same Composition.
Checking the signing delay: Check that allowed delay time between the creation of the draft and the direct signing of the Composition match with current configuration.
Overlay CheckVerification of signature overlay: Checks that the signature is overlaid correctly and the signature is valid
Validation of signed content: checks that the signature was applied to the corresponding Composition’s object record without any modifications after creating the draft
Signer Check: Checks the data in the signature certificate against the author data according to Composition.author and Employee data
Checking the related Composition: Check that specified in relatesTo Composition exists and has an appropriate status
Status update: Changes the Composition status in the database and related Composition’s status (in case of refinement Temporary Disability Composition)
Saving Composition: Saves the data of the signed Composition in the object drive (ceph)
For Temporary Disability Composition (for tasks that were successfully completed at this stage): Planning CREATE ERLN RECORD task (in PENDING status)
...
HTTP status code | Message | What caused the error |
---|---|---|
200 | In the case of successful creation of the task of signing the Composition |
|
400 | Invalid request format | |
401 | Unauthorized | In case of invalid scope(s) |
500 | Subordinate service error | Service error |