SPICE Product Docs
SPICE 2.0 Docs
SPICE 2.0 Docs
  • Overview
    • 📒What is SPICE?
    • ✨SPICE App Workflows
      • Household Registration
      • Assessment
      • Follow-up
      • My Patients
      • Medical Review
      • Pharmacy
    • 👩‍⚕️SPICE Users
    • 🏢Admin Workflows
      • Admin Portal
    • 🔏Data Privacy & Security
      • Privacy Policy
      • Terms & Conditions of Use
    • ❓Frequently Asked Questions (FAQs)
  • Engineering
    • 🖥️Architecture
      • C4 Diagrams
      • Architecture Diagram
    • 🔧Technology Stack
    • 👨‍💻API Documentation
      • Common Services
        • Login
        • Reset Password
        • Logout
        • Verify Set Password
        • User Profile Update
        • Set Password for new User
        • Validate Phone Number
        • Get User Details
        • Change Password for Users
        • Forgot Password
        • Validate User Email
        • Get User Profile
      • Admin Services
        • Lab Test Customization
          • Lab Test Update
          • Lab Test List
          • Lab Test by Name
          • Lab Test Delete
          • Lab Test Create
          • Lab Test Validate
        • Medication
          • Medication List
          • Medication Create
          • Medication Update
          • Medication Remove
          • Medication Validate
        • User
          • User Validate
          • User List
          • User Remove
          • User Create and Update
        • Get Menu
        • Country List
        • Health Facility
          • Health Facility Update
          • Health Facility List
          • Health Facility Create
          • Health Facility Details
        • Region
          • Get Region Detail
          • Region Upload
          • Region Download
      • SPICE Service
        • Patient Search
        • Household Create
        • Patient List
        • Member Create
        • Offline Sync
          • Offline Household Create
          • Offline Member Create
        • Medical Review
          • ANC Pregnancy Create
          • ANC Pregnancy Detail
          • ICCM Under two months Create
          • ICCM Under five years Create
          • ICCM Under two months Details
          • Labour Mother Neonate Create
          • ICCM Under five years Details
          • Labour Mother Neonate Details
          • PNC Create
          • PNC Details
        • Assessment
          • Childhood Visit
          • ICCM
          • ANC
          • PNC
          • Other Symptoms
        • Investigation
          • Create Investigation
          • Investigation Remove
          • Investigation History List
        • Prescription
          • Prescription Remove
          • Prescribed Details
          • Prescription Create
        • App Version
        • Calculate WGS
        • Create Diagnosis
        • Diagnosis Details
        • Get Chiefdoms
        • Get Districts
        • Get Patient Status
        • Get Patient Details
        • Household Update
        • Member Update
  • Deploy
    • 🚀Deployment Guide
      • 📱Android
      • 🖥️Admin Portal
      • 🗄️HAPI FHIR Server
      • 🗄️Server
    • 🌎Customization Guide
      • Multi-Language Translation
        • Support for multiple languages
      • Clinical Workflow Customization
      • WHO Hearts Algorithm
      • Country Level Administrative Divisions
  • PRODUCT
    • 🥘Releases
    • 🛣️Roadmap
  • COMMUNITY
    • 🧑‍💻Engage
    • 📞Support
    • 📃Policies
  • LINKS
    • Source Code (GitHub)
    • Medtronic LABS
    • Developer Support
  • versions
    • SPICE 1.0
      • OVERVIEW
        • 📒What is SPICE?
        • ✨SPICE App Workflows
          • Screening
          • Enrollment
          • Assessment
          • Medical Review
            • Treatment Plan
            • Prescribe
            • Lab Test
          • My Patients
          • Pharmacy
          • Admin Portal
        • 👩‍⚕️SPICE Users
        • 🔏Data Privacy & Security
          • Privacy Policy
          • Terms & Conditions of Use
        • ❓Frequently Asked Questions (FAQs)
      • ENGINEERING
        • 🖥️Architecture
          • C4 Diagrams
          • FHIR & Standards
        • 🔧Technology Stack
        • 👨‍💻API Documentation
          • Common Services
            • Account Create
            • Change Password for Site Users
            • Country Create
            • Forgot Password
            • Get User Details
            • Get User Profile
            • Locked Users List
            • Login
            • Logout
            • Operating Unit Create
            • Reset Password
            • Set Password for New User
            • Site Create
            • Unlock User
            • User Profile Update
            • Validate User Email
            • Verify Set Password
            • Super Admin
              • Superadmin Details
              • Superadmin List
              • Superadmin Create
              • Superadmin Delete
              • Superadmin Update
          • Admin Services
            • Account
              • Account - Activate
              • Account - Deactivate
              • Account - Deactivated list
              • Account - Details
              • Account - Update
              • Account Admin - Create
              • Account Admin - Delete
              • Account Admin - Update
              • Account Dashboard - Region Admin
              • Account List - Admin
            • Clinical Workflow
              • Create
              • Delete
              • List
              • Update
              • Account Customization - Create
              • Account Customization - Details
              • Account Customization - Update
            • Country Dashboard - Superadmin
            • Lab Test
              • Create
              • Delete
              • Details
              • List
              • Update
              • Lab Test Range - Create
              • Lab Test Range - Delete
              • Lab Test Range - Details
              • Lab Test Range - Update
            • Medication
              • Create
              • Delete
              • Medication Validation
              • List
              • Update
            • Operating Unit
              • Operating Unit - Details
              • Operating Unit - Update
              • Operating Unit Admin - Create
              • Operating Unit Admin - Remove
              • Operating Unit Admin - Update
              • Operating Unit Dashboard - Account Admin
              • Operating Unit List - Admin
            • Program
              • Create
              • List
              • Delete
              • Details
              • Update
            • Region Admin
              • Region Admin - Create
              • Region admin - Delete
              • Region Admin - Details
              • Region admin - Update
            • Site
              • Site - Details
              • Site - Update
              • Site Dashboard - Operating Unit Admin
              • Site List - Admin
              • Site User - Create
              • Site User - Remove
              • Site User - Update
            • Site List - Region Admin
          • SPICE Services
            • Advance-search
            • Advanced search - Site
            • App Version
            • Assessment
            • Assessment Bplog Create
            • Assessment Glucose log Create
            • BPLog List
            • BPLog Create
            • Confirm Diagnosis
            • Device Details
            • Fill Prescription - Update
            • GlucoseLog Create
            • GlucoseLog List
            • Investigation Create
              • Fill Prescription List
            • Investigation List
            • Investigation Search
            • Labtest Result Create
            • Labtest Result Details
            • Labtest Result List
            • Lifestyle Create
            • Lifestyle List
            • Lifestyle remove
            • Lifestyle Update
            • Lifestyle Update view Status
            • Lifestyle view history
            • Medical Review Create - Continuous Medical Review
            • Medical Review Create - Initial Medical Review
            • Medical Review Static Data
            • Medical Review Count
            • Medical review list
            • Medical Review Summary
            • Mental Health Create
            • Mental Health Details
            • Mobile - Forgot Password
            • Mobile - Login
            • Mobile - Logout
            • Nutritionist Lifestyle Create
            • Patient Basic Details
            • Patient Details
            • Patient enrollment
            • Patient-labtest-list
            • Patient Labtest - Remove
            • Patient Labtest - Review
            • Patient-lifestyle-details
            • Patient list
            • Patient Pregnancy Details
            • Patient Pregnancy Details Create
            • Patient Remove
            • Patient Transfer - Create
            • Patient Transfer Count
            • Patient Transfer - Country Site List
            • Patient Transfer - Role user list
            • Patient Transfer List
            • Patient Transfer - Update
            • Patient Transfer - Validate
            • Patient update
            • Patient Visit
            • PatientVisit
            • Pregnancy Create
            • Pregnancy Details
            • Prescription History List
            • Prescription List
            • Prescription Remove
            • Prescription search
            • Pregnancy Update
            • Prescription-history list
            • Prescription Update
            • Refill Prescription History
            • Screening
            • Screening log details
            • Search
            • Transfer Notification Count
            • Treatment Plan Details
            • Treatment Plan Update
            • User Validate API
          • FHIR-Adapter Services
            • Add User
            • Get User By Id
            • Get User By Username
            • Get User List
            • Get User Profile
            • Update User
            • Reset User Password
            • Delete User by ID
            • Forgot Password Validation
            • Options
            • Receive Message
            • Login
            • Site Migration
            • User Migration
            • APIKey Manager API
              • Retrieve API Keys
              • Generate API Keys
              • Delete API Keys
              • Validate API Key
      • DEPLOY
        • 🚀Deployment Guide
          • 🗄️Server
          • 📱Android
          • 🖥️Admin Portal
          • 🗄️FHIR Adapter
        • 🌎Customization Guide
          • Multi-Language Translation
            • Support for multiple languages
          • Clinical Workflow Customization
          • WHO Hearts Algorithm
          • Country Level Administrative Divisions
      • PRODUCT
        • 🥘Releases
        • 🛣️Roadmap
      • LINKS
        • Source Code (GitHub)
        • Medtronic LABS
        • Developer Support
