Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ SECRET_KEY=someCrazyS3cR3T!Key.!
DB_USER=root
DB_HOST=db
DB_PORT=3306
DB_NAME=northwind
DB_NAME=meditrack
MYSQL_ROOT_PASSWORD=<put a good password here>
83 changes: 0 additions & 83 deletions api/backend/customers/customer_routes.py

This file was deleted.

Empty file removed api/backend/ml_models/__init__.py
Empty file.
48 changes: 0 additions & 48 deletions api/backend/ml_models/model01.py

This file was deleted.

32 changes: 32 additions & 0 deletions api/backend/nurses/nurse_routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
########################################################
# Nurse routes blueprint file
########################################################
from flask import Blueprint
from flask import request
from flask import jsonify
from flask import make_response
from flask import current_app
from backend.db_connection import db

# ------------------------------------------------------------
# Create a new Blueprint object, which is a collection of
# routes.
nurses = Blueprint("nurses", __name__)


# ------------------------------------------------------------
# Get all care tasks from the system
@nurses.route("/care-tasks", methods=["GET"])
def get_care_tasks():
current_app.logger.info("GET /care-tasks route")
cursor = db.get_db().cursor()
cursor.execute(
"""SELECT task_id, task_name, description,
priority, estimated_duration FROM CARE_TASKS"""
)

theData = cursor.fetchall()

the_response = make_response(jsonify(theData))
the_response.status_code = 200
return the_response
37 changes: 37 additions & 0 deletions api/backend/pharmacists/pharmacist_routes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
########################################################
# Pharmacist routes blueprint file
########################################################
from flask import Blueprint
from flask import request
from flask import jsonify
from flask import make_response
from flask import current_app
from backend.db_connection import db

# ------------------------------------------------------------
# Create a new Blueprint object, which is a collection of
# routes.
pharmacists = Blueprint("pharmacists", __name__)


# ------------------------------------------------------------
# Get medication history for a specific patient
@pharmacists.route("/medication-records/<patient_id>", methods=["GET"])
def get_medication_records(patient_id):
current_app.logger.info(f"GET /medication-records/{patient_id} route")
cursor = db.get_db().cursor()
cursor.execute(
"""SELECT mr.patient_id, m.medication_name,
mr.dosage, mr.frequency
FROM medication_record mr
JOIN MEDICATIONS m ON mr.medication_id = m.medication_id
WHERE mr.patient_id = {0}""".format(
patient_id
)
)

theData = cursor.fetchall()

the_response = make_response(jsonify(theData))
the_response.status_code = 200
return the_response
Loading