ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 15 Next »

Purpose

This method allows to create Composition of all types and categories for a person/pre-person in eHealth.

Used in processes:

2.1. МВН - Створення нового

2.2. МВТН - Створення нового

Specification

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

Logic

Sequence:

MIS/Medical employee->Compositions: Create Composition POST/patients/composition
Compositions->Compositions: Check user scopes authorization composition:create
Compositions-->MIS/Medical employee: In case of error HTTP/401
Compositions->Compositions: Async job planning
Compositions->MIS/Medical employee: Async job details
Compositions<->eHealth:data clarification and verification about author, custodsan, diagnosis etc
Compositions->Compositions:Create and save Composition according to the XML template
Compositions->Compositions:Async job Completed
MIS/Medical employee->Compositions: GET/patients/composition/job/{asyncJobId}
Compositions->MIS/Medical employee:Async job completed (conclusionAsyncJobListItem.href)
MIS/Medical employee->Compositions:GET/patients/{patientId}/composition/{compositionId}/episode/{episodeId}/encounter/{encounterId}
Compositions->MIS/Medical employee: Composition in PRELIMINARY status
MIS/Medical employee->MIS/Medical employee:Signs document and gives to patient
MIS/Medical employee->Compositions:Sign Composition PATCH /patients/composition/{compositionId}/sign
Compositions->Compositions:Check user scopes authorization composition:sign
Compositions-->MIS/Medical employee: In case of error HTTP/401
Compositions->MIS/Medical employee: HTTP/200 Async job Created
Compositions<->eHealth:Signature and author validation
Compositions->Compositions:Save object on SWIFT/S3
Compositions->Compositions:Schedule of trigger interactions (DIIA,MJU_DRACZ,ERLN,MPI,Closure)
MIS/Medical employee->Compositions:GET /patients/composition/job/{asyncJobId}
Compositions->MIS/Medical employee:Async job completed (conclusionAsyncJobListItem.href)
MIS/Medical employee->Compositions:GET/patients/{patientId}/composition/{compositionId}/episode/{episodeId}/encounter/{encounterId}
Compositions->MIS/Medical employee:Composition in FINAL status

Request structure

See on SwaggerHub

Example

 Request example
{
  "category": {
    "coding": [
      {
        "system": "COMPOSITION_CATEGORIES",
        "code": "SICKNESS"
      }
    ]
  },
  "type": {
    "coding": [
      {
        "system": "COMPOSITION_TYPES",
        "code": "TEMP_DISABILITY"
      }
    ]
  },
  "event": [
    {
      "code": {
        "coding": [
          {
            "system": "COMPOSITION_EVENTS",
            "code": "COMPOSITION_VALIDITY_PERIOD"
          }
        ]
      },
      "period": {
        "start": "2022-10-24T10:45:16Z",
        "end": "2022-10-28T10:45:16Z"
      }
    }
  ],
  "subject": {
    "type": {
      "coding": [
        {
          "system": "eHealth/resources",
          "code": "person"
        }
      ],
      "text": "string"
    },
    "value": "52b504c7-0177-4078-834b-52d89154081c"
  },
  "encounter": {
    "type": {
      "coding": [
        {
          "system": "eHealth/resources",
          "code": "encounter"
        }
      ],
      "text": "string"
    },
    "value": "e39ee5ae-2644-4f04-8e64-bb359866e907"
  },
  "author": {
    "type": {
      "coding": [
        {
          "system": "eHealth/resources",
          "code": "employee"
        }
      ],
      "text": "string"
    },
    "value": "43cc2161-1c2b-481b-a618-77e35817f850"
  },
  "section": {
    "focus": {
      "type": {
        "coding": [
          {
            "system": "eHealth/resources",
            "code": "person"
          }
        ],
        "text": "string"
      },
      "value": "52b504c7-0177-4078-834b-52d89154081c"
    }
  },
  "extension": [
    {
      "valueCode": "AUTHORIZE_WITH",
      "valueUuid": "e7ff2eef-712f-4676-960d-6aa16dce2103"
    },
    {
      "valueCode": "IS_ACCIDENT",
      "valueBoolean": true
    },
    {
      "valueCode": "TREATMENT_VIOLATION",
      "valueString": "reject_recommendation"
    },
    {
      "valueCode": "TREATMENT_VIOLATION_DATE",
      "valueDate": "2022-10-24"
    },
    {
      "valueCode": "IS_INTOXICATED",
      "valueBoolean": true
    },
    {
      "valueCode": "IS_FOREIGN_TREATMENT",
      "valueBoolean": true
    },
    {
      "valueCode": "IS_FORCE_RENEW",
      "valueBoolean": true
    }
  ]
}

Authorize

Check user scopes in order to perform this action (scope = 'composition:create')

  • return 401 (Unauthorized) in case of invalid scope(s)

Headers

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:

  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

Processing

  1. prechecks - Initial checks of request input data

  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

Response structure

See on SwaggerHub

Example:

 Response example
{
  "data": {
    "eta": "2022-10-24T12:35:49.956Z",
    "id": "89678f60-4cdc-4fe3-ae83-e8b3ebd35c59",
    "links": [
      {
        "entity": "eHealth/resources"
      }
    ],
    "status": "PENDING"
  }
}

Post-processing processes

None

HTTP status codes

HTTP status code

Message

What caused the error

200

In case of successful creation of the task for creation Composition creation

 

400

Invalid request format

 Validation failed

  • No labels