Table of Contents | ||||
---|---|---|---|---|
|
...
Link | https://app.swaggerhub.com/apis/ehealthua/compositions/2.32.2#/main/cancelComposition |
Resource | /patients/composition/{compositionId}/cancel |
Scope | composition:cancel |
Components | |
Using Microservices | API paragraph not found |
Protocol type | REST |
Request type | PATCH |
Sync/Async | Async |
Public/Private/Internal | Public |
...
At the beginning of the task, an incoming request is received, which is content signed with a qualified electronic signature of the doctor.
Rechecking is similar progress to what has already been implemented in the SIGN_COMPOSITION task (list item 3).
Searching for a Composition object in FINAL status for which cancellation is being attempted
if the conclusion is not found — the task completes its execution with code (1000)
if found, the procedure continues execution
Checking the content of the request (CancelContentFilter)
if in the body of the request the identifier of the MCTD is different from the identifier in the API request - the task completes its execution with the code INVALID_IDENTIFIER_IN_PAYLOAD(1026)
if the status of the MC for which the request is made is not FINAL, the task completes its execution with the code CANT_CANCEL_NONFINAL_COMPOSITION (1003)
for the MCTD (except for the MC for an undefined preperson) additional checks is performed:
If the ERLN status of the request is not available (the ERLN request has not been sent) - the task ends its execution with the code CANCELLATION_NOT_ALLOWED_ERLN_CALL_PENDING (1130)
If the ERLN status of the response is not available (the ERLN request was sent, but the answer has not yet received) - the task ends its execution with the code CANCELLATION_NOT_ALLOWED_ERLN_CALL_IN_PROGRESS(1131)
in other cases the procedure continues execution.
If no cancellation explanation text is provided, the task terminates with CANCELLATION_TEXT_NOT_PROVIDED.
If the element of the cancellation object coding system is not provided - the task ends its execution with the code CANCELLATION_NO_CODING (1028)
If several (>1) elements of the cancellation object coding system are provided - the task ends its execution with the code CANCELLATION_MULTIPLE_CODINGS (1029)If a cancellation code is provided that does not match the allowed cancellation reasons, namely INCORRECT_PATIENT or TYPO, the task terminates with CANCELLATION_INVALID_CODING (1004)
Checking reason.code for an entry in one of the dictionaries:
COMPOSITION_CANCELLATION_REASONS_NEWBORN
COMPOSITION_CANCELLATION_REASONS_TEMP_DISABILITY
(depending on the type of MC)
If the check is not passed, the error 1004 Invalid cancellation coding (Invalid cancellation reason coding) occurs.We also check that reason.system == eHealth/composition_cancellation_reasons
If the check is not passed, the error 1004 Invalid cancellation coding (Invalid cancellation reason coding) occurs.
The verification of the owner of the QES to compliance with the author of the MC is carried out, completely similar to SIGN_COMPOSITION task (list item 5).
For MCN, the status of integration with DRACS is being checked.
If the request from DRACS to check the MC has already received (getComposition), then the task ends its execution with the code CANCELLATION_FOR_RUNNING_TASK (1006)
in other cases, the procedure continues its execution
The allowed delay is checked — the delay between the opening time of the MC (composition.date) and the current date.
If EMAL_COMPOSITION_FLOW_REPLACE_ENABLED=false, then ignored value of EMAL_REPLACEMENT_FLOW_DISABILITY_ALLOWED_CANCELLATION_REASONS and EMAL_REPLACEMENT_FLOW_NEWBORN_ALLOWED_CANCELLATION_REASONS and the allowable delay
of cancellation is checked by configurations EMAL_FILTER_CANCEL_TIMEOUT_DISABILITY and EMAL_FILTER_CANCEL_TIMEOUT_NEWBORN. If the configuration parameter values fail to pass the check, then error 1005 occurs.
If EMAL_COMPOSITION_FLOW_REPLACE_ENABLED=true, then validate the reasons for cancellation by EMAL_REPLACEMENT_FLOW_DISABILITY_ALLOWED_CANCELLATION_REASONS and EMAL_REPLACEMENT_FLOW_NEWBORN_ALLOWED_CANCELLATION_REASONS. If reason.code is in list EMAL_REPLACEMENT_FLOW_DISABILITY_ALLOWED_CANCELLATION_REASONS and EMAL_REPLACEMENT_FLOW_NEWBORN_ALLOWED_CANCELLATION_REASONS, then filter cancel-timeout does not start, new configuration parameters are started instead: EMAL_FILTER_REPLACEMENT_CANCEL_TIMEOUT_DISABILITY and EMAL_FILTER_REPLACEMENT_CANCEL_TIMEOUT_NEWBORN.
In the case of failure to pass the filter check, error "1005 Can't cancel composition: too old" occurs (Cancellation of the conclusion is not allowed - the time allowed for cancellation has expired).
The configuration of the replacement-cancel-timeout filter is the same as for cancel-timeout:
EMAL_FILTER_REPLACEMENT_CANCEL_TIMEOUT_NEWBORN
EMAL_FILTER_REPLACEMENT_CANCEL_TIMEOUT_DISABILITY
Processing
After all validations:
...