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

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 2 Next »

Purpose

This WS give the opportunity to create unidentified person in eHealth. It means that person can be created w/o any information about it but requires a medical identification with set of medical events.

Specification

TBD

Service logic

  1. Only authenticated and authorized OWNER, SPECIALIST, ASSISTANT, RECEPTIONIST employees can register prepersons.

  2. Prepersons can be registered in OUTPATIENT and EMERGENCY legal entities.

  3. Prepersons shoul be registered only with predefined set of medical events (package).

  4. Preperson registered w/o entry in MPI. Only as document in patients collection.

  5. Service should generate patient_id in MongoDB, but return person_id (w/o creating entry in MPI)

Authentication

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Check user scopes in order to perform this action (scope = 'preperson:write')

    1. Return 403 in case invalid scope(s)

Validate legal entity

Check that legal entity is active (status = ACTIVE, SUSPENDED) and belongs to the user

  1. Extract client_id from token (token.client_id == legal_entity_id)

  2. Check legal entity status (status = ACTIVE, SUSPENDED)

    1. In case of error - return 409 (Legal entity must be ACTIVE or SUSPENDED)

Validate request

  1. Validate request using schema (TBD)

  2. Required set of medical events (TBD)

Validate external_id

  1. Check external_id is not empty.

  2. Check external_id is unique ? (unique within le?)

Save object to Mongo DB

Insert patient and set of submitted medical events

  1. patients collection

Parameter

Source

Description

_id

string

Autogenerated hash.

status

string

Status. By default is “active”

inserted_by

uuid

Extract user from token

inserted_at

timestamp

Get current date-time

updated_by

uuid

Extract user from token

updated_at

timestamp

Get current date-time

2. medical event collections (TBD)

  • No labels