⚙️
API Reference
  • Introduction
  • Features
  • Roadmaps & Requests
  • Frequently Asked Questions
  • Release notes
  • 💡START HERE
    • Terminology
    • Identity and Access Management (IAM)
      • Overview
      • Users in IAM
      • Policies in IAM
      • Roles in IAM
      • Security best practices
    • Dynamic Objects
      • Object Definition
      • Field Definition
      • Data Validation
      • Data Security
        • Encryption
      • Version Control
      • Audit Logs
    • System Architecture Diagram
    • How-To Guides
      • Clinic Project
  • 🔌CORE API Reference
    • Overview
    • Auth
    • Projects
    • Organization
    • Users
    • Roles
    • Policies
    • Objects
    • Item
    • Files
    • Notifications
    • API Request History
    • Auto-Documentation
    • Branches & Merging
    • API Performance
  • ☁️[Coming SOON] YOUR ACCELERATOR PLATFORM ACCOUNT
    • Help and Support
    • Account Page
    • Billing
    • Upgrading an Instance
    • Adjust Server Performance
    • Custom Domain
    • Change Server Region
    • Manage Team
    • API Rate Limit
    • Developer API
  • 🔓SECURITY AND COMPLIANCE
    • Best Practices
    • SOC 2 Type 2 & SOC 3
    • GDPR
    • HIPAA
    • ISO 27001:2013
    • ISO 9001:2015
    • Penetration Testing
  • Accelerator Platform - Core APIs
  • Identity and Access Management
Powered by GitBook
On this page
  1. START HERE
  2. How-To Guides

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

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

REQUEST BODY

{ 
  "name": "providerDataAccess", 
  "label": "Provider Data Access", 
  "version": "2023-01", 
  "type": "ObjectControl", 
  "object": "Providers", 
  "fields": { 
    "read": "*", 
    "write": ["name"] 
  }, 
  "condition": { 
    "stringEquals": { 
    "email": "{{user.email}}" 
    } 
  } 
} 

RESPONSE

200 
<Provider-Data-Access-Policy-Id> 
  • 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

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

REQUEST BODY

{ 
  "name": "ProvidersAccessToPatientsData", 
  "label": "Providers Access To Patients Data", 
  "version": "2023-01", 
  "type": "ObjectControl", 
  "object": "Patients", 
  "fields": { 
    "read": "*" 
  }, 
  "condition": { 
    "stringEquals": { 
      "provider": "{{user.id}}" 
    } 
  } 
}  

RESPONSE

200 
<Providers-Access-To-Patients-Data-Policy-Id>  
  • 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

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

REQUEST BODY

{ 

  "name": "patientDataAccess", 
  "label": "Patient Data Access", 
  "version": "2023-01", 
  "type": "ObjectControl", 
  "object": "Patients", 
  "fields": { 
    "read": ["name", "email", "provider"], 
    "write": "*" 
  }, 
  "condition": { 
    "stringEquals": { 
      "email": "{{user.email}}" 
    } 
  } 
} 

RESPONSE

200 
<Patients-Data-Access-Policy-Id> 
  • 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

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

REQUEST BODY

{ 
  "name": " patientsAccessToProviders ", 
  "label": " Patients Access to Providers", 
  "version": "2023-01", 
  "type": "ObjectControl", 
  "object": "Providers", 
  "fields": { 
    "read": ["_id", "name", "email" ], 
  }, 
  "condition": {} 
  } 
}  

RESPONSE

200 
<Patients-Access-to-Provider-Policy-Id>   
  • 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

{ 
         "Authorization": "bearer <Provider -AuthToken>"
}

REQUEST BODY

[ 
  { 
    "name": "[Name of the Provider]",  
    "email": "[Email of the Provider]" 
  } 
] 

RESPONSE

200 
<n> of <n> items inserted successfully    
  • 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

{ 
         "Authorization": "bearer <Provider-AuthToken>"
}

RESPONSE

200 
<list of all Providers>  
  • 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

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

REQUEST BODY

{ 

  "Type": "email", 
  "ContentType": "html", 
  "Subject": "Provider Invitation", 
  "SenderName": "[Name of the Email Sender]", 
  "SenderEmail": "[Email Address of the Sender]", 
  "RecipientList": [ "<Email of the Provider>" ], 
  "TemplateId": "user_invitation", 
  "Vars": { 
    "firstName": "[Name of the Provider]", 
    "role": "Provider", 
    "orgName": "Clinic.org" 
    } 
} 

RESPONSE

200 
User with id <user-id> successfully invited     
  • 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

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

REQUEST BODY

{ 
  "email": "[Email of the Provider]", 
  "orgDomain": "clinic", 
  "invitationCode": "[Invitation Code for the Provider]", 
  "password": "[Password of the account]"   
} 

RESPONSE

200 
<provider-id>      
  • 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

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

RESPONSE

200 
Access Token     
  • 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

{ 
         " Authorization ": "bearer <Patient-AuthToken>"
}

REQUEST BODY

[ 
    { 
        "name": "[Name of the Patient]",  
        "email": "[Email of the Patient]", 
        "provider": "<provider-item-Id>" 
    } 
] 

RESPONSE

200 
<n> of <n> items inserted successfully     
  • 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

{ 
         "Authentication": "bearer <Patient-AuthToken>"
}

RESPONSE

200 
<list of all Patients>  

PreviousHow-To GuidesNextOverview

Last updated 2 years ago

💡