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

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

Version 1 Next »

Purpose

This method is designed to create a request for composition.

Specification

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>

Using Microservices

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

Protocol type

JSON

Request type

POST

Sync/Async

Async

Logic

Preconditions

  • авторизацію пройдено

Input parameters (filters)

None

Request structure

 JSON schema
compositionRequest{
description:	Запит на створення висновку

category*	codeableConceptCompositionCategory{
coding*	[codeableConceptCompositionCategoryCoding{
system*	string
example: 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: 2020-06-26T15:22:53.403Z
end	string($datetime)
example: 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: 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: e49abc30-6d17-11ea-b83c-673680173afa
 
}
author*	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: 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: 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)

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

 Response
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
{
  "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"
      }
    ]
  }
}

Post-processing processes

None

Error list

What caused the error

HTTP status code

Error message

200

OK (задачу знайдено)

 

400

Bad Request  (невірний формат запиту)

  • No labels