def get_medical_examiners_officers_list_for_examination(auth_token, examination_id): if settings.LOCAL: return [convert_user(user) for user in UserMocks.get_meo_user_list()] else: response_users = MedexRequest.get(auth_token, "%s/examination/%s/users/role/medical_examiner_officer" % ( settings.API_URL, examination_id)).json()['users'] return [convert_user(response_user) for response_user in response_users]
def get_medical_examiners_officers_list(auth_token): if settings.LOCAL: return [convert_user(user) for user in UserMocks.get_meo_user_list()] else: response_users = MedexRequest.get(auth_token, "%s/users/medical_examiner_officers" % settings.API_URL).json()[ 'users'] return [convert_user(response_user) for response_user in response_users]
def load_permissions_for_user(user_id, auth_token): if settings.LOCAL: return PermissionMocks.get_successful_permission_load_response( PermissionMocks.MEO_TYPE) else: return MedexRequest.get( auth_token, '%s/users/%s/permissions' % (settings.API_URL, user_id))
def load_by_id(auth_token, location_id): print(location_id) response = MedexRequest.get(auth_token, "%s/locations/%s" % (settings.API_URL, location_id)) print(response) if response.status_code == 200: return response.json() return None
def __get_filtered_locations_list(auth_token, permitted_locations_only, limit_to_me_offices, parent_id, create_examination_locations): query_params = { "ParentId": parent_id, "AccessOnly": permitted_locations_only, "OnlyMEOffices": limit_to_me_offices, "CreateExaminationOnly": create_examination_locations, } print(query_params) response = MedexRequest.get(auth_token, "%s/locations" % settings.API_URL, query_params).json()['locations'] print(response) return response
def load_all_users(auth_token): if settings.LOCAL: return UserMocks.get_successful_users_load_response() else: return MedexRequest.get(auth_token, "%s/users" % settings.API_URL)
def load_by_id(user_id, auth_token): if settings.LOCAL: return UserMocks.get_successful_single_user_load_response() else: return MedexRequest.get(auth_token, '%s/users/%s' % (settings.API_URL, user_id))
def load_case_breakdown_by_id(examination_id, auth_token): if settings.LOCAL: return ExaminationMocks.get_successful_case_breakdown_load_response() else: return MedexRequest.get(auth_token, '%s/examinations/%s/casebreakdown' % (settings.API_URL, examination_id))
def load_modes_of_disposal(auth_token): if settings.LOCAL: return DatatypeMocks.get_successful_modes_of_disposal_list_response() else: return MedexRequest.get(auth_token, '%s/data_types/mode_of_disposal' % settings.API_URL)
def load_medical_team_by_id(examination_id, auth_token): if settings.LOCAL: return ExaminationMocks.get_successful_medical_team_load_response(examination_id) else: return MedexRequest.get(auth_token, '%s/examinations/%s/medical_team' % (settings.API_URL, examination_id))
def load_patient_details_by_id(examination_id, auth_token): if settings.LOCAL: return ExaminationMocks.get_successful_patient_details_load_response() else: return MedexRequest.get(auth_token, '%s/examinations/%s/patient_details' % (settings.API_URL, examination_id))
def load_examinations_index(params, auth_token): if settings.LOCAL: return ExaminationMocks.get_successful_case_index_response() else: return MedexRequest.get(auth_token, '%s/examinations' % settings.API_URL, params)
def load_financial_report_locations(auth_token): if settings.LOCAL: return ReportMocks.get_successful_financial_report_locations_response() else: return MedexRequest.get(auth_token, '%s/report/finance_download_locations' % settings.API_URL)
def void_case(auth_token, examination_id): if settings.LOCAL: return ExaminationMocks.get_successful_case_index_response() else: return MedexRequest.get(auth_token, '%s/examinations/%s/case_settings' % (settings.API_URL, examination_id))
def load_coroner_report(auth_token, examination_id): if settings.LOCAL: return ReportMocks.get_successful_coroner_report_response() else: return MedexRequest.get(auth_token, '%s/report/%s/coronal_referral_download' % (settings.API_URL, examination_id))