Versions Compared

Key

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

...

  • ADULT_AGE

  • DECLARATION_TERM

  • no_self_auth_ag 

Request structure

Example:

...

Expand
titleJson schema
Code Block
 {
  "$schema": "http://json-schema.org/declaration_request_newdraft-07/schema#",
  "type": "object",
  "properties": {
    "person_id": {
      "type": "string"
    },
    "employee_id": {
      "type": "string"
    },
    "division_id": {
      "type": "string"
    },
    "authorize_with": {
      "type": "string"
    },
    "parent_declaration_id": {
      "type": "string"
    }
  },
  "required": [
    "person_id",
    "employee_id",
    "division_id"
  ]
}

...

  • validate person_id UUID

    • in case error return 422

  • search person by person_id in MPI 

    • in case error return 404, "Such person doesn't exist"

  • validate person.auth_method != NA

    • in case error return 422, "Person must have authentication method"

  • validate person.status = ‘active’ and is_active =true

    • in case error return 404, "Such person doesn't exist"

Validate person verification status

  • validate patient's verification_status is not equal to NOT_VERIFIED.

    • in case of error return 409, "Patient is not verified"

Validate authorize_with

The person can pass the id of his auth_method which he wants to confirm the create declaration request. The necessary auth method can be found by making Get person's auth methods

...

Expand
titleResponse example (Code 201)
Code Block
{
  "meta": {
    "code": 201,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda6617aeec-15e2-4d6f-b9bd-53559c358f97#17810"
  },
  "data": {
    "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
    "start_date": "2017-03-02",
    "end_date": "2017-03-02",
    "person_id": "4d0d790c-cbf1-44f5-ab21-ba8db67da161",
    "employee_id": "1a8b10ea-ba09-40f2-8f9e-55608e9208c6",
    "division_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "declaration_number": "0000-12H4-245D",
    "declaration_id": "8311ab82-e341-4da0-8a95-235ec9885e23",
    "parent_declaration_id": "8c7753fc-a647-435f-8e43-4ff4546431f6",
    "status": "NEW",
    "channel": "MIS",
    "authorize_with": "cc949559-5dfe-420f-ac05-065e443b2cc6"
  },
  "urgent": {
    "authentication_method_current": {
      "type": "OTP",
      "number": "+38093*****74"
    },
    "documents": [
      {
        "type": "PASSPORT",
        "url": "https://storage.ehealth.world"
      }
    ]
  }
}

Expand
titleResponse example (Code 422)
Code Block
{
  "meta": {
    "code": "422",
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda6617aeec-15e2-4d6f-b9bd-53559c358f97#17810"
  },
  "error": {
    "type": "unverified",
    "message": "Person not found"
  }
}

...