Repository for Make-Easy HMIS
Checkout the Wiki page for the technical implementation
If you're running with docker, inside ./src/assets/backend-axios-instance/index.js with docker baseURL = baseURL: "http://backend:8000",
In the root directory run;
docker compose up
Frontend will be running on http://backend:3000 and backend on http://backend:8000
First rename the ./backend/.env.local
to .env
with the sample code inside
Install python and virtualenv. Next, in the project directory run:
virtualenv venv
venv\scripts\activate
cd backend
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
virtualenv venv
source venv/bin/activate
cd backend
pip install -r requirements.txt
python manage.py makemigrations customuser authperms patient pharmacy inventory laboratory receptions billing announcement
python manage.py migrate
python manage.py runserver
Create a superuser with python manage.py createsuperuser
You'll use this account to log into the dashboard in frontend
To register patients using landing page, create a group in django Admin called PATIENT
API Endpoints:
/docs/
docs/swagger/
Inside ./src/assets/backend-axios-instance/index.js running manually = baseURL: "http://127.0.0.1:8000",
Lastly run the development server using:
npm run dev
Dev version can be a little slow. To run a faster build version, use the follwoing commands:
npm run build
npm start
Visit localhost 127.0.0.1:3000/dashboard
You need to create groups and associate permissions. make sure groups follow this order SYS_ADMIN
, PATIENT
group then the rest ie DOCTOR
,PHARMACIST
, RECEPTIONIST
, LAB_TECH
, NURSE
Then create permissions below and link to the GROUPS
.
Create super user then navigate to localhost:8080/admin and add permissions;
CAN_ACCESS_DOCTOR_DASHBOARD
CAN_ACCESS_GENERAL_DASHBOARD
CAN_ACCESS_ADMIN_DASHBOARD
CAN_ACCESS_RECEPTION_DASHBOARD
CAN_ACCESS_NURSING_DASHBOARD
CAN_ACCESS_LABORATORY_DASHBOARD
CAN_ACCESS_PATIENTS_DASHBOARD
CAN_ACCESS_AI_ASSISTANT_DASHBOARD
CAN_ACCESS_ANNOUNCEMENT_DASHBOARD
CAN_ACCESS_PHARMACY_DASHBOARD
CAN_ACCESS_INVENTORY_DASHBOARD
CAN_ACCESS_BILLING_DASHBOARD
You will notice that we have a Role and a Group. A group is associated with permissions which determines which specific dashboards a user is allowed to access. A role helps differentiate staff from patients hence redirecting to patient profile if patient and to general dashboard if staff.
If not installed already, install celery and redis INSIDE YOUR VIRTUAL ENV
pip install celery redis
Run Celery: celery -A easymed worker --loglevel=INFO
Run Redis: redis-cli -h 127.0.0.1 -p 6379
Generated PDFs
http://127.0.0.1:8080/download_{service_name}_pdf/{id}
i.e http://127.0.0.1:8080/download_invoice_pdf/24
Django's runserver does not support asgi
run with uvicorn to have the notifications working
uvicorn --port 8080 easymed.asgi:application
On a separate terminal
npm install -g wscat
wscat -c ws://localhost:8080/ws/doctor_notifications/
<-- appointment assigned notification will be seen here
To generate sales by given date, send sample request as shown below
curl -X POST http://localhost:8080/reports/sale_by_date/ -H "Content-Type: application/json" -d '{"start_date": "2024-02-01", "end_date": "2024-02-18"}' > report-log.txt
curl
The > report-log.txt
just dumps the logs to the report-log.txt file for troubleshooting.
If sending directly from frontend, just configure the payload and send to the endpoint http://localhost:8080/reports/sale_by_date/
You can access the generated report here
http://127.0.0.1:8080/sale_by_date/pdf/
To generated sales report by date range and given item id;
curl -X POST http://localhost:8080/reports/sale_by_item_and_date/ -H "Content-Type: application/json" -d '{"item_id": "1", "start_date": "2024-02-01", "end_date": "2024-02-10"}'
You can access the generated pdf here /serve_sales_by_item_id_pdf/
Send POST request to the endpoint below, teh response will have the total amount
for a given payment mode
/reports/total_payment_mode_amount/?payment_mode=insurance&date=2024-02-18
The /preflight directory contains set up files for an LIS Host listener.
Qualitative and quantitative results will be moved to specify the type in a test panel
If a Lab results is selected as qualitative, use this endpoint
/lab/lab-test-results-qualitative/
and the results for the test panels should be sent here
/lab/lab-test-results-panel-qualitative
Generated report can be gotten here
/lab/download_qualitative_labtestresult_pdf/<int:labtestresult_id>/
By default, or when explicitly specified, all lab test will be quantitative and will use the following endpoints. In the same order, create a report, add test-panel-results to that report
then generate the pdf report
/lab/lab-test-results/
/lab/lab-test-results-panel/
/download_labtestresult_pdf/<int:labtestresult_id>/
When you click Send to Equipment and select the equiment in the dashboard, the test request gets converted to HL7 or ASTM and sent to the equipment.
The laboratory>addons>lis_list2.py will listen for any incoming data, then check the format, convert that format to json then send to the results endpoint
Minimum system specifications RAM 8GB Disk SSD 250GB CPU 3-10th Gen
Other requirements; The system uses TCP to primarily integret with Equipment. For equipment with any other form of coms other than TCP/Ethernet, will need to be configured with additional hardware that converts the coms to TCP A device such us this, can work.