ЕСОЗ - публічна документація
RC_(CSI-2483,CR-441)_signComposition
Existing method: https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/16992665601
Implemented changes:
…
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)
Encounter.value uniqueness check. Check that such Encounter.value not used in another Composition with the same type, category and in "Final" status
If it used - return 1127 (FINAL_COMPOSITION_FOR_ENCOUNTER_ALREADY_EXISTS)
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(individual tax number) from the certificate)
Сompliance check RNOCPP (individual tax number) with data specified in the employee profile (Composition.author)
If employee.party.no_tax_id == true then it is verified that the value of DRFO corresponds to at least one of the documents for employee.party. The rules of transliteration of letters are applied for comparing
If a match isn't found - return 1024 (SIGVER_FAILED_DOCUMENTS_DONT_MATCH)
In all other options - check that the employee.party.tax_id value is equal to the DRFO field in the signer's certificate
if the fields are not equal - return 1025 (SIGVER_FAILED_DRFO_DOESNT_MATCH)
Checking the related Composition:
If Composition’s status in target.identifier is “Amended” - return 1184 (CANT_SIGN_INVALID_RELATED_STATUS)
If RelatesTo.code is “appends” or “transforms” and Composition’s status in target.identifier isn’t “Final” - return 1184 (CANT_SIGN_INVALID_RELATED_STATUS)
If RelatesTo.code is “replaces” - check for status change: FINAL-> AMENDED, ENTERED_IN_ERROR -> ENTERED_IN_ERROR
In case of error - return 1184 (CANT_SIGN_INVALID_RELATED_STATUS)
Checking authentication method in authorize_with extension (if exists):
If
extension.authorize_with
of composition exists and contains authentication method with type = THIRD_PERSON - validate that person from value is an approved confidant for a person from composition – exists active and approved confidant person relationship between person from composition and person_id from authentication method value (using following logic: https://e-health-ua.atlassian.net/wiki/spaces/CSI/pages/17667883028 withperson_id
= person from composition (section.focus.value
) andconfidant_person_id
= value from auth method - expected:ok, :approved
response)In case of error - return 1233 INVALID_AUTH_METHOD (Auth method is not active or confidant person relationship is invalid)
ЕСОЗ - публічна документація