# What is SPICE?

## Overview

SPICE, an open-source digital platform designed with and for health systems, patients, and communities. SPICE is focused on data-driven, outcomes-focused care at both the community and primary care levels. The platform is certified as a [digital public good](https://app.digitalpublicgoods.net/a/10764), and we work with Ministries of Health to plan for long-term country-ownership.

Digitization is not enough. Data collection alone does not drive outcomes. At Medtronic LABS we enable health systems to collect high quality data and *use* data insights to make decisions that drive outcomes.

Rather than community health and facility level care operating in silos, SPICE bi-directionally links community health work with facility services with closed-loop referrals and counter-referrals. Community Health Workers receive targeted community-based follow-up for longitudinal patient management based on clinical algorithms. At the facility level doctor visits, pharmacy and lab workflows are augmented clinical decision support. Ultimately, the community and primary care model enabled by SPICE drives improved health outcomes for patients.

Healthcare delivered at the community level delivered via community health workers has been disconnected from care delivered within formal health system. With SPICE-enabled care models, the patient journey is seamless regardless of whether they visit a facility, receive an SMS, talk on the phone with a provider, or welcome a visit from a community health worker. Closing the loop between facilities and communities is one of the keys to driving treatment plan adherence and ultimately health outcomes.

## SPICE Features

SPICE focused on data-driven, outcomes-focused care at both the community and primary care levels. The platform enables health systems to collect high quality data, coordinated across levels of care, and use data insights to make decisions that drive improved clinical outcomes. SPICE supports a range of primary care areas including diabetes, hypertension, ante- & post-natal care and mental health.

SPICE facilitates community based screening & referrals based on a patients’ risk level and refers for further assessment. SPICE enables a bi-directional linkage between the community and facilities levels, seamlessly linking referrals and coordinating care. SPICE has built in SMS messaging to remind patients to seek care at critical points in the patient journey.

At the facility level, SPICE provides the ability for a clinician to perform a medical review, prescribe medications, and order investigations. SPICE generates a customized treatment plan for the patient based on their CVD Risk level (calculated from the WHO Hearts algorithm) which includes a combination of community-based assessment and facility medical reviews. SPICE generates a longitudinal patient record for the physician to track progress over time and meaningfully impacts clinical outcomes.

## Impact

To date, SPICE-enabled programs have screened 500,000 patients and enrolled 230,000 patients and measurably improved the lives of over 120,000 patients globally. In multiple peer-reviewed studies, Medtronic LABS has shown significant decreases in clinical indicators such as blood pressure and blood glucose for patients across multiple sub-Saharan African countries.

Specifically, our outcomes data shows:

* Our Journal of Hypertension publication reports a-15.2 mmHg reduction in systolic blood pressure in the uncontrolled subgroup.
* Our Journal of Clinical Hypertension reports-17.6 mmHg reduction in systolic blood pressure in the uncontrolled subgroup
* Real-world evidence studies of 52,000 hypertension over 6 months across four countries shows a – 7.9mmHg reduction in blood pressure, control rates improving by 17.7% and shifts in hypertension severity towards less severe.
* Real-world evidence studies over 20,800 diabetic patients over 6 months across four countries show improvement in both fasting and random blood glucose control for the population.


# SPICE App Workflows

## Patient Journey

The SPICE application enables a seamless patient journey as a patient interacts with a variety of health system users.

The following is a typical patient journey for a sample patient named Mary:

1. Mary is screened at a community event by a community health worker (CHW) equipped with SPICE. At the screening, Mary's blood pressure is found to be elevated and she is referred for further assessment to the nearest facility.
2. Mary receives a SMS reminder 3 days after her community screening to remind her to visit the facility for a medical review.
3. Mary visits the facility where she is seen by a provider who confirms her diagnosis after ordering a series of lab tests.
4. Mary is enrolled in SPICE and the SPICE application calculates her CVD risk score and determines a customized treatment plan (pending confirmation from a provider) for Mary which includes weekly community-based follow-up assessments for BP checks and monthly facility visits for medicals reviews.
5. Mary returns home and is visited by a CHW the next week for her assessment. The CHW follows up with her at the weekly cadence to build out her longitudinal patient record.
6. After 1-month of at home visits, Mary visits the facility again for a medical review where she receives a prescription from the doctor.
7. Steps 4-5 repeat continuously by seamlessly linking the community and facility activities.

## Application Workflows

### Screening

The Screening feature is a crucial component of SPICE, playing a pivotal role in the early detection and management of disease. SPICE enhances the reach and accessibility of healthcare services by enabling health workers to conduct screenings across various settings and record data both online and offline.

The offline-first screening workflow collects information such as age, gender, smoking status, blood pressure, and weight to determine who should be referred for further assessment. SPICE uses a risk algorithm to identify patients to refer to the facility for further assessment. The utilization of this risk algorithm ensures proactive healthcare management, aiding in the early referral of patients. Simultaneously, the platform computes a patient's Cardiovascular Disease (CVD) risk based on the [WHO HEARTS](https://www.who.int/publications/i/item/9789240001367), a Technical package for cardiovascular disease management in primary health care. The primary users of the screening workflow is community health workers (CHWs) in the community and nurses at the facility.

### Enrollment

The Enrollment feature in the SPICE platform is a crucial step in the patient management process. The enrollment process creates a customized treatment plan for the patient based on their CVD risk. For example, a High Risk patient will have weekly assessments and monthly medical reviews. The customization of the treatment plan enables the health workers to prioritze patients for follow-up. This streamlines the process of identifying, referring, and managing patients, reducing the burden on healthcare workers to follow-up with all patients at the same intervals. For patients that are referred from screening, the app reduces manual effort by auto-populating fields from prior screenings. This feature saves time for healthcare providers and ensures consistency and accuracy of patient data.

### Assessment

The Assessment feature is vital for the management and ongoing monitoring of enrolled patients. The information collected through this feature, such as blood pressure, blood glucose levels, and medication compliance, facilitates the continuous monitoring of a patient's health status. It enables the healthcare professional to take a proactive approach to patient care, thereby managing non-communicable diseases more effectively. Moreover, the assessment feature is integrated with a risk algorithm that updates the cardiovascular disease (CVD) risk level based on blood pressure and blood glucose values, in alignment with the WHO HEARTS algorithm. This not only assists in refining treatment plans but also helps in reducing the burden of CVD in the community.

### Medical Review

The Medical Review feature in SPICE is a vital tool designed for medical professionals that enhances the capacity for assessment, monitoring, and decision-making, especially for patients suffering from chronic conditions such as hypertension and diabetes. Leveraging this feature, healthcare providers can seamlessly conduct medical reviews, prescribe treatment plans, prescribe medications, recommend lab tests, and maintain thorough documentation of patients' health profiles, thereby optimizing healthcare delivery in underserved communities.

### Pharmacy

The Pharmacy features in the SPICE platform is integral to delivering prescribed medications to patients. Pharmacists can view comprehensive details about each prescribed medication, including the name, dosage, form, frequency, prescribed days, and additional comments from the physician. The feature allows for better adherence to treatment plans by enabling pharmacists to provide specific instructions for medication intake. Moreover, it keeps track of the dispensation history and allows pharmacists to document discrepancies, improving the transparency and efficiency of the medication dispensation process.

### My Patients Feature

The "My Patients" feature in SPICE allows healthcare professionals to efficiently manage and monitor their assigned patients within the platform. The "My Patients" feature brings convenience and organization to healthcare professionals by offering a centralized hub to access, track, and manage patient information. It enhances patient care coordination, improves communication, and facilitates better healthcare decision-making.

##


# Screening

The Screening Summary page provides the referral status (Referred or Not Referred) based on the screening results. Alongside this, it also displays the calculated CVD risk as per the WHO HEARTS algorithm. If a referral is recommended, you can link the patient to the nearest facility from a dropdown menu.

After this, click the "Done" button to finalize the screening, and return to the Screening Home page.

The Screening Home page displays daily statistics on the number of screenings and referrals, offering a quick overview of daily operations. After completing each screening, immediately initiate another one by selecting the "Screen Patient" button.

<figure><img src="/files/tgVV8wq9aCbSUwZVQhhX" alt="" width="375"><figcaption><p>Screen a patient in SPICE</p></figcaption></figure>

## Screening Form Structure in the Feature - Tabular Format

<table data-header-hidden><thead><tr><th width="216"></th><th></th></tr></thead><tbody><tr><td>Field Name</td><td>Description</td></tr><tr><td>National ID</td><td>Enter the patient's National ID. This ID is issued by the government to its citizens/residents.</td></tr><tr><td>First Name, Middle Name, Last Name</td><td>Enter the patient's first name, middle name, and last name. The first and last names are mandatory.</td></tr><tr><td>Mobile Number</td><td>Enter the patient's mobile number. If unavailable, use a mobile number of a friend, family member, or CHV.</td></tr><tr><td>Mobile Number Category</td><td>Select the category that best describes the mobile number you provided: Personal, CHV, Friend, or Family.</td></tr><tr><td>Landmark</td><td>Enter a well-known landmark near the patient's residence.</td></tr><tr><td>Gender</td><td>Select the gender of the patient. This is a mandatory field.</td></tr><tr><td>Date of Birth</td><td>Enter the patient's date of birth. If entered, the age field will populate automatically.</td></tr><tr><td>Age</td><td>Enter the patient's age if the date of birth is unknown. This is a mandatory field.</td></tr><tr><td>Height (cm)</td><td>Enter the patient's height in centimeters.</td></tr><tr><td>Weight (kg)</td><td>Enter the patient's weight in</td></tr><tr><td>Blood Pressure Measurement Instructions</td><td>A clickable guide providing step-by-step instructions to measure Blood Pressure.</td></tr><tr><td>Systolic (mmHg), Diastolic (mmHg), Pulse (BPM)</td><td>Enter these blood pressure and pulse values in the given fields. The sequence should be maintained starting from the systolic value in the 1st set to the diastolic value in the second set for the input fields to be enabled.</td></tr><tr><td>Blood Glucose (mg/dL)</td><td>Enter the blood glucose value captured during the assessment.</td></tr><tr><td>Time of Last Meal</td><td>After entering blood glucose values, this field will be enabled. Select the date and time of the last meal the patient consumed.</td></tr></tbody></table>

##

&#x20;


# Enrollment

The feature also facilitates data entry, with an automatic population of parameters from previous screenings. In cases where patients are enrolled directly without screening, details can be manually entered.

## Enrollment Workflow

To use the Enrollment feature, follow these steps:

1. Ensure you have an active internet connection and log in to the SPICE platform app using your SPICE account credentials.
2. Once logged in, navigate to the Enrollment option on the Home page.
3. Click on the Enrollment option, and you will be navigated to the Terms and Conditions page. Enter the patient's initials in the relevant textbox, then accept the Terms and Conditions.
4. You will then be directed to the Enrollment form page.
5. Enter the patient's National ID and click on the Search button.
6. If the patient has been referred from screening, their details will auto-populate in the Enrollment form. If not, you will receive a message and be asked to manually enter the parameters.
7. Fill in the necessary details according to the Enrollment form structure (outlined in the next section).
8. After submitting the form, you will be shown an Enrollment summary with patient data and a calculated CVD risk level, alongside a provisional treatment plan.
9. Confirm by clicking on the 'Done' button, and you will be redirected back to the home page.

<figure><img src="/files/ztsxqB7hneV4xt0ysa2P" alt=""><figcaption><p>Enroll a patient in SPICE</p></figcaption></figure>

## Structure of the Enrollment form for manual input:

<table data-header-hidden><thead><tr><th width="182">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>National ID</td><td>Enter the person's National ID issued by the government.</td></tr><tr><td>First Name</td><td>Enter the person's first name. This is a mandatory field.</td></tr><tr><td>Middle Name</td><td>Enter the person's middle name, if applicable.</td></tr><tr><td>Last Name</td><td>Enter the person's last name. This is a mandatory field.</td></tr><tr><td>Mobile Number</td><td>Enter the person's mobile number. If they don't have one, you can use a relative's or your own.</td></tr><tr><td>Mobile Number Category</td><td>Choose the type of mobile number provided from personal, CHV, Friend, or Family options.</td></tr><tr><td>County</td><td>Enter the person's County of residence.</td></tr><tr><td>Sub-County</td><td>Enter the person's Sub-county of residence.</td></tr><tr><td>Date of Birth</td><td>Select the person's date of birth. This will auto-fill the 'Age' field.</td></tr><tr><td>Age</td><td>If the date of birth is unknown, manually enter the person's age. This is a mandatory field.</td></tr><tr><td>Smoking Related Question</td><td>A mandatory 'Yes' or 'No' question about the person's smoking habits.</td></tr><tr><td>Height (in cm)</td><td>Enter the person's height in centimeters.</td></tr><tr><td>Weight (in kg)</td><td>Enter the person's weight in kilograms.</td></tr><tr><td>Temperature</td><td>Measure and enter the temperature</td></tr></tbody></table>

##

&#x20;


# Assessment

## Feature Overview

Patient attends a community-based location or a health care facility (e.g. clinic, hospital) at prescribed intervals for their routine BP or BG assessment or takes it at home. The Health Screener/ Community Health worker will be able to do the assessment for the patient online. Based on the Blood Glucose and Blood Pressure values of the patient, our risk algorithm updates the CVD Risk level. The features of this assessment - blood pressure, blood glucose, reported symptoms and medication compliance data are manually captured in the app by the health screener and are shown to the physician as part of the respective patient's Medical Review.

## Assessment Workflow

1. Open the SPICE mobile app.
2. Login using the credentials associated with your SPICE account.
3. On the Home page, select the Assessment option.
4. Enter the National ID in the search field and click on the search button.
5. The patient's form will appear on the screen.
6. Proceed by entering the required details into the form, then click on the submit button.
7. Upon submission, you'll be redirected to the Assessment Summary page displaying updated CVD risk level, average BP, BMI, and Blood Glucose values.
8. After reviewing the results based on the captured values during the assessment, click on the "Done" button to complete the assessment.

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc8r5CWDYQD5YGrlFur8R%2Fuploads%2Fgit-blob-9777b395fdb7e34d4e3e8a5f8c74da9d2bf63b77%2FUntitled%20(Instagram%20Post%20(Square)).gif?alt=media" alt=""><figcaption></figcaption></figure>

#### Assessment Form Structure <a href="#assessment-form-structure" id="assessment-form-structure"></a>

Comment

| Parameter                                      | Description                                                                                                                                                                                                                     |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| National ID                                    | Enter the National ID issued by the government to the citizens/residents of the country.                                                                                                                                        |
| Height (in cm)                                 | Measure and enter the patient's height in centimeters.                                                                                                                                                                          |
| Weight (in kg)                                 | Measure and enter the patient's weight in kilograms.                                                                                                                                                                            |
| Temperature                                    | Enter the patient's body temperature measured during the assessment.                                                                                                                                                            |
| Blood Pressure Measurement Instructions        | A clickable guide providing step-by-step instructions to measure Blood Pressure.                                                                                                                                                |
| Systolic (mmHg), Diastolic (mmHg), Pulse (BPM) | Enter these blood pressure and pulse values in the given fields. The sequence should be maintained starting from the systolic value in the 1st set to the diastolic value in the second set for the input fields to be enabled. |
| Blood Glucose (mg/dL)                          | Enter the blood glucose value captured during the assessment.                                                                                                                                                                   |
| Time of Last Meal                              | After entering blood glucose values, this field will be enabled. Select the date and time of the last meal the patient consumed.                                                                                                |
| HbA1c Values                                   | Enter the values for HbA1c, a form of hemoglobin that is chemically linked to a sugar. It helps to identify the average level of plasma glucose concentration.                                                                  |

This feature is an integral part of the SPICE system. The detailed steps provided in this document are intended to enable new users to utilize the Assessment feature effectively.


# My Patients

## **Feature Overview**

The "My Patients" feature provides healthcare professionals with a dedicated workspace to view, search, and manage patient records. It offers a holistic overview of patient information, including medical history, prescriptions, Investigations, and vital signs.&#x20;

Key features of the "My Patients" feature include:

1. Patient Record: Access comprehensive patient profiles containing personal details, medical history, and relevant clinical information.
2. Medical Review: Perform medical reviews, assess patient conditions, and update treatment plans within the platform.
3. Prescriptions: View and manage patient prescriptions, including medication details, dosage, and refill information.
4. Vital Signs: Monitor and record patient vital signs, such as blood pressure, heart rate, and temperature.
5. Progress Tracking: Track patient progress, view trends, and record notes to evaluate treatment effectiveness.

## My Patients Workflow

To effectively utilize the "My Patients" feature, follow these steps:

1. Login: Open the SPICE application and sign in using your credentials. Ensure a stable internet connection for seamless access to patient records.
2. Navigate to "My Patients": Once logged in, locate the "My Patients" section in the app's navigation menu. Click on it to enter the "My Patients" workspace.
3. Search and Select Patient: Use the search functionality to find a specific patient by name, ID, or other identifying information. Select the desired patient from the search results to access their profile.
4. View Patient Information: In the patient profile, review the medical history, prescriptions, Investigations, Diagnosis and vital signs. Familiarize yourself with the relevant information to make informed decisions.
5. Perform Medical Review: Conduct a medical review by assessing the patient's condition, reviewing their medical history, and updating treatment plans accordingly. Document any observations or changes in the patient's condition.
6. Coordinate Care: Collaborate with other healthcare professionals involved in the patient's care. Share information, assign tasks, and communicate updates to ensure coordinated and comprehensive care delivery.
7. Manage Prescriptions: Access the patient's prescription records, review medication details, monitor refill status, and make any necessary adjustments. Ensure accurate and up-to-date medication management.
8. Monitor Vital Signs: Regularly record and monitor the patient's vital signs using the platform's integrated tools. Keep track of changes, identify trends, and make informed decisions based on the recorded data.
9. Track Patient Progress: Continuously evaluate the patient's progress, record notes, and update treatment plans as required. Monitor trends, review previous assessments, and make data-driven decisions to optimize patient care.

<figure><img src="/files/8zPeB8vrDGwRXUboy3Kx" alt=""><figcaption></figcaption></figure>


# Medical Review

## Medical Review Overview

The Medical Review feature allows for two distinctive workflows - the First Medical Review and the Continuous Medical Review. The First Medical Review entails the initial thorough check-up of the patient, diagnosis confirmation, capturing details of current lifestyle, medication, comorbidities, complications, physical examination results, and formulating a suitable treatment plan. The Continuous Medical Review enables the follow-up with the patient, noting their ongoing medical condition, reviewing lab test results, prescribing medication, and updating the treatment plan as required.

## Medical Review Workflow

1. Ensure an active internet connection and sign in to the SPICE mobile app using your SPICE credentials.
2. Navigate to the 'Home' page and select 'Medical Review' to initiate the process.
3. For a first-time review, fill in the various parameters of the 'First Medical Review Form' and for a follow-up visit, select 'Start Medical Review' for the specific patient under the 'My Patients' section.
4. Follow the intuitive workflow to document necessary details, diagnose the patient, and establish a treatment plan.
5. In case of prescriptions or lab tests, search for the required medication or test, add it, and follow the subsequent steps to confirm.
6. Sign and confirm the prescriptions when prompted.
7. After review completion, click on 'Submit' to save the changes.

<figure><img src="/files/cCcilkXl0pftI3PLrsLn" alt=""><figcaption><p>Conduct a Medical Review for the patient in SPICE</p></figcaption></figure>

&#x20;


# Pharmacy

## Feature Overview

The Pharmacy Medication feature assists pharmacists in tracking & dispensing prescribed medications. It provides a detailed view of each medication's attributes and the prescribing physician's details. Pharmacists can provide specific instructions and document any discrepancies between the prescribed and dispensed quantities, all within the platform.

## Pharmacist Workflow

To use the Pharmacy features, follow these steps:

1. Ensure you have an active internet connection and log in to the SPICE platform app using your SPICE account credentials.
2. Once logged in, navigate to the 'Dispense' option on the Home page.
3. Click on the 'Dispense' option. You will be redirected to the 'Search Patient' page.
4. Enter the National ID/Patient ID of the patient in the search bar and click 'Search'.
   1. From the search results, select the patient card for the patient in question.
5. On the patient's page, you will see parameters such as Program ID, National ID, Prescriber, and Prescriber Number, which are mapped from the medical review. The 'Last Refill Date' shows the last time the medication was refilled. The list of prescribed medications will be displayed in a tabular view. Each entry will show details such as Medication Name, Dosage, Form, Frequency, Prescribed Days, and Days Filled.
6. Click on a specific medication to see additional details, such as the date the medication was prescribed and its dosage form. If there are specific instructions for taking the medicine, these will be recorded in the 'Instructions' text box.
7. If the 'Days Filled' is less than the 'Prescribed Days', enter the 'Days Filled' value and click 'Done'. A pop-up will appear, asking for the reason for the quantity difference.
8. Click on 'Reason' and select the appropriate reason for the quantity discrepancy. After selecting the reason, complete the process.

<figure><img src="/files/7k67TxishDvZpXy9h6Ox" alt=""><figcaption><p>Dispense medication in SPICE</p></figcaption></figure>


# Admin Portal

The SPICE Admin Portal is a powerful tool that enables administrators to manage users, facilities, workflows, medication databases, and lab test databases, and customize the platform at the region and account levels.

## Key Features

* User Management: The Admin Portal allows administrators to manage user accounts, including creating, editing, and deactivating user profiles. Administrators can assign roles and permissions to ensure proper access control.
* Facility Management: Administrators have the ability to set up and maintain facilities within the SPICE platform. This includes creating new facilities, managing facility details, and assisting with account setups and resets.
* Workflow Customization: The Admin Portal provides flexible workflows with customizable clinical capabilities. Administrators can on/off clinical workflows according to specific requirements, such as hypertension, diabetes, mental health, maternal health, HIV, TB, and malaria.
* Medication Database Management: The Super Admin, who has master administrative privileges, is responsible for managing the medication database. They can add country-relevant medication information to the web portal database, ensuring accurate and up-to-date medication records.
* Region-Level Customization: The SPICE platform allows for region-level customization, empowering administrators to configure specific settings and features based on the geographical region they are operating in. This ensures alignment with local healthcare practices and guidelines.
* Account-Level Workflow Customization: Administrators can customize workflows at the account level, adapting the platform to suit the unique requirements of each organization or institution. This allows for tailored workflows that align with specific healthcare processes and practices.

## User Roles

The SPICE Admin Portal supports different user roles with varying levels of access and responsibilities. These roles include:

**Super Admin:** The Super Admin is the master administrator responsible for setting up regions, accounts, customization, and user management. They have full control over all aspects of the Admin Portal and can perform all administrative functions.

**Regional Admin:** The Regional Admin manages accounts in specific regions and assists with facility setup, maintenance, and account management. They have the authority to perform account-level administrative tasks and provide support to local administrators.

**Account Admin:** The Account Admin is responsible for managing a specific account within the SPICE platform. They handle account setup, operating unit management, and user creation. Account Admins can perform administrative functions within their assigned accounts.

**OU Admin:** The OU Admin operates at the Operating Unit (OU) level and has administrative privileges within their assigned OU. They can create sites, groups, and users, and perform administrative tasks specific to the OU they manage.

<figure><img src="/files/u37pGvZUFOQngMtmH7UL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/HKuPLCmjhRnHI8ccJFUJ" alt=""><figcaption><p>Heirarchy of the Administrators and their functions</p></figcaption></figure>


# SPICE Users

Understanding the user roles in the SPICE platform is key to effectively navigate the system. In this documentation, we will define each role and its corresponding feature access.

<table><thead><tr><th width="150.33333333333331">User Role</th><th width="385">Description</th><th>Feature Access</th></tr></thead><tbody><tr><td>Health Screener</td><td>The Health Screener is responsible for community based screenings and assessments - Community health worker</td><td>Screening, Assessment</td></tr><tr><td>Health Coach</td><td>The Health Coach role encompasses all of the community-based clinical roles such as CHW, CHV, Peer support group leader, and health coach.</td><td>Screening, Assessment</td></tr><tr><td>Lab Technician</td><td>The LAB technician will receive requests for lab tests from the physician and have the ability to enter test results into the patient record.</td><td>Screening, Assessment, Investigation</td></tr><tr><td>Pharmacist</td><td>The Pharmacist has the ability to view the basic patient record and see the list of prescriptions that a patient has, and they have the ability to dispense medication based on prescriptions.</td><td>Screening, Assessment, Dispense</td></tr><tr><td>HRIO</td><td>The HRIO has access to the Basic patient record and enroll the patient into the program</td><td>Screening, Assessment, Enrolment, My Patients</td></tr><tr><td>Provider</td><td>The Provider role encompasses a Physician who conducts medical review for the patient</td><td>Screening, Assessment, Enrolment, Medical Review, My Patients</td></tr><tr><td>Nurse</td><td>A licensed healthcare professional who is part of the medical team in the facility and practices, supervised by a physician, surgeon and who is skilled in promoting and maintaining health</td><td>Screening, Assessment, Enrolment, My Patients, Dispense</td></tr><tr><td>Physician Prescriber</td><td>A physician who will be able to dispense medication based on the prescription</td><td>Screening, Assessment, Enrolment, Medical Review, My Patients</td></tr></tbody></table>


# Data Privacy & Security

We build technology that prioritizes patient safety, privacy, and security. Our SPICE platform complies with all major international standards including GDPR and HIPPA, and all regional regulations in the countries in which we operate.

**Key Highlights:**

* All data is encrypted at rest and in transit
* Application access is restricted through role-based access and access is audited at set intervals
* Our organization security governance, risk, and compliance framework ensures that our products and processes are robust and risks are appropriately mitigated
* All data used for reporting and analytics is fully de-identified
* Applications are built using security and privacy by design principles, and we perform regular security vulnerability and risk assessments against the latest privacy and security standards.


# Privacy Policy

## Privacy Statement

Please read this privacy statement carefully.

### INTRODUCTION

This Privacy Statement tells you how we protect and use information that we gather through MEDTRONIC LABS SPICE Mobile Application (the “Application” or “App”). This Privacy Statement is intended for a global audience.

This Privacy Statement was last revised on July 29, 2022. We may change the Privacy Statement at any time and for any reason.

Except as written in any other disclaimers, policies, terms of use, or other notices in an Application, this Privacy Statement is a complete agreement between you and MEDTRONIC LABS with respect to your use of the Application. By using MEDTRONIC LABS SPICE Mobile Application (the “Application” or “App”), you agree to the terms of the most recent version of this Privacy Statement. You may be subject to additional terms that may apply when you access particular services or materials on certain areas in this Application, or by following a link from this Application.

The full list of regulations that SPICE complies with is as follows: General Data Protection Regulation (GDPR) Kenya Data Protection Act, 2019 Ghana Data Protection Act, 2012 Tanzania Personal Data Protection Act, 2022.

The Applications are owned and operated by MEDTRONIC LABS. MEDTRONIC LABS is the name we use to refer to our whole business, including MEDTRONIC LABS PBC and any of the companies that it controls, such as its subsidiaries and affiliates. When we use the words "we" or "our," we mean MEDTRONIC LABS. The information we receive, and how we use it, depends on what you do when using the Application.

We collect and use both personal information (information that is identifiable to you personally) and non-personal information about you through the application. Please see below for a definition of personal and non-personal information, and how MEDTRONIC LABS may use them.

### WHAT IS PRIVATE INFORMATION

Personal information is information that we can use to specifically identify you, such as your:

* First Name
* Last Name
* City/Town name
* Telephone number
* Email
* Date of birth
* Account name
* Geolocation information
* Health condition(s) and related health data
* Biometric data
* Hospital/clinic name, address, and phone number
* Information about how you use the App, such as links or functions you may access within the App

### HOW DOES MEDTRONIC LABS COLLECT AND USE YOUR PERSONAL INFORMATION?

We may collect and use personal information from you through this App to provide you with access to the App. You may choose not to provide us with this information, but then you may not be able to access and utilize the App. In addition, we may keep and use your personal information:

* If you are a Patient, to transmit data to your Health Care Provider
* To provide services to you through the App
* To send you notifications
* To respond to your requests
* To develop records, including records of your personal information
* To analyze how people use our App and to research, develop, and improve programs, products, services, and content
* To create a set of data that has only non-personal or de-identified information. In this case, we would remove your personal identifiers (your name, email address, biometric data, etc.) and we may treat it like other non-personal or de-identified information
* To enforce this Privacy Statement and other rules about your use of this App
* To protect our rights or property
* To protect someone's health, safety, or welfare
* To comply with a law or regulation, court order or other legal process

### DOES MEDTRONIC LABS EVER SHARE PERSONAL INFORMATION WITH THIRD PARTIES?

MEDTRONIC LABS will not share your personal information collected from the App with an unrelated third-party without your permission, except as otherwise provided in this Privacy Statement. MEDTRONIC LABS may share de-identified information with approved partners and affiliates for purposes that are consistent with those identified in this Privacy Statement.

In the ordinary course of business, we will share some personal information with companies that we hire to perform services or functions on our behalf. In all cases in which we share your personal information with a third-party, we will not authorize them to keep, disclose or use your information with others except for the purpose of providing the services we asked them to provide.

We may be legally compelled to release your personal information in response to a court order, subpoena, search warrant, law, or regulation. We may cooperate with law enforcement authorities in investigating and prosecuting Application users who violate our rules or engage in behavior which is harmful to other visitors (or illegal). In addition, we may keep, disclose, and use your personal information in order to comply with U.S. FDA and other governmental guidance, directions, regulations, and laws.

We may disclose your personal information to third parties if we feel that the disclosure is necessary to:

* Enforce this Privacy Statement and the other rules about your use of the App
* Protect our rights or property
* Protect someone's health, safety, or welfare
* Comply with a law or regulation, court order or other legal process

### TRANSFERS BETWEEN COUNTRIES

For West- and East African Users: By accepting this, you are giving us authorization to receive, process, and use your personal information, including sensitive data, and also transfer the data out of your country to our affiliates and subsidiaries internationally, or third parties hired by MEDTRONIC LABS to manage the App.

### WHAT DOES MEDTRONIC LABS DO WITH NON-PERSONAL INFORMATION?

Non-personal information is information that cannot identify you. We are always looking for ways to better serve you and improve this App. We will use non-personal information from you to help us make this App more useful to visitors. We also will use non-personal information for other business purposes. For example, we may use non-personal information or aggregate non-personal information to:

* Create reports for internal use to develop programs, products, services, or content
* Share it with or sell it to third parties
* Provide aggregated information on how visitors use our site, such as 'traffic statistics' and 'response rates,' to third parties

### WHAT ABOUT PRIVACY ON OTHER APPLICATIONS?

This application does not contain links to other apps or websites.

### ARE THERE SPECIAL RULES ABOUT CHILDREN'S PRIVACY?

We care about protecting the online privacy of children. We will not intentionally collect any personal information (such as a child's name or e-mail address) from children under the age of 18 unless a parent or legal guardian has provided consent for us to do so. If you think that we have unlawfully collected personal information from a child under the age of 18, please contact us. For West- and East African users, please notify us regarding children under the age of 18.

### WHAT ABOUT APPLICATION SECURITY?

Security is very important to us. We also understand that security is important to you. We take reasonable steps to protect your personal information from loss, misuse, and unauthorized access, disclosure, alteration, or destruction. You should keep in mind that no Internet transmission is ever 100% secure or error-free. You acknowledge that you are responsible for maintaining the confidentiality and security of any of your data available via the App on your mobile device, by using an ID and password credentials for your mobile device.

### HOW TO CONTACT MEDTRONIC LABS

If you have questions or comments about this Privacy Statement, please contact us here. You may use the Contact Us form on our website to exercise your rights to access, rectify, update, and/or eliminate your personal information or ask for non-disclosure ([www.medtroniclabs.org](http://www.medtroniclabs.org)). Elimination may not be possible if it can cause damage to third parties or if preserving your personal information is required by any law or regulation.

**Disclaimer:** This page may include information about products that may not be available in your region or country. Please consult the approved indications for use. Content on specific MEDTRONIC LABS products is not intended for users in markets that do not have authorization for use.


# Terms & Conditions of Use

SPICE provides the ability to modify the Terms and Conditions to the Country in which the application is used. The below is the template provided which can be customized for the specific country.&#x20;

***

### Terms and Conditions

Terms of Service

These Terms of Service (“TOS”) apply to the access and use of our mobile based applications (which is referred to as “**Platform**”) and use of our products and services provided through the Platform (“**Services**”). The Platform is owned, managed, and operated by MEDTRONIC LABS having its registered office at Nairobi Garage, Delta Corner Annex, 4th Floor-Unit 5, Ring Road, Westlands (hereinafter referred as “**us**”/ “**we**”/ “**SPICE**”/ “**Company**”).

These TOS govern the use of the Platform and Services by you, your staff (“**Staff”),** and the patients and end users who are using the Platform (“**Patients**”). Health workers, Staff and Doctors are jointly referred to as “**Users**” or “**you**”. By accessing or using the Platform, registering for Services offered on the Platform, or by accepting, uploading, submitting or downloading any information or content from or to the Platform, you shall have agreed to these TOS.

IF YOU DO NOT AGREE TO BE BOUND BY ALL OF THESE TOS, we request you DO NOT USE THE PLATFORM.

1. **Acceptance of Terms**

Your use of the Platform is subject to these TOS, which may be updated, amended, modified or revised by Medtronic Labs from time to time without any notice to you. It is important for you to refer to these TOS from time to time to make sure that you are aware of any additions, revisions, amendments or modifications that we may have made to these TOS. Your use of the Platform and engagement with SPICE constitutes your acceptance of these TOS. Your use of the Services herein is under a limited, non-transferable, non-licensable, non-assignable licence to use the Services granted by SPICE only for the purposes mentioned herein.

2. **Use of Services**

The Platform and Services are designed to assist the health care providers to store, obtain and review health information of the Patients who visit their clinics or hospitals. The health care providers can review the health information such as the Patient’s vitals, medical reports, medical records, etc. (**“Data”**) and provide feedback, advice and suggestion or any other information that may be relevant to the Patient. The Platform and Services are designed to allow the health care providers to seamlessly access their Patient Data via the Platform and use the Data to provide healthcare services to the Patients. We endeavour to provide a functional and convenient Service through our Platform, but we do not guarantee that your web browser, or mobile device will be compatible with the Platform or the Services or that the Platform and Services will be available uninterrupted or that any content will be error free. Medtronic Labs is not responsible for any interruption in Services or availability of Platform due to, but not limited to, changes or updates in individual clinic’s practice, network failure, or any other technical incident. SPICE reserves the right, at its sole discretion, to modify or replace all or any part of the TOS, or change, suspend, or discontinue all or any part of the Services or Platform at any time by posting a notice on the Platform or by informing you through any other modes of communication. It is your responsibility to check the TOS periodically for changes. Your continued use of the Platform or the Services following the posting of any changes to the TOS constitutes acceptance of those changes.

The Platform may collect and store demographic, health records and any other type of information that you may provide. This information is collected, stored and processed as per our privacy policy published on the Platform.

The Users represent and warrant that they have taken the appropriate consent from Patients before storing, or sharing with any third parties, any of the Patients’ information including but not limited to personally identifiable information, health records, demographic information etc.

The Patients, by accessing the Platform, consent and agree that the Platform may store their personal information including but not limited to contact information, demographic data, health records and medical history etc. The Platform may use this information for purposes as per our privacy policy published on the Platform.

3. **Registration**

As part of the registration process you will need to create an account, including your email, username and password. It is your responsibility to ensure that the information you provide is accurate, not misleading, and secure. You shall be responsible for keeping your credentials in safe custody. Medtronic Labs will not be liable for any losses or claims arising out of misuse of Platform or Services accessed with your credentials. You cannot create an account or username and password using the names and information of another person or using words that are the trademarks or the property of another party (including ours), or vulgar, obscene or in any other way inappropriate. We reserve the right with or without notice to suspend or terminate any account in breach. Doctors represent and warrant that they are licensed medical practitioners registered with \[*Enter Country Regulatory Body*] and there are no legal or regulatory impediments which prevent you from practising medicine in \[*Country*].

4. **Data Confidentiality**

**a) Responsibility of Doctors and Staff**

Through your use of the Platform, you shall have access to sensitive and valuable Data of the Patients which may include medical records, medical information, personal information or any other information as may be required. Additionally, Users agree to treat as confidential all Data that they have been provided access to, and that they shall make their best efforts to maintain the confidentiality of such Data. Users should be aware of the Patient confidentiality requirements and observe all caution and the applicable duty of care in provision of services under these TOS. The Data, provided by the Patient or entered by the Doctor or the Staff. The Platform present the Patient Data to the Doctors in an As-Is manner and the Platform do not make any warranties, representations, etc. on the accuracy and correctness of the Data.

**b) Restrictions on Use of Platform.** Users agrees that they shall not:

i.               and shall not permit anyone to: (i) copy or republish the Platform, except as may be provided herein; (ii) make the Platform available to any person other than its authorized personnel, (iii) remove, modify or obscure any copyright, trademark or other proprietary notices contained in the Platform, (iv) reverse engineer, decompile, disassemble, or otherwise attempt to derive the source code of Platform or (vii) Users shall not access (or attempt to access) the Platform and the materials or services by any means other than through the interface that is provided by Company.

ii.              use any deep-link, robot, spider or other automatic device, program, algorithm or methodology, or any similar or equivalent manual process, to access, acquire, copy or monitor any portion of the Platform or content, or in any way reproduce or circumvent the navigational structure or presentation of the Platform, materials or any content, to obtain or attempt to obtain any materials, documents or information through any means not specifically made available through the Platform.

iii.             attempt to gain unauthorized access to any portion or feature of the Platform, any other systems or networks connected to the Platform, to any Company server, or to any of the services offered on or through the Platform, by hacking, password mining or any other illegitimate means.

iv.            probe, scan or test the vulnerability of the Platform or any network connected to the Platform, nor breach the security or authentication measures on the Platform or any network connected to the Platform. Users may not reverse look-up, trace or seek to trace any information on any other user, of or visitor to, the Platform, including any Company account not owned by Doctors, to its source, or exploit the Platform or Services or information made available or offered by or through the Platform, in any way whether or not the purpose is to reveal any information, including but not limited to personal identification information, other than Doctors’ own information, as provided for by the Platform;

v.              disrupt or interfere with the security of, or otherwise cause harm to, the Platform, systems resources, accounts, passwords, servers or networks connected to or accessible through the Platform or any affiliated or linked sites.

**c) Non-Disclosure by SPICE**

SPICE will store the Data on a secure infrastructure and/or third-party servers chosen by data controller (Owner). SPICE is committed to protecting the identity of the Users. The following security procedures have been put in place by us to protect Data:

a)    Access to the Services is only after the user keys in his username and password. The username and password have to be successfully authenticated post which the access to the Platform and Services is granted. Users are fully and solely responsible for any or all use of the Platform or the Services while accessing these using the username and password (upon successful authentication).

