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/bugzi11a/emal/1.0.8#/main/createComposition

Resource

/patients/composition

Scope

composition:create

Components

Compositions

Global and configure parameters

?

Using Dictionaries

<Потрібно вказати словники, які використовує метод API>API paragraph not found

Using Microservices

<Вкажіть перелік мікросервісів, які використовує метод API. Наприклад: Auth, ABAC>API paragraph not found

Protocol type

JSON

Request type

POST

Sync/Async

Async

Logic

...

Preconditions

...

None

Global and configuration parameters

None

Input parameters

...

None

Filters

None

Request structure

See on Apiary

Example

Expand
titleJSON schemaRequest example
Code Block
compositionRequest{
  description"category":	Запит на{
створення висновку  category*	codeableConceptCompositionCategory{ "coding*	[codeableConceptCompositionCategoryCoding{
system*	string
example: ": [
      {
        "system": "eHealth/composition_categories
code*	{",
      oneOf ->	
compositionTempDisabilityCategoryEnumstring
Категорія медичного висновку тимчасової непрацездатності

Enum:
[ SICKNESS, CHILD_CARE, FAMILY_CARE, PARENTAL_CARE, QUARANTINE, COVID19, TEMP_TRANSFER, PROSTHETIC, RESTORATION ]
compositionNewbornCategoryEnumstring
Категорія медичного висновку про народження

Enum:
[ LIVE_BIRTH ]
}
example: LIVE_BIRTH
 
}]
 
}
type*	codeableConceptCompositionType{
coding*	[codeableConceptCompositionTypeCoding{
system*	string
example: eHealth/composition_types
code*	compositionTypeEnumstring
Тип медичного висновку

Enum:
[ NEWBORN, TEMP_DISABILITY ]
 
}]
 
}
event	[compositionEvent{
description:	
https://www.hl7.org/fhir/composition-definitions.html#Composition.event

code	codeableConceptCompositionEvent{
coding*	[...]
 
}
period*	compositionEventPeriod{
description:	
https://www.hl7.org/fhir/datatypes.html#Period

start*	string($datetime)
example:  "code": "LIVE_BIRTH"
      }
    ]
  },
  "type": {
    "coding": [
      {
        "system": "eHealth/composition_types",
        "code": "NEWBORN"
      }
    ]
  },
  "event": [
    {
      "code": {
        "coding": [
          {
            "system": "eHealth/composition_events",
            "code": "COMPOSITION_VALIDITY_PERIOD"
          }
        ]
      },
      "period": {
        "start": "2020-06-26T15:22:53.403Z",
        end	string($datetime)
example"end": "2020-07-26T15:22:53.403Z"
      }
    }
  ],
subject*	resourceIdentifier{
description:	
http://hl7.org/fhir/STU3/datatypes.html#Identifier

type*	codeableConcept{
coding*	[codeableConceptCoding{
system*	string
example: eHealth/composition
code*	string
 
}]
text	string
Описова частина

 
}
value*	string($uuid)
example:   "subject": {
    "type": {
      "coding": [
        {
          "system": "eHealth/composition",
          "code": "string"
        }
      ],
      "text": "string"
    },
    "value": "e49abc30-6d17-11ea-b83c-673680173afa"
  },
  encounter*	resourceIdentifier{
description:	
http://hl7.org/fhir/STU3/datatypes.html#Identifier

type*	codeableConcept{
coding*	[codeableConceptCoding{
system*	string
example: eHealth/composition
code*	string
 
}]
text	string
Описова частина

 
}
value*	string($uuid)
example: "encounter": {
    "type": {
      "coding": [
        {
          "system": "eHealth/composition",
          "code": "string"
        }
      ],
      "text": "string"
    },
    "value": "e49abc30-6d17-11ea-b83c-673680173afa"
  },
 author*	resourceIdentifier "author": {
description:	
http://hl7.org/fhir/STU3/datatypes.html#Identifier    type*	codeableConcept{
coding*	[codeableConceptCoding{
system*	string
example: eHealth/composition
code*	string
 
}]
text	string
Описова частина

 
}
value*	string($uuid)
example: e49abc30-6d17-11ea-b83c-673680173afa
 
}
section*	compositionSectionRequest{
focus*	resourceIdentifier{
description:	
http://hl7.org/fhir/STU3/datatypes.html#Identifier

type*	codeableConcept{
coding*	[...]
text	string
Описова частина

 
}
value*	string($uuid)
example: "type": {
      "coding": [
        {
          "system": "eHealth/composition",
          "code": "string"
        }
      ],
      "text": "string"
    },
    "value": "e49abc30-6d17-11ea-b83c-673680173afa"
  },
  }
extension*	[
Розширення обʼєкту для додаткових функцій обробки мед висновків

{
 
anyOf ->	
authorizeWithExtension{
description:	
Розширення, яке використовується лікарем для вказання методу авторизація для надсилання СМС.

valueCode*	string
Enum:
[ AUTHORIZE_WITH ]
valueUuid	string($uuid)
 
}
disabilityAccidentExtension{
description:	
розширення, для вказання лікарем випадків, що непрацездатність викликана випадком на виробництві (тільки для висновків про тимчасову непрацездатність)

valueCode*	string
Enum:
[ IS_ACCIDENT ]
valueBoolean*	boolean
Чи цей випадок пов'язаним із професійною діяльністю працівника

 
}
disabilityTreatmentViolationExtension{
description:	
розширення, для вказання лікарем випадків, що непрацездатність викликана порушенням режиму лікування. Значення відповідно до словника COMPOSITION_TREATMENT_VIOLATION

valueCode*	string
Enum:
[ TREATMENT_VIOLATION ]
valueString*	string
Enum:
[ late_arrival, alcohol_intoxication, narcotic_intoxication, toxic_intoxication, hospital_leave, hospital_change_unauthorized, reject_examination ]
 
}
disabilityTreatmentViolationDateExtension{
description:	
дата порушення режиму лікування. Обовʼязкова, якщо надано disabilityTreatmentViolationExtension

valueCode*	string
Enum:
[ TREATMENT_VIOLATION_DATE ]
valueDate*	string($date)
example: 2020-12-12
 
}
disabilityIntoxicationExtension{
description:	
розширення, для вказання лікарем випадків, що висновок створено при наявній інтоксикації пацієнта

valueCode*	string
Enum:
[ IS_INTOXICATED ]
valueBoolean*	boolean
Чи виявлено алкогольну, наркотичну інтоксикацію

 
}
disabilityForeignTreatmentExtension{
description:	
розширення, для вказання лікарем випадків, які відносяться до лікування за кордоном

valueCode*	string
Enum:
[ IS_FOREIGN_TREATMENT ]
valueBoolean*	boolean
Чи відбувалось лікування за кордоном

 
}
disabilityForceNewExtension{
description:	
розширення, для вказання лікарем випадків, які однозначно вказують на початок нового випадку лікування, і не дозволяють проовжувати будь-які існуючі

valueCode*	string
Enum:
[ IS_FORCE_RENEW ]
valueBoolean*	boolean
Чи лікар підтверджуює, що даний МВ є початком нового лікування

 
}
}]
 
}

Authorize

?

Validate request (JSON schema)

?

Validation data request

?

Processing

1. Using global parameters

<Потрібно викликати глобальні параметри (Global parameters), щоб отримати наведені нижче параметри>

2. Generate structure for response

<Наприклад:

  • Collect response array for all programs in payload with status for each (VALID or INVALID) and rejection_reason

  • For all VALID programs - Get linked medications (type = BRAND) with reimbursement info 

  • Show only active program medications based on start_date and end (start_date must be earlier or equal to the current date or empty, end_date must be greater or equal to the current date or empty)

...

Code Block
IF EXISTS
    (SELECT * FROM program_medications MP
        INNER JOIN medications M
            ON M.id = MP.medication_id
                AND M.type =  BRANDS
        INNER JOIN ingredients I
            ON I.parend_id = M.id
                AND I.is_primary = TRUE
                AND I.medication_child_id = _MR.medication_id
    WHERE MP.medical_program_id == $.id
        AND MP.is_active == TRUE
        AND M.is_active == TRUE)

>

Response structure

Expand
titleResponse
Code Block
compositionAsyncJobStateResponse{
description:	
Стан планування/виконання асинхронної задачі

data*	compositionAsyncJobStateData{
id	string($uuid)
status*	string
Enum:
[ PENDING, FAILED, DONE ]
eta*	string($datetime)
doneAt*	string($datetime)
links*	[compositionAsyncJobListItem{
entity*	string
example: eHealth/composition
href	string
example: composition/0daaad78-6cfb-11ea-9cd6-afab698838bc
error	string
 
}]
 
}
 
}

Example:

Example of response
Expand
title
"section": {
    "focus": {
      "type": {
        "coding": [
          {
            "system": "eHealth/composition",
            "code": "string"
          }
        ],
        "text": "string"
      },
      "value": "e49abc30-6d17-11ea-b83c-673680173afa"
    }
  },
  "extension": [
    {
      "valueCode": "AUTHORIZE_WITH",
      "valueUuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    },
    {
      "valueCode": "IS_ACCIDENT",
      "valueBoolean": true
    },
    {
      "valueCode": "TREATMENT_VIOLATION",
      "valueString": "late_arrival"
    },
    {
      "valueCode": "TREATMENT_VIOLATION_DATE",
      "valueDate": "2020-12-12"
    },
    {
      "valueCode": "IS_INTOXICATED",
      "valueBoolean": true
    },
    {
      "valueCode": "IS_FOREIGN_TREATMENT",
      "valueBoolean": true
    },
    {
      "valueCode": "IS_FORCE_RENEW",
      "valueBoolean": true
    }
  ]
}

Authorize

API paragraph not found

Validate request (JSON schema)

API paragraph not found

Validation data request

API paragraph not found

Processing

API paragraph not found

Response structure

See on Apiary

Example:

Expand
titleResponse example
Code Block
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "PENDING",
    "eta": "string",
    "doneAt": "string",
    "links": [
      {
        "entity": "eHealth/composition",
        "href": "composition/0daaad78-6cfb-11ea-9cd6-afab698838bc",
        "error": "string"
      }
    ]
  }
}

...