Versions Compared

Key

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

...

Page Properties
idAPI_Specification

Link

Посилання на Apiary або Swagger

Resource

Посилання на ресурс, наприклад: /api/persons/create

Scope

rule_engine_rule:write

Scope для доступу

Components

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC

Protocol type

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Метод є синхронним чи асинхронним?

Public/Private/Internal

Потрібно зазначити тип методу за ступенем доступності

Expand
titleRequest example
Code Block
"""
Input for `createRuleEngineRule` mutation.

User must have a scope **rule_engine_rule:write**
"""
input CreateRuleEngineRuleInput {
  "Signed data to create rule engine set"
  signedContent: SignedContent!
}

"""
Return type for `createRuleEngineRule` mutation.
"""
type CreateRuleEngineRulePayload {
  "Created `RuleEngineRule`."
  ruleEngineRule: RuleEngineRule
}

...

  1. Save signed content to media storage

  2. Save data to rule_engine_rules collection (Mongo DB) according to https://e-health-ua.atlassian.net/wiki/spaces/EH/pages/17049387155

Request structure

...

See on Apiary

Authorize

  • Verify the validity of access token

    • in case of error - return 401 (“Invalid access token”) in case of validation fails

  • Verify that token is not expired

    • in case of error - return 401 (“Invalid access token”)

  • Check user scopes in order to perform this action (scope = 'rule_engine_rule:write')

    • return 403 (“Your scope does not allow to access this resource. Missing allowances: rule_engine_rule:write”) in case of invalid scope(s)

...

  • Check name, code and value block is submitted

    • in case of error - return 422 ('required property <property> was not present')

  • Check that rule engine rule with code is unique (extract active rule_engine_rule with the same code.system and code.value)

    • in case of error - return 409 ("Rule engine rule with such code and system already exists")

Processing

...

Response structure

...

See on Apiary

Post-processing processes

...

HTTP status codes

...