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

Skip to end of metadata
Go to start of metadata

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

Compare with Current View Page History

« Previous Version 3 Next »

Purpose

This WS allows to find rule engine rules in Admin panel using search params.

Key points

  1. This is a graphQl query method used in Administration panel only.

  2. Only authenticated and authorized NHS employee with appropriate scope can search Rule engine rules.

Specification

Link

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

Resource

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

Scope

rule_engine_rule:details

Scope для доступу

Components

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

Microservices

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

Protocol type

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

Request type

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

Sync/Async

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

Public/Private/Internal

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

 Request example
{
  "category": {
    "coding": [
      {
        "system": "eHealth/composition_categories",
        "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": "2020-07-26T15:22:53.403Z"
      }
    }
  ],
  "subject": {
    "type": {
      "coding": [
        {
          "system": "eHealth/composition",
          "code": "string"
        }
      ],
      "text": "string"
    },
    "value": "e49abc30-6d17-11ea-b83c-673680173afa"
  },
  "encounter": {
    "type": {
      "coding": [
        {
          "system": "eHealth/composition",
          "code": "string"
        }
      ],
      "text": "string"
    },
    "value": "e49abc30-6d17-11ea-b83c-673680173afa"
  },
  "author": {
    "type": {
      "coding": [
        {
          "system": "eHealth/composition",
          "code": "string"
        }
      ],
      "text": "string"
    },
    "value": "e49abc30-6d17-11ea-b83c-673680173afa"
  },
  "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
    }
  ]
}

Logic

Render a response according to search params.

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:details')

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

Request data validation

Validate legal entity

  • Extract client_id from token.

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

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

  • Check client type (type = NHS)

    • In case of error - return 403 ('You don't have permission to access this resource')

Processing

Search with a few params performs according to the logical AND rule.

  1. id. Search by rule_engine_rules.id (used to get rule engine rule details)

  2. name. Search by rule_engine_rules.name

  3. is_active. Search by rule_engine_rules.is_active

  4. code.system. Searches by rule_engine_rules.code.system

  5. code.value. Searches by rule_engine_rules.code.value

Response structure

See on Apiary

 

Post-processing processes

 

 

HTTP status codes

 

  • No labels