def patients_hiv(): if api_key.check_key(request.query.api_key,"hiv","patients"): api_key.accessed(request.query.api_key) if request.query.type=="csv": data=get_data.patients(database="openmrs_aggregation") return helper_functions.patients_to_csv(data) else: return {'patients':get_data.patients(database="openmrs_aggregation")} else: abort(401, "Access denied.")
def patients_mch(): if api_key.check_key(request.query.api_key,"mch","patients"): api_key.accessed(request.query.api_key) if request.query.type=="csv": data=get_data.patients(database="mch_aggregation") return helper_functions.patients_to_csv(data) else: return get_data.patients(database="mch_aggregation") else: abort(401, "Access denied.")
def performace_hiv(date): if api_key.check_key(request.query.api_key,"hiv","performace"): api_key.accessed(request.query.api_key) if request.query.type=="csv": data=get_data.performance_by_week(date,database="openmrs_aggregation") return helper_functions.weeks_to_csv(data) else: return get_data.performance_by_week(date) else: abort(401, "Access denied.")
def verification_eligible(): if api_key.check_key(request.query.api_key,"hiv","neel"): api_key.accessed(request.query.api_key) if request.query.type=="csv": data=get_data.neel(database="openmrs_aggregation") return helper_functions.patients_to_csv(data) else: return get_data.neel(database="openmrs_aggregation") else: abort(401, "Access denied.")
def verification_missed_appointment(): if api_key.check_key(request.query.api_key,"hiv","verification_missed_appointment"): api_key.accessed(request.query.api_key) if request.query.type=="csv": data=get_data.verification_missed_appointment(database="openmrs_aggregation") return helper_functions.verification_to_csv(data) else: return get_data.verification_missed_appointment(database="openmrs_aggregation") else: abort(401, "Access denied.")
def performace_mch(): if api_key.check_key(request.query.api_key,"mch","performance"): api_key.accessed(request.query.api_key) return get_data.performance(database="mch_aggregation") else: abort(401, "Access denied.")