MCI Patient APIs

MCI Patient APIs



1. Format

The API is based on REST convention and would use JSON as the default data format.

2. Authentication

All APIs described below need authentication. The client_id and From are given when registering with the Identity Provider. The signin API of Identity Provider should be used to get the auth token(To be provided in the "X-Auth-Token" header). Refer the Identity Provider page for more information on how to use the Identity Provider APIs. 

3. Validations

For Validations on the API fields below and codes used refer this page.

Described below are the various API definitions.  

  1. Create Patient API

    Create Patient API can be called with or without "hid" field.

    1. Creating a patient without the "hid" field will automatically create a Health ID for the patient. The response returns the created Health ID.

    2. Creating a patient with the "hid" field. (The organization for which  a Health ID was assigned, will only be able to create a patient using that Health ID)
      If the organization to whom the Health ID was assigned and the organization trying to create the patient is different the create patient will fail. 
      In addition to the above example payload it should have field hid as well. ("hid" = "9xxxxxxxxxx")







  2. Update Patient API :



  3. Get Patient API :





Errors:

Error Categories: (Application error code series)

  1. Validation error - 1000

  2. Invalid request - 2000

  3. Permission Error - 3000

Validation Error-

  1. Required - 1001

  2. Pattern - 1002

  3. DataType - 1003

  4. Incorrect Value - 1004 (Like registries lookup)

  5. Server Error - 500

  6. Dependency error -1005

Invalid Request-

  1. Invalid JSON - 2001

  2. Unrecognized field - 2002

Permission Error-

  1. Field not permitted for the request -3001

  2. Field update not permitted -3002



100Char, space, numbers, alphabets, special characters, all accepted.