Powered by GitBook

@2024 Medtronic LABS

On this page
  • Tech stack
  • GitHub
  • Installation
  • Setup
  • Configuration
  • .env
  • .env description
  • Alternative solution to AWS services using open-source and free service.
  • Deployment
  • Validation
  • Endpoint
  • Request Body
  • Swagger:
  1. versions
  2. SPICE 1.0
  3. DEPLOY
  4. Deployment Guide

Server

PreviousDeployment GuideNextAndroid

Last updated 3 months ago

Tech stack

  • Git

  • Java 17.x

  • Apache Maven 3.8.x

  • Docker 20.10.xx

  • Docker-compose 1.29.x

GitHub

The code for the server can be found in this repository:

Installation

To bring the Spice back-end up and running, there are few prerequisite that has to be done. You can either follow the commands or access the official documentation by clicking the hyperlink.

  • To install git in ubuntu run the following command or click .

sudo apt install git
  • To install git in windows visit .

  • To install java in ubuntu run the following command or click .

sudo apt install openjdk-17-jdk
nano ~/.bashrc
  • After installing the maven zip file open the download folder and extract it.

  • To set the maven home path Ubuntu run the following command.

nano ~/.bashrc
  • Paste the following lines in .bashrc file.

MAVEN_HOME='/home/ubuntu/Downloads/apache-maven-3.8.8'
PATH="$MAVEN_HOME/bin:$PATH"
export PATH
  • Then save the .bashrc file.

  • To apply the changes in the .bashrc file run the following command.

 . ~/.bashrc

