new data
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
from flask import jsonify
|
||||
from app.utils.logger import logger
|
||||
from app.api.services.base_service import BaseService
|
||||
from sqlalchemy import func, desc
|
||||
from app.api.helpers.response_helper import ResponseHelper
|
||||
from app.api.schemas.user import UserSchema
|
||||
from app.models import Members
|
||||
from app.extensions import db
|
||||
|
||||
class CommonDataService(BaseService):
|
||||
|
||||
@staticmethod
|
||||
def available_practices(data):
|
||||
try:
|
||||
with db.session.begin():
|
||||
validated_data = CommonDataService.validate_data(data, UserSchema())
|
||||
token = validated_data.get('token')
|
||||
uid = validated_data.get('uid')
|
||||
member_data = Members.get_member_by_uid(uid)
|
||||
member_id = member_data.id
|
||||
|
||||
available_practices_data = {
|
||||
{
|
||||
"type": "Physician",
|
||||
"specialties": [
|
||||
"General Practitioner",
|
||||
"Cardiologist",
|
||||
"Dermatologist",
|
||||
"Pediatrician",
|
||||
"Surgeon",
|
||||
"Oncologist",
|
||||
"Neurologist",
|
||||
"Psychiatrist",
|
||||
"Radiologist",
|
||||
"Anesthesiologist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Nurse",
|
||||
"specialties": [
|
||||
"Registered Nurse (RN)",
|
||||
"Nurse Practitioner (NP)",
|
||||
"Licensed Practical Nurse (LPN)",
|
||||
"Certified Nursing Assistant (CNA)",
|
||||
"Clinical Nurse Specialist (CNS)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Dentist",
|
||||
"specialties": [
|
||||
"General Dentist",
|
||||
"Orthodontist",
|
||||
"Oral Surgeon",
|
||||
"Periodontist",
|
||||
"Endodontist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Pharmacist",
|
||||
"specialties": [
|
||||
"Retail Pharmacist",
|
||||
"Hospital Pharmacist",
|
||||
"Clinical Pharmacist",
|
||||
"Compounding Pharmacist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Therapist",
|
||||
"specialties": [
|
||||
"Physical Therapist (PT)",
|
||||
"Occupational Therapist (OT)",
|
||||
"Speech-Language Pathologist (SLP)",
|
||||
"Psychotherapist",
|
||||
"Massage Therapist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Other Allied Health Professional",
|
||||
"specialties": [
|
||||
"Medical Assistant",
|
||||
"Phlebotomist",
|
||||
"Radiologic Technologist",
|
||||
"Dietitian/Nutritionist",
|
||||
"Optometrist",
|
||||
"Chiropractor",
|
||||
"Podiatrist",
|
||||
"Medical Laboratory Scientist"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ResponseHelper.success(data=available_practices_data)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred while getting dashboard data: {str(e)}", exc_info=True)
|
||||
return jsonify({"message": "Internal Server Error"}), 500
|
||||
|
||||
|
||||
Reference in New Issue
Block a user