b)    To prevent impersonation, your password is never stored in plain text format on any of our servers.

c)    The communication between your device and our servers will be through a secure HTTPS connection.

d)    A secure session is established with the help of a session token for providing access to the Patient Data after the Doctors or the Staff have successfully authenticated their username and password

e)    Role based access to database depending on the roles assigned by the Doctor to his/her Staff

f)     Within our server we use an Advanced Encryption Standard (AES) and multi-level security and authentication checks to protect the confidential Data. Personally identifiable patient information is always kept strictly confidential and is never disclosed with any third party except as provided under our privacy policy. We reserve the right to access, read, preserve, and disclose any information that we reasonably believe is necessary to comply with law or court order; enforce or apply our conditions of use and other agreements; or protect the rights, property, or safety of Company, our employees, our Users, or others. The Company may also use the data in de-identified and aggregated form for the following purposes without violating the relevant data privacy and data security laws of \[*Country*].

i.               for the purpose of research and publications, statistical analysis, generating Real World Evidence (RWE) algorithmically,

ii.              for communication purpose so as to provide the Doctor a better way of communicating with his/her patients by means of SMS/Emails,

iii.             for debugging customer support related issues,

iv.            for improving the algorithms of Company’s EMR to make it faster, efficient and reliable

v.              for communicating about new Services and offerings by the Company or its partners with the Users

5. **Communications**

You agree to receive communications through emails, telephone, mobile phone and/or SMS, from SPICE or its third-party vendors or business partners or third-party service providers regarding the services or services updates, and/or any announcements. In this context and regard, you agree and provide your consent to receive all communications at the mobile number provided to SPICE. You also agree that in accordance with the applicable laws, rules and regulations tied to Telecom Communications:

i.               Each time you do visit/transact or login in your account on the Platform, it shall be regarded as a verifiable request from you pertaining to receipt of our Services and activities;

ii.              Each time you visit/login/transact on the Platform, it will be deemed to be as a fresh request from you for continuing to receive communication from SPICE

iii.             In case you do not wish to receive any communication from us or to provide your feedback about the services, you can mail us at <support@medtroniclabs.org>

SPICE will retain and use your information as necessary to comply with our legal obligations, resolve disputes and enforce our agreements entered into for providing Services and ancillary services.

6. **Termination**

SPICE may terminate your access to all or any part of the Platform or Services at any time if you fail to comply with these TOS. This may result in the forfeiture and destruction of all information associated with your membership and will immediately terminate your ability to provide services through the Platform. All provisions of the TOS, which by their nature should survive termination, shall survive termination, including, without limitation, warranty disclaimers, indemnity and limitations of liability. In the event of discontinuation of services, SPICE, at its discretion,  will make reasonable efforts to help you take a backup of your Data in a suitable electronic format.

7. **DISCLAIMER**

THE PLATFORM (INCLUDING, WITHOUT LIMITATION, ANY CONTENT) ARE PROVIDED “AS IS” AND “AS AVAILABLE” AND IS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES IMPLIED BY ANY COURSE OF PERFORMANCE OR USAGE OF TRADE, ALL OF WHICH ARE EXPRESSLY DISCLAIMED. MEDTRONIC LABS AND ITS DIRECTORS, EMPLOYEES, SUPPLIERS, AND PARTNERS DO NOT WARRANT THAT: (A) THE SERVICE WILL BE SECURE OR AVAILABLE AT ANY PARTICULAR TIME OR LOCATION; (B) ANY DEFECTS OR ERRORS WILL BE CORRECTED; (C) ANY CONTENT OR SOFTWARE AVAILABLE AT OR THROUGH THE SERVICE IS FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS; OR (D) THE RESULTS OF USING THE SERVICE WILL MEET YOUR REQUIREMENTS.

8. **Indemnification**

You shall defend, indemnify, and hold harmless Medtronic Labs, its affiliates/subsidiaries/partners and each of its affiliates/subsidiaries employees, contractors, directors, suppliers and representatives from all liabilities, losses, claims, and expenses, including reasonable attorneys’ fees, that arise from or relate to (i) your use or misuse of, or access to, the Platform or Services, or (ii) your violation of the TOS or any applicable law, contract, policy, regulation or other obligation. MEDTRONIC LABS reserves the right to assume the exclusive defence and control of any matter otherwise subject to indemnification by you, in which event you will assist and cooperate with MEDTRONIC LABS in connection therewith.

9. **Limitation of Liability**

