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

chevron-rightCreate Clinic Organizationhashtag

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 -

chevron-rightCreate Provider Objecthashtag

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 -

chevron-rightCreate Patient Objecthashtag

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 -

chevron-rightCreate Provider's Data Access Policyhashtag

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 -

chevron-rightCreate Policy for Provider's to Access Patients Datahashtag

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 -

chevron-rightCreate Patient's Data Access Policyhashtag

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 -

chevron-rightCreate Policy for Patient's to Access Provider Datahashtag

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 -

chevron-rightAdd Providers into Provider's Objecthashtag

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

chevron-rightList of all the providers into Provider's Objecthashtag

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

chevron-rightAdd Providers into the Accelerator Platformhashtag

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 -

chevron-rightProvider Registration and Loginhashtag

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 -

chevron-rightAuthorize Providerhashtag

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-

chevron-rightAdd Patient into Patient's Objecthashtag

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

chevron-rightList of all the patients into Provider's Objecthashtag

GET

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

REQUEST HEADER

RESPONSE

Last updated