Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

REST API method / Метод REST API (настанова) (remove the link block before publishing the document)

...

Page Properties
idpage_properties_method_REST API

Document type

Метод REST API

Document title

[Document status] REST API [Назва методу] [ID методу]

Guideline ID

GUI-0011

Author

@

Document version

1

Document status

DRAFT

Date of creation

ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD)

Date of update

ХХ.ХХ.ХХХХ (дата зміни версії)

Method API ID

API-005-009-003-0188

Microservices (namespace)

IL

Component

Legal Entities

Component ID

COM-005-009

Link на API-специфікацію

https://uaehealthapiehealthmisapi1.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/licenses/create-license

Resource

{{host}}/api/licenses

Scope

license:write

Protocol type

REST

Request type

POST

Sync/Async

Sync

Public/Private

Public

...

Save new license in licenses table (PRM DB)

Configuration parameters

Description of the configuration parameters that are used when processing a request in the system

Dictionaries

  • LICENSE_TYPE

  • LEGAL_ENTITY_<LEGAL_ENTITY_TYPE>_ADDITIONAL_LICENSE_TYPES

...

  • Check that additional license was passed in request ($.is_primary = false)

    • in case of error - return 422 (“Only additional license can be created”)

  • Check that license type in request exists in LICENSE_TYPE dictionary

    • in case of error - return 422 (“value is not allowed in enum”)

  • Check that license type in request exists in chart parameter LEGAL_ENTITY_<LEGAL_ENTITY_TYPE>_ADDITIONAL_LICENSE_TYPES based on legal entity type

    • in case of error - return 409 (“Legal entity type and license type mismatch")

  • Check that legal entity has active primary license (request: select id from licenses where is_active=true and is_primary=true and legal_entity_id=$.legal_entity.id and (expiry_date >= current_date() or expiry_date is null); returns at least one value)

    • in case of error - return 404 (“No active primary license found for legal entity”)

  • Check that legal entity does not have license with type same as in request ($.type)

    • in case of error - return 409 (“License with type $.type is already present”) where $.type = license type from request

Validate license dates

  • Check that $.issued_date is not greater than $.active_from_date

    • in case of error - return 422 (“License can not be issued later than active from date”)

  • Check that $.active_from_date is not greater than $.expiry_date

    • in case of error - return 422 (“License can not have active from date later than expiration date”)

  • Check that $.expiry_date is not lesser than current_date

    • in case of error - return 409 (“License is expired”)

Processing

A list of processes related to receiving, changing or transmitting data according to the logic defined in the REST API

Response structure examples

...

Post-processing processes

Description of actions performed on data after processing

Technical modules where the method is used

List of pages describing technical modules where the method is used

Page Properties Report
headingsID ТМ, Статус
cqllabel = "tr-mis"

...