Академический Документы
Профессиональный Документы
Культура Документы
Спецификация API
(API Specification)
Версия 2.8
(Version 2.8)
ФАРМА
PHARMA
Содержание
1. Введение (Introduction) .................................................................................................................. 1
2. Сокращения, определения (Terminology) ....................................................................................... 3
3. Общее описание (General description)............................................................................................ 4
4. Описание процесса (General description process) ........................................................................... 6
4.1 01.01.00.00 Создать заказ на эмиссию КМ (Create order for emission IC) .............................. 7
4.2 01.02.00.00 Получить статус массива КМ из бизнес-заказа (Get IC buffer status) ................ 12
4.3 01.03.00.00 Получить КМ из бизнес-заказа (Get ICs from the order) .................................... 16
4.4 01.04.00.00 Отправить отчёт об использовании КМ (Send IC utilisation report to OMS)....... 20
4.5 Буфер хранения кодов маркировки внутри СУЗ (ICs storage buffer in the OMS).................. 24
5. Описание API (API description).................................................................................................... 25
5.1 Описание API (API description) ........................................................................................... 25
5.1.1 Проверить доступность СУЗ (Ping OMS) ........................................................................ 25
5.1.1.1 Запрос (Request)...................................................................................................... 26
5.1.2 Создать бизнес-заказ на эмиссию кодов маркировки (Create order for emission IC) ........ 27
5.1.2.1 Запрос (Request)...................................................................................................... 28
5.1.7 Закрыть подзаказ по заданному GTIN (Close IC array for the specified product GTIN) ..... 49
5.1.7.1 Запрос (Request)...................................................................................................... 50
3
1. Введение (Introduction)
Некоторые методы API при отправке данных используют метод HTTP POST. В таких
случаях следует использовать указание дополнительного HTTP-заголовка – «Content-Type:
application/json».
API REST controller authenticates the clients by so-called client token sent by the client
in the HTTP request header. The client token HTTP header name is “clientToken”.
Some API calls require sending data using HTTP POST method. In such cases you should
use specify additional HTTP Header - Content-Type: application/json.
API methods of the OMS as parameters use the ID «Omsid», the ID «Omsid» is available
in the settings of the OMS.
Valid characters IC are listed in the table below. These symbols are used in the following
groups of marking code data: “Key identifier”, “Verification code”.
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!”%&’()*+,
-./_:;=<>?
1
OMS supports ordering IC in two modes (chosen by the client):
− generation of IC using the serial numbers provided by the client («Self-made» mode);
2
2. Сокращения, определения (Terminology)
Термин Описание
Term Description
СЭ Сервер эмиссии
Emission Server Emission Server
3
3. Общее описание (General description)
This section describes the OMS API, the interaction is carried out using the HTTP protocol,
using the JSON format.
2. Создать бизнес-заказ на эмиссию кодов маркировки (Create order for emission IC).
2. Закрыть подзаказ по заданному GTIN (Close IC array for the specified product
GTIN).
4
Note: if there are unused marking codes when closing an order, a report will be generated and
sent on changing the status of marking codes that are not used by the CM and will be assigned
the status “ELIMINATED” (not used).
Диаграмма последовательности вызова методов СУЗ представлена на рисунке ниже
(Рисунок 1 ). Diagram of the call sequence of the OMS methods is presented in the figure below
(see Figure 1).
API СУЗ также предоставляет вспомогательные методы (The OMS API also provides
helper methods):
Рисунок 1. Последовательность вызова методов СУЗ (Figure 1. Sequence of calling OMS methods)
5
4. Описание процесса (General description process)
This section provides a general description of the process of issuing marking codes.
The overall emission process of the IC includes four key stages.
6
4.1 01.01.00.00 Создать заказ на эмиссию КМ (Create order for emission IC)
Описание:
4.1. В случае если запрос содержит ошибки, Сервер эмиссии регистрирует ошибку
в журнале.
5.1. В случае если запрос содержит ошибки, Сервер эмиссии регистрирует ошибку
в журнале.
10. Регистратор эмиссии при отсутствии ошибок формирует пустой пул КМ:
8
14.1. СУЗ ожидает время готовности заказа и запрашивает эмитированные КМ
в Регистраторе эмиссии (действие выполняется асинхронно).
A diagram of the process of creating an order for emission IC is shown in the figure below
(see Figure 3).
9
Description:
2. The OMS conducts the verification of the request and sends the order to the Emission Registrar.
3. The Emission Registrar forms a request containing an order for the emission ICs and sends it
to the Emission Server.
4. Emission Server receives a request containing an order for the emission ICs, checks
the request:
4.1. In case the request contains errors, the Emission Server logs an error in the log.
4.2. The Emission Server generates an error message and sends it to the Emission Registrar.
5. The Emission Server, in the absence of errors, checks the order for the emission of ICs:
5.1. In case the request contains errors, the Emission Server logs an error in the log.
5.2. The Emission Server generates an error message and sends it to the Emission Registrar.
6. The Emission Server if there are no errors in the order for the emission of ICs, assigns the order
ID and calculates the time of order readiness:
6.1. The Emission Server sends the order for processing (the action is performed
asynchronously).
7. The Emission Server forms a response message and sends it to the Emission Registrar.
9.1. In case the message contains errors, the Emission Registrar registers an error
in the journal.
9.2. The Emission Registrar generates an error message and sends it to the OMS.
10. The Emission Registrar generates an empty pool of ICs in the absence of errors:
10.1. The Emission Registrar waits for the order readiness time and requests the emitted ICs
in the Emission Server (the action is performed asynchronously).
10
11. The Emission Registrar sends a reply message to the OMS.
12. The OMS receives the result of the request processing from the Emission Registrar.
13.2. The OMS generates an error message and sends it to the APCS.
14.1. The OMS expects the time of readiness of the order and requests the emitted ICs
in the Emission Registrar (the action is performed asynchronously).
15. The OMS forms a reply message and sends it to the APCS.
16. The APCS receives the result of processing the request from the OMS.
18. If there are no errors, the APCS saves the order data:
18.1. The APCS initiates the 01.02.00.00 process «Get IC buffer status» (the action is
performed asynchronously).
11
4.2 01.02.00.00 Получить статус массива КМ из бизнес-заказа (Get IC
buffer status)
АСУТП СУЗ
Время готовности
заказа
Проверить ФЛК
запроса
Сформировать
01.02.00.00 «Получить статус массива КМ из бизнес-заказа»
Да запрос статуса КМ из
Проверить наличие
бизнес-заказа
ошибок
Да Нет
Ошибки есть?
Зарегистрировать
ошибку в журнале
Сформировать Получить
сообщение об информацию о
ошибке массиве КМ
Проверить наличие
ошибок Сформировать
ответное
сообщение
Нет Да
Есть ошибки?
Статус буфера КМ
равен «PENDI NG»?
Зарегистрировать Ответное сообщение
ошибку в журнале включает информацию о
буфере и массивах КМ
Нет Статус буфера КМ
равен «ACTIVE»?
Нет
Да
01.03.00.00
«Получить КМ из
бизнес-заказа» Завер шение
Описание:
4.1. В случае если запрос содержит ошибки, СУЗ регистрирует ошибку в журнале.
8.1. В случае если запрос содержит ошибки, АСУТП регистрирует ошибку в журнале.
10. АСУТП при отсутствии ошибок, проверяет статус буфера КМ – равен «ACTIVE»:
11. В случае если статус буфера КМ равен «ACTIVE», АСУТП инициирует выполнение
процесса 01.03.00.00 «Получить КМ из бизнес-заказа» (действие выполняется
асинхронно).
A diagram of the process of obtaining the status of an array of IC is shown in the figure below
(see Figure 5).
13
Figure 5. Get IC buffer status
Description:
2. The APCS forms a request to obtain the status of the array of ICs and sends it to the OMS.
4.1. In case the request contains errors, the OMS logs an error in the log.
4.2. The OMS generates an error message and sends it to the APCS.
14
8. The APCS checks for errors:
8.1. In case the request contains errors, the APCS registers an error in the log.
9. The APCS in the absence of errors, checks the status of the buffer ICs equals «PENDING»:
9.1. If the status of the IC buffer is equal to «PENDING», the APCS initiates a repeated
request for the status of the IC array.
10. APCS in the absence of errors, checks the status of the IC buffer equals «ACTIVE»:
10.1. If the status Of the IC buffer is not equal to «ACTIVE» the process terminates.
11. If the status of the IC buffer is «ACTIVE», the APCS initiates the process of 01.03.00.00 «Get
IC from the order» (the action is performed asynchronously).
15
4.3 01.03.00.00 Получить КМ из бизнес-заказа (Get ICs from the order)
АСУТП СУЗ
Проверить ФЛК
запроса
Сформировать
запрос КМ из бизнес-
заказа Проверить наличие
ошибок
01.03.00.00 «Получить КМ из бизнес-заказа»
Да Нет
Ошибки есть?
Зарегистрировать
ошибку в журнале
Сформировать Сформировать
сообщение об массив
ошибке эмитированных КМ
Проверить наличие
ошибок Сформировать
ответное
сообщение
Нет Да
Есть ошибки?
Есть ещё КМ в
заказе?
Нет
Да Требуется загрузить
КМ из заказа?
Да Нет
Эмитированные КМ загружаются
блоками, при загрузке следующего Завер шение
блока в запросе должен
указываться параметр «lastBlockId»
- Идентификатор блока кодов,
выданных в предыдущем запросе.
Описание:
3.1. В случае если запрос содержит ошибки, СУЗ регистрирует ошибку в журнале.
16
3.2. СУЗ формирует сообщение об ошибке и отправляет в АСУТП.
7.1. В случае если запрос содержит ошибки, АСУТП регистрирует ошибку в журнале.
10. При наличии КМ в заказе, АСУТП проверяет, требуется ли загрузка оставшихся КМ:
A diagram of the process of obtaining a CM from a business order is shown in the figure
below (see Figure 7).
17
Figure 7. Get IC buffer status
Description:
1. The APCS forms a request to receive ICs from the business order and sends it to the OMS.
3.1. In case the request contains errors, the OMS logs an error in the log.
3.2. The OMS generates an error message and sends it to the APCS.
18
4. The OMS forms an array of emitted ICs.
7.1. In case the request contains errors, the APCS registers an error in the log.
10. If there is an IC in the order, the AOP checks whether the remaining IC is required to be
downloaded:
10.1. If it is necessary to load the remaining IC in the order, the company initiates
the re-execution of the process 01.03.00.00 «Get IC from the order».
11. If you do not need to download the remaining ICs in the order, the process is completed.
19
4.4 01.04.00.00 Отправить отчёт об использовании КМ (Send IC utilisation
report to OMS)
Описание:
20
4.1. В случае если запрос содержит ошибки, Сервер эмиссии регистрирует ошибку
в журнале.
12. СУЗ при отсутствии ошибок формирует ответное сообщение и отправляет в АСУТП.
21
15. АСУТП при отсутствии ошибок сохраняет идентификатор отчёта, процесс завершается.
A diagram of the process of sending a report on the IC utilisation is shown in the figure below
(see Figure 9).
Description
1. The APCS forms a request containing an IC utilisation report and sends it to the OMS.
2. The OMS conducts a request verification and sends a request containing an IC utilisation
report in the Emission Registrar.
3. The Emission Registrar forms a request containing an IC utilisation report and sends it
to the Emission Server.
4. The Emission Server receives a request containing an IC utilisation report, checks the request:
4.1. In case the request contains errors, the Emission Server logs an error in the log.
4.2. The Emission Server generates an error message and sends it to the Emission Registrar.
22
5.1. The Emission Server convert the report to 10311/10319 form.
5.2. The Emission Server sends the 10311/10319 form to the processing in Information
System MDLP (the action is performed asynchronously).
6. The Emission Server forms a response message and sends it to the Emission Registrar.
8.1. In case the message contains errors, the Emission Registrar registers an error
in the journal.
8.2. The Emission Registrar generates an error message and sends it to the OMS.
9. The Emission Registrar generates and sends a response message to the OMS in the absence
of errors.
10. The OMS receives the result of the request processing from the Emission Registrar.
11.2. The OMS generates an error message and sends it to the APCS.
12. If there are no errors, the OMS forms a response message and sends it to the APCS.
13. The APCS receives the result of processing the request from the OMS.
15. If there are no errors, the process retains the ID of the report.
23
4.5 Буфер хранения кодов маркировки внутри СУЗ (ICs storage buffer
in the OMS)
To ensure the necessary performance for high-speed production lines, the OMS stores inside
a small buffer with marking codes for each item of a business order. The size of the block of codes
that can be obtained from the control system for a given item at a time is limited by the size
of the buffer. It is customized to the needs of production. This storage structure additionally ensures
the fault tolerance of the emission unit marking codes in production The storage structure
of marking codes in the OMS is shown in the figure below (see Figure 10).
Регистратор эмиссии 1
Заказ 1 (Order 1) (Emission Registrar 1)
GTIN 1
Бизнес-заказ Регистратор эмиссии 2
(Business order) (Emission Registrar 2)
Буфер КМ Заказ 1 (Order 1)
(IC buffer)
Заказ 2 (Order 2)
GTIN 1
24
5. Описание API (API description)
параметры:
Access to the OMS API extensions for the pharmaceutical industry is provided via a URL.
options:
The URL parameter «extension» that defines access to extensions has the value = pharma
for the pharmaceutical industry.
25
при регистрации клиента СУЗ. Маркер безопасности (token) передаётся на сервер в HTTP-
заголовке с именем «clientToken».
This method checks the availability of the OMS and requires the following parameters:
security token and unique OMS identifier. The security token is generated by OMS during
registration of OMS client. The security token is sent to the server in the HTTP-Header named
"clientToken".
The query string parameter are listed in the table below (see Table 3).
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
При успешном выполнении запроса, сервер возвращает HTTP код - 200 и уникальный
идентификатор СУЗ. Формат ответа на запрос доступности СУЗ приведён в таблице ниже
(см. Таблицу 4). Коды ошибок приведены в разделе 5.3.
26
If the request is successful, the server returns the HTTP code - 200 and unique OMS
identifier. The format of the response to the request for availability of OMS are listed in the table
below (see Table 4). Error codes are described in section 5.3.
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
{
"omsId":"CDF12109-10D3-11E6-8B6F-0050569977A1"
}
5.1.2 Создать бизнес-заказ на эмиссию кодов маркировки (Create order for emission IC)
Этот метод используется для создания и отправки заказа на эмиссию КМ. Маркер
безопасности (token) генерируется СУЗ при регистрации клиента СУЗ. Маркер безопасности
(token) передаётся на сервер в HTTP-заголовке с именем «clientToken».
This method is used to create and send an order for emission IC. The security token is
generated by OMS during registration of OMS client. The security token is sent to the server in the
HTTP-Header named «clientToken».
27
Note: product item (GTIN) in one business order should not exceed 150 000 marking codes,
the number of product items in one business order for the pharmaceutical industry - 1 (1 business
order - 1 GTIN). The number of active orders is not more than 100.
The query string parameters are listed in the table below (see Table 5).
Обязательность.
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
The description of the JSON format for creating and sending an order for emission CM are
listed in the table below (see Table 6).
Таблица 6 – Описание формата JSON запроса создания и отправки заказа на эмиссию КМ, объект
«Order»
Table 6 – Request of the JSON format for creating a business order for issuing a CM, object «Order»
JSON Array of
Список товаров OrderProduct
products Да (Yes)
List of products Таблица 7
Table 7
Описание формата объекта «OrderProduct» приведено в таблице ниже (см. Таблицу 7).
The format of the object «OrderProduct» are listed in the table below (see Table 7).
28
Таблица 7 – Формат объекта «OrderProduct»
Table 7 – Format of object «OrderProduct»
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
Количество КМ Integer
quantity Да (Yes)
Quantity of ICs / Identifiers ($int32)
Note: the initially established IC generation scheme for a specific type of product (GTIN),
defined by the attribute «serialNumberType» cannot be changed in the future.
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
subjectId Субъект обращения. Номер, String Да (Yes)
присвоенный при регистрации в ИС (36)
МДЛП.
GUID
Subject ID. Number assigned during
registration with IS MDLP
29
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
freeСode Признак оплаты эмиссии КМ. boolean Нет (No)*
true - КМ не подлежит оплате; (Условно
false - КМ подлежит оплате. обязательное,
Sign of payment for IC issue. Conditionally
true - IC is not payable;
Mandatory)
false - IC payable
Attention! The payment type «1- Payment by issue» is temporarily disabled. PaymentType
field must contain value=2.
If you send paymentType = 1, then an error will be returned: «Order processing with the
payment type “Payment by issue” is temporarily unavailable».
30
POST /api/v2/pharma/orders?omsId=CDF12109-10D3-11E6-8B6F-
0050569977A1 HTTP/1.1
Accept: application/json
clientToken: 1cecc8fb-fb47-4c8a-af3d-d34c1ead8c4f
Content-Length: 559
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
{
"products" : [ {
"gtin" : "01334567894339",
"quantity" : 20,
"serialNumberType" : "SELF_MADE",
"serialNumbers" : [ "77X4DdOGGDc9d", "6KfL3i7igypkd",
"oBtEYaq1HCxHN", "kRGmTQoeOckPx", "KHnFN1fj7NmL6", "LSsbD7BrWRyFX",
"rEw3MOgC86H4w", "7WQ4FZapQpacq", "Qaty1C5Imop1O", "mSWjzXd5axLRj",
"2sneq3ZzQPxRD", "m6edPWjxsTc6R", "pIfdgy1XyYIkx", "CTQzSe9ZTormg",
"dock4TYN5HSkW", "ZA6AITKGQNfO1", "AJfr6XoYxRIHE", "GpxniqfHc6iBA",
"57gx4I7fj8J58", "iQ4PtkYIYfxKL" ],
"templateId":5
} ],
"subjectId ":"65468245-fb47-4c8a-af3d-d3486ead8c4a"
}
The method returns a unique OMS order ID and the expected order completion time
in milliseconds (The received time must be divided by 1 000 to get seconds and 60 to get minutes).
The “orderId” value is used to get the CM from the order when the order is completed (see section
5.1.4.). Error codes are described in section 5.3.
Обязательность
Поле Описание Тип Is it mandatory
Field Description Type to complete the
field?
31
Обязательность
Поле Описание Тип Is it mandatory
Field Description Type to complete the
field?
{
"omsId" : "CDF12109-10D3-11E6-8B6F-0050569977A1",
"orderId" : "b024ae09-ef7c-449e-b461-05d8eb116c79",
"expectedCompleteTimestamp" : 5100
}
The method of getting current IC buffer status for a specific order requires the following
parameters: security token, OMS identifier, order ID, and product GTIN. The security token is
generated by OMS during registration of OMS client. The security token is sent to the server
in the HTTP-Header named "clientToken".
32
5.1.3.1 Запрос (Request)
The query string parameters are listed in the table below (see Table 10).
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
33
The JSON format of the response to the request for obtaining the status of the KM array are
listed in the table below (see Table 11). Error codes are described in section 5.3.
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
Общее количество доступных КМ для
товара в буфере и пулах регистратора Integer
availableCodes Да (Yes)
Number of available codes in buffer and ($int32)
pools
String
Статус буфера
bufferStatus Voc. №4 Да (Yes)
Buffer status
(See section 5.2.4.)
String
GTIN – по которому был сделал запрос
gtin (14) Да (Yes)
Product GTIN
[0-9]{14}
Количество неиспользованных КМ
Integer
leftInBuffer (локальный буфер) Да (Yes)
($int32)
Number of unused ICs in the array
Уникальный идентификатор СУЗ String
omsId Да (Yes)
Unique OMS identifier (UUID)
Уникальный идентификатор заказа на
эмиссию КМ. Заказ, по которому был String
orderId Да (Yes)
сделан запрос (UUID)
A unique order ID in OMS
JSON Array of
Массив пулов, созданных для буфера PoolInfo Object
poolInfos Да (Yes)
Array of pools created for the IC buffer Таблица 12
Table 12
34
Таблица 12 – Формат объекта «PoolInfo»
Table 12 - Format of object «PoolInfo»
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
Готовность РЭ
isRegistrarReady Logical flag that shows if the Emission Boolean Да (Yes)
Registrar is currently ready for orders
Количество ошибок РЭ
registrarErrorCo Integer
Number of Emission Registrar errors Да (Yes)
unt ($int32)
occurred
Идентификатор РЭ (номер)
registrarId String Да (Yes)
Emission Registrar Identifier
Причина отказа
rejectionReason The IC array rejection reason returned by String Нет (No)
the Emission Registrar
String
Статус пула КМ
status Voc. №3 Да (Yes)
IC array status
(See section 5.2.3.)
{
"poolInfos" : [ {
"status" : "READY",
"quantity" : 9,
35
"leftInRegistrar" : 0,
"registrarId" : "Virtual Registrar",
"isRegistrarReady" : true,
"registrarErrorCount" : 0,
"lastRegistrarErrorTimestamp" : 0
}, {
"status" : "READY",
"quantity" : 11,
"leftInRegistrar" : 0,
"registrarId" : "Virtual Registrar",
"isRegistrarReady" : true,
"registrarErrorCount" : 0,
"lastRegistrarErrorTimestamp" : 0
} ],
"leftInBuffer" : 0,
"totalCodes" : 20,
"unavailableCodes" : 0,
"orderId" : "b024ae09-ef7c-449e-b461-05d8eb116c79",
"gtin" : "01334567894339",
"bufferStatus" : "ACTIVE",
"omsId" : "CDF12109-10D3-11E6-8B6F-0050569977A1"
}
The method of getting ICs from the specified order requires the following parameters:
security token, OMS identifier, order ID, product GTIN and quantity of ICs to be provided.
The security token is generated by OMS during registration of OMS client. The security token is
sent to the server in the HTTP-Header named «clientToken». If the order is still in progress and
the IC array has not been generated yet, the method return an error.
36
clientToken:{clientToken}
The query string parameters are listed in the table below (see Table 13).
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
String
GTIN товара, по которому запрашиваются коды
gtin (14) Да (Yes)
Product GTIN
[0-9]{14}
37
утерянными, в этом случае коды маркировки будут отбракованы (СУЗ
сформирует отчёт об отбраковке и отправит его в систему).
− Финальным шагом является закрытие заказа, закрытие заказа должно
осуществляться клиентом посредством вызова метода «Закрыть подзаказ
по заданному GTIN» (см. раздел 5.1.7), в запросе которого должен передаваться
последний полученный идентификатор блока кодов.
Note: Receipt of emitted ICs is performed by a client (guaranteed receipt of emitted ICs) with
a transfer in confirmation requests for receipt of ICs and upon closing of the order. The rules
for ICs obtaining are presented below:
− The first request for ICs, the value of the «lastBlockId» attribute is set to «0» (zero),
the response message will contain the identifier of the code block (the value
of the attribute «blockId»), which should be specified in the next request for ICs. Then
each request should contain the value of the «lastBlockId» attribute equal
to the identifier of the code block received in the previous request (the transfer
of the code block identifier is a confirmation of receipt of the emitted ICs).
− If in the request the code block identifier other than the one received in the previous
request is specified as the value of the «lastBlockId» attribute, the ICs sent
in the previous request will be considered lost, in this case the ICs will be rejected
(OMS will generate a report rejection and send it to the system).
− The final step is to close the order, closing the order should be carried out
by the client by calling the method «Close IC array for the specified product GTIN»
(see section 5.1.7) in the request of which the last received code block identifier
should be transmitted.
При успешном выполнении запроса, сервер возвращает HTTP код -200 и массив КМ
КМ. Формат ответа на запрос получения КМ для заданного товара приведён в таблице ниже.
Коды ошибок приведены в разделе 5.3.
38
If the request is successful, the server returns the HTTP code -200 and IC array. The format
of the response to the request for receipt of the IC for a given product are listed in the table below.
Error codes are described in section 5.3.
Обязательность.
Поле Описание Тип Is it mandatory to
Field Description Type complete the
field?
{
"omsId" : "CDF12109-10D3-11E6-8B6F-0050569977A1",
"codes" : [
"010460165303004621u003drxdv3Mu0\u001d91VXQI\u001d92X8s451dPdmHvUKs6
cTvZgqTFvvagZl/NFVUNwo+ufaM= "],
"blockId" : "CAF16549-15B1-11E6-8A4F-0056563378A1"
}
39
This method is used for sending the IC utilisation report to OMS. The security token is
generated by OMS during registration of OMS client. The security token is sent to the server
in HTTP-Header named "clientToken".
The query string parameters are listed in the table below (see Table 15).
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
The description of the structure of the object «UtilisationReport» for sending a report
on the IC utilization report to OMS are listed in the table below (see Table 16).
Note. Transmitted IСs as “sntins” parameters should include the full marking code,
including the verification code (crypto code), since this report is transmitted to the issue registrar,
40
where the authentication of the IС is performed. The number of IC in the utilization report should
not exceed 30 000 codes).
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
The extension of the object «UtilisationReport» for the pharmacy industry are listed
in the table below (see Table 17).
Обязательность
Поле Описание Тип†
Is it mandatory to
Field Description Type
complete the field?
†
Формат и допустимые символы должны соответствовать форматам соответствующих полей в ИС МДЛП.
The format and valid characters must comply with the formats of the corresponding fields in Information System MDLP
41
Обязательность
Поле Описание Тип†
Is it mandatory to
Field Description Type
complete the field?
Внимание!
Attention!
Field orderType must be completed. The specified field must contain the numeric value
of the production order type – (1) own, (2) contract.
Fields packingId and controlId must be completed. The specified field must contain
the 36-characters identifiers of secondary packaging manufacturer and manufacturer, who
produced the quality control, from the register of foreign counter companies in the information
system MDLP.
43
Sample of REST query (for Pharma industry, Local own drug production in Russia)
POST /api/v2/pharma/utilisation?omsId=CDF12109-10D3-11E6-8B6F-
0050569977A1 HTTP/1.1
Accept: application/json
clientToken: 1cecc8fb-fb47-4c8a-af3d-d34c1ead8c4f
Content-Length: 271
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
{
"sntins":[
"010460165303004621u003drxdv3Mu0\u001d91VXQI\u001d92X8s451dPdmHvUKs6
cTvZgqTFvvagZl/NFVUNwo+ufaM=",
"010460165303004621u003drxdv3Mu0\u001d91VXQI\u001d92A3igGog+daH9OlF2
Atkb/UZvzZctL55wlOCsDXW1oyg="],
"usageType":"VERIFIED",
"expirationDate":"12.06.2020",
"orderType":"1",
"seriesNumber":"123",
"subjectId":"00000000000397"
}
Sample of REST query (for Pharma industry, Local contract drug production in Russia)
POST /api/v2/pharma/utilisation?omsId=CDF12109-10D3-11E6-8B6F-
0050569977A1 HTTP/1.1
Accept: application/json
clientToken: 1cecc8fb-fb47-4c8a-af3d-d34c1ead8c4f
Content-Length: 271
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
{
"sntins":[
"010460165303004621u003drxdv3Mu0\u001d91VXQI\u001d92X8s451dPdmHvUKs6
cTvZgqTFvvagZl/NFVUNwo+ufaM=",
"010460165303004621u003drxdv3Mu0\u001d91VXQI\u001d92A3igGog+daH9OlF2
Atkb/UZvzZctL55wlOCsDXW1oyg="],
"usageType":"VERIFIED",
"expirationDate":"12.06.2020",
"orderType":"2",
"ownerId":"0c290e4a-aabb-40ae-8ef2-ce462561ce7f",
"seriesNumber":"123",
"subjectId":"00000000000397"
}
44
Пример REST запроса (для фармацевтической промышленности, для производства
вне территории Российской Федерации).
Sample of REST query (for Pharma industry, Drug production outside the Russia)
POST /api/v2/pharma/utilisation?omsId=CDF12109-10D3-11E6-8B6F-
0050569977A1 HTTP/1.1
Accept: application/json
clientToken: 1cecc8fb-fb47-4c8a-af3d-d34c1ead8c4f
Content-Length: 271
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
{
"sntins":[
"010460165303004621u003drxdv3Mu0\u001d91VXQI\u001d92X8s451dPdmHvUKs6
cTvZgqTFvvagZl/NFVUNwo+ufaM=",
"010460165303004621u003drxdv3Mu0\u001d91VXQI\u001d92A3igGog+daH9OlF2
Atkb/UZvzZctL55wlOCsDXW1oyg="],
"usageType":"VERIFIED",
"expirationDate":"12.06.2020",
"seriesNumber":"123",
"subjectId":"0c29564a-aacc-brae-8652-ce462561c898",
"packingId":"0c290e4a-aabb-40ae-8ef2-ce462561ce7f",
"controlId":"0c456e4a-aacb-42ae-8ef2-ce462662ce8a"
}
При успешном выполнении запроса, сервер возвращает HTTP код - 200 и уникальный
идентификатор отчёта об использовании КМ, присвоенный СУЗ. Полученный
идентификатор отчёта об использовании КМ используется для получения статуса обработки
отчёта (см. раздел 5.1.8.). Структура ответа на запрос отправки отчёта об использовании
приведён в таблице ниже (см. Таблицу 18). Коды ошибок приведены в разделе 5.3.
If the request is successful, the server returns the HTTP code -200 and unique identifier
of the report IC utilisation, assigned to the OMS. The received identifier of the report IC utilisation
is used to obtain the status of report processing (see section 5.1.8.). The structure of the response
to the request to send information about the report IC utilisation are listed in the table below
(see Table 18). Error codes are described in section 5.3.
45
Таблица 18 – Формат ответа на запрос отправки отчёта о нанесении КМ
Table 18 – The format of the response to the request to send report IC utilisation
Обязательность
Поле Описание Тип Is it mandatory
Field Description Type to complete the
field?
{
"omsId" : "CDF12109-10D3-11E6-8B6F-0050569977A1",
"reportId" : "3179f5d2-2bf5-47d1-8df0-9452b257d851"
}
Этот метод предназначен для получения статуса бизнес заказов, используя следующие
параметры: маркер безопасности (token), идентификатор СУЗ. Маркер безопасности (token)
генерируется СУЗ при регистрации клиента СУЗ. Маркер безопасности (token) передаётся
на сервер в HTTP-заголовке с именем «clientToken».
The method receives the status of business orders using the following parameters: security
token, OMS identifier. The security token is generated by OMS during registration of OMS client.
The security token is sent to the server in the HTTP-Header named «clientToken».
46
5.1.6.1 Запрос (Request)
The query string parameter are listed in the table below (see Table 19).
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
При успешном выполнении запроса, сервер возвращает HTTP код -200 и данные статус
бизнес заказов и уникальный идентификатор СУЗ. Формат ответа на запрос получения
состава агрегата приведён в таблице ниже (см. Таблица 20). Коды ошибок приведены
в разделе 5.3.
If the request is successful, the server returns the HTTP code -200 and business order status
data and unique OMS identifier. The structure of the response to the request for obtaining
the composition of the aggregation unit are listed in the table below (see Table 20). Error codes are
described in section 5.3.
47
Таблица 20 – Формат ответа на запрос получения статуса бизнес-заказа
Table 20 - The format of the response to a request for receiving the status orders
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
JSON Array of
Массив бизнес-заказов с их статусами
OrderSummary
orderInfos An array of business orders with their Да (Yes)
Таблица 21
statuses
Table 21
Обязательность
Поле Описание Тип
Is it mandatory to
Field Description Type
complete the field?
Идентификатор бизнес-заказа на
String
orderId эмиссию КМ Да (Yes)
(UUID)
Unique OMS Order ID
String
Статус бизнес-заказа
orderStatus Voc. №7 Да (Yes)
Business order status
(See section 5.2.7.)
JSON Array of
Массив информации о статусе буферов BufferInfo
buffers Да (Yes)
Array of buffer status information Таблица 11
Table 11
48
{
"omsId" : "CDF12109-10D3-11E6-8B6F-0050569977A1",
"orderInfos" : [ {
"orderId" : "b024ae09-ef7c-449e-b461-05d8eb116c79",
"orderStatus" : "READY",
"createdTimestamp" : 1550650989568,
"buffers" : [ {
"poolInfos" : [ {
"status" : "READY",
"quantity" : 9,
"leftInRegistrar" : 0,
"registrarId" : "Virtual Registrar",
"isRegistrarReady" : true,
"registrarErrorCount" : 0,
"lastRegistrarErrorTimestamp" : 0
}, {
"status" : "READY",
"quantity" : 11,
"leftInRegistrar" : 0,
"registrarId" : "Virtual Registrar",
"isRegistrarReady" : true,
"registrarErrorCount" : 0,
"lastRegistrarErrorTimestamp" : 0
} ],
"leftInBuffer" : 20,
"totalCodes" : 20,
"unavailableCodes" : 0,
"orderId" : "b024ae09-ef7c-449e-b461-05d8eb116c79",
"gtin" : "01334567894339",
"bufferStatus" : "ACTIVE",
"omsId" : "CDF12109-10D3-11E6-8B6F-0050569977A1"
} ]
} ]
}
5.1.7 Закрыть подзаказ по заданному GTIN (Close IC array for the specified product
GTIN)
The method closes IC array for the specified order and product GTIN and requires
the following parameters: token, order ID, and product GTIN. The token is generated by OMS
49
during registration of OMS client. The token is sent to the server in the HTTP-Header named
"clientToken".
The query string parameters are listed in the table below (see Table 22).
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
50
− В случае если клиент не закроет заказ, то СУЗ выполнит закрытие заказа
по истечению времени указанного в параметрах конфигурации СУЗ и коды
маркировки, полученные в последнем запросе, будут считаться утерянными,
данные коды маркировки будут отбракованы (СУЗ сформирует отчёт
об отбраковке и отправит его в систему) по причине того, что не будет
отправлено подтверждение о получении последнего блока кодов маркировки
(подтверждение о получении кодов маркировки клиентом подтверждается
указанием последнего идентификатора блок кодов маркировки).
− The client is obliged to close the order after receiving the emitted ICs. In the request,
the value of the «lastBlockId» parameter should include the value of the last
identifier of the block of codes received in the response message when calling
the «Get CM from business order» method (see section 5.1.4). In case if the client
did not request ICs, the value of the «lastBlockId» parameter should be set to «0»
(zero), which is the default value.
− In case the client does not close the order, the OMS completes the order after
the time specified in the OMS configuration parameters and the ICs received
in the last request will be considered lost, these ICs will be rejected (OMS will
generate a rejection report and send it to the system ) due to the fact that
the confirmation of receipt of the last block of ICs will not be sent (confirmation
of receipt of ICs by the client is confirmed by indicating the last identifier and
a block of ICs).
При успешном выполнении запроса, сервер возвращает HTTP код -200 и уникальный
идентификатор СУЗ. Структура ответа на запрос закрытие подзаказа по заданному GTIN
приведён в таблице ниже (см. Таблицу 23). Коды ошибок приведены в разделе 5.3.
51
If the request is successful, the server returns the HTTP code -200 and a unique OMS
identifier. The structure of the response to a request to close a sub-order according to a given GTIN
are listed in the table below (see Table 23). Error codes are described in section 5.3.
Обязательность
Поле Описание Тип Is it mandatory
Field Description Type to complete the
field?
{
"omsId" : "CDF12109-10D3-11E6-8B6F-0050569977A1"
}
The method receives the report processing status using the following parameters: token,
report identifier and unique OMS identifier. The token is generated by OMS during registration
of OMS client. The token is sent to the server in the HTTP-Header named "clientToken".
52
5.1.8.1 Запрос (Request)
The query string parameter are listed in the table below (see Table 24).
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
При успешном выполнении запроса, сервер возвращает HTTP код -200 и уникальный
идентификатор СУЗ и статус обработки отчёта. Формат ответа на запрос на получение
статуса обработки отчёта приведён в таблице ниже (см. Таблицу 25). Коды ошибок
приведены в разделе 5.3.
If the request is successful, the server returns the HTTP code -200 and unique OMS identifier
and report processing status. The format of the response to a request for receiving the report
processing status are listed in the table below (see Table 25). Error codes are described
in section 5.3.
53
Таблица 25 – Формат ответа на запрос получения статуса обработки отчёта
Table 25 - The format of the response to a request for receiving the report processing status
Обязательность
Параметр Описание Тип
Is it mandatory to
Parameter Description Type
complete the field?
String
Статус обработки отчёта
reportStatus Voc. №5 Да (Yes)
Report processing status
(See section 5.2.5.)
{
"omsId":"CDF12109-10D3-11E6-8B6F-0050569977A1",
"reportId":"fab1c0e4-9590-4ed7-8d58-18862d6a9aab",
"reportStatus":"SENT"
}
54
5.2 Справочники (Dictionary)
Values of the vocabulary «Methods for generating an individual serial number» are listed
in the table below (see Table 26).
Самостоятельно.
SELF_MADE String
Self-generated
Оператором ИС МДЛП
OPERATOR String
Generated by Information System MDLP operator
Значения справочника «Шаблоны КМ» приведены в таблице ниже (см. Таблицу 27).
Values of the vocabulary «Template IC» are listed in the table below (see Table 27).
Таблица 27 – Шаблон КМ
Table 27 – Template IC
55
Константа Описание Тип
Constant parameter Description Type
Наименование Описание
Name Description
56
Наименование Описание
Name Description
Values of the vocabulary «IC array status» are listed in the table below (see Table 29).
57
Диаграмма состояний представлена на рисунке ниже (см. Рисунок 11).
The state diagram is shown in the figure below (see Figure 11).
REQUESTED
REQUEST_ERROR
Запрошен
Ошибка
IN_PROCESS REJECTED
В обработке Отклонен
READY
Готов
CLOSED
Закрыт
DELETED
Удален
Values of the vocabulary «IC buffer status» are listed in the table below (see Table 30).
Буфер создан
ACTIVE String
IC buffer has been created
58
Константа Описание Тип
Constant parameter Description Type
Буфер закрыт
CLOSED String
IC buffer has been closed
The state diagram is shown in the figure below (see Figure 12).
PENDING
В ожидании
CLOSED
Закрыт
59
Константа Описание Тип
Constant parameter Description Type
Отчёт отправлен
SENT String
Report sent
The state diagram is shown in the figure below (see Figure 13).
PENDING
В ожидании
READY_TO_SEND REJECTED
SENT
Отправлен
Values of the vocabulary «Usage Type» are listed in the table below (see Table 32).
60
Константа Описание Тип
Constant parameter Description Type
Для фармацевтической промышленности используется только тип использования VERIFIED. For the
pharmacy industry only VERIFIED is used
Бизнес-заказ создан
CREATED String
Business order created
61
Диаграмма состояний представлена на рисунке ниже (см. Рисунок 14).
The state diagram is shown in the figure below (see Figure 14).
CREATED
Создан
PENDING
В ожидании
APPROVED DECLINED
Подтверждён Отклонен
READY
Готов
CLOSED
Закрыт
62
5.3 Формат и коды ошибок (Format and error codes)
Формат ответа с ошибкой на запрос описан в таблице ниже (см. Таблицу 34).
The format of the response with an error in the table below (see Table 34).
JSON Array Of
ProtobeansFieldError
Описание детальных ошибок (по полям)
fieldErrors Object
Detail error description (by the field)
Таблица 35
Table 35
The format of the «ProtobeansFieldError » object is described in the table below (see
Table 35).
Описание ошибки
fieldError String
Error description
Наименование поля
fieldName String
Field name
63
"fieldError": "string",
"fieldName": "string"
}
],
"globalErrors": [
"string"
],
"success": false
}
Коды ошибок в ответе на запрос приведены в таблице ниже (см. Таблицу 36).
Error codes in response to the request are presented in the table below (see Table 36).
64
6. Список изменений (List of changes)
Дата
Версия Список, внесенных изменений
изменения
Version List of changes
Date
1. Valid characters of IC updated according GS1 specification, see (Section 1, Table 1).
2. An explanation on how to generate serial numbers has been fixed (Section 5.1.2.1).
3. The mandatory parameters for the freeСode field in oblect Order are changed, note
added for this field (Section 5.1.2.1, Table 7).
4 Corrected sample report for drug production outside the Russia according to the
described data formats (Section 5.1.5.1)
65
Дата
Версия Список, внесенных изменений
изменения
Version List of changes
Date
5.1.5.1).
1. An explanation has been added on how to generate serial numbers (Section 5.1.2.1).
2. Type and rules for filling subjectId field are changed (Table 8).
3. The fields freeСode and paymentType are added to the extension of the Order
object (Table 8).
4. Added note about charging free codes (Section 5.1.2.1).
5. The value of the subjectId field in the sample of query has been fixed according to
the format (Section 5.1.2.1).
6. The maximum number of ICs in the usage report has been changed (30 000 ICs) (Section
5.1.5.1).
7. The value of the usageType (=VERIFIED)field in the query sample has been fixed
according to the vocabulary (Section 5.1.5.1)
66
Дата
Версия Список, внесенных изменений
изменения
Version List of changes
Date
19. Добавлен новый шаблон кода маркировки для лекарственных препаратов
(короткий код проверки), внесены уточнения по порядку применения шаблонов
(Таблица 27 и Таблица 28).
20. Внесены изменения в значения справочника «Статус буфера КМ» (Таблица30).
21. Внесены изменения в значения справочника «Статус обработки отчёта»
(Таблица31).
22. В дополнение к описанию статусов массива КМ (Раздел 5.2.3) приведена
диаграмма состояний (Рисунок 11).
23. В дополнение к описанию статусов буфера КМ (Раздел 5.2.4) приведена
диаграмма состояний (Рисунок 12).
24. В дополнение к описанию статусов обработки отчёта (Раздел 5.2.5) приведена
диаграмма состояний (Рисунок 13).
25. В дополнение к описанию статусов бизнес-заказа (Раздел 5.2.7) приведена
диаграмма состояний (Рисунок 14).
1. All methods have been updated in the omsId field format - UUID. The examples of all
queries and responses indicate the correct values of the omsId field.
2. To the description of the “Create a business order for the issue of marking codes”
method, a note is added containing restrictions on the number of ICs in a business order
and the number of product items in one business order (Section 5.1.2).
3. The quantity field type is changed in object OrderProduct (Table 7).
4. The mandatory parameters for the serialNumbers field in oblect OrderProduct
are changed (Table 7).
5. Type and description for the templateId field in oblect OrderProduct are
changed (Table 7).
6. The mandatory parameters for the fields of the Format of the response to the request
are added (Table 9).
7. The expectedCompletionTime field type is changed in the Format of the response
to the request (Table 9).
8. Changed the sequence of fields in the BufferInfo object, added new fields
rejectionReason, totalPassed (Table 11).
9. Changed the sequence of fields in the PoolInfo object (Table 12).
10. Added rule (note) to receive ICs (see section 5.1.4.1).
11. The mandatory parameters for the fields of the Format of the response to the request
for receipt of the CM for a product are added (Table 14).
12. In the sample of query the value of the sntins field is given according to the format
(Section 5.1.5.1).
13. The value of the expirationDate field in the sample of query has been fixed
according to the format (Section 5.1.5.1).
14. The mandatory parameters for the fields of the format of the response to the request to
send report IC utilisation are added (Table 18).
15. Added new field declineReason to the OrderSummaryInfo object (Table 21).
16. The omsId field is excluded from the the object OrderSummary (Table 21).
17. Added a rule (note) to close the order of ICs (see section 5.1.7.1).
18. The mandatory parameters for the fields of the Format of the response to the request
to close a sub-order according to a given GTIN are added (Table 23).
19. A new template for medical drugs has been added (short verification code=5),
67
Дата
Версия Список, внесенных изменений
изменения
Version List of changes
Date
clarifications have been made on how to use the templates (Table 27 and Ta ble 28).
20. The values of the vocabulary IC buffer status have been changed (Table 30).
21. The values of the vocabulary Report Processing Status have been changed (Table 31).
22. In addition to the description of the statuses of the KM array (Section 5.2 .3), a state
diagram is shown (Figure 11).
23. In addition to the description of the KM buffer status (Section 5.2.4), a state diagram is
shown (Figure 12).
24. In addition to the description of the report processing statuses (Section 5.2.5), a state
diagram is shown (Figure 13).
25. In addition to the description of the business order statuses (Section 5.2.7), a state
diagram is shown (Figure 14)
1. Раздел 5.1.5. перенесен в раздел 4.5.
2. Добавлен перевод раздела 4.5.
3. Добавлено описание порядка доступа к API СУЗ для фармацевтической
промышленности при помощи URL.
4. Изменено описание методов и примеров в части правила указания URL.
5. Изменено описание поля sntins в объекте UtilisationReport
(Таблица 16).
6. Изменен пример JSON ответа в разделе 5.1.4.2 в части формата кода.
7. Внесено уточнение о необходимости использования одного статуса VERIFIED
2.3 20.06.2019 в отчете о нанесении.
1. Section 5.1.5 moved to Section 4.5.
2. Added translation of section 4.5.
3. Added descriptions of the OMS API access rules for the pharmaceutical industry using
URL.
4. Description of methods and examples are changed in the part of the URL writing rule.
5. The sntins field description is changed in object UtilisationReport (Table 16).
6. Sample of JSON response in Section 5.1.4.2 has been changed.
7. Added information about using one type of status = VERIFIED
68
Дата
Версия Список, внесенных изменений
изменения
Version List of changes
Date
8. Внесено уточнение, что функционал для производства лекарственных препаратов
вне территории Российской Федерации находится в режиме отладки.
9. Внесено новое значение статуса обработки отчета COMPLETE и внесены уточнения
в описания статусов (Таблица 31).
10. Внесено уточнение о возможности заказа КМ в двух режимах.
11. Внесено уточнение о необходимости использования одного типа шаблона = 2
12. Внесено уточнение о необходимости соответствия форматов данных в
расширения объекта UtilisationReport форматам соответствующих данных
ИС МДЛП
13. Внесена информация о регистрозависимости названий полей и их значений.
1. Excluded sections containing methods that are not applicable to the processes of the
pharmacy industry.
2. Added sections with detailed description of the emission process steps.
3. Methods are described according to the sequence given in section 4.
4. The ownerId field is excluded from the extension of the object Order (Table 8).
5. The mandatory parameters for the orderType field in the description of the extension
of the object UtilisationReport are changed (Table 17).
6. For the Order and the UtilisationReport, the rules for filling in specific fields
are included.
7. Corrected sample report according to the described data formats.
8. Added information that System function for drug production outside the Russia is under
development.
9. A new report processing status value is added (COMPLETE)and status descriptions are
detailed (Table 31).
10. Added information about the possibility of ordering IC in two modes.
11. Added information about using one type of template = 2.
12. A clarification was made on the need to match the data formats in the extensions of
the UtilisationReport object to the formats of the corresponding fields in
Information System MDLP.
13. Information about the case-dependence of field names and their values has been
entered
69