Clinic Project

Here is a tutorial for creating a "Clinic" project in Accelerator Platform -

  • Sign-in as root user in the accelerator platform instance.

  • As a root user, create a Clinic organization using the below code

Create Clinic Organization

POST

https://api.accelerator-platform.com/<project-id>/v1/Organizations

REQUEST HEADER

{ 
        "Authorization": "bearer <Project-Admin-AuthToken>" 
}

RESPONSE

200 
<Organization-Id> 
  • Two user types will be created in the Clinic organization : Providers and Patients.

  • Create Provider Object with fields like Name and Email using the below code -

Create Provider Object

POST

https://api.accelerator-platform.com/<project-id>/v1/CreateObject

REQUEST HEADERcode

{ 
        "Authorization": "bearer <Project-Admin-AuthToken>" 
}

REQUEST BODY

{ 
    "name": "Providers", 
    "containsUsers": true, 
    "fields":[ 
      { 
          "type": "text", 
          "name": "name", 
          "label": "Name", 
          "validators": { 
              "isRequired": true, 
              "minChars": 3, 
              "maxChars": 50 
          } 
      }, 
      { 
          "type": "email", 
          "name": "email", 
          "label": "Email", 
          "validators": { 
            "isRequired": true, 
            "isUnique": true, 
            "regex": "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$" 
          } 
      } 
    ] 
 }

RESPONSE

200 
<Providers-object-id>  
  • Create Patient Object with fields like name, email, provider using the below code -

Create Patient Object

POST

https://api.accelerator-platform.com/<project-id>/v1/CreateObject

REQUEST HEADER

{ 
        "Authorization": "bearer <Project-Admin-AuthToken>" 
}

REQUEST BODY

{ 
    "name": "Patients", 
    "containsUsers": true, 
    "fields":[ 
      { 
          "type": "text", 
          "name": "name", 
          "label": "Name", 
          "validators": { 
              "isRequired": true, 
              "minChars": 3, 
              "maxChars": 50 
          } 
      }, 
      { 
          "type": "email", 
          "name": "email", 
          "label": "Email", 
          "validators": { 
            "isRequired": true, 
            "isUnique": true, 
            "regex": "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$" 
          } 
      }, 
      { 
          "type": "reference", 
          "name": "provider", 
          "label": "Provider", 
          "validators": { 
              "isRequired": true 
          }, 
          "lookup":{ 
              "ObjectId": "<Providers-object-Id>", 
              "returnedFields": [ 
                  "name", 
                  "email" 
              ] 
          } 
      } 
    ] 
} 

RESPONSE

200 
<Patients-object-id> 
  • Both Providers and Patients will have different policies to accommodate their respective requirements. Create Provider's data access policy using the below code -

Create Provider's Data Access Policy

POST

https://api.accelerator-platform.com/<project-id>/v1/CreatePolicy

REQUEST HEADER

REQUEST BODY

RESPONSE

  • As Providers can access the data of Patient, create Provider's Access To Patients Data using the below code -

Create Policy for Provider's to Access Patients Data

POST

https://api.accelerator-platform.com/<project-id>/v1/CreatePolicy

REQUEST HEADER

REQUEST BODY

RESPONSE

  • Create Patient's data access policy using the below code -

Create Patient's Data Access Policy

POST

https://api.accelerator-platform.com/<project-id>/v1/CreatePolicy

REQUEST HEADER

REQUEST BODY

RESPONSE

  • As Patient's can access the basic information of the Provider, create Patient’s Access to Providers using the below code -

Create Policy for Patient's to Access Provider Data

POST

https://api.accelerator-platform.com/<project-id>/v1/CreatePolicy

REQUEST HEADER

REQUEST BODY

RESPONSE

  • As root user, add data into Provider's Object using below code -

Add Providers into Provider's Object

POST

https://api.accelerator-platform.com/<project-id>/v1/AddItems/Providers

REQUEST HEADER

REQUEST BODY

RESPONSE

  • View the list of providers in Provider's Object using the below code

List of all the providers into Provider's Object

GET

https://api.accelerator-platform.com/<project-id>/v1/GetItems/Providers

REQUEST HEADER

RESPONSE

  • As root user, invite Providers who can later invite Patients using the below code

Add Providers into the Accelerator Platform

POST

https://api.accelerator-platform.com/<project-id>/v1/InviteUser/<Provider-Role-Id>?sendInvite=true&sendInviteRole=<Patient-Role-Id>

REQUEST HEADER

REQUEST BODY

RESPONSE

  • Once Provider receives the invite, they can register and login into the platform using the below code -

Provider Registration and Login

POST

https://api.accelerator-platform.com/<project-id>/v1/Register

REQUEST HEADER

REQUEST BODY

RESPONSE

  • Once registration is complete, provider can authorize them using below code -

Authorize Provider

GET

https://api.accelerator-platform.com/<project-id>/v1/Authorize?email=<Email of the the Provider>&password=<Password>

REQUEST HEADER

RESPONSE

  • Once Provider login into the platform, they can start adding patients data using the below code-

Add Patient into Patient's Object

POST

https://api.accelerator-platform.com/<project-id>/v1/AddItems/Patients

REQUEST HEADER

REQUEST BODY

RESPONSE

  • View the list of patient using the below code

List of all the patients into Provider's Object

GET

https://api.accelerator-platform.com/<project-id>/v1/GetItems/Patients

REQUEST HEADER

RESPONSE

Last updated