Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel7

...

Link

https://app.swaggerhub.com/apis/ehealthua/compositions/2.32.2#/main/createComposition

Resource

/patients/composition

Scope

composition:create

Components

Compositions

Using Dictionaries

API paragraph not found

Using Microservices

API paragraph not found

Protocol type

REST

Request type

POST

Sync/Async

Async

Public/Private/Internal

Public

...

API paragraph not found

Validation data request

  1. prechecks - Initial checks of request input data

    1. If “relatesTo” isn’t null:

      1. For Newborn Composition:

        1. Validate that replacement is enabled

          1. In case of error (replacement isn’t enabled) - return 1181 (REPLACEMENT_FLOW_NOT_IMPLEMENTED_YET)

      2. For Temporary Disability Composition:

        1. If Composition.subject=person in current composition, Composition.subject = preperson ( in indicated composition in relatesTo.target.identifier ) and composition.status is FINAL, then the Refinement process is initiated

        2. If Composition.status in indicated composition in relatesTo.target.identifier is ENTERED_IN_ERROR and replacement is enabled, then the Raplacement process is initiated

          1. In case of error (replacement isn’t enabled) - return 1181 (REPLACEMENT_FLOW_NOT_IMPLEMENTED_YET)

        3. in other cases - return 1160 (INVALID_REPLACEMENT_ARGUMENT)

    2. For Newborn Composition:

      1. Checking for an already created Composition for preperson (“subject” attribute) which are according such requirements: Composition.type is Newborn and Composition.status isn’t ENTERED_IN_ERROR:

        1. In case of existing appropriate Compositions - return 1002 (COMPOSITION_ALREADY_EXISTS_FOR_SUBJECT)

      2. If in item a. was initiated Replacement flow:

        1. Checking the Composition.type in current Composition and Composition.type indicated in relatesTo.target.identifier

          1. In case of difference - return 1146 (CANT_REPLACE_DIFFERENT_TYPE)

        2. Check if the indicated Composition is last in the chain:

          1. In case of error (indicated Composition isn’t last in the chain) - return 1153 (CANT_AMEND_IS_APPENDED)

        3. Check if the indicated Composition has ENTERED_IN_ERROR status:

          1. In case of error (indicated Composition hasn’t ENTERED_IN_ERROR status) - return 1148 (CANT_REPLACE_IS_APPENDED)

        4. Check if the indicated Composition was canceled with Replacement’s reason

          1. In case of right Replacement’s reason - check validity period of Composition according to the configuration parameter EMAL_FILTER_REPLACEMENT_CANCEL_TIMEOUT_NEWBORN. In case of error - return 1039 (INVALID_PERIOD)

          2. In case of common cancelation reason - check validity period of Composition according to the configuration parameter EMAL_FILTER_PERIOD_START_NEWBORN. In case of error - return 1039 (INVALID_PERIOD)

    3. For Temporary Disability Composition:

      1. If in item a. was initiated Replacement flow:

        1. Checking the Composition.type in current Composition and Composition.type indicated in relatesTo.target.identifier

          1. In case of difference - return 1146 (CANT_REPLACE_DIFFERENT_TYPE)

        2. Check if the indicated Composition is last in the chain:

          1. In case of error (indicated Composition isn’t last in the chain) - return 1153 (CANT_AMEND_IS_APPENDED)

        3. Check if the indicated Composition has ENTERED_IN_ERROR status:

          1. In case of error (indicated Composition hasn’t ENTERED_IN_ERROR status) - return 1148 (CANT_REPLACE_IS_APPENDED)

        4. Check if the indicated Composition was canceled with Replacement’s reason

          1. In case of right Replacement’s reason - check validity period of Composition according to the configuration parameter EMAL_FILTER_REPLACEMENT_CANCEL_TIMEOUT_DISABILITY. In case of error - return 1039 (INVALID_PERIOD)

          2. In case of common cancelation reason - check validity period of Composition according to the configuration parameter EMAL_FILTER_PERIOD_START_DISABILITY. In case of error - return 1039 (INVALID_PERIOD)

      2. f in item a. wasn’t initiated Replacement flow:

        1. In case of IS_FORCE_RENEW=true - the function completes it's execution and does not perform further checks

        2. Check of maximum length of one link of a medical opinion (disabilitySingleSpanFilter)

          1. In case of error - return 1039 (INVALID_PERIOD), 1031 (DURATION_SINGLE_PERIOD_TOO_LONG)

        3. Check for event.period.start attribute (periodStartFilter)

          1. In case of error - return 1039 (INVALID_PERIOD), 1040 (PERIOD_TOLERANCE_EXCEEDED)

        4. Search for previous compositions with the same type and category as in the request, overlapping with the period of validity for this composition for at least 1 day

          1. If previous compositions wasn’t found - the function completes it's execution

          2. If previous compositions was found - check validity period of compositions

            1. In case of error - return 1143 (NEW_START_DATE_IS_BEFORE_PREVIOUS_START_DATE), 1103(SAME_END_DATE_FOR_NEW_AND_EXISTING_COMPOSITION)

        5. Check for the maximum total length of the validity period (disabilityTotalSpanFilter)

          1. In case of error - return 1039 (INVALID_PERIOD), 1032 (DURATION_TOTAL_PERIOD_TOO_LONG)

  2. Encounter Processing - Receiving and processing medical records (Encounter)

  3. Employee Processing - Receiving and processing Employee record (Composition.author)

  4. Division Processing - Receiving and processing Devision record (Employee Devision)

  5. Legal Entity Processing - Receiving and processing Legal Entity record (Employee Legal Entity)

  6. Subject Processing - Receiving and processing Subject record

  7. Focus Processing - Receiving and processing Focus record

  8. getSmsPhoneNumber - Receiving phone number for sending SMS about creation of composition

  9. Saving the record of the Сomposition into database

  10. Task status updating in DONE

...