Note: Once you have executed the script mentioned above, please restart the machine.

  • To verify the maven installation, run the following command and check the version

  mvn -v

Setup

  • Clone the spice-opensource repository.

git clone https://github.com/Medtronic-LABS/spice-server.git

Configuration

To run the application, you should pass the necessary configuration via environment properties. To achieve this, create a .env file and pass your own values for the following properties.

Note: Please paste the .env file inside the specified directory.

/spice-opensource/spice-server/

.env file

PROJECT_PATH=/home/ubuntu/spice-opensource/spice-server
DATABASE_URL=jdbc:postgresql://mypostgres:5432/spice_open_source?serverTimezone=UTC
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=postgres
DATABASE_NAME=spice_open_source
NOTIFICATION_PROJECT_PATH=/home/ubuntu/spice-opensource/spice-server
REDIS_PASSWORD=password
REDIS_HOST=192.169.33.10
REDIS_PORT=6379
HERE_MAP_API_KEY=sAmpleKeYSTexT
IS_CLOUD=false
API_KEY_PATH=Dev/HERE_MAP
SERVER_REGION=us-east-1
MAIL_SEND=false
ENABLE_SMS_NOTIFICATION=false
SHEDLOCK_EMAIL_START=PT30S
SHEDLOCK_EMAIL_STOP=PT02M
IS_NEXT_MEDICAL_REVIEW_JOB=false
IS_NEXT_BP_JOB=false
IS_NEXT_BG_JOB=false
SHEDLOCK_OUTBOUND_START=PT24H
SHEDLOCK_OUTBOUND_STOP=PT25H
SHEDLOCK_SMS_START=PT30S
SHEDLOCK_SMS_STOP=PT02M
SWAGGER_ENABLED=true
LOCAL_FILE_SYSTEM_PATH=/Prescription_Signatures
IS_PRESCRIPTION_SIGNATURE_UPLOADED_TO_S3=false

.env

The .env file is used to store environment variables for the project. These variables are used to configure the application and contain sensitive information such as passwords, API keys, and other credentials.

Please note that the .env file should never be committed to version control, as it contains sensitive information that should not be shared publicly. Instead, you should add the .env file to your .gitignore file to ensure that it is not accidentally committed.

To use the application, you will need to create a .env file in the root directory of the project and add the necessary environment variables. You can refer to the above file for an example of the required variables and their format.

The values provided in the instructions are for demonstration purposes only and will not work as-is. You will need to replace them with actual values that are specific to your environment.

Note: After checking out the project, please ensure that you update the relevant properties and values in env.example, and then rename it to .env.

.env description

PROJECT_PATH: This property specifies the file path to the project's backend directory in the server.