TO THE FULLEST EXTENT PERMITTED BY LAW, IN NO EVENT SHALL MEDTRONIC LABS (NOR ITS DIRECTORS, EMPLOYEES, PARTNERS, SUPPLIERS, CONTENT PROVIDERS, LICENSORS OR RESELLERS, BE LIABLE UNDER CONTRACT, TORT, STRICT LIABILITY, NEGLIGENCE OR ANY OTHER LEGAL OR EQUITABLE THEORY WITH RESPECT TO THE SERVICE (I) FOR ANY LOST PROFITS, DATA LOSS, LOSS OF GOODWILL OR OPPORTUNITY, OR SPECIAL, INDIRECT, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER, OR SUBSTITUTE GOODS OR SERVICES, (II) FOR ANY MATTER BEYOND ITS OR THEIR REASONABLE CONTROL, EVEN IF MEDTRONIC LABS HAS BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE AFOREMENTIONED DAMAGES.

10. **Governing Law**

This Agreement shall be governed by and construed in accordance with the laws of \[*Country*] without regard to the conflict of laws provisions thereof. All claims, differences and disputes arising under or in connection with or in relation hereto the App, the Terms or any transactions entered into on or through the App shall be subject to the exclusive jurisdiction of the courts at \[*Country*] and you hereby accede to and accept the jurisdiction of such courts.

11. **Miscellaneous**

The TOS are the entire agreement between you and MEDTRONIC LABS with respect to the use of Platform or the Services. If any provision of the TOS is found to be unenforceable or invalid, that provision will be limited or eliminated to the minimum extent necessary so that the TOS will otherwise remain in full force and effect and enforceable. The failure of either party to exercise in any respect any right provided for herein shall not be deemed a waiver of any further rights hereunder. The TOS are personal to you, and are not assignable or transferable by you except with Company’s prior written consent. MEDTRONIC LABS may assign, transfer or delegate any of its rights and obligations hereunder without consent.

&#x20;


# Frequently Asked Questions (FAQs)

1. Is SPICE compatible with other healthcare systems and platforms?

Yes, SPICE is designed to be interoperable with existing healthcare systems and platforms, including electronic medical record (EMR) systems, health information exchanges (HIEs), and national health databases. It supports integration through standard protocols such as HL7 and FHIR. The latest release introduces the FHIR Adapter, which simplifies data exchange by translating SPICE data into the widely used FHIR format. This adapter enables seamless integration with FHIR-compatible systems and facilitates centralized data storage and exchange, including interoperability with DHIS2 systems used in Africa and Bangladesh.

4. Can I customize workflows in SPICE to suit my organization's needs?

While non-clinical workflows are customizable to suit organizational needs, clinical decision support features are not customizable. However, users have the flexibility to [customize parameters ](/spice-docs/deploy/customization-guide/clinical-workflow-customization)and create custom workflows for non-clinical tasks.

5. How secure is the data stored in SPICE?

Security is a top priority for SPICE. The platform employs robust encryption protocols and access controls to safeguard sensitive patient information. All data is encrypted at rest and in transit. We perform regular security audits and vulnerability testing on the platform and ensure compliance with standards and regulations to ensure data integrity and confidentiality. See [Data Privacy & Security](/spice-docs/overview/data-privacy-and-security) for more information.&#x20;

6. What kind of support is available for SPICE users?

For any support or additional questions, please reach out to <community@medtroniclabs.org>. Medtronic LABS provides comprehensive support to users through various channels, including online documentation, GitHub discussions, and 1:1 support. Users can access role-specific guides to better understand workflows and get answers to functionality questions. See [Support](/spice-docs/community/support) for more information.&#x20;

7. How often is SPICE updated, and are there any additional costs for updates?

SPICE undergoes regular updates and enhancements to introduce new features, improve performance, and address user feedback. For implementations leveraging the hosted model, updates are typically rolled out periodically, and there are no additional costs for receiving updates. For implementations leveraging the open source packages, we send release notification emails to the newsletter subscribers. See [Support](/spice-docs/community/support) and [Releases](/spice-docs/product/releases) for more information.&#x20;

8. Can SPICE be used in offline environments or areas with limited internet connectivity?

Yes, SPICE offers offline functionality, allowing users to perform essential tasks even in environments with limited or no internet connectivity. Data captured offline is synced with the central server once an internet connection is restored, ensuring continuity of care and data integrity.


# Architecture

## Platform Components

The SPICE platform consists of four key components:

* [SPICE Android](https://github.com/Medtronic-LABS/spice-android): Primary mobile application for end-users&#x20;
* [SPICE Admin](https://github.com/Medtronic-LABS/spice-admin-web): Web-based administrative portal
* [SPICE Server](https://github.com/Medtronic-LABS/spice-server): Service layer & hosting components
* [SPICE FHIR Adaptor](https://github.com/Medtronic-LABS/spice-fhir-adapter): FHIR adapter service for platform interoperability

The components are intended to be used together and the platform uses a microservice based architecture for separating out the specific business workflows. The mobile application communicates with the service layer through Rest APIs.&#x20;

For more information on the system context and components, see the [C4 diagrams](/spice-docs/engineering/architecture/c4-diagrams) to learn more.&#x20;

The platform can be deployed in a Cloud or on-premise environment, see the [Deployment Guide](/spice-docs/deploy/deployment-guide) for specific instructions on deployment.&#x20;


# C4 Diagrams

Below you will find SPICE platform documentation using the [C4 model](https://c4model.com/) for architecting software solutions. &#x20;

## System Context

The below diagram demonstrates the context of the SPICE system and the various system users and system components.&#x20;

<figure><img src="/files/tCoamP13zbdWirQlroZz" alt="" width="563"><figcaption><p>SPICE Context Architecture. </p></figcaption></figure>

* The system primarily interacts with the healthcare worker, in this case the community health worker (CHW) who collects information from the patient
* The SPICE platform is used for the data collection, storage, and processing of the data collected.
* In addition to its primary functionalities, the SPICE application integrates with a software system dedicated to handling emails sent to Health Workers.
* The SPICE application also leverages an SMS software system to transmit information to the patient directly.

## System Container:

<figure><img src="/files/oCRX7aRCgv95y3lFEKVz" alt="" width="563"><figcaption><p>SPICE Container Architecture</p></figcaption></figure>

* SPICE Mobile (Android application) is the primary application for end-user engagement
* SPICE Admin users interact with a web application built with HTML, JavaScript, and React, serving as the front end for managing organizations, metadata, and workflows.
* We have a set of core platform services (microservices) that the applications query using REST API calls.
* The web application communicates with the following services:
  * Admin Service: A SpringBoot-based service that enables the creation of metadata, management of facilities, and linking facilities with users.
  * User Service: A SpringBoot-based service responsible for user management, client profiles, and authentication/authorization.
  * Notification Service: A SpringBoot-based service managing notifications through SMS, email, and WhatsApp.
* The mobile application users input patient data via a Kotlin-based mobile application available on the Play Store. The mobile application communicates with three services:
  * User Service: The same service utilized by SPICE Admin users, managing user-related functionalities and authentication.
  * Notification Service: Also shared with SPICE Admin users, responsible for handling notifications.
  * SPICE Service: A SpringBoot-based service overseeing screening, enrollment, assessment, and medical review. It utilizes AWS storage for data storage requirements.
* All four services (Admin, User, Notification, and SPICE) interact with an RDS instance, employing PostgreSQL to store and retrieve meta, configuration, and transaction data.
* The Notification Service forwards patient-related information to SPICE Admin users via an email system.
* Additionally, the Notification Service employs an SMS system to directly communicate information to the Patients.

## System Components

### Android Component System:

* The Mobile application performs the main functions through API calls to the service layer. The mobile application is made up of the following components that communicate with the associated microservices in the service layer:
  * Screening Manager
  * Patient Enrollment Manager
  * Medical Review Manager
  * Assessment Manager
  * Medication Manager
  * Lab Test Manager
  * Nutrition Manager
* The following details out what each component is responsible for:
  * The Screening Manager component is responsible for gathering basic information and health-related data during the screening process.
  * The Patient Enrollment Manager component facilitates the enrollment of patients either from the screening process or directly into the system.
  * The Medical Review Manager component handles the management of medical reviews, including maintaining a history of reviews and adding new reviews.
  * The Assessment Manager component assists in managing patient assessments and creating follow-ups for assessments.
  * The Medication Manager component allows the CHW to prescribe and manage medications, refill prescriptions, and save the Practitioner Signature in an AWS storage.
  * The Lab Test Manager component enables the CHW to manage and prescribe lab tests, as well as manage the results of the tests.
  * The Nutrition Manager component supports the CHW in managing and prescribing nutrition counseling.
* All of the above-mentioned components are part of the comprehensive SPICE service, which interacts with an RDS instance to store and retrieve the corresponding data.

<figure><img src="/files/okyhpMQz0p7IIKcq7ajJ" alt="" width="563"><figcaption><p>Android Component Architecture</p></figcaption></figure>

### Web component system:

* The Web Admin System comprises a web application that interacts with the Admin Service, which contains three main components:&#x20;
  * Organization Manager
  * Metadata Manager
  * Workflow Manager.
* The following details out what each component is responsible for:
  * The Organization Manager component handles the management and creation of Regions, Accounts, Operating Units, and Sites.
  * The Metadata Manager component is responsible for managing data related to medication and lab tests.
  * The Workflow Manager component allows customization of workflows associated with screening, enrollment, assessment, and account customization.
* Each of the three components communicates with an RDS instance, which utilizes PostgreSQL as the database technology.
* The RDS instance is responsible for storing and retrieving all meta, configuration, and transaction-related data.

<figure><img src="/files/0SfMEK64fSsn7WZHmFVq" alt="" width="563"><figcaption><p>Web Component Architecture</p></figcaption></figure>


# FHIR & Standards

### Platform Interoperability

The SPICE platform supports the [HL7 FHIR](https://www.hl7.org/fhir/overview.html) standard through the SPICE FHIR Service. This service functions as an adaptor, converting the SPICE data into the FHIR format.&#x20;

* GitHub Repository: [FHIR Adaptor](https://github.com/Medtronic-LABS/spice-fhir-adapter)

The adapter converts SPICE data into the FHIR format using the custom FHIR Adapter.&#x20;

### **Key Functionality:**

* Converted data saved in FHIR database using HAPI-FHIR JPA server.
* HAPI-FHIR JPA server acts as a FHIR server which is coupled with FHIR Database.
* FHIR data is accessible via REST API and FHIR database.

<div data-full-width="false"><figure><img src="/files/rGMcJj8h2ZwAqGy7Qv84" alt=""><figcaption><p>SPICE FHIR Service</p></figcaption></figure></div>

### **Using the FHIR Adapter:**&#x20;

Take a look at the [API documentation for the FHIR Adapter](/spice-docs/engineering/api-documentation/fhir-adapter-services).&#x20;

Take a look at the [deployment documentation for the FHIR Adapter](/spice-docs/deploy/deployment-guide/fhir-adapter).&#x20;


# Technology Stack

The Technology Infrastructure of SPICE forms the backbone of its functionality, performance, and scalability.

<figure><img src="/files/tq9amjvTIX1oGEHmstiO" alt=""><figcaption><p>SPICE Layer Architecture. The SPICE platform utilizes a layered architecture approach with three tiers: 1. Presentation Layer 2. Computer Layers and 3. Database Layers. </p></figcaption></figure>

**Presentation Layer**

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td align="center">React</td><td><a href="/files/hURvA3qsc2M4VlqelNGc">/files/hURvA3qsc2M4VlqelNGc</a></td></tr><tr><td align="center">SCSS</td><td><a href="/files/44fKmJeYYxiDtxHDePl7">/files/44fKmJeYYxiDtxHDePl7</a></td></tr><tr><td align="center">Typescript</td><td><a href="/files/IslGQTq4GuXyA8FDWpz7">/files/IslGQTq4GuXyA8FDWpz7</a></td></tr></tbody></table>

SPICE's presentation layer relies on a combination of technologies, including React, HTML5, SCSS, TypeScript, and npm. Together, these technologies form a robust and efficient foundation for the application's presentation layer.

* React is a JavaScript library that enables interactive user interfaces
* HTML5 serves as the markup language for structuring the application's content
* SCSS supports writing more maintainable and modular CSS styles.&#x20;
* TypeScript adds static typing to JavaScript, enhancing code reliability and scalability.&#x20;
* Npm is a package manager that helps manage and install the necessary dependencies for the project.&#x20;

**Service Layer**

<div align="center"><figure><img src="/files/yB6oEln4scoeJzoxDNfU" alt="" width="375"><figcaption><p>Spring Boot</p></figcaption></figure></div>

The service layer of the SPICE application leverages the Spring Boot framework to develop REST APIs. Spring Boot simplifies the process of creating and managing these APIs, allowing for seamless communication with other systems or clients. By utilizing features such as dependency injection, security, and database integration, we ensure efficient and scalable services. REST APIs enable SPICE to follow the principles of stateless, client-server communication, facilitating interoperability and flexibility in the SPICE application's architecture. With Spring Boot, we can build reliable and high-performing components for our service layer, providing a solid foundation for SPICE application functionality.

**Business Layer**

<figure><img src="/files/vwWbGgxIovi6buCw4U1H" alt="" width="375"><figcaption><p>Java</p></figcaption></figure>

The business layer of the SPICE application is implemented using Java to create business workflows. Java provides a robust platform for developing intricate and efficient business logic, given the fact that it is a versatile and widely-used programming language. Leveraging Java's object-oriented features, we can model complex business processes and incorporate encapsulation, inheritance, and polymorphism to achieve modular and maintainable workflows. Java's extensive libraries and frameworks enhance the capabilities of our business layer, enabling us to handle data transformations, business rules, and workflow orchestration effectively. By coding the business workflows in Java, we ensure a reliable and scalable foundation for the application's core functionality.

**Persistence Layer**

<figure><img src="/files/XrhH26wOAgVUWwLSoxxq" alt="" width="375"><figcaption><p>JPA - Hibernate</p></figcaption></figure>

The SPICE persistence layer utilizes Object Modeling based on JPA using Hibernate. JPA (Java Persistence API) is a Java specification that provides a standard way to map Java objects to relational databases. Hibernate, an implementation of JPA, simplifies the interaction between the application and the database by handling object-relational mapping. With JPA Hibernate, we can define and manage the persistence of our application's domain objects, enabling seamless storage and retrieval of data. This approach enhances code maintainability, as it abstracts away the underlying database details. Leveraging JPA Hibernate in our business layer ensures efficient and reliable data persistence in our application.

**Database Layer**

<figure><img src="/files/ruHbLb5ZanoAEGYl85ld" alt="" width="375"><figcaption><p>PostgreSQL</p></figcaption></figure>

The database layer of SPICE is built on PostgreSQL, an open-source, relational database management system (RDBMS). PostgreSQL is known for its stability, scalability, and extensive feature set. It provides robust data storage and retrieval capabilities, ensuring the efficient handling of our application's data. With PostgreSQL, we can create and manage complex database structures, define relationships between entities, and perform efficient queries. It offers advanced features such as transactions, concurrency control, and data integrity mechanisms. Leveraging PostgreSQL in our database layer guarantees reliable and secure storage of our application's data, supporting the overall performance and functionality of our system.


# API Documentation

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>API reference documentation for common services</td><td></td><td></td><td><a href="/files/xDurlWOQgsjOHYLPiwgP">/files/xDurlWOQgsjOHYLPiwgP</a></td><td><a href="/pages/eopGgR0q22uiW63cdIvE">/pages/eopGgR0q22uiW63cdIvE</a></td></tr><tr><td>API reference documentation for admin services</td><td></td><td></td><td><a href="/files/GatVfVlZ0nFaOz6VFXlA">/files/GatVfVlZ0nFaOz6VFXlA</a></td><td><a href="/pages/vTg8j9rknVZBHjAH3SiH">/pages/vTg8j9rknVZBHjAH3SiH</a></td></tr><tr><td>API reference documentation for SPICE services</td><td></td><td></td><td><a href="/files/gY14qDjijgs9O73kQCy0">/files/gY14qDjijgs9O73kQCy0</a></td><td><a href="/pages/BpeHdjvSkD1AXGb8HuxH">/pages/BpeHdjvSkD1AXGb8HuxH</a></td></tr><tr><td>API reference documentation for Fhir-Adapter Services</td><td></td><td></td><td><a href="/files/OPsF4kphSuTYB8yF68KF">/files/OPsF4kphSuTYB8yF68KF</a></td><td><a href="/pages/X97u6YNTQfepMQtmegZs">/pages/X97u6YNTQfepMQtmegZs</a></td></tr></tbody></table>

&#x20;


# Common Services


# Account Create

| **API URL**     | {{url}}/user-service/organization/create-account |
| --------------- | ------------------------------------------------ |
| **Method**      | POST                                             |
| **Description** | Create Account                                   |

#### **Input** <a href="#accountcreate-input" id="accountcreate-input"></a>

| **Field Name**       | **Type** | **Mandatory** | **Example**        |
| -------------------- | -------- | ------------- | ------------------ |
| name                 | String   | Yes           | Healthcarezone     |
| maxNoOfUsers         | Number   | No            | 100                |
| parentOrganizationId | String   | Yes           | 290                |
| tenantId             | String   | Yes           | 290                |
| countryId            | String   | Yes           | 3                  |
| clinicalWorkflow     | Array    | No            | 4,3,2,1            |
| customizedWorkflow   | Array    | No            | 5,6                |
| username             | String   | Yes           | <johnbxxx@xxx.xxx> |
| firstName            | String   | Yes           | Kennedy            |
| lastName             | String   | Yes           | John               |
| gender               | String   | No            | Male               |
| id(countryId)        | Number   | Yes           | 3                  |
| countryCode          | Number   | Yes           | 1                  |
| phoneNumber          | String   | Yes           | 733XXX701X         |
| id(timezone)         | Number   | Yes           | 3                  |

#### **Sample Input:** <a href="#accountcreate-sampleinput" id="accountcreate-sampleinput"></a>

"name": "Healthcarezonenew",\
"maxNoOfUsers": 0,\
"parentOrganizationId": 290,\
"tenantId":290,\
"countryId": 3,\
"clinicalWorkflow": \[\
4,3,2,1\
],\
"customizedWorkflow": \[

],\
"users": \[\
{\
"username": "<johnbxxx@sxxxe.xxx>",\
"firstName": "Kennedy",\
"lastName": "John",\
"gender": "male",\
"country": {\
"id": 3\
},\
"countryCode": "1",\
"phoneNumber": "733XXX701X",\
"timezone": {\
"id": 2\
}\
}\
]

}

#### **Sample Output:** <a href="#accountcreate-sampleoutput" id="accountcreate-sampleoutput"></a>

```
"message": "Organization created successfully. "
```


# Change Password for Site Users

| **API URL**     | {{url}}/user-service/user/change-password |
| --------------- | ----------------------------------------- |
| **Method**      | POST                                      |
| **Description** | Change password by Admins for Site Users  |

#### **Input** <a href="#changepasswordforsiteusers-input" id="changepasswordforsiteusers-input"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**                     |
| ---------------------- | -------- | ------------- | ------------------------------- |
| userId                 | String   | Yes           | 4658                            |
| newPassword            | String   | Yes           | Hashed Password                 |
| Authorization (Header) | String   | Yes           | Token from Admin Login Response |

#### **Sample Input:** <a href="#changepasswordforsiteusers-sampleinput" id="changepasswordforsiteusers-sampleinput"></a>

{\
&#x20;   "userId":6479,\
&#x20;   "newPassword":"3901e08e724bb73a72137e03e2f03d54d70eaeea39f8a7e0459f15d9e80585ffd2159283b8324d72f7ba8c2aa2f0e82e5c1b685d7ef569e2ebad02d71ba4076e"\
}

#### **Sample Output:** <a href="#changepasswordforsiteusers-sampleoutput" id="changepasswordforsiteusers-sampleoutput"></a>

```
  {
    "message": "Password has been Changed Successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Country Create

| **API URL**     | {{url}}/user-service/organization/create-country |
| --------------- | ------------------------------------------------ |
| **Method**      | POST                                             |
| **Description** | Create country                                   |

#### **Input** <a href="#countrycreate-input" id="countrycreate-input"></a>

| **Field Name**  | **Type** | **Mandatory** | **Example**          |
| --------------- | -------- | ------------- | -------------------- |
| name            | String   | Yes           | Netherland           |
| countryCode     | Number   | Yes           | 336                  |
| unitMeasurement | String   | Yes           | Metric System        |
| username        | String   | Yes           | <jackxxx@xxxx.coxxx> |
| countryCode     | Number   | Yes           | 123                  |
| firstName       | String   | Yes           | John                 |
| lastName        | String   | Yes           | Milan                |
| gender          | String   | No            | male                 |
| phoneNumber     | String   | Yes           | 73XXX270XXX          |
| id(timezone)    | Number   | Yes           | 1                    |

#### **Sample Input:** <a href="#countrycreate-sampleinput" id="countrycreate-sampleinput"></a>

{\
"name": "Netherland",\
"countryCode": "336",\
"unitMeasurement": "Metric System",\
"users": \[\
{\
"username": "<jackxxx@gxxxil.xxx>",\
"countryCode":"123",\
"firstName": "John",\
"lastName": "Milan",\
"gender": "male",\
"phoneNumber": "73XXX2701X",\
"timezone": {\
"id": 1\
}\
}\
]\
}

#### **Sample Output:** <a href="#countrycreate-sampleoutput" id="countrycreate-sampleoutput"></a>

```
"message": "Organization created successfully. "
```


# Forgot Password

| **API URL**     | {{url}}/user-service/user/forgot-password/{username}                  |
| --------------- | --------------------------------------------------------------------- |
| **Method**      | GET                                                                   |
| **Description** | Forgot Password by username and response will send email notification |

#### **Input** <a href="#forgotpassword-input" id="forgotpassword-input"></a>

| **Field Name**      | **Type** | **Mandatory** | **Example**     |
| ------------------- | -------- | ------------- | --------------- |
| username(parameter) | String   | Yes           | <aaaa@aaa.aaaa> |

#### **Sample Input** <a href="#forgotpassword-sampleinput" id="forgotpassword-sampleinput"></a>

{{url}}/user-service/user/forgot-password/aaaa\@aaa.aaaa

**Sample Output**

```
  {
      "message": "An email will send if the account exists in our system.",
      "entity": true,
      "status": true,
      "entityList": null,
      "responseCode": 200,
      "totalCount": null
  }
```


# Get User Details

| **API URL**     | {{url}}/user-service/user/details/{{userId}} |
| --------------- | -------------------------------------------- |
| **Method**      | GET                                          |
| **Description** | To get user details by user id               |

#### **Input** <a href="#getuserdetails-input" id="getuserdetails-input"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                          |
| --------------------- | -------- | ------------- | ------------------------------------ |
| userId(parameter)     | String   | Yes           | User unique identification number    |
| Authorization(Header) | String   | Yes           | Authorized token from login response |

#### **Sample Input** <a href="#getuserdetails-sampleinput" id="getuserdetails-sampleinput"></a>

{{url}}/user-service/user/details/248

#### **Output** <a href="#getuserdetails-output" id="getuserdetails-output"></a>

| **Field Name**          | **Type** | **Comments**                     |
| ----------------------- | -------- | -------------------------------- |
| `id`                    | Integer  | User ID                          |
| `username`              | String   | User Username                    |
| `gender`                | String   | User Gender                      |
| `roles`                 | Object   | Roles of the user                |
| `active`                | Boolean  | Flag for, is user active or not  |
| `firstName`             | String   | User First Name                  |
| `lastName`              | String   | User Last Name                   |
| `middleName`            | String   | User Middle Name                 |
| `phoneNumber`           | String   | User Phone number                |
| `country`               | Object   |                                  |
| `timezone`              | Object   | User Timezone                    |
| `organizations`         | Object   |                                  |
| `isBlocked`             | Boolean  | Flag for, is user blocked or not |
| `countryCode`           | String   | Country code value               |
| `cultureId`             | Integer  |                                  |
| `tenantId`              | Integer  | User Tenant ID                   |
| `isSuperUser`           | Boolean  | Flag for, Super user or not      |
| redRisk                 | Boolean  |                                  |
| defaultOrganizationName | String   |                                  |
| defaultRoleName         | String   |                                  |

#### **Sample Output:** <a href="#getuserdetails-sampleoutput" id="getuserdetails-sampleoutput"></a>

```
      "id": 248,
    "username": "mcf_labtechnicxxx@spice.mdt",
    "gender": "",
    "roles": [
        {
            "id": 25,
            "name": "LAB_TECHNICIAN",
            "level": null,
            "authority": "LAB_TECHNICIAN",
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": "2023-01-12T23:00:47+06:00",
            "updatedAt": "2023-01-12T23:00:47+06:00",
            "active": true,
            "deleted": false
        }
    ],
    "active": true,
    "firstName": "MCF",
    "lastName": "Lab technician",
    "phoneNumber": "978XXX4323",
    "country": {
        "id": 4,
        "name": "India",
        "countryCode": "91",
        "unitMeasurement": "metric",
        "tenantId": 6
    },
    "timezone": {
        "id": 2,
        "offset": "-08:00",
        "description": "(UTC-08:00) Baja California"
    },
    "organizations": [
        {
            "id": 15,
            "createdBy": 2,
            "updatedBy": 2,
            "createdAt": "2023-03-08T15:41:23+06:00",
            "updatedAt": "2023-03-08T15:41:25+06:00",
            "tenantId": 10,
            "formDataId": 1,
            "formName": "site",
            "name": "MCF Ashoknagar",
            "sequence": null,
            "parentOrganizationId": 10,
            "active": true,
            "deleted": false
        },
        {
            "id": 33,
            "createdBy": 2,
            "updatedBy": 2,
            "createdAt": "2023-03-08T17:33:16+06:00",
            "updatedAt": "2023-03-08T17:33:18+06:00",
            "tenantId": 10,
            "formDataId": 2,
            "formName": "site",
            "name": "MCF Guindy",
            "sequence": null,
            "parentOrganizationId": 10,
            "active": true,
            "deleted": false
        }
    ],
    "isBlocked": false,
    "countryCode": "91",
    "tenantId": 15,
    "isSuperUser": false,
    "defaultOrganizationName": "MCF Ashoknagar",
    "defaultRoleName": "LAB_TECHNICIAN",
    "cultureId": 1,
    "redRisk": false
```


# Get User Profile

| **API URL**     | {{url}}/user-service/user/profile |
| --------------- | --------------------------------- |
| **Method**      | GET                               |
| **Description** | Get details of the user           |

#### **Input** <a href="#getuserprofile-input" id="getuserprofile-input"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**                                                                                                                             |
| ---------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization (Header) | String   | Yes           | Bearer 1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6 |

#### **Output** <a href="#getuserprofile-output" id="getuserprofile-output"></a>

| **Field Name**  | **Type** | **Comments**    |
| --------------- | -------- | --------------- |
| `message`       | String   | Success Message |
| `id`            | Integer  | User ID         |
| `username`      | String   |                 |
| `gender`        | String   |                 |
| `roles`         | Object   |                 |
| `firstName`     | String   |                 |
| `lastName`      | String   |                 |
| `middleName`    | String   |                 |
| `phoneNumber`   | String   |                 |
| `timezone`      | Object   |                 |
| `organizations` | String   |                 |
| `tenantId`      | String   |                 |
| `countryCode`   | String   |                 |
| `country`       | String   |                 |
| `status`        | String   |                 |
| `responseCode`  | String   |                 |
| `totalCount`    | String   |                 |

#### **Sample Output** <a href="#getuserprofile-sampleoutput" id="getuserprofile-sampleoutput"></a>

```
{
  "message": "Got user.",
  "entity": {
    "id": 2,
    "roles": [
      {
        "id": 2,
        "name": "SUPER_ADMIN",
        "level": null,
        "authority": "SUPER_ADMIN",
        "createdBy": 1,
        "updatedBy": 1,
        "createdAt": "2023-01-12T09:00:47-08:00",
        "updatedAt": "2023-01-12T09:00:47-08:00",
        "active": true,
        "deleted": false
      }
    ],
    "firstName": "Superadminnn",
    "lastName": "Test",
    "username": "XXX-bd@XXX.XXX",
    "organizations": [],
    "tenantId": 15,
    "timezone": {
      "id": 2,
      "offset": "-08:00",
      "description": "(UTC-08:00) Baja California"
    },
    "phoneNumber": "2443XX4534",
    "gender": "Female",
    "countryCode": "202",
    "country": null
  },
  "status": true,
  "entityList": null,
  "responseCode": 200,
  "totalCount": null
}
```


# Locked Users List

| **API URL**     | {{url}}/user-service/user/locked-users |
| --------------- | -------------------------------------- |
| **Method**      | POST                                   |
| **Description** | Get all locked users                   |

#### **Input** <a href="#lockeduserslist-input" id="lockeduserslist-input"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**                                                                         |
| ---------------------- | -------- | ------------- | ----------------------------------------------------------------------------------- |
| Authorization (Header) | String   | Yes           | Token from Login                                                                    |
| tenantId               | String   | No            | Organization id of Region / Account / Operating Unit and not needed for super admin |

#### **Sample Input:** <a href="#lockeduserslist-sampleinput" id="lockeduserslist-sampleinput"></a>

{    "tenantId":"5",    "limit":2 }

#### **Output** <a href="#lockeduserslist-output" id="lockeduserslist-output"></a>

| **Field Name** | **Type** | **Comments** |
| -------------- | -------- | ------------ |
| `id`           | String   | User ID      |
| `username`     | String   |              |
| `gender`       | String   |              |
| `roles`        | Object   |              |
| `active`       | Boolean  |              |
| `firstName`    | String   |              |
| `lastName`     | String   |              |
| `middleName`   | String   |              |
| `phoneNumber`  | String   |              |
| `timezone`     | Object   |              |
| `countryCode`  | String   |              |
| `country`      | Object   |              |
| `isSuperUser`  | Boolean  |              |

#### **Sample Output:** <a href="#lockeduserslist-sampleoutput" id="lockeduserslist-sampleoutput"></a>

```
  {
    "message": "Got All users.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 395,
            "username": "autobanXXX@spXXXe.XXX",
            "firstName": "Sathya",
            "lastName": "BanglaHS",
            "gender": "Male",
            "country": {
                "id": 3,
                "name": "Bangladesh",
                "countryCode": "880",
                "unitMeasurement": "metric",
                "tenantId": 5
            },
            "countryCode": "880",
            "phoneNumber": "9876XXX21X",
            "timezone": {
                "id": 1,
                "offset": "-12:00",
                "description": "(UTC-12:00) International Date Line West"
            }
        }
    ],
    "responseCode": 200,
    "totalCount": 1
}
```


# Login

| **API URL**     | {{url}}/auth-service/session |
| --------------- | ---------------------------- |
| **Method**      | POST                         |
| **Description** | Login and get Access Token   |

#### **Input** <a href="#login-input" id="login-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**               |
| -------------- | -------- | ------------- | ------------------------- |
| username       | String   | Yes           | <superXXXn@XXX.mdt>       |
| password       | String   | Yes           | Hashed Password           |
| client(Header) | String   |               | spice web or spice mobile |

#### **Sample Input:** <a href="#login-sampleinput" id="login-sampleinput"></a>

#### { <a href="#login" id="login"></a>

&#x20;   "username": "<spxxxice@xx.mdt>",

&#x20;   "password": "1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6"

}

#### **Output** <a href="#login-output" id="login-output"></a>

| **Field Name**       | **Type** | **Comments** |
| -------------------- | -------- | ------------ |
| `id`                 | String   | User ID      |
| `username`           | String   |              |
| `gender`             | String   |              |
| `roles`              | Object   |              |
| `active`             |          |              |
| `accountExpired`     |          |              |
| `accountLocked`      |          |              |
| `credentialsExpired` |          |              |
| `authorization`      |          |              |
| `currentDate`        |          |              |
| `firstName`          |          |              |
| `lastName`           |          |              |
| `middleName`         |          |              |
| `subject`            |          |              |
| `phoneNumber`        |          |              |
| `timezone`           | Object   |              |
| `organizations`      | Object   |              |
| `tenantId`           |          |              |
| `countryCode`        |          |              |
| `isBlocked`          |          |              |
| `country`            |          |              |
| `deviceInfoId`       |          |              |
| `isSuperUser`        |          |              |
| `cultureId`          |          |              |

#### **Sample Output:** <a href="#login-sampleoutput" id="login-sampleoutput"></a>

```
 {
    "id": 23,
    "username": "suXXXXmin@spXXXce.mXt",
    "gender": "Female",
    "roles": [
        {
            "id": 2,
            "name": "SUPER_ADMIN",
            "level": null,
            "authority": "SUPER_ADMIN",
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": 1684844119755,
            "updatedAt": 1684844119755,
            "active": true,
            "deleted": false
        }
    ],
    "active": true,
    "accountExpired": false,
    "accountLocked": false,
    "credentialsExpired": false,
    "authorization": null,
    "currentDate": 1685102162753,
    "firstName": "Super",
    "lastName": "Admin",
    "middleName": null,
    "subject": null,
    "phoneNumber": "XXX764XXX3",
    "timezone": {
        "id": 1,
        "offset": "+05:30",
        "description": "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi"
    },
    "organizations": [],
    "tenantId": 3,
    "countryCode": "256",
    "isBlocked": false,
    "country": null,
    "deviceInfoId": null,
    "isSuperUser": false,
    "cultureId": null
}
```


# Logout

| **API URL**     | {{url}}/auth-service/logout |
| --------------- | --------------------------- |
| **Method**      | GET                         |
| **Description** | Logout from Admin Portal    |

#### **Input** <a href="#logout-input" id="logout-input"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                                                                                                                             |
| --------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization(Header) | String   | Yes           | Bearer 1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6 |

#### **Output** <a href="#logout-output" id="logout-output"></a>

```
    responseCode": 200
```


# Operating Unit Create

| **API URL**     | {{url}}/user-service/organization/create-operating-unit |
| --------------- | ------------------------------------------------------- |
| **Method**      | POST                                                    |
| **Description** | Create Operating unit                                   |

#### **Input** <a href="#operatingunitcreate-input" id="operatingunitcreate-input"></a>

| **Field Name**       | **Type** | **Mandatory** | **Example**          |
| -------------------- | -------- | ------------- | -------------------- |
| name                 | String   | Yes           | Hablot Manos         |
| account              | Number   | No            | 15                   |
| parentOrganizationId | Number   | Yes           | 156                  |
| tenantId             | Number   | Yes           | 156                  |
| countryId            | Number   | Yes           | 4                    |
| username             | String   | Yes           | <johnbxxx@sxxxe.xxx> |
| firstName            | String   | Yes           | Kennedy              |
| lastName             | String   | Yes           | John                 |
| gender               | String   | No            | Male                 |
| id(countryId)        | Number   | Yes           | 4                    |
| countryCode          | Number   | Yes           | 232                  |
| phoneNumber          | String   | Yes           | 733XXX701X           |
| id(timezone)         | Number   | Yes           | 3                    |

#### **Sample Input:** <a href="#operatingunitcreate-sampleinput" id="operatingunitcreate-sampleinput"></a>

{

"name": "Hablot Manos",

“account”: 15,\
"parentOrganizationId": 156,\
"tenantId":156,\
"countryId": 4,\
"users": \[\
{\
"username": "<davidbxxxn@sxxxe.xxx>",\
"firstName": "Kennedy",\
"lastName": "John",\
"gender": "male",\
"country": {\
"id": 4\
},\
"countryCode": "1",\
"phoneNumber": "756XXX709X",\
"timezone": {\
"id": 2\
}\
}\
]

}

#### **Sample Output:** <a href="#operatingunitcreate-sampleoutput" id="operatingunitcreate-sampleoutput"></a>

```
"message": "Organization created successfully. "
```


# Reset Password

| **API URL**     | {{url}}/user-service/user/reset-password/{{token}} |
| --------------- | -------------------------------------------------- |
| **Method**      | POST                                               |
| **Description** | Reset password after Forgot password               |

#### **Input** <a href="#resetpassword-input" id="resetpassword-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**     |
| -------------- | -------- | ------------- | --------------- |
| password       | String   | Yes           | Hashed password |

#### **Sample Input:** <a href="#resetpassword-sampleinput" id="resetpassword-sampleinput"></a>

#### { <a href="#resetpassword" id="resetpassword"></a>

&#x20;   "password": "3901e08e724bb73a72137e03e2f03d54d70eaeea39f8a7e0459f15d9e80585ffd2159283b8324d72f7ba8c2aa2f0e82e5c1b685d7ef569e2ebad02d71ba4076e"

}

**Sample Output:**

```
{
    "message": "Password has been set successfully.",
    "entity": true,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Set Password for New User

| **API URL**     | {{url}}/user-service/user/set-password/{{token}} |
| --------------- | ------------------------------------------------ |
| **Method**      | POST                                             |
| **Description** | Set Password for new user creation               |

#### **Input** <a href="#setpasswordfornewuser-input" id="setpasswordfornewuser-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**     |
| -------------- | -------- | ------------- | --------------- |
| password       | String   | Yes           | Hashed password |

#### **Sample Input:** <a href="#setpasswordfornewuser-sampleinput" id="setpasswordfornewuser-sampleinput"></a>

#### { <a href="#setpasswordfornewuser" id="setpasswordfornewuser"></a>

&#x20;   "password": "3901e08e724bb73a72137e03e2f03d54d70eaeea39f8a7e0459f15d9e80585ffd2159283b8324d72f7ba8c2aa2f0e82e5c1b685d7ef569e2ebad02d71ba4076e"

}

**Sample Output:**

```
{
    "message": "Password has been set successfully.",
    "entity": {
        "isPasswordSet": true
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Site Create

| **API URL**     | {{url}}/user-service/organization/create-site |
| --------------- | --------------------------------------------- |
| **Method**      | POST                                          |
| **Description** | Create site                                   |

#### **Input** <a href="#sitecreate-input" id="sitecreate-input"></a>

| **Field Name**       | **Type** | **Mandatory** | **Example**                                  |
| -------------------- | -------- | ------------- | -------------------------------------------- |
| name                 | String   | Yes           | ZikandaClinic                                |
| siteType             | String   | Yes           | Clinic                                       |
| addressUse           | String   | Yes           | Home                                         |
| addressType          | String   | Yes           | Physical                                     |
| countyId             | Number   | Yes           | 29                                           |
| subCountyId          | Number   | Yes           | 265                                          |
| culture              | Number   | Yes           | 1                                            |
| latitude             | Number   | Yes           | 1                                            |
| longitude            | Number   | Yes           | 1                                            |
| city                 | String   | Yes           | New Zealand, Christchurch City, Christchurch |
| siteLevel            | String   | Yes           | Level 3                                      |
| accountId            | Number   | Yes           | 2                                            |
| parentOrganizationId | Number   | Yes           | 277                                          |
| tenantId             | Number   | Yes           | 277                                          |
| id(operatingUnit)    | Number   | Yes           | 6                                            |
| countryId            | Number   | Yes           | 1                                            |
| cultureId            | Number   | Yes           | 1                                            |
| address1             | String   | Yes           | Christ road                                  |
| postalCode           | Number   | Yes           | 43233                                        |
| phoneNumber          | String   | Yes           | 987XXX27XX                                   |
| firstName            | String   | Yes           | Henry                                        |
| lastName             | String   | Yes           | Williams                                     |
| gender               | String   | No            |                                              |
| username             | String   | Yes           | <henrywixxxams@xxxx.xxx>                     |
| id(country)          | Number   | Yes           | 2                                            |
| id(timezone)         | Number   | Yes           | 58                                           |
| name(role)           | String   | Yes           | PHYSICIAN\_PRESCRIBER                        |
| countryCode          | Number   | Yes           | 232                                          |

#### **Sample Input:** <a href="#sitecreate-sampleinput" id="sitecreate-sampleinput"></a>

{\
"name": "ZikandaClinic",\
"siteType": "Clinic",\
"addressUse": "Work",\
"addressType": "Physical",\
"countyId": 51,\
"subCountyId": 416,\
"culture": 1,\
"latitude": "1",\
"longitude": "1",\
"city": "New Zealand, Christchurch City, Christchurch",\
"siteLevel": "Level 3",\
"accountId": 2,\
"parentOrganizationId": 277,\
"tenantId": 277,\
"operatingUnit": {\
"id": 6\
},\
"countryId": 2,\
"cultureId": 1,\
"address1": "Christ road",\
"postalCode": 94932,\
"phoneNumber": "987XXX278X",\
"users": \[\
{\
"firstName": "Henry",\
"lastName": "Williams",\
"phoneNumber": "848XXX358X",\
"gender": "",\
"username": "<henrywxxxams@xxx.xxx>",\
"country": {\
"id": 2\
},\
"timezone": {\
"id": 58\
},\
"roles": \[\
{\
"name": "PHYSICIAN\_PRESCRIBER"\
}\
],\
"countryCode": "232"\
}\
]\
}

#### **Sample Output:** <a href="#sitecreate-sampleoutput" id="sitecreate-sampleoutput"></a>

```
"message": "Organization created successfully. "
```


# Unlock User

| **API URL**     | {{url}}/user-service/user/unlock |
| --------------- | -------------------------------- |
| **Method**      | POST                             |
| **Description** | To unlock user                   |

#### **Input** <a href="#unlockuser-input" id="unlockuser-input"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**               |
| ---------------------- | -------- | ------------- | ------------------------- |
| Authorization (Header) |          |               | Token form login response |
| id                     | String   | Yes           | User ID                   |

#### **Sample Input:** <a href="#unlockuser-sampleinput" id="unlockuser-sampleinput"></a>

{    "id":"395" }

#### **Sample Output:** <a href="#unlockuser-sampleoutput" id="unlockuser-sampleoutput"></a>

```
  {
    "message": "User unlocked successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# User Profile Update

| **API URL**     | {{url}}/user-service/user/update |
| --------------- | -------------------------------- |
| **Method**      | POST                             |
| **Description** | Update user profile              |

#### **Input** <a href="#userprofileupdate-input" id="userprofileupdate-input"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**                                                                                                                             |
| ---------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization (Header) | String   | Yes           | Bearer 1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6 |

#### **Sample Input** <a href="#userprofileupdate-sampleinput" id="userprofileupdate-sampleinput"></a>

```
{
  "id": 2,
  "username": "supexxxin-bd@sxxxce.mxxt",
  "gender": "Female",
  "roles": [
    {
      "id": 2,
      "name": "SUPER_ADMIN",
      "level": null,
      "authority": "SUPER_ADMIN",
      "createdBy": 1,
      "updatedBy": 1,
      "createdAt": "2023-01-12T09:00:47-08:00",
      "updatedAt": "2023-01-12T09:00:47-08:00",
      "active": true,
      "deleted": false
    }
  ],
  "active": true,
  "firstName": "Superadmin",
  "lastName": "Test",
  "phoneNumber": "244XXX45XX",
  "timezone": {
    "id": 107,
    "createdBy": null,
    "updatedBy": null,
    "createdAt": "2022-05-10T22:49:06-08:00",
    "updatedAt": "2022-05-10T22:49:06-08:00",
    "abbreviation": "BST",
    "description": "(UTC+06:00) Bangladesh Standard Time",
    "offset": "+06:00",
    "active": true,
    "deleted": false
  },
  "organizations": [],
  "isBlocked": false,
  "countryCode": "202",
  "tenantId": 15,
  "isSuperUser": false,
  "defaultRoleName": "SUPER_ADMIN",
  "redRisk": false,
  "roleName": "SUPER_ADMIN",
  "culture": {
    "id": 1,
    "name": "English - India"
  }
}
```

#### **Sample Output** <a href="#userprofileupdate-sampleoutput" id="userprofileupdate-sampleoutput"></a>

```
{
  "message": "User updated successfully.",
  "entity": {
    "id": 2,
    "createdBy": 1,
    "updatedBy": 2,
    "createdAt": "2023-03-07T20:26:43-08:00",
    "updatedAt": "2023-05-03T02:15:37-08:00",
    "username": "superadXXX-bd@XXX.XXX",
    "gender": "Female",
    "roles": [
      {
        "id": 2,
        "name": "SUPER_ADMIN",
        "level": null,
        "authority": "SUPER_ADMIN",
        "createdBy": 1,
        "updatedBy": 1,
        "createdAt": "2023-01-12T09:00:47-08:00",
        "updatedAt": "2023-01-12T09:00:47-08:00",
        "active": true,
        "deleted": false
      }
    ],
    "active": true,
    "blockedDate": null,
    "forgetPasswordToken": null,
    "forgetPasswordTime": "2023-03-24T02:59:08-08:00",
    "forgetPasswordCount": 1,
    "invalidLoginTime": null,
    "invalidLoginAttempts": 0,
    "invalidResetTime": null,
    "isPasswordResetEnabled": false,
    "passwordResetAttempts": 0,
    "lastLoggedIn": null,
    "lastLoggedOut": null,
    "address": null,
    "accountExpired": false,
    "accountLocked": false,
    "credentialsExpired": false,
    "authorization": null,
    "currentDate": 0,
    "firstName": "Superadmin",
    "lastName": "Test",
    "middleName": null,
    "subject": null,
    "phoneNumber": "244XX345XX",
    "country": null,
    "timezone": {
      "id": 107,
      "offset": "+06:00",
      "description": "(UTC+06:00) Bangladesh Standard Time"
    },
    "organizations": [],
    "isBlocked": false,
    "countryCode": "202",
    "deviceInfoId": null,
    "tenantId": 15,
    "isSuperUser": false,
    "cultureId": null,
    "deleted": false,
    "licenseAcceptance": false
  },
  "status": true,
  "entityList": null,
  "responseCode": 200,
  "totalCount": null
}
```


# Validate User Email

| **API URL**     | {{url}}/user-service/user/validate-user |
| --------------- | --------------------------------------- |
| **Method**      | POST                                    |
| **Description** | Validating a new user’s username        |

#### **Input** <a href="#validateuseremail-input" id="validateuseremail-input"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**                                                                                                                             |
| ---------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization (Header) | String   | Yes           | Bearer 1ba363a1edf54402b51f58060aa52b11d30f99a490295adec900fdabf2b472181c0bfb165be18f4f5c430c7218a244bd29b9300d3471acc08197ccfb996118f6 |

#### **Sample Input:** <a href="#validateuseremail-sampleinput" id="validateuseremail-sampleinput"></a>

```
{
    "email":"superXXXin@XXX.mdt"
}
```

#### **Sample Output 1: If new user** <a href="#validateuseremail-sampleoutput1-ifnewuser" id="validateuseremail-sampleoutput1-ifnewuser"></a>

```
{
    "message": "Got user.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```

#### **Sample Output 2: If user exist** <a href="#validateuseremail-sampleoutput2-ifuserexist" id="validateuseremail-sampleoutput2-ifuserexist"></a>

```
{
    "message": "Got user.",
    "entity": {
        "id": 2,
        "username": "DDDD-bd@DDD.mdt",
        "gender": "Female",
        "roles": [
            {
                "id": 2,
                "name": "SUPER_ADMIN",
                "level": null,
                "authority": "SUPER_ADMIN",
                "createdBy": 1,
                "updatedBy": 1,
                "createdAt": "2023-01-12T23:00:47+06:00",
                "updatedAt": "2023-01-12T23:00:47+06:00",
                "active": true,
                "deleted": false
            }
        ],
        "active": true,
        "firstName": "Superadmin",
        "lastName": "Test",
        "phoneNumber": "24AASS534534",
        "timezone": {
            "id": 2,
            "offset": "-08:00",
            "description": "(UTC-08:00) Baja California"
        },
        "organizations": [],
        "isBlocked": false,
        "countryCode": "202",
        "tenantId": 15,
        "isSuperUser": false,
        "defaultRoleName": "SUPER_ADMIN",
        "redRisk": false
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Verify Set Password

| **API URL**     | {{url}}/user-service/user/verify-set-password/{forgot-password-token} |
| --------------- | --------------------------------------------------------------------- |
| **Method**      | GET                                                                   |
| **Description** | Verify if user has changed/set password                               |

#### **Sample Input:** <a href="#verifysetpassword-sampleinput" id="verifysetpassword-sampleinput"></a>

{{url}}/user-service/user/verify-set-password/eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJTcGljZUFwcGxpY2F0aW9uIiwiZXhwIjoxNjc3MjE0MDY0LCJpYXQiOjE2NzcxMjc2NjQsImp0aSI6IjY0ODYiLCJ1c2VybmFtZSI6InN1cGVyYWRtaW5Ac3BpY2UubWR0In0.0CxV9oah6Cs8hz2GdcIDFklv7M8yJT-iLyIqRKKd8iA

#### **Sample Output 1:** <a href="#verifysetpassword-sampleoutput1" id="verifysetpassword-sampleoutput1"></a>

```
{
   "message": "Got Super Admin Users.",
   "entity": {
       "isPasswordSet": false
   },
   "status": true,
   "entityList": null,
   "responseCode": 200,
   "totalCount": null
}
```

#### **Sample Output 2:** <a href="#verifysetpassword-sampleoutput2" id="verifysetpassword-sampleoutput2"></a>

```
{
    "dateTime": 1683040301487,
    "status": false,
    "errorCode": 404,
    "message": "Your Account Has Been Already Activated.",
    "exception": "Your Account Has Been Already Activated."
}
```


# Super Admin


# Superadmin Details

| **API URL**     | {{url}}/user-service/user/super-admin/details/{id} |
| --------------- | -------------------------------------------------- |
| **Method**      | Get                                                |
| **Description** | View superadmin details                            |

#### **Input** <a href="#superadmindetails-input" id="superadmindetails-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**    |
| -------------- | -------- | ------------- | -------------- |
| id             | number   | Yes           | 6486\[User Id] |

#### **Sample Input:** <a href="#superadmindetails-sampleinput" id="superadmindetails-sampleinput"></a>

{{url}}/user-service/user/super-admin/details/6486

#### **Output** <a href="#superadmindetails-output" id="superadmindetails-output"></a>

| **Field Name** | **Type** | **Comments**              |
| -------------- | -------- | ------------------------- |
| `id`           | Number   | Superadmin Id             |
| `firstName`    | String   | Superadmin First name     |
| `lastName`     | String   | Superadmin Last name      |
| `gender`       | String   | Superadmin Gender         |
| `tenantId`     | Number   | Superadmin Tenant ID      |
| `email`        | String   | Superadmin Email ID       |
| `phoneNumber`  | String   | Superadmin Phone number   |
| `createdAt`    | String   | Superadmin created time   |
| `updatedAt`    | String   | Superadmin updated time   |
| `id`           | Number   | Timezone ID               |
| `offset`       | String   | Timezone offset           |
| `description`  | String   | Timezone description      |
| `countryCode`  | Number   | Phone number country code |
| `username`     | String   | Superadmin mail ID        |

#### **Sample Output:** <a href="#superadmindetails-sampleoutput" id="superadmindetails-sampleoutput"></a>

```
{
"message": "Got Super Admin Users.",
"entity": {
        "id": 6486,
        "firstName": "Super",
        "lastName": "Admin",
        "gender": null,
        "tenantId": 0,
        "email": "superadxxx@spxxx.xxx",
        "phoneNumber": "733XXX701X",
        "createdAt": "2023-01-30T19:56:36+05:30",
        "updatedAt": "2023-02-08T17:27:08+05:30",
        "timezone": {
            "id": 45,
            "offset": "+05:30",
            "description": "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi"
        },
        "countryCode": "91",
        "timezoneId": 45,
        "username": "superadxxx@spxxx.xxx"
    }
```


# Superadmin List

| **API URL**     | {{url}}/user-service/user/super-admin/list |
| --------------- | ------------------------------------------ |
| **Method**      | POST                                       |
| **Description** | Get Super admin lists                      |

#### **Sample Input:** <a href="#superadminlist-sampleinput" id="superadminlist-sampleinput"></a>

#### { <a href="#superadminlist" id="superadminlist"></a>

&#x20; “limit”: “2“

}

#### **Output** <a href="#superadminlist-output" id="superadminlist-output"></a>

| **Field Name** | **Type** | **Comments**               |
| -------------- | -------- | -------------------------- |
| `id`           | Number   | Superadmin ID              |
| `firstname`    | String   | Superadmin First name      |
| `lastName`     | String   | Superadmin Last name       |
| `gender`       | String   | Superadmin Gender          |
| `tenantId`     | Number   | Superadmin tenant ID       |
| `email`        | String   | Superadmin Email ID        |
| `phoneNumber`  | String   | Superadmin Phone number    |
| `createdAt`    | String   | Superadmin Created at date |
| `updatedAt`    | String   | Superadmin Updated at date |
| `timezone`     | String   | Superadmin timezone        |
| `id`           | Number   | Superadmin id              |
| `offset`       | String   | Superadmin timezone offset |
| `description`  | String   | Timezone description       |
| `countryCode`  | Number   | Phone number country code  |
| `timezoneId`   | Number   | Timezone ID                |

#### **Sample Output:** <a href="#superadminlist-sampleoutput" id="superadminlist-sampleoutput"></a>

```
{{
            "id": 6486,
            "firstName": "Super",
            "lastName": "Admin",
            "gender": null,
            "tenantId": 174,
            "email": "supxxxmin@xxx.xxx",
            "phoneNumber": "73xxxxx17",
            "createdAt": "2023-01-30T19:56:36+05:30",
            "updatedAt": "2023-02-08T16:30:27+05:30",
            "timezone": {
                "id": 45,
                "offset": "+05:30",
                "description": "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi"
            },
            "countryCode": "91",
            "timezoneId": 45,
            "username": "supexxxmin@sxxxe.xxx"
        },
        {
            "id": 3023,
            "firstName": "Kelly",
            "lastName": "Shelden",
            "gender": "Female",
            "tenantId": 0,
            "email": "kexxy.a.xxx@xxx.xxx",
            "phoneNumber": "202xxx649",
            "createdAt": "2022-05-20T17:39:55+05:30",
            "updatedAt": "2022-05-20T17:46:42+05:30",
            "timezone": {
                "id": 99,
                "offset": "-07:00",
                "description": "(UTC-07:00) Pacific Time (US & Canada)"
            },
            "countryCode": "1",
            "timezoneId": 99,
            "username": "kexxx.a.xxx@xxx.xxx"
        }
        "responseCode": 200,
        "totalCount": 2
        }
```


# Superadmin Create

| **API URL**     | {{url}}/user-service/user/super-admin/create |
| --------------- | -------------------------------------------- |
| **Method**      | Post                                         |
| **Description** | Create Superadmin                            |

#### **Input** <a href="#superadmincreate-input" id="superadmincreate-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**          |
| -------------- | -------- | ------------- | -------------------- |
| firstName      | String   | Yes           | Henry                |
| lastName       | String   | Yes           | Davis                |
| phoneNumber    | String   | Yes           | 733XXX701X           |
| email          | String   | Yes           | <henxxxavis@xxx.xxx> |
| countryCode    | String   | Yes           | 91                   |
| timezone       | Number   | Yes           | 1                    |
| gender         | String   | No            | Male                 |

#### **Sample Input:** <a href="#superadmincreate-sampleinput" id="superadmincreate-sampleinput"></a>

\[\
{\
"firstName": "Hemanath",\
"lastName": "D",\
"gender": "Male",\
"email": "<hexxrydaxxx@xxx.xxx>",\
"phoneNumber": "7338XXX01X",\
"timezone": {\
"id": 1\
},\
"countryCode": "91"\
}\
]

#### **Sample Output:** <a href="#superadmincreate-sampleoutput" id="superadmincreate-sampleoutput"></a>

```
"message": "Super Admin created successfully."
```


# Superadmin Delete

| **API URL**     | {{url}}/user-service/user/super-admin/remove/{id} |
| --------------- | ------------------------------------------------- |
| **Method**      | PUT                                               |
| **Description** | Delete Superadmin                                 |

#### **Input** <a href="#superadmindelete-input" id="superadmindelete-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**   |
| -------------- | -------- | ------------- | ------------- |
| id             | Number   | Yes           | 6520(user Id) |

#### **Sample Input:** <a href="#superadmindelete-sampleinput" id="superadmindelete-sampleinput"></a>

{{url}}/user-service/user/super-admin/remove/31<br>

#### **Sample Output:** <a href="#superadmindelete-sampleoutput" id="superadmindelete-sampleoutput"></a>

```
    "message": "Super Admin Role removed successfully."
```


# Superadmin Update

| **API URL**     | {{url}}/user-service/user/super-admin/update |
| --------------- | -------------------------------------------- |
| **Method**      | POST                                         |
| **Description** | Update Superadmin details                    |

#### **Input** <a href="#superadminupdate-input" id="superadminupdate-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**           |
| -------------- | -------- | ------------- | --------------------- |
| id             | Number   | Yes           | 6520                  |
| firstName      | String   | Yes           | Henry                 |
| lastName       | String   | Yes           | Davis                 |
| phoneNumber    | String   | Yes           | 733XXX701X            |
| email          | String   | Yes           | <hexxrydaxxx@xxx.xxx> |
| countryCode    | String   | Yes           | 91                    |
| timezone       | Number   | Yes           | 1                     |
| gender         | String   | No            | Male                  |

#### **Sample Input:** <a href="#superadminupdate-sampleinput" id="superadminupdate-sampleinput"></a>

{

“id”:6520\
"firstName": "xxxxnath",\
"lastName": "D",\
"gender": "Male",\
"email": "<henrydaxxx@xxx.xxx>",\
"phoneNumber": "7338XXX01X",\
"timezone": {\
"id": 1\
},\
"countryCode": "91"\
}<br>

#### **Sample Output:** <a href="#superadminupdate-sampleoutput" id="superadminupdate-sampleoutput"></a>

```
"message": "Super Admin Details update successfully."
```


# Admin Services


# Account


# Account - Activate

| **API URL**     | {{url}}/admin-service/account/activate    |
| --------------- | ----------------------------------------- |
| **Method**      | PUT                                       |
| **Description** | Activate the account which is deactivated |

#### **Input**: <a href="#account-activate-input" id="account-activate-input"></a>

| **Field Name** | **Type** | **Comments** |
| -------------- | -------- | ------------ |
| `tenantId`     | Number   | 347          |

#### **Sample Input:** <a href="#account-activate-sampleinput" id="account-activate-sampleinput"></a>

{\
"tenantId":347

}

#### **Sample Output:** <a href="#account-activate-sampleoutput" id="account-activate-sampleoutput"></a>

```
{
    "message": "Account activated successfully."
}
```


# Account - Deactivate

| **API URL**     | {{url}}/admin-service/account/deactivate |
| --------------- | ---------------------------------------- |
| **Method**      | PUT                                      |
| **Description** | Deactivate the account                   |

#### **Input** <a href="#account-deactivate-input" id="account-deactivate-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**   |
| -------------- | -------- | ------------- | ------------- |
| status         | String   | Yes           | Inactive site |

#### **Sample Input:** <a href="#account-deactivate-sampleinput" id="account-deactivate-sampleinput"></a>

{\
"tenantId":460,\
"status":"Inactive site"\
}

#### **Output** <a href="#account-deactivate-output" id="account-deactivate-output"></a>

| **Field Name** | **Type** | **Comments** |
| -------------- | -------- | ------------ |
| `tenantId`     | Number   | 460          |

#### **Sample Output:** <a href="#account-deactivate-sampleoutput" id="account-deactivate-sampleoutput"></a>

```
{
    "message": "Account deactivated successfully."
}
```


# Account - Deactivated list

| **API URL**     | {{url}}/admin-service/account/deactivate-list |
| --------------- | --------------------------------------------- |
| **Method**      | POST                                          |
| **Description** | List the deactivate account                   |

#### **Sample Input:** <a href="#account-deactivatedlist-sampleinput" id="account-deactivatedlist-sampleinput"></a>

{\
"skip": 0,\
"limit": 4,\
"tenantId": "",\
"isPaginated": true\
}

#### **Output** <a href="#account-deactivatedlist-output" id="account-deactivatedlist-output"></a>

| **Field Name**    | **Type** | **Comments**                       |
| ----------------- | -------- | ---------------------------------- |
| `id`              | Number   | Account id                         |
| `name`            | String   | Account name                       |
| `maxNoOfUsers`    | Number   | maximum number of users in account |
| `tenantId`        | Number   | Account tenant id                  |
| `id`              | Number   | Country id                         |
| `name`            | String   | Country name                       |
| `unitMeasurement` | String   | Unit measurement format            |
| `countryCode`     | String   | Country code                       |

#### **Sample Output:** <a href="#account-deactivatedlist-sampleoutput" id="account-deactivatedlist-sampleoutput"></a>

```
{
    "message": "Got deactivated accounts.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 54,
            "name": "Healthcare001",
            "maxNoOfUsers": 100,
            "updatedAt": "2023-02-24T12:36:11+05:30",
            "tenantId": 460,
            "country": {
                "id": 3,
                "name": "Ghana",
                "countryCode": "233",
                "unitMeasurement": "metric"
            }
        },
        {
            "id": 44,
            "name": "Nk healthcare",
            "maxNoOfUsers": 100,
            "updatedAt": "2023-02-20T17:58:39+05:30",
            "tenantId": 406,
            "country": {
                "id": 3,
                "name": "Ghana",
                "countryCode": "233",
                "unitMeasurement": "metric"
            }
        }
    ],
    "responseCode": 200,
    "totalCount": 10
}
```


# Account - Details

| **API URL**     | {{url}}/admin-service/account/details |
| --------------- | ------------------------------------- |
| **Method**      | POST                                  |
| **Description** | Account details                       |

#### **Input**: <a href="#account-details-input" id="account-details-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example** |
| -------------- | -------- | ------------- | ----------- |
| tenantId       | Number   | Yes           | 208         |
| id             | Number   | Yes           | 4           |

#### **Sample Input:** <a href="#account-details-sampleinput" id="account-details-sampleinput"></a>

{\
"tenantId": 208,\
"id": 4\
}

#### **Output:** <a href="#account-details-output" id="account-details-output"></a>

| **Field Name**    | **Type** | **Comments**                       |
| ----------------- | -------- | ---------------------------------- |
| `id`              | Number   | Account id                         |
| `name`            | String   | Account name                       |
| `maxNoOfUsers`    | Number   | Maximum number of users in account |
| `tenantId`        | Number   | Account tenant id                  |
| `id`              | Number   | Country id                         |
| `unitMeasurement` | String   | Unit measurement format            |
| `id`              | Number   | Clinical workflow id               |
| `name`            | String   | Clinical workflow name             |
| `workflow`        | String   | Workflow                           |
| `moduleType`      | String   | Workflow module type               |
| `default`         | String   | Default for workflow true/false    |
| `id`              | Number   | Account admin id                   |
| `username`        | String   | Account admin mail id              |
| `firstName`       | String   | Account admin first name           |
| `lastName`        | String   | Account admin last name            |
| `gender`          | String   | Account admin gender               |
| `countryCode`     | String   | Country code for phone number      |
| `phoneNumber`     | String   | Account admin phone number         |
| `id`              | Number   | Time zone id                       |
| `offset`          | Number   | Time zone offset                   |
| `description`     | String   | Time zone description              |

#### **Sample Output:** <a href="#account-details-sampleoutput" id="account-details-sampleoutput"></a>

```
{
    "message": "Got account.",
    "entity": {
        "id": 4,
        "name": "Ghana Health Service",
        "maxNoOfUsers": 100,
        "tenantId": 208,
        "country": {
            "id": 3,
            "name": "Ghana",
            "countryCode": "233",
            "unitMeasurement": "metric"
        },
        "clinicalWorkflow": [
            {
                "id": 1,
                "name": "mental health",
                "workflow": "phq4",
                "moduleType": "clinical",
                "default": false
            },
            {
                "id": 3,
                "name": "hypertension",
                "workflow": "bp_log",
                "moduleType": "clinical",
                "default": true
            },
            {
                "id": 4,
                "name": "diabetics",
                "workflow": "glucose_log",
                "moduleType": "clinical",
                "default": true
            }
        ],
        "customizedWorkflow": [
            {
                "id": 40,
                "name": "Gasstroke",
                "workflow": "gasstroke",
                "moduleType": "customized",
                "default": false
            }
        ],
        "users": [
            {
                "id": 183,
                "username": "GH_xxxxxHealthService@spice.com",
                "firstName": "Ghana Health Service",
                "lastName": "Ghana Health Service",
                "gender": null,
                "country": {
                    "id": 3,
                    "name": "Ghana",
                    "countryCode": "233",
                    "unitMeasurement": "metric"
                },
                "countryCode": "233",
                "phoneNumber": "78737XXX5",
                "timezone": {
                    "id": 88,
                    "offset": "+00:00",
                    "description": "(UTC) Monrovia, Reykjavik"
                }
            }
        ],
        "countryCode": "233"
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Account - Update

| **API URL**     | {{url}}/admin-service/account/update |
| --------------- | ------------------------------------ |
| **Method**      | PUT                                  |
| **Description** | Account update                       |

#### **Input** <a href="#account-update-input" id="account-update-input"></a>

| **Field Name**     | **Type** | **Mandatory** | **Example**                     |
| ------------------ | -------- | ------------- | ------------------------------- |
| id                 | Number   | Yes           | 11                              |
| name               | String   | Yes           | Africa Heart Associates Account |
| countryId          | Number   | Yes           | 4                               |
| clinicalWorkflow   | Number   | Yes           | 1                               |
| customizedWorkflow | Number   | Yes           | 11                              |

#### **Sample Input:** <a href="#account-update-sampleinput" id="account-update-sampleinput"></a>

{\
"id":11,\
"name": "Africa Heart Associates Account",\
"countryId": 4,\
"clinicalWorkflow": \[\
1\
],\
"customizedWorkflow": \[\
11\
],\
"tenantId":211\
}

#### **Sample Output:** <a href="#account-update-sampleoutput" id="account-update-sampleoutput"></a>

```
{
    "message": "Account updated successfully."
}
```


# Account Admin - Create

| **API URL**     | {{url}}/admin-service/account/user-add |
| --------------- | -------------------------------------- |
| **Method**      | POST                                   |
| **Description** | Create Account admin                   |

#### **Input** <a href="#accountadmin-create-input" id="accountadmin-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**             |
| -------------- | -------- | ------------- | ----------------------- |
| firstName      | String   | Yes           | Henry                   |
| phoneNumber    | String   | Yes           | 733XXX7017              |
| gender         | String   | No            | Male                    |
| username       | String   | Yes           | <novoaccxxxx@spice.mdt> |
| lastName       | String   | Yes           | Rane                    |
| timezone       | Number   | Yes           | 1                       |
| id(country)    | Number   | Yes           | 3                       |

#### **Sample Input:** <a href="#accountadmin-create-sampleinput" id="accountadmin-create-sampleinput"></a>

{\
"firstName": "Damoor",\
"phoneNumber": "87XXX87437",\
"gender": "",\
"username": "<novoaxxxunt@spice.mdt>",\
"lastName": "Rane",\
"country": {\
"id": "3"\
},\
"timezone": {\
"id": 60\
},\
"countryCode": "232",\
"tenantId": 71\
}

#### **Sample Output:** <a href="#accountadmin-create-sampleoutput" id="accountadmin-create-sampleoutput"></a>

```
{
    "message": "Account Admin created successfully."
}
```


# Account Admin - Delete

| **API URL**     | {{url}}/admin-service/account/user-remove |
| --------------- | ----------------------------------------- |
| **Method**      | DELETE                                    |
| **Description** | Delete Account admin                      |

#### **Input** <a href="#accountadmin-delete-input" id="accountadmin-delete-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example** |
| -------------- | -------- | ------------- | ----------- |
| id             | Number   | Yes           | 6617        |
| tenantId       | Number   | Yes           | 71          |

#### **Sample Input:** <a href="#accountadmin-delete-sampleinput" id="accountadmin-delete-sampleinput"></a>

{\
"id": 6617,\
"tenantId": 71\
}

#### **Sample Output:** <a href="#accountadmin-delete-sampleoutput" id="accountadmin-delete-sampleoutput"></a>

```
{
    "message": "Account Admin deleted successfully."   
}
```


# Account Admin - Update

| **API URL**     | {{url}}/admin-service/account/user-update |
| --------------- | ----------------------------------------- |
| **Method**      | PUT                                       |
| **Description** | Account admin update                      |

#### **Input** <a href="#accountadmin-update-input" id="accountadmin-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**            |
| -------------- | -------- | ------------- | ---------------------- |
| id             | Number   | Yes           | 6617                   |
| firstName      | String   | Yes           | Henry                  |
| phoneNumber    | String   | Yes           | 733XXX7017             |
| gender         | String   | No            | Male                   |
| username       | String   | Yes           | <novoxxxxxx@spice.mdt> |
| lastName       | String   | Yes           | Rane                   |
| timezone       | Number   | Yes           | 60                     |
| id(country)    | Number   | Yes           | 3                      |
| tenantId       | Number   | Yes           | 71                     |

#### **Sample Input:** <a href="#accountadmin-update-sampleinput" id="accountadmin-update-sampleinput"></a>

{\
"id": 6617,\
"firstName": "Damor",\
"phoneNumber": "878XXX7437",\
"gender": "",\
"username": "<novoxxxxxx@spice.mdt>",\
"lastName": "Rane",\
"country": {\
"id": 3\
},\
"timezone": {\
"id": 60\
},\
"countryCode": "232",\
"tenantId": 71\
}

#### **Sample Output:** <a href="#accountadmin-update-sampleoutput" id="accountadmin-update-sampleoutput"></a>

```
{
    "message": "Account Admin updated successfully.",   
}
```


# Account Dashboard - Region Admin

| **API URL**     | {{url}}/admin-service/account/list         |
| --------------- | ------------------------------------------ |
| **Method**      | POST                                       |
| **Description** | Get account list in region admin dashboard |

#### **Sample Input:** <a href="#accountdashboard-regionadmin-sampleinput" id="accountdashboard-regionadmin-sampleinput"></a>

{     &#x20;

"tenantId":156

}

#### **Output** <a href="#accountdashboard-regionadmin-output" id="accountdashboard-regionadmin-output"></a>

| **Field Name**    | **Type** | **Comments**         |
| ----------------- | -------- | -------------------- |
| `id(Account)`     | Number   | 6                    |
| `name`            | String   | Kisumu Heart Account |
| `siteCount`       | Number   | 1                    |
| `tenantId`        | Number   | 195                  |
| `oucount`         | Number   | 1                    |
| `name(country)`   | String   | Kenya                |
| `countryCode`     | String   | 254                  |
| `unitMeasurement` | String   | metric               |

#### **Sample Output:** <a href="#accountdashboard-regionadmin-sampleoutput" id="accountdashboard-regionadmin-sampleoutput"></a>

```
{
    "message": "Got all Accounts.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 6,
            "name": "Kisumu Heart Account",
            "siteCount": 1,
            "tenantId": 195,
            "oucount": 1
        },
        {
            "id": 11,
            "name": "Africa Heart Associates Account",
            "siteCount": 0,
            "tenantId": 210,
            "oucount": 1
        }
        ]
        "responseCode": 200,
    "totalCount": 2
    }
```


# Account List - Admin

| **API URL**     | {{url}}/admin-service/account/account-list                       |
| --------------- | ---------------------------------------------------------------- |
| **Method**      | POST                                                             |
| **Description** | Get account list in account menu as Super Admin and Region Admin |

#### **Sample Input:** <a href="#accountlist-admin-sampleinput" id="accountlist-admin-sampleinput"></a>

{     &#x20;

"tenantId":156

}

#### **Output** <a href="#accountlist-admin-output" id="accountlist-admin-output"></a>

| **Field Name**    | **Type** | **Comments**                 |
| ----------------- | -------- | ---------------------------- |
| `id(Account)`     | Number   | 16                           |
| `name`            | String   | Fountain Health Care Account |
| `maxNoOfUsers`    | String   | 100                          |
| `updatedAt`       | String   | 2023-02-14T10:18:24+05:30    |
| `tenantId`        | Number   | 20                           |
| `id(country)`     | Number   | 4                            |
| `name(country)`   | String   | Kenya                        |
| `countryCode`     | String   | 254                          |
| `unitMeasurement` | String   | metric                       |

#### **Sample Output:** <a href="#accountlist-admin-sampleoutput" id="accountlist-admin-sampleoutput"></a>

```
{
"message": "Got all Accounts."
"entityList": [
        {
            "id": 16,
            "name": "Fountain Health Care Account",
            "maxNoOfUsers": 100,
            "updatedAt": "2023-02-14T10:18:24+05:30",
            "tenantId": 20,
            "country": {
                "id": 4,
                "name": "Kenya     ",
                "countryCode": "254",
                "unitMeasurement": "metric"
            }
        },
        {
            "id": 28,
            "name": "Afyadumu",
            "maxNoOfUsers": 100,
            "updatedAt": "2023-02-13T17:56:02+05:30",
            "tenantId": 291,
            "country": {
                "id": 4,
                "name": "Kenya     ",
                "countryCode": "254",
                "unitMeasurement": "metric"
            }
        }
        ]
        "responseCode": 200,
    "totalCount": 2
    }
```


# Clinical Workflow


# Create

| **API URL**     | {{url}}/admin-service/clinical-workflow/create |
| --------------- | ---------------------------------------------- |
| **Method**      | POST                                           |
| **Description** | Create clinical workflow                       |

#### **Input** <a href="#clinicalworkflow-create-input" id="clinicalworkflow-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**           |
| -------------- | -------- | ------------- | --------------------- |
| name           | String   | Yes           |                       |
| viewScreens    | Array    | Yes           | Screening, Assessment |
| countryId      | Number   | Yes           | 1                     |
| tenantId       | Number   | Yes           | 1                     |

#### **Sample Input:** <a href="#clinicalworkflow-create-sampleinput" id="clinicalworkflow-create-sampleinput"></a>

{     "name": "Gluocose",     "viewScreens": \[         "Screening",         "Assessment"     ],     "countryId": "1",     "tenantId": "1" }

#### **Sample Output:** <a href="#clinicalworkflow-create-sampleoutput" id="clinicalworkflow-create-sampleoutput"></a>

```
{
    "message": "Account workflow created successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 201,
    "totalCount": null
}
```


# Delete

| **API URL**     | {{url}}/admin-service/clinical-workflow/remove |
| --------------- | ---------------------------------------------- |
| **Method**      | PUT                                            |
| **Description** | Remove clinical workflow                       |

#### **Sample Input:** <a href="#clinicalworkflow-delete-sampleinput" id="clinicalworkflow-delete-sampleinput"></a>

{\
"id": 90,\
"tenantId": "1"\
}

#### **Sample Output:** <a href="#clinicalworkflow-delete-sampleoutput" id="clinicalworkflow-delete-sampleoutput"></a>

```
{
    "message": "Account workflow removed successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# List

| **API URL**     | {{url}}/admin-service/clinical-workflow/list |
| --------------- | -------------------------------------------- |
| **Method**      | POST                                         |
| **Description** | Get clinical workflow list                   |

#### **Sample Input:** <a href="#clinicalworkflow-list-sampleinput" id="clinicalworkflow-list-sampleinput"></a>

{     "countryId": 1,     "skip": 0,     "limit": 10,     "search\_name": "" }

#### **Output** <a href="#clinicalworkflow-list-output" id="clinicalworkflow-list-output"></a>

| **Field Name** | **Type** | **Comments**                    |
| -------------- | -------- | ------------------------------- |
| `id`           | Number   | Clinical workflow id            |
| `name`         | String   | Clinical workflow name          |
| `workflow`     | String   | Clinical workflow key           |
| `moduleType`   | String   | Workflow module type (Clinical) |

#### **Sample Output:** <a href="#clinicalworkflow-list-sampleoutput" id="clinicalworkflow-list-sampleoutput"></a>

```
{
    "message": "Got account workflows.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 3,
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": "2022-01-25T13:21:35+05:30",
            "updatedAt": "2022-01-25T13:21:35+05:30",
            "tenantId": null,
            "name": "hypertension",
            "viewScreens": null,
            "workflow": "bp_log",
            "moduleType": "clinical",
            "countryId": null,
            "refId": "620f828756b9eb8a6b1824b1",
            "default": true,
            "active": true,
            "deleted": false
        },
        {
            "id": 4,
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": "2022-01-25T13:22:15+05:30",
            "updatedAt": "2022-01-25T13:22:15+05:30",
            "tenantId": null,
            "name": "diabetics",
            "viewScreens": null,
            "workflow": "glucose_log",
            "moduleType": "clinical",
            "countryId": null,
            "refId": "620f828756b9eb8a6b1824bc",
            "default": true,
            "active": true,
            "deleted": false
        },
        {
            "id": 1,
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": "2022-01-25T13:22:38+05:30",
            "updatedAt": "2022-01-25T13:22:38+05:30",
            "tenantId": null,
            "name": "mental health",
            "viewScreens": null,
            "workflow": "phq4",
            "moduleType": "clinical",
            "countryId": null,
            "refId": "620f828756b9eb8a6b1824c7",
            "default": false,
            "active": true,
            "deleted": false
        },
        {
            "id": 2,
            "createdBy": 1,
            "updatedBy": 1,
            "createdAt": "2022-01-25T13:22:50+05:30",
            "updatedAt": "2022-01-25T13:22:50+05:30",
            "tenantId": null,
            "name": "pregnancy",
            "viewScreens": null,
            "workflow": "pregnancy",
            "moduleType": "clinical",
            "countryId": null,
            "refId": "620f828756b9eb8a6b1824d6",
            "default": false,
            "active": true,
            "deleted": false
        },
        {
            "id": 67,
            "createdBy": 6486,
            "updatedBy": 6486,
            "createdAt": "2023-02-22T13:46:52+05:30",
            "updatedAt": "2023-02-22T13:47:12+05:30",
            "tenantId": 1,
            "name": "Heart",
            "viewScreens": [
                "Assessment"
            ],
            "workflow": "heart",
            "moduleType": "customized",
            "countryId": 1,
            "refId": null,
            "default": false,
            "active": true,
            "deleted": false
        }
    ],
    "responseCode": 200,
    "totalCount": 5
}
```


# Update

| **API URL**     | {{url}}/admin-service/clinical-workflow/update |
| --------------- | ---------------------------------------------- |
| **Method**      | PUT                                            |
| **Description** | Update clinical workflow                       |

#### **Input** <a href="#clinicalworkflow-update-input" id="clinicalworkflow-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**           |
| -------------- | -------- | ------------- | --------------------- |
| id             | Number   | Yes           | 90                    |
| viewScreens    | Array    | No            | Screening, Enrollment |
| tenantId       | Number   | Yes           | 1                     |

#### **Sample Input:** <a href="#clinicalworkflow-update-sampleinput" id="clinicalworkflow-update-sampleinput"></a>

{     "id": 90,     "viewScreens": \[         "Screening",         "Assessment"     ],     "tenantId": "1" }

#### **Sample Output:** <a href="#clinicalworkflow-update-sampleoutput" id="clinicalworkflow-update-sampleoutput"></a>

```
{
    "message": "Account workflow updated successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Account Customization - Create

| **API URL**     | {{url}}/admin-service/account-customization/create |
| --------------- | -------------------------------------------------- |
| **Method**      | POST                                               |
| **Description** | Create customization form for customized workflow  |

#### **Input** <a href="#accountcustomization-create-input" id="accountcustomization-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**   |
| -------------- | -------- | ------------- | ------------- |
| workflow       | String   | Yes           | smoking       |
| instructions   | Array    | Yes           | Avoid Smoking |

#### **Sample Input:** <a href="#accountcustomization-create-sampleinput" id="accountcustomization-create-sampleinput"></a>

{     "type": "Module",     "countryId": "1",     "tenantId": "1",     "category": "Input\_form",     "formInput": "{\\"time\\":1676956556561,\\"formLayout\\":\[{\\"id\\":\\"smoking\\",\\"viewType\\":\\"CardView\\",\\"title\\":\\"Smoking\\",\\"familyOrder\\":0,\\"isCustomWorkflow\\":true},{\\"id\\":\\"Smoking \\",\\"viewType\\":\\"Instruction\\",\\"title\\":\\"Smoking \\",\\"fieldName\\":\\"Smoking \\",\\"family\\":\\"smoking\\",\\"isSummary\\":false,\\"isMandatory\\":false,\\"isEnabled\\":true,\\"visibility\\":\\"visible\\",\\"instructions\\":\[\\"Avoid Smoking\\",\\"Take Medication\\"],\\"isNotDefault\\":true,\\"orderId\\":1}]}",     "workflow": "smoking",     "clinicalWorkflowId": "91" }

#### **Sample Output:** <a href="#accountcustomization-create-sampleoutput" id="accountcustomization-create-sampleoutput"></a>

```
{
    "message": "Account Customization Form created  successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 201,
    "totalCount": null
}
```


# Account Customization - Details

| **API URL**     | {{url}}/admin-service/account-customization/details |
| --------------- | --------------------------------------------------- |
| **Method**      | POST                                                |
| **Description** | Get account customization details                   |

#### **Sample Input:** <a href="#accountcustomization-details-sampleinput" id="accountcustomization-details-sampleinput"></a>

{     "clinicalWorkflowId": 91,     "countryId": 1,     "tenantId": 1 }

#### **Output:** <a href="#accountcustomization-details-output" id="accountcustomization-details-output"></a>

| **Field Name**       | **Type** | **Comments**              |
| -------------------- | -------- | ------------------------- |
| `id`                 | Number   | Customization id          |
| `tenantId`           | Number   | Country tenant id         |
| `type`               | String   | Module                    |
| `category`           | String   | Form category             |
| `formInput`          | String   | Customization form fields |
| `countryId`          | Number   | Country id                |
| `clinicalWorkflowId` | Number   | Workflow id               |
| `workflow`           | String   | Workflow name             |

#### **Sample Output:** <a href="#accountcustomization-details-sampleoutput" id="accountcustomization-details-sampleoutput"></a>

```
{
    "message": "Got Account Customization forms.",
    "entity": {
        "id": 72,
        "createdBy": 6486,
        "updatedBy": 6486,
        "createdAt": "2023-02-21T10:51:47+05:30",
        "updatedAt": "2023-03-02T15:47:25+05:30",
        "tenantId": 1,
        "type": "Module",
        "category": "Input_form",
        "formInput": "{\"time\":1677752244755,\"formLayout\":[{\"id\":\"smoking\",\"viewType\":\"CardView\",\"title\":\"Smoking\",\"familyOrder\":0,\"isCustomWorkflow\":true},{\"id\":\"Smoking Effects\",\"viewType\":\"Instruction\",\"title\":\"Smoking Effects\",\"fieldName\":\"Smoking Effects\",\"family\":\"smoking\",\"isSummary\":false,\"isMandatory\":false,\"isEnabled\":true,\"visibility\":\"visible\",\"instructions\":[\"Diabetes\",\"Dental problems\",\"Heart disease, stroke and blood circulation problems\",\"Breathing problems and chronic respiratory conditions\"],\"isNotDefault\":true,\"orderId\":1}]}",
        "countryId": 1,
        "clinicalWorkflowId": 91,
        "accountId": null,
        "workflow": "glucose",
        "active": true,
        "deleted": false
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Account Customization - Update

| **API URL**     | {{url}}/admin-service/account-customization/update |
| --------------- | -------------------------------------------------- |
| **Method**      | PUT                                                |
| **Description** | Update customization form for customized workflow  |

#### **Input** <a href="#accountcustomization-update-input" id="accountcustomization-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**                    |
| -------------- | -------- | ------------- | ------------------------------ |
| workflow       | String   | Yes           | smoking                        |
| instructions   | Array    | Yes           | Avoid Smoking, Dental problems |

#### **Sample Input:** <a href="#accountcustomization-update-sampleinput" id="accountcustomization-update-sampleinput"></a>

{\
"type": "Module",\
"countryId": "1",\
"tenantId": "1",\
"category": "Input\_form",\
"formInput": "{\\"time\\":1676962312557,\\"formLayout\\":\[{\\"id\\":\\"smoking\\",\\"viewType\\":\\"CardView\\",\\"title\\":\\"Smoking\\",\\"familyOrder\\":0,\\"isCustomWorkflow\\":true},{\\"id\\":\\"Smoking Effetcs\\",\\"viewType\\":\\"Instruction\\",\\"title\\":\\"Smoking Effetcs\\",\\"fieldName\\":\\"Smoking Effetcs\\",\\"family\\":\\"smoking\\",\\"isSummary\\":false,\\"isMandatory\\":false,\\"isEnabled\\":true,\\"visibility\\":\\"visible\\",\\"instructions\\":\[\\"Diabetes\\",\\"Dental problems\\",\\"Heart disease, stroke and blood circulation problems\\",\\"Breathing problems and chronic respiratory conditions\\"],\\"isNotDefault\\":true,\\"orderId\\":1}]}",\
"id": 72,\
"workflow": "smoking",\
"clinicalWorkflowId": "91"\
}

#### **Sample Output:** <a href="#accountcustomization-update-sampleoutput" id="accountcustomization-update-sampleoutput"></a>

```
{
    "message": "Account Customization Form updated successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Country Dashboard - Superadmin

| **API URL**     | {{url}}/admin-service/data/country/list |
| --------------- | --------------------------------------- |
| **Method**      | POST                                    |
| **Description** | Get country list                        |

#### **Sample Input:** <a href="#countrydashboard-superadmin-sampleinput" id="countrydashboard-superadmin-sampleinput"></a>

{\
"limit": 10,\
"searchTerm": ""

}

#### **Output** <a href="#countrydashboard-superadmin-output" id="countrydashboard-superadmin-output"></a>

| **Field Name**  | **Type** | **Comments** |
| --------------- | -------- | ------------ |
| `id(Country)`   | Number   | 3            |
| `name`          | String   | Ghana        |
| `accountsCount` | Number   | 9            |
| `siteCount`     | Number   | 110          |
| `tenantId`      | Number   | 290          |
| `oucount`       | Number   | 13           |

#### **Sample Output:** <a href="#countrydashboard-superadmin-sampleoutput" id="countrydashboard-superadmin-sampleoutput"></a>

```
{
    "message": "Got Country.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 1,
            "name": "Sierra Leone",
            "accountsCount": 3,
            "siteCount": 10,
            "tenantId": 1,
            "oucount": 8
        },
        {
            "id": 5,
            "name": "US",
            "accountsCount": 1,
            "siteCount": 2,
            "tenantId": 52,
            "oucount": 1
        },
        {
            "id": 2,
            "name": "Tanzania",
            "accountsCount": 2,
            "siteCount": 34,
            "tenantId": 207,
            "oucount": 4
        },
        {
            "id": 3,
            "name": "Ghana",
            "accountsCount": 9,
            "siteCount": 110,
            "tenantId": 290,
            "oucount": 13
        },
        {
            "id": 4,
            "name": "Kenya     ",
            "accountsCount": 20,
            "siteCount": 100,
            "tenantId": 156,
            "oucount": 28
        }
    ],
    "responseCode": 200,
    "totalCount": 5
}
```


# Lab Test


# Create

| **API URL**     | {{url}}/admin-service/labtest/create |
| --------------- | ------------------------------------ |
| **Method**      | POST                                 |
| **Description** | Lab test create                      |

#### **Input** <a href="#labtest-create-input" id="labtest-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example** |
| -------------- | -------- | ------------- | ----------- |
| active         | String   | No            | true        |
| name           | String   | Yes           | Potassium   |
| displayOrder   | Number   | No            | 1           |
| name           | String   | Yes           | Potassium   |
| countryId      | Number   | Yes           | 4           |
| tenantId       | Number   | Yes           | 156         |

#### **Sample Input:** <a href="#labtest-create-sampleinput" id="labtest-create-sampleinput"></a>

{     "active": true,     "labTestResults": \[         {             "name": "Potassium 2",             "displayOrder": 0         }     ],     "name": "Potassium level7",     "countryId": "4",     "tenantId": "156" }

#### **Sample Output:** <a href="#labtest-create-sampleoutput" id="labtest-create-sampleoutput"></a>

```
{
    "message": "Labtest created successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 201,
    "totalCount": null
}
```


# Delete

| **API URL**     | {{url}}/admin-service/labtest/remove |
| --------------- | ------------------------------------ |
| **Method**      | DELETE                               |
| **Description** | Delete lab test                      |

#### **Sample Input:** <a href="#labtest-delete-sampleinput" id="labtest-delete-sampleinput"></a>

{     "id": 158 }

#### **Sample Output:** <a href="#labtest-delete-sampleoutput" id="labtest-delete-sampleoutput"></a>

```
{
    "message": "LabTest status deleted successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Details

| **API URL**     | {{url}}/admin-service/labtest/details |
| --------------- | ------------------------------------- |
| **Method**      | POST                                  |
| **Description** | Lab test details                      |

#### **Sample Input:** <a href="#labtest-details-sampleinput" id="labtest-details-sampleinput"></a>

{     "id": 98,     "tenantId": 156 }

#### **Output** <a href="#labtest-details-output" id="labtest-details-output"></a>

| **Field Name**    | **Type** | **Comments**                 |
| ----------------- | -------- | ---------------------------- |
| `id`              | Number   | Lab test id                  |
| `tenantId`        | Number   | Country id                   |
| `name`            | String   | Lab test name                |
| `id`              | Number   | Lab test result id           |
| `name`            | String   | Lab test result name         |
| `labTestId`       | Number   | Lab test result id           |
| `id`              | Number   | Lab test range id            |
| `labTestResultId` | Number   | Lab test result id           |
| `minimumValue`    | Number   | Lab test range minimum value |
| `maximumValue`    | Number   | Lab test range maximum value |
| `displayOrder`    | Number   | Lab test range display order |
| `displayName`     | String   | Lab test range display name  |
| `active`          | String   | Lab test status              |

#### **Sample Output:** <a href="#labtest-details-sampleoutput" id="labtest-details-sampleoutput"></a>

```
{
    "message": "Got LabTest.",
    "entity": {
        "id": 98,
        "createdBy": 1,
        "updatedBy": 1,
        "createdAt": "2022-05-20T14:43:21+05:30",
        "updatedAt": "2023-03-01T10:31:52+05:30",
        "tenantId": 156,
        "name": "Potassium",
        "displayOrder": 11,
        "labTestResults": [
            {
                "id": 115,
                "createdBy": 1,
                "updatedBy": 6486,
                "createdAt": "2022-05-20T14:44:13+05:30",
                "updatedAt": "2023-03-01T10:31:52+05:30",
                "tenantId": 156,
                "name": "Potassium",
                "labTestId": 98,
                "labTestResultRanges": [
                    {
                        "id": 135,
                        "createdBy": 3025,
                        "updatedBy": 6486,
                        "createdAt": "2022-10-19T00:17:29+05:30",
                        "updatedAt": "2023-03-01T10:31:52+05:30",
                        "tenantId": 156,
                        "labTestId": 98,
                        "labTestResultId": 115,
                        "minimumValue": 4,
                        "maximumValue": 5,
                        "unit": "mEq/L",
                        "unitId": 15,
                        "displayOrder": 1,
                        "displayName": "(3.5 - 5.0 mEq/L)",
                        "active": true,
                        "deleted": false
                    }
                ],
                "displayOrder": 11,
                "active": true,
                "deleted": false
            }
        ],
        "countryId": 4,
        "resultTemplate": true,
        "active": true,
        "deleted": false
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# List

| **API URL**     | {{url}}/admin-service/labtest/list |
| --------------- | ---------------------------------- |
| **Method**      | POST                               |
| **Description** | Get lab test list                  |

#### **Input 1:** <a href="#labtest-list-input1" id="labtest-list-input1"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                                                                                                                                     |
| --------------------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization(Header) | String   | Yes           | Bearer eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.MCm0mJDfpfjlr10Uok79-kTF7fv9Tn7cI5m2WsRDGUd9VS7iRmfbszjuc1-w5D-PYt9CdVxRMGBQlzYauhnI |

#### **Sample Input 1:** <a href="#labtest-list-sampleinput1" id="labtest-list-sampleinput1"></a>

{\
"searchTerm": "",\
"countryId": 4,\
"tenantId": 156\
}

#### **Output 1:** <a href="#labtest-list-output1" id="labtest-list-output1"></a>

| **Field Name** | **Type** | **Comments**      |
| -------------- | -------- | ----------------- |
| `id`           | String   | Lab test id       |
| `countryId`    | Number   | Country id        |
| `tenantId`     | Number   | Country tenant id |
| `name`         | String   | Lab test name     |
| `active`       | String   | Lab test status   |

#### **Sample Output 1:** <a href="#labtest-list-sampleoutput1" id="labtest-list-sampleoutput1"></a>

```
{
    "message": "Got All LabTests.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 98,
            "patientTrackId": null,
            "countryId": 4,
            "roleNames": null,
            "searchTerm": null,
            "patientVisitId": null,
            "tenantId": 156,
            "name": "Potassium",
            "displayOrder": 11,
            "updatedAt": "2023-02-20T13:25:14+05:30",
            "active": true,
            "resultTemplate": true
        },
       
        {
            "id": 95,
            "patientTrackId": null,
            "countryId": 4,
            "roleNames": null,
            "searchTerm": null,
            "patientVisitId": null,
            "tenantId": 156,
            "name": "Lipids",
            "displayOrder": 0,
            "updatedAt": "2022-05-20T14:43:27+05:30",
            "active": true,
            "resultTemplate": true
        },
        {
            "id": 43,
            "patientTrackId": null,
            "countryId": 4,
            "roleNames": null,
            "searchTerm": null,
            "patientVisitId": null,
            "tenantId": 156,
            "name": "Serum alanine aminotransferase (ALT, SGPT)",
            "displayOrder": 19,
            "updatedAt": "2022-05-20T14:43:22+05:30",
            "active": true,
            "resultTemplate": true
        },
        {
            "id": 99,
            "patientTrackId": null,
            "countryId": 4,
            "roleNames": null,
            "searchTerm": null,
            "patientVisitId": null,
            "tenantId": 156,
            "name": "Serum aspartate aminotransferase (AST, SGOT)",
            "displayOrder": 20,
            "updatedAt": "2022-05-20T14:43:22+05:30",
            "active": true,
            "resultTemplate": true
        },
        {
            "id": 32,
            "patientTrackId": null,
            "countryId": 4,
            "roleNames": null,
            "searchTerm": null,
            "patientVisitId": null,
            "tenantId": 156,
            "name": "Urine Protein",
            "displayOrder": 4,
            "updatedAt": "2022-05-20T14:43:22+05:30",
            "active": true,
            "resultTemplate": true
        }       
        
    ],
    "responseCode": 200,
    "totalCount": 23
}
```

#### **Input 2:** <a href="#labtest-list-input2" id="labtest-list-input2"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                                                                                                                                     |
| --------------------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization(Header) | String   | Yes           | Bearer eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.MCm0mJDfpfjlr10Uok79-kTF7fv9Tn7cI5m2WsRDGUd9VS7iRmfbszjuc1-w5D-PYt9CdVxRMGBQlzYauhnI |
| Search Name           | String   | No            | Diabetes care                                                                                                                                   |

#### **Sample Input 2:** <a href="#labtest-list-sampleinput2" id="labtest-list-sampleinput2"></a>

{\
"tenantId": "5",\
"limit": 10,\
"searchTerm": "Urine Ketones",\
"countryId": "3",\
"paginated": true\
}

#### **Output 2:** <a href="#labtest-list-output2" id="labtest-list-output2"></a>

| **Field Name** | **Type** | **Comments**      |
| -------------- | -------- | ----------------- |
| `id`           | String   | Lab test id       |
| `countryId`    | Number   | Country id        |
| `tenantId`     | Number   | Country tenant id |
| `name`         | String   | Lab test name     |
| `active`       | String   | Lab test status   |

#### **Sample Output 2:** <a href="#labtest-list-sampleoutput2" id="labtest-list-sampleoutput2"></a>

```
{
    "message": "Got All LabTests.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 52,
            "patientTrackId": null,
            "countryId": 3,
            "roleNames": null,
            "searchTerm": null,
            "patientVisitId": null,
            "tenantId": 5,
            "name": "Urine Ketones",
            "displayOrder": 0,
            "updatedAt": "2023-03-14T10:05:34-08:00",
            "labTestResults": [
                {
                    "id": 75,
                    "createdBy": 2,
                    "updatedBy": 2,
                    "createdAt": "2023-03-14T10:05:34-08:00",
                    "updatedAt": "2023-03-14T10:05:34-08:00",
                    "tenantId": 5,
                    "name": "Urine Ketones",
                    "labTestId": 52,
                    "displayOrder": 1,
                    "active": true,
                    "deleted": false
                }
            ],
            "createdBy": 2,
            "updatedBy": 2,
            "createdAt": "2023-03-14T10:05:34-08:00",
            "active": true,
            "deleted": false,
            "resultTemplate": true
        }
    ],
    "responseCode": 200,
    "totalCount": 1
}
```


# Update

| **API URL**     | {{url}}/admin-service/labtest/update |
| --------------- | ------------------------------------ |
| **Method**      | PATCH                                |
| **Description** | Lab test update                      |

#### **Input** <a href="#labtest-update-input" id="labtest-update-input"></a>

| **Field Name**         | **Type** | **Mandatory** | **Example**       |
| ---------------------- | -------- | ------------- | ----------------- |
| id(lab test)           | Number   | Yes           | 98                |
| tenantId               | Number   | Yes           | 156               |
| name                   | String   | Yes           | Potassium         |
| displayOrder           | Number   | No            | 1                 |
| id(lab test result id) | Number   | Yes           | 115               |
| id(lab test range id)  | Number   | Yes           | 135               |
| minimumValue           | Number   | Yes           | 3.5               |
| maximumValue           | Number   | Yes           | 5.0               |
| unit                   | String   | Yes           | mEq/L             |
| displayOrder(Range)    | Number   | Yes           | 1                 |
| displayName            | String   | Yes           | (3.5 - 5.0 mEq/L) |
| countryId              | Number   | Yes           | 4                 |
| active                 | String   | No            | true              |

#### **Sample Input:** <a href="#labtest-update-sampleinput" id="labtest-update-sampleinput"></a>

{\
"id": 98,\
"tenantId": 156,\
"name": "Potassium",\
"displayOrder": 11,\
"labTestResults": \[\
{\
"id": 115,\
"tenantId": 156,\
"name": "Potassium",\
"labTestId": 98,\
"labTestResultRanges": \[\
{\
"id": 135,\
"tenantId": 156,\
"labTestId": 98,\
"labTestResultId": 115,\
"minimumValue": 4,\
"maximumValue": 5,\
"unit": "mEq/L",\
"unitId": 15,\
"displayOrder": 1,\
"displayName": "(3.5 - 5.0 mEq/L)",\
"active": true,\
"deleted": false\
}\
],\
"displayOrder": 11,\
"active": true\
}\
],\
"countryId": "4",\
"active": true\
}

#### **Sample Output:** <a href="#labtest-update-sampleoutput" id="labtest-update-sampleoutput"></a>

```
{
    "message": "LabTest updated successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Lab Test Range - Create

| **API URL**     | {{url}}/admin-service/labtest-result-ranges/create |
| --------------- | -------------------------------------------------- |
| **Method**      | POST                                               |
| **Description** | Create lab test range                              |

#### **Input** <a href="#labtestrange-create-input" id="labtestrange-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**       |
| -------------- | -------- | ------------- | ----------------- |
| minimumValue   | Number   | Yes           | 3.5               |
| maximumValue   | Number   | Yes           | 5                 |
| unit           | String   | Yes           | mEq/L             |
| displayOrder   | Number   | Yes           |                   |
| displayName    | String   | Yes           | (3.5 to 5.0)mEq/L |

#### **Sample Input:** <a href="#labtestrange-create-sampleinput" id="labtestrange-create-sampleinput"></a>

{\
"tenantId": "156",\
"labTestResultId": 115,\
"labTestResultRanges": \[\
{\
"minimumValue": 3.5,\
"maximumValue": 5,\
"unit": "mEq/L",\
"displayOrder": 1,\
"displayName": "(3.5 to 5.0)mEq/L",\
"unitId": 1\
}\
]\
}

#### **Sample Output:** <a href="#labtestrange-create-sampleoutput" id="labtestrange-create-sampleoutput"></a>

```
{
    "message": "Labtest result range created successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 201,
    "totalCount": null
}
```


# Lab Test Range - Delete

| **API URL**     | {{url}}/admin-service/labtest-result-ranges/remove/{id} |
| --------------- | ------------------------------------------------------- |
| **Method**      | PUT                                                     |
| **Description** | Delete lab test range                                   |

#### **Sample Input:** <a href="#labtestrange-delete-sampleinput" id="labtestrange-delete-sampleinput"></a>

{{url}}/admin-service/labtest-result-ranges/remove/207

#### **Sample Output:** <a href="#labtestrange-delete-sampleoutput" id="labtestrange-delete-sampleoutput"></a>

```
{
    "message": "Labtest result range updated successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Lab Test Range - Details

| **API URL**     | {{url}}/admin-service/labtest-result-ranges/details/{id} |
| --------------- | -------------------------------------------------------- |
| **Method**      | GET                                                      |
| **Description** | Get lab test range details                               |

#### **Sample Input:** <a href="#labtestrange-details-sampleinput" id="labtestrange-details-sampleinput"></a>

{{url}}/admin-service/labtest-result-ranges/details/115

#### **Output** <a href="#labtestrange-details-output" id="labtestrange-details-output"></a>

| **Field Name** | **Type** | **Comments**                          |
| -------------- | -------- | ------------------------------------- |
| `id`           | Number   | Lab test range id                     |
| `minimumValue` | Number   | Lab test range minimum value          |
| `maximumValue` | Number   | Lab test range maximum value          |
| `unit`         | String   | Lab test range unit                   |
| `unitId`       | Number   | Lab test range unit id                |
| `displayOrder` | Number   | Range display order                   |
| `displayName`  | String   | Display name for lab test range added |

#### **Sample Output:** <a href="#labtestrange-details-sampleoutput" id="labtestrange-details-sampleoutput"></a>

```
{
    "message": "Got labtest result range.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 135,
            "minimumValue": 4,
            "maximumValue": 5,
            "unit": "mEq/L",
            "unitId": 15,
            "displayOrder": 1,
            "displayName": "(3.5 - 5.0 mEq/L)"
        },
        {
            "id": 234,
            "minimumValue": 3,
            "maximumValue": 5,
            "unit": "mEq/L",
            "unitId": 1,
            "displayOrder": 1,
            "displayName": "(3.5 to 5.0)mEq/L"
        }
    ],
    "responseCode": 200,
    "totalCount": 2
}
```


# Lab Test Range - Update

| **API URL**     | {{url}}/admin-service/labtest-result-ranges/create |
| --------------- | -------------------------------------------------- |
| **Method**      | PUT                                                |
| **Description** | Update lab test range                              |

#### **Input** <a href="#labtestrange-update-input" id="labtestrange-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**       |
| -------------- | -------- | ------------- | ----------------- |
| minimumValue   | Number   | Yes           | 3.5               |
| maximumValue   | Number   | Yes           | 5                 |
| unit           | String   | Yes           | mEq/L             |
| displayOrder   | Number   | Yes           | 1                 |
| displayName    | String   | Yes           | (3.5 to 5.0)mEq/L |

#### **Sample Input:** <a href="#labtestrange-update-sampleinput" id="labtestrange-update-sampleinput"></a>

{\
"tenantId": "156",\
"labTestResultId": 115,\
"labTestResultRanges": \[\
{\
"minimumValue": 3.5,\
"maximumValue": 5,\
"unit": "mEq/L",\
"displayOrder": 1,\
"displayName": "(3.5 to 5.0)mEq/L",\
"unitId": 2,\
"id":234\
}\
]\
}

#### **Sample Output:** <a href="#labtestrange-update-sampleoutput" id="labtestrange-update-sampleoutput"></a>

```
{
    "message": "Labtest result range updated successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Medication


# Create

| **API URL**     | {{url}}/admin-service/medication/create |
| --------------- | --------------------------------------- |
| **Method**      | POST                                    |
| **Description** | Create medication                       |

#### **Input** <a href="#medication-create-input" id="medication-create-input"></a>

| **Field Name**     | **Type** | **Mandatory** | **Example**  |
| ------------------ | -------- | ------------- | ------------ |
| medicationName     | String   | Yes           | Dolo         |
| dosageFormName     | String   | Yes           | Tablet       |
| brandName          | String   | Yes           | Generic      |
| classificationName | String   | Yes           | Beta-blocker |

#### **Sample Input:** <a href="#medication-create-sampleinput" id="medication-create-sampleinput"></a>

\[     {         "countryId": "3",         "classificationId": 19,         "classificationName": "Beta-blocker",         "brandId": 120,         "brandName": "Generic",         "medicationName": "Dolo",         "dosageFormId": 2,         "dosageFormName": "Tablet",         "tenantId": "290"     } ]

#### **Sample Output:** <a href="#medication-create-sampleoutput" id="medication-create-sampleoutput"></a>

```
{
    "message": "Medication created successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 201,
    "totalCount": null
}
```


# Delete

| **API URL**     | {{url}}/admin-service/medication/update |
| --------------- | --------------------------------------- |
| **Method**      | DELETE                                  |
| **Description** | Delete medication                       |

#### **Sample Input:** <a href="#medication-delete-sampleinput" id="medication-delete-sampleinput"></a>

{\
"id": 1661,\
"tenantId": "290"\
}

#### **Sample Output:** <a href="#medication-delete-sampleoutput" id="medication-delete-sampleoutput"></a>

```
{
    "message": "Medication removed successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Medication Validation

| **API URL**     | {{url}}/admin-service/medication/validate                                                                                             |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **Method**      | POST                                                                                                                                  |
| **Description** | Validate if same Medication Name, Dosage Unit, Dosage Unit Name, Classification, Brand and Dosage form already exist in Medication DB |

#### **Input** <a href="#medicationvalidation-input" id="medicationvalidation-input"></a>

| **Field Name**     | **Type** | **Mandatory** | **Example**  |
| ------------------ | -------- | ------------- | ------------ |
| medicationName     | String   | Yes           | Dolo         |
| dosageFormId       | Integer  | Yes           |              |
| dosageFormName     | String   | Yes           | Tablet       |
| brandId            | Integer  | Yes           |              |
| brandName          | String   | Yes           | Generic      |
| classificationId   | Integer  | Yes           |              |
| classificationName | String   | Yes           | Beta-blocker |
| dosageUnitId       | Integer  | Yes           |              |
| dosageUnitValue    | String   | Yes           |              |
| dosageUnitName     | String   | Yes           |              |
| tenantId           | String   | Yes           |              |

#### **Sample Input:** <a href="#medicationvalidation-sampleinput" id="medicationvalidation-sampleinput"></a>

{\
"countryId": "4",\
"classificationId": 123,\
"classificationName": "Biguanide",\
"brandId": 121,\
"brandName": "Generic",\
"medicationName": "Zincovit",\
"dosageFormId": 4,\
"dosageFormName": "Liquid",\
"dosageUnitValue": "8",\
"dosageUnitId": 14,\
"dosageUnitName": "mg",\
"tenantId": "6"\
}

#### **Sample Output:** <a href="#medicationvalidation-sampleoutput" id="medicationvalidation-sampleoutput"></a>

```
{
  "dateTime": 1683037472729,
  "status": false,
  "errorCode": 409,
  "message": "Zincovit already exist(s) in the regional database",
  "exception": "Zincovit already exist(s) in the regional database"
}
```


# List

| **API URL**     | {{url}}/admin-service/medication/list |
| --------------- | ------------------------------------- |
| **Method**      | POST                                  |
| **Description** | Get medication list                   |

#### **Input 1:** <a href="#medication-list-input1" id="medication-list-input1"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                                                                                                                                     |
| --------------------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization(Header) | String   | Yes           | Bearer eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.MCm0mJDfpfjlr10Uok79-kTF7fv9Tn7cI5m2WsRDGUd9VS7iRmfbszjuc1-w5D-PYt9CdVxRMGBQlzYauhnI |

#### **Sample Input 1:** <a href="#medication-list-sampleinput1" id="medication-list-sampleinput1"></a>

{\
"countryId": 4,\
"searchTerm": "",\
"tenantId": 156,\
"sortField": "medication\_name",\
"sortOrder": -1,\
"limit": 10\
}

#### **Output :** <a href="#medication-list-output" id="medication-list-output"></a>

| **Field Name**       | **Type** | **Comments**                     |
| -------------------- | -------- | -------------------------------- |
| `id`                 | Number   | Medication id                    |
| `countryId`          | Number   | Country id for medication        |
| `tenantId`           | Number   | Country tenant id                |
| `medicationName`     | String   | Medication name                  |
| `classificationId`   | Number   | Classification id for medication |
| `dosageFormId`       | Number   | Dosage form id for medication    |
| `brandId`            | Number   | Brand name id                    |
| `classificationName` | String   | Classification name              |
| `brandName`          | String   | Brand name                       |

#### **Sample Output 1:** <a href="#medication-list-sampleoutput1" id="medication-list-sampleoutput1"></a>

```
{
    "message": "Got All Medications.",
    "entity": null,
    "status": true,
    "entityList": [
     {
            "id": 288,
            "countryId": 4,
            "tenantId": 156,
            "medicationName": "Vildagliptin + Metformin",
            "classificationId": 3,
            "dosageFormId": 2,
            "dosageFormName": "Tablet",
            "brandId": 147,
            "classificationName": "Dual Therapy",
            "brandName": "Other"
        },
        {
            "id": 117,           
            "countryId": 4,           
            "tenantId": 156,
            "medicationName": "Vildagliptin + Metformin",
            "classificationId": 3,
            "dosageFormId": 2,
            "dosageFormName": "Tablet",
            "brandId": 135,
            "classificationName": "Aldosterone Antagonist",
            "brandName": "Other"
        }
    ],
    "responseCode": 200,
    "totalCount": 420
}
```

#### **Sample Input 2:** <a href="#medication-list-sampleinput2" id="medication-list-sampleinput2"></a>

{\
"tenantId": 5,\
"countryId": 3,\
"limit": 10,\
"sortField": "medication\_name",\
"sortOrder": 1,\
"searchTerm": "Cetrizen"\
}

#### **Sample Output 2:** <a href="#medication-list-sampleoutput2" id="medication-list-sampleoutput2"></a>

```
{
    "message": "Got All Medications.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 76,
            "patientTrackId": null,
            "countryId": 4,
            "roleNames": null,
            "searchTerm": null,
            "patientVisitId": null,
            "tenantId": 6,
            "medicationName": "Cetrizen",
            "classificationId": 135,
            "dosageFormId": 1,
            "dosageFormName": "Tablet",
            "dosageUnitName": "mg",
            "dosageUnitValue": "2",
            "brandId": 148,
            "dosageUnitId": 14,
            "classificationName": "Other",
            "brandName": "Other",
            "displayOrder": 0,
            "type": null,
            "status": false
        }
    ],
    "responseCode": 200,
    "totalCount": 1
}
```


# Update

| **API URL**     | {{url}}/admin-service/medication/update |
| --------------- | --------------------------------------- |
| **Method**      | PUT                                     |
| **Description** | Update medication                       |

#### **Input** <a href="#medication-update-input" id="medication-update-input"></a>

| **Field Name**     | **Type** | **Mandatory** | **Example**  |
| ------------------ | -------- | ------------- | ------------ |
| dosageFormName     | String   | No            | Tablet       |
| brandName          | String   | No            | Generic      |
| classificationName | String   | No            | Beta-blocker |

#### **Sample Input:** <a href="#medication-update-sampleinput" id="medication-update-sampleinput"></a>

{\
"countryId": 3,\
"classificationId": 19,\
"classificationName": "Diuretic",\
"brandId": 147,\
"brandName": "Generic",\
"dosageFormId": 4,\
"dosageFormName": "Capsule",\
"medicationName": "Dolo",\
"id": 1661,\
"tenantId": "290"\
}

#### **Sample Output:** <a href="#medication-update-sampleoutput" id="medication-update-sampleoutput"></a>

```
{
    "message": "Medication updated successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Operating Unit


# Operating Unit - Details

| **API URL**     | {{url}}/admin-service/operating-unit/details |
| --------------- | -------------------------------------------- |
| **Method**      | POST                                         |
| **Description** | Operating unit details                       |

#### **Sample Input:** <a href="#operatingunit-details-sampleinput" id="operatingunit-details-sampleinput"></a>

{\
"id": 55,\
"tenantId": 235\
}

#### **Output**: <a href="#operatingunit-details-output" id="operatingunit-details-output"></a>

| **Field Name**    | **Type** | **Comments**                          |
| ----------------- | -------- | ------------------------------------- |
| `id`              | Integer  | Operating unit id                     |
| `name`            | String   | Operating unit name                   |
| `tenantId`        | Bigint   | Operating unit id                     |
| `id`              | Integer  | OU Admin id                           |
| `username`        | String   | OU Admin mail id                      |
| `firstName`       | String   | OU Admin first name                   |
| `lastName`        | String   | OU Admin last name                    |
| `gender`          | String   | OU Admin gender                       |
| `id`              | Integer  | Country id                            |
| `name`            | String   | Country name                          |
| `countryCode`     | String   | Country code                          |
| `unitMeasurement` | String   | Unit measurement format across region |
| `phoneNumber`     | String   | OU Admin phone number                 |
| `id`              | Integer  | Time zone id                          |
| `offset`          | String   | Time zone offset                      |
| `description`     | String   | Time zone description                 |

#### **Sample Output:** <a href="#operatingunit-details-sampleoutput" id="operatingunit-details-sampleoutput"></a>

```
{
    "message": "Operating unit fetched successfully.",
    "entity": {
        "id": 55,
        "name": "Kilifi",
        "tenantId": 235,
        "users": [
            {
                "id": 4966,
                "username": "kilixxxuadmin@spice.mdt",
                "firstName": "Kilifi",
                "lastName": "Kilifi",
                "gender": null,
                "country": {
                    "id": 4,
                    "name": "Kenya",
                    "countryCode": "254",
                    "unitMeasurement": "metric"
                },
                "countryCode": "254",
                "phoneNumber": "78XXX00012",
                "timezone": {
                    "id": 60,
                    "offset": "+00:00",
                    "description": "(UTC) Coordinated Universal Time"
                }
            }
        ],
        "account": {
            "id": 9,
            "name": "Novo Kenya",
            "tenantId": 146
        }
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Operating Unit - Update

| **API URL**     | {{url}}/admin-service/operating-unit/update |
| --------------- | ------------------------------------------- |
| **Method**      | POST                                        |
| **Description** | Operating unit update                       |

#### **Input** <a href="#operatingunit-update-input" id="operatingunit-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**       |
| -------------- | -------- | ------------- | ----------------- |
| id             | Integer  | Yes           | 55                |
| tenantId       | Bigint   | Yes           | 235               |
| name           | String   | Yes           | Volta Region-Novo |

#### **Sample Input:** <a href="#operatingunit-update-sampleinput" id="operatingunit-update-sampleinput"></a>

{\
"id": 47,\
"tenantId": 147,\
"name": "Volta Region-Novo"\
}

#### **Sample Output:** <a href="#operatingunit-update-sampleoutput" id="operatingunit-update-sampleoutput"></a>

```
{
    "message": "Operating unit updated successfully."
}
```


# Operating Unit Admin - Create

| **API URL**     | {{url}}/admin-service/operating-unit/user-add |
| --------------- | --------------------------------------------- |
| **Method**      | POST                                          |
| **Description** | OU Admin create                               |

#### **Input** <a href="#operatingunitadmin-create-input" id="operatingunitadmin-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**         |
| -------------- | -------- | ------------- | ------------------- |
| firstName      | String   | Yes           | Damoor              |
| phoneNumber    | String   | Yes           | 833XXX7890          |
| gender         | String   | No            | Male                |
| username       | String   | Yes           | <voltxxx@spice.mdt> |
| lastName       | String   | Yes           | Rane                |
| id(country)    | Integer  | Yes           | 3                   |
| id(timezone)   | Integer  | Yes           | 6                   |
| countryCode    | String   | Yes           | 232                 |

#### **Sample Input:** <a href="#operatingunitadmin-create-sampleinput" id="operatingunitadmin-create-sampleinput"></a>

{\
"firstName": "Damoor",\
"phoneNumber": "833XXX7890",\
"gender": "",\
"username": <voltxxx@spice.mdt>,\
"lastName": "Rane",\
"country": {\
"id": 3\
},\
"timezone": {\
"id": 6\
},\
"countryCode": "232",\
"tenantId": 147\
}

#### **Sample Output:** <a href="#operatingunitadmin-create-sampleoutput" id="operatingunitadmin-create-sampleoutput"></a>

```
{
    "message": "Operating Unit Admin created successfully."
}
```


# Operating Unit Admin - Remove

| **API URL**     | {{url}}/admin-service/operating-unit/user-remove |
| --------------- | ------------------------------------------------ |
| **Method**      | DELETE                                           |
| **Description** | OU Admin remove                                  |

#### **Input** <a href="#operatingunitadmin-remove-input" id="operatingunitadmin-remove-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example** |
| -------------- | -------- | ------------- | ----------- |
| id(OU admin)   | Integer  | Yes           | 6868        |
| tenantId       | bigint   | Yes           | 557         |

#### **Sample Input:** <a href="#operatingunitadmin-remove-sampleinput" id="operatingunitadmin-remove-sampleinput"></a>

{\
"id": 6868,\
"tenantId": 557\
}

#### **Sample Output:** <a href="#operatingunitadmin-remove-sampleoutput" id="operatingunitadmin-remove-sampleoutput"></a>

```
{
    "message": "Operating Unit Admin deleted successfully."
}
```


# Operating Unit Admin - Update

| **API URL**     | {{url}}/admin-service/operating-unit/user-update |
| --------------- | ------------------------------------------------ |
| **Method**      | PUT                                              |
| **Description** | OU Admin update                                  |

#### **Input** <a href="#operatingunitadmin-update-input" id="operatingunitadmin-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**         |
| -------------- | -------- | ------------- | ------------------- |
| id(OU admin)   | Integer  | Yes           | 6631                |
| firstName      | String   | Yes           | Damoor              |
| phoneNumber    | String   | Yes           | 833XXX7890          |
| gender         | String   | No            | Male                |
| username       | String   | Yes           | <voltxxx@spice.mdt> |
| lastName       | String   | Yes           | Rane                |
| id(country)    | Integer  | Yes           | 3                   |
| id(timezone)   | Integer  | Yes           | 6                   |
| countryCode    | String   | Yes           | 232                 |

#### **Sample Input:** <a href="#operatingunitadmin-update-sampleinput" id="operatingunitadmin-update-sampleinput"></a>

{\
"id": 6631,\
"firstName": "Damoor",\
"phoneNumber": "833XXX7890",\
"gender": "",\
"username": "<voltxxx@spice.mdt>",\
"lastName": "Rane",\
"country": {\
"id": 3\
},\
"timezone": {\
"id": 6\
},\
"countryCode": "232",\
"tenantId": 147\
}

#### **Sample Output:** <a href="#operatingunitadmin-update-sampleoutput" id="operatingunitadmin-update-sampleoutput"></a>

```
{
    "message": "Operating Unit Admin updated successfully."
}
```


# Operating Unit Dashboard - Account Admin

| **API URL**     | {{url}}/admin-service/operating-unit/list       |
| --------------- | ----------------------------------------------- |
| **Method**      | POST                                            |
| **Description** | Get Operating Unit list for Account admin login |

#### **Sample Input:** <a href="#operatingunitdashboard-accountadmin-sampleinput" id="operatingunitdashboard-accountadmin-sampleinput"></a>

{

"limit":15,\
"tenantId":146,\
"searchTerm":""

}

#### **Output:** <a href="#operatingunitdashboard-accountadmin-output" id="operatingunitdashboard-accountadmin-output"></a>

| **Field Name**       | **Type** | **Comments** |
| -------------------- | -------- | ------------ |
| `id(operating unit)` | Integer  | 36           |
| `name`               | String   | Nakuru       |
| `siteCount`          | Integer  | 8            |
| `tenantId`           | Integer  | 74           |

#### **Sample Output:** <a href="#operatingunitdashboard-accountadmin-sampleoutput" id="operatingunitdashboard-accountadmin-sampleoutput"></a>

```
{
    "message": "Operating unit fetched successfully.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 36,
            "name": "Nakuru",
            "siteCount": 8,
            "tenantId": 74
        },
        {
            "id": 37,
            "name": "Mombasa",
            "siteCount": 6,
            "tenantId": 316
        }
    ],
    "responseCode": 200,
    "totalCount": 4
}
```


# Operating Unit List - Admin

| **API URL**     | {{url}}/admin-service/operating-unit/all                                       |
| --------------- | ------------------------------------------------------------------------------ |
| **Method**      | POST                                                                           |
| **Description** | Get Operating Unit list in Operating Unit menu as Super Admin and Region Admin |

#### **Sample Input:** <a href="#operatingunitlist-admin-sampleinput" id="operatingunitlist-admin-sampleinput"></a>

{\
"limit": 10,\
"tenantId": "156"\
}

#### **Output** <a href="#operatingunitlist-admin-output" id="operatingunitlist-admin-output"></a>

| **Field Name**      | **Type** | **Comments**              |
| ------------------- | -------- | ------------------------- |
| `id(Account)`       | Integer  | 60                        |
| `name`              | String   | Hablot Manos              |
| `tenantId`          | Bigint   | 360                       |
| `id(account)`       | Integer  | 15                        |
| `name(account)`     | String   | St. Anne’s Medical center |
| `tenantId(account)` | Bigint   | 248                       |

#### **Sample Output:** <a href="#operatingunitlist-admin-sampleoutput" id="operatingunitlist-admin-sampleoutput"></a>

```
{
    "message": "Operating unit fetched successfully.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 60,
            "name": "Hablot Manos",
            "tenantId": 360,
            "account": {
                "id": 15,
                "name": "St. Anne's Medical Center",
                "tenantId": 248
            }
        },
        {
            "id": 57,
            "name": "Meruu",
            "tenantId": 337,
            "account": {
                "id": 30,
                "name": "Rochec",
                "tenantId": 336
            }
        }
    ],
    "responseCode": 200,
    "totalCount": 27
}
```


# Program


# Create

| **API URL**     | {{url}}/admin-service/program/create |
| --------------- | ------------------------------------ |
| **Method**      | POST                                 |
| **Description** | Program create                       |

#### **Input** <a href="#program-create-input" id="program-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example** |
| -------------- | -------- | ------------- | ----------- |
| name           | String   | Yes           | Finnas      |
| tenantId       | String   | Yes           | 290         |
| sites          | Array    | Yes           | \[14,78]    |
| country        | Number   | Yes           | 3           |

#### **Sample Input:** <a href="#program-create-sampleinput" id="program-create-sampleinput"></a>

{\
"name": "Finnas",\
"tenantId": "290",\
"sites": \[14,78],\
"country": "3"\
}

#### **Sample Output:** <a href="#program-create-sampleoutput" id="program-create-sampleoutput"></a>

```
{
    "message": "Program created successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 201,
    "totalCount": null
}
```


# List

| **API URL**     | {{url}}/admin-service/program/list |
| --------------- | ---------------------------------- |
| **Method**      | POST                               |
| **Description** | Program List                       |

#### **Input 1:** <a href="#program-list-input1" id="program-list-input1"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                                                                                                                                     |
| --------------------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization(Header) | String   | Yes           | Bearer eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.MCm0mJDfpfjlr10Uok79-kTF7fv9Tn7cI5m2WsRDGUd9VS7iRmfbszjuc1-w5D-PYt9CdVxRMGBQlzYauhnI |

#### **Sample Input 1:** <a href="#program-list-sampleinput1" id="program-list-sampleinput1"></a>

{

"limit":3,\
"tenantId":156,\
"searchTerm":""

}

#### **Output 1:** <a href="#program-list-output1" id="program-list-output1"></a>

| **Field Name** | **Type** | **Comments**     |
| -------------- | -------- | ---------------- |
| `id`           | Number   | Program id       |
| `name`         | String   | Program name     |
| `tenantId`     | Number   | Program tenantId |
| `active`       | String   | Program status   |

#### **Sample Output 1:** <a href="#program-list-sampleoutput1" id="program-list-sampleoutput1"></a>

```
{
    "message": "Got Program.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 64,
            "name": "Heart",
            "tenantId": 156,
            "createdAt": "2023-02-28T14:56:26+05:30",
            "active": true
        },
        {
            "id": 57,
            "name": "KENPro",
            "tenantId": 156,
            "createdAt": "2023-02-24T17:57:57+05:30",
            "active": true
        },
        {
            "id": 38,
            "name": "Covid Camp",
            "tenantId": 156,
            "createdAt": "2023-02-17T14:49:06+05:30",
            "active": true
        }
    ],
    "responseCode": 200,
    "totalCount": 9
}
```

#### **Input 2:** <a href="#program-list-input2" id="program-list-input2"></a>

| **Field Name**        | **Type** | **Mandatory** | **Example**                                                                                                                                     |
| --------------------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Authorization(Header) | String   | Yes           | Bearer eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.MCm0mJDfpfjlr10Uok79-kTF7fv9Tn7cI5m2WsRDGUd9VS7iRmfbszjuc1-w5D-PYt9CdVxRMGBQlzYauhnI |
| Search Name           | String   | No            | Medplus                                                                                                                                         |

#### **Sample Input 2:** <a href="#program-list-sampleinput2" id="program-list-sampleinput2"></a>

{\
"tenantId": "6",\
"country": "4",\
"limit": 10,\
"searchTerm": "Medplus"\
}

#### **Output 2:** <a href="#program-list-output2" id="program-list-output2"></a>

| **Field Name** | **Type** | **Comments**     |
| -------------- | -------- | ---------------- |
| `id`           | Number   | Program id       |
| `name`         | String   | Program name     |
| `tenantId`     | Number   | Program tenantId |
| `active`       | String   | Program status   |

#### **Sample Output 2:** <a href="#program-list-sampleoutput2" id="program-list-sampleoutput2"></a>

```
{
    "message": "Got Program.",
    "entity": null,
    "status": true,
    "entityList": [
        {
            "id": 5,
            "name": "Medplus",
            "tenantId": 6,
            "createdAt": "2023-03-08T22:23:16-08:00",
            "active": false
        }
    ],
    "responseCode": 200,
    "totalCount": 1
}
```


# Delete

| **API URL**     | {{url}}/admin-service/program/remove |
| --------------- | ------------------------------------ |
| **Method**      | PATCH                                |
| **Description** | Program delete                       |

#### **Sample Input:** <a href="#program-delete-sampleinput" id="program-delete-sampleinput"></a>

{\
"id": 41,\
"tenantId": 156\
}

#### **Sample Output:** <a href="#program-delete-sampleoutput" id="program-delete-sampleoutput"></a>

```
{
    "message": "Program removed successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Details

| **API URL**     | {{url}}/admin-service/program/details |
| --------------- | ------------------------------------- |
| **Method**      | POST                                  |
| **Description** | Program details                       |

#### **Sample Input:** <a href="#program-details-sampleinput" id="program-details-sampleinput"></a>

{\
"id": 55,\
"tenantId": 235\
}

#### **Output:** <a href="#program-details-output" id="program-details-output"></a>

| **Field Name**    | **Type** | **Comments**                   |
| ----------------- | -------- | ------------------------------ |
| `id`              | Number   | Program id                     |
| `name`            | String   | Program name                   |
| `id`              | Number   | Country id                     |
| `name`            | String   | Country name                   |
| `unitMeasurement` | String   | Unit measurement format        |
| `tenantId`        | Number   | Country tenant Id              |
| `id`              | Number   | Site id                        |
| `name`            | String   | Site name                      |
| `tenantId`        | Number   | Site tenantId                  |
| `status`          | String   | Program active/inactive status |

#### **Sample Output:** <a href="#program-details-sampleoutput" id="program-details-sampleoutput"></a>

```
{
    "message": "Got Program.",
    "entity": {
        "id": 14,
        "name": "Redcross",
        "country": {
            "id": 4,
            "name": "Kenya",
            "countryCode": "254",
            "unitMeasurement": "metric"
        },
        "tenantId": 156,
        "sites": [
            {
                "id": 144,
                "name": "Kanyakine Sub-County Hospital(Redcross)",
                "tenantId": 190,
                "roleName": null,
                "displayName": null,
                "culture": {
                    "id": 1
                }
            },
            {
                "id": 167,
                "name": "Coast General Teaching and Referral Hospital",
                "tenantId": 145,
                "roleName": null,
                "displayName": null,
                "culture": {
                    "id": 1
                }
            }
        ],
        "deletedSites": [],
        "active": true,
        "deleted": false
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Update

| **API URL**     | {{url}}/admin-service/program/update |
| --------------- | ------------------------------------ |
| **Method**      | PATCH                                |
| **Description** | Program update                       |

#### **Input** <a href="#program-update-input" id="program-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example** |
| -------------- | -------- | ------------- | ----------- |
| name           | String   | Yes           | Finnas      |
| tenantId       | String   | Yes           | 290         |
| sites          | Array    | Yes           | \[14,78]    |
| country        | Number   | Yes           | 3           |
| deletedSites   | Array    | No            | \[78]       |
| active         | String   | Yes           | true        |

#### **Sample Input:** <a href="#program-update-sampleinput" id="program-update-sampleinput"></a>

{\
"id":41,\
"sites":\[14,78],\
"tenantId":290,\
"country":{"id":4},\
"deletedSites":\[78],\
"active":true\
}

#### **Sample Output:** <a href="#program-update-sampleoutput" id="program-update-sampleoutput"></a>

```
{
    "message": "Program status updated successfully.",
    "entity": null,
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Region Admin


# Region Admin - Create

| **API URL**     | {{url}}/admin-service/data/country/user-add |
| --------------- | ------------------------------------------- |
| **Method**      | Post                                        |
| **Description** | Create Region Admin                         |

#### **Input** <a href="#regionadmin-create-input" id="regionadmin-create-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**            |
| -------------- | -------- | ------------- | ---------------------- |
| firstName      | String   | Yes           | Hemanath               |
| lastName       | String   | Yes           | D                      |
| phoneNumber    | String   | Yes           | 5234XXX532             |
| email          | String   | Yes           | <hemanatxxx@spice.mdt> |
| countryCode    | String   | Yes           | 91                     |
| timezone       | Number   | Yes           | 45                     |
| gender         | String   | No            | Male                   |

#### **Sample Input:** <a href="#regionadmin-create-sampleinput" id="regionadmin-create-sampleinput"></a>

{     "email": "<hemanatxxx@spice.mdt>",     "firstName": "Hemanath",     "lastName": "D",     "phoneNumber": "5234XXX532",     "gender": "",     "username": "<hemanatXXX@spice.mdt>",     "countryCode": "1",     "timezone": {         "id": 45     },     "tenantId": 6,     "country": {         "id": 4     } }

#### **Sample Output:** <a href="#regionadmin-create-sampleoutput" id="regionadmin-create-sampleoutput"></a>

```
"message": "Region Admin created successfully."
```


# Region admin - Delete

| **API URL**     | {{url}}/admin-service/data/country/user-remove |
| --------------- | ---------------------------------------------- |
| **Method**      | DELETE                                         |
| **Description** | Delete Region admin                            |

#### **Sample Input:** <a href="#regionadmin-delete-sampleinput" id="regionadmin-delete-sampleinput"></a>

{\
"id": 498,\
"tenantId": 6\
}<br>

#### **Sample Output:** <a href="#regionadmin-delete-sampleoutput" id="regionadmin-delete-sampleoutput"></a>

```
    "message": "Region Admin removed successfully."
```


# Region Admin - Details

| **API URL**     | {{url}}/admin-service/data/country/details |
| --------------- | ------------------------------------------ |
| **Method**      | POST                                       |
| **Description** | View Region admin details                  |

#### **Sample Input:** <a href="#regionadmin-details-sampleinput" id="regionadmin-details-sampleinput"></a>

{

"tenantId":"6",

"id":"4"

}

#### **Output** <a href="#regionadmin-details-output" id="regionadmin-details-output"></a>

| **Field Name**    | **Type** | **Comments**             |
| ----------------- | -------- | ------------------------ |
| `id`              | Number   | Country id               |
| name              | String   | Country name             |
| `countrycode`     | Number   | Country code             |
| `unitMeasurement` | String   | Country unit measurement |
| `id`              | Number   | Region admin id          |
| `username`        | String   | Region admin mail        |
| `firstName`       | String   | First name               |
| `lastName`        | String   | Last name                |
| `gender`          | String   | Admin gender             |
| `tenantId`        | Number   | Country tenant id        |
| `phoneNumber`     | String   | Admin phone number       |
| `id`              | Number   | Timezone                 |
| `offset`          | String   | Timezone offset          |
| `description`     | String   | Timezone description     |

#### **Sample Output:** <a href="#regionadmin-details-sampleoutput" id="regionadmin-details-sampleoutput"></a>

```
{
    "message": "Got Country.",
    "entity": {
        "id": 4,
        "name": "India",
        "countryCode": "91",
        "unitMeasurement": "metric",
        "users": [
            {
                "id": 4,
                "username": "india_regadxxx@spice.mdt",
                "firstName": "India",
                "lastName": "Admin",
                "gender": "",
                "country": {
                    "id": 4,
                    "name": "India",
                    "countryCode": "91",
                    "unitMeasurement": "metric",
                    "tenantId": 6
                },
                "countryCode": "91",
                "phoneNumber": "9894XXX335",
                "timezone": {
                    "id": 2,
                    "offset": "-08:00",
                    "description": "(UTC-08:00) Baja California"
                }
            }
        ],
        "tenantId": 6
    },
    "status": true,
    "entityList": null,
    "responseCode": 200,
    "totalCount": null
}
```


# Region admin - Update

| **API URL**     | {{url}}/user-service/user/super-admin/update |
| --------------- | -------------------------------------------- |
| **Method**      | PUT                                          |
| **Description** | Update Region admin details                  |

#### **Input** <a href="#regionadmin-update-input" id="regionadmin-update-input"></a>

| **Field Name** | **Type** | **Mandatory** | **Example**            |
| -------------- | -------- | ------------- | ---------------------- |
| id             | Number   | Yes           | 6520                   |
| firstName      | String   | Yes           | Henry                  |
| lastName       | String   | Yes           | Davis                  |
| phoneNumber    | String   | Yes           | 733XXX7017             |
| username       | String   | Yes           | <henrydaxxx@gmail.com> |
| countryCode    | String   | Yes           | 91                     |
| timezone       | Number   | Yes           | 1                      |
| gender         | String   | No            | Male                   |

#### **Sample Input:** <a href="#regionadmin-update-sampleinput" id="regionadmin-update-sampleinput"></a>

{

“id”:6520\
"firstName": "Hemanath",\
"lastName": "D",\
"gender": "Male",\
"username": "<henrydaxxx@gmail.com>",\
"phoneNumber": "7338XXX017",\
"timezone": {\
"id": 1\
},\
"countryCode": "91"\
}

#### **Sample Output:** <a href="#regionadmin-update-sampleoutput" id="regionadmin-update-sampleoutput"></a>

```
"message": "Region Admin updated successfully."
```


# Site




---

[Next Page](/llms-full.txt/1)

