PEAR Patient Service is a microservice for managing patient-related data. This repository provides the setup and development instructions to get the service running locally.
- Git: Ensure Git is installed on your system.
- Conda: Install Conda for managing virtual environments.
- NTU VPN: Install the NTU VPN to access internal resources.
To connect to the NTU VPN, follow these steps:
Network Connection: Ensure you are connected to the NTUSECURE Wi-Fi network or connect through the NTU VPN.
VPN Setup: Follow the installation guide for detailed instructions on setting up and connecting to the VPN.
Clone the repository using the following command:
git clone https://github.com/ntu-pear/PEAR_patient_service.git
cd PEAR_patient_service
- Create a Conda Virtual Environment:
# This is to set the python version in your conda environment to 3.9.19
conda create -n pear_patient_service python=3.9.19
conda activate pear_patient_service
#install the necessary requirements in the conda environment
pip install -r requirements.txt
Make sure to create a .env file in the PEAR_patient_service folder. For instructions on how to configure this file, refer to the Confluence page:
Click on the link to be redirect to the confluence page -->Confluence page
After the installation is completed, run the application on your machine
uvicorn app.main:app --reload
This will start the microservice, which should be accessible at http://localhost:8000
.
Ensure that Visual Studio Code uses LF (Line Feed) instead of CRLF (Carriage Return Line Feed) for line endings.
There will be a lot of unresolved troubleshooting. If the application does not work, run this command in the current directory
#install the necessary requirements in the conda environment
pip install -r requirements.txt
#After the installation is completed, run the application on your machine
uvicorn app.main:app --reload
If you encounter issues with Docker Compose, such as missing .sh
files, you may need to adjust Git's line ending settings:
git config core.autocrlf false
git rm --cached -r .
git reset --hard
After running these commands, you should see:
Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
This indicates that the service is running successfully.
For consistency and reproducibility, the following versions of packages are used in this project:
- Python: 3.9.19
- FastAPI: 0.111.1
- Pydantic: 2.8.2
- Psycopg2-binary: 2.9.9
- Databases: 0.9.0
- SQLAlchemy: 2.0.31
- PyODBC: 5.1.0
- Uvicorn: 0.30.3
- Python-dotenv: 1.0.1
- MSSQL Database Name:
fyp_patient_service_dev
- Microservice Name:
patient_service