DATABASE_URL: This property contains the JDBC connection URL for the PostgreSQL database server with the server timezone set to UTC, with the database name.

DATABASE_USERNAME: This property contains the username used to connect to the PostgreSQL database server.

DATABASE_PASSWORD: This property contains the password to connect to the PostgreSQL database server.

DATABASE_NAME: This property contains the name of the PostgreSQL database used by the project.

NOTIFICATION_PROJECT_PATH: This property specifies the file path to the notification project.

REDIS_PASSWORD: This property contains the password used to authenticate with the Redis server.

REDIS_HOST: This property contains the IP address of the Redis server.

REDIS_PORT: This property contains the port number used by the Redis server.

HERE_MAP_API_KEY: This property contains the API key required to access the HERE Maps API.

IS_CLOUD: This property indicates whether the project should retrieve the API Key from the cloud to use it with the HERE Maps API.

API_KEY_PATH: This property specifies the path to the API key required to access the HERE Maps API.

SERVER_REGION: This property specifies the region where the Amazon S3 buckets should create.

MAIL_SEND: The Application uses this property to indicate whether it sends emails.

ENABLE_SMS_NOTIFICATION: This property indicates whether SMS notifications are enabled in the Application.

SHEDLOCK_EMAIL_START: This property specifies the start time for the email shedlock job.

SHEDLOCK_EMAIL_STOP: This property specifies the stop time for the email shedlock job.

IS_NEXT_MEDICAL_REVIEW_JOB: This property indicates whether the next medical review job is enabled.

IS_NEXT_BP_JOB: This property indicates whether the next blood pressure job is enabled.

IS_NEXT_BG_JOB: This property indicates whether the next blood glucose job is enabled.

SHEDLOCK_OUTBOUND_START: This property specifies the start time for the outbound shedlock job.

SHEDLOCK_OUTBOUND_STOP: This property specifies the stop time for the outbound shedlock job.

SHEDLOCK_SMS_START: This property specifies the start time for the SMS shedlock job.

SHEDLOCK_SMS_STOP: This property specifies the stop time for the SMS shedlock job.

SWAGGER_ENABLED: This property indicates whether Swagger UI is enabled in the project.

LOCAL_FILE_SYSTEM_PATH: This property specifies the path to the directory on the server where prescription signatures are stored.

IS_PRESCRIPTION_SIGNATURE_UPLOADED_TO_S3: This property indicates whether prescription signatures uploaded to S3 bucket.

Alternative solution to AWS services using open-source and free service.

Deployment

Run the following commands in the below path.

Build a clean-install using maven /spice-opensource/spice-server

mvn clean install

Build docker images by the following command.

docker compose build

Once the images are built, run the docker containers by the following docker command.

docker compose up

Validation

Once the deployment of the application is successful, you can confirm the connectivity of the Back-end by logging into the application. To accomplish this, you may choose any API Testing tool. In this particular case, the Postman API Platform was utilized as an example.

Endpoint

POST {{ipAdd}}:8762/auth-service/session

Request Body

This endpoint allows users to sign-in into the application. The request body should be in the form-data format and include the following fields:

  • username: superuser@test.com

  • password: 1be35bc75f8316c2b5e48203d93ab3043b4774a7ab4a9e9eebf963c283cde32ddfb95aa843aee3d345f78a551a069200f013cd98904011ea6fb0cd08087d4841

The response contains two values: Authorization and TenantId. You must use these values in the subsequent requests.

Swagger:

Access the Swagger UI documentation in the project using the following URL.

Note: The credentials displayed in the tables are for demonstration purposes only and should not be used in a production environment. If you need to remove, modify, or add new user credentials, you can create a new script file containing the necessary DDL or DML queries in the below specified location. It's important to note that attempting to update the existing script file may result in a checksum error.

user-service/src/main/resources/db/migration

To install java in windows visit .

To install Java in windows visit .

To download and install maven in ubuntu click and .

To download maven in windows visit .

To install maven in windows visit .

To install docker follow steps in the .

To install docker-compose in ubuntu follow steps in the .

Storage Service -

Mail Service -

SMS Service -

For more information refer .

SPICE Server
Git Official site
Git Official site
Java Official site
Java Official site
Java Official site
Maven Official site - Download
Maven Official site - Install
Maven Official site - Download
Maven Official site - Install
Docker Official Docs
Docker Compose Official Docs
Min.IO
SendGrid
Twilio
link
http://localhost:8762/webjars/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config
🚀
🗄️
Page cover image
Response Body
Response Headers