|
|
|
|
@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/auth/login_form.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:http/http.dart';
|
|
|
|
|
import 'package:http_interceptor/http_client_with_interceptor.dart';
|
|
|
|
|
@ -23,6 +24,7 @@ const GET_PATIENT_LAB_OREDERS =
|
|
|
|
|
const GET_PRESCRIPTION = BASE_URL + 'Patients.svc/REST/GetPrescriptionApptList';
|
|
|
|
|
const GET_RADIOLOGY =
|
|
|
|
|
BASE_URL + 'DoctorApplication.svc/REST/GetPatientRadResult';
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
|
|
|
|
|
class PatientsProvider with ChangeNotifier {
|
|
|
|
|
bool isLoading = false;
|
|
|
|
|
@ -44,8 +46,11 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
// var srvicePatiant = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"];
|
|
|
|
|
// print("a=SERVICES_PATIANT[patientType]========='=======a");
|
|
|
|
|
int val = int.parse(patientType);
|
|
|
|
|
final url =BASE_URL+"DoctorApplication.svc/REST/"+ SERVICES_PATIANT[val];///"https://uat.hmgwebservices.com/Services/Doctors.svc/REST/";
|
|
|
|
|
//BASE_URL + 'DoctorApplication.svc/REST/' + SERVICES_PATIANT[val];
|
|
|
|
|
final url =
|
|
|
|
|
BASE_URL + "DoctorApplication.svc/REST/" + SERVICES_PATIANT[val];
|
|
|
|
|
|
|
|
|
|
///"https://uat.hmgwebservices.com/Services/Doctors.svc/REST/";
|
|
|
|
|
//BASE_URL + 'DoctorApplication.svc/REST/' + SERVICES_PATIANT[val];
|
|
|
|
|
// print("a===========$url=======a");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
@ -76,8 +81,8 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
//***********************
|
|
|
|
|
|
|
|
|
|
return Future.value(json.decode(response.body));
|
|
|
|
|
} catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
throw err;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -128,8 +133,8 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
error = 'Please Check The Internet Connection';
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
handelCatchErrorCase(err);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -182,8 +187,8 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
error = 'Please Check The Internet Connection';
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
handelCatchErrorCase(err);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -228,11 +233,25 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
error = 'Please Check The Internet Connection';
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
handelCatchErrorCase(err);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*@author: Elham Rababah
|
|
|
|
|
*@Date:12/5/2020
|
|
|
|
|
*@param: patient
|
|
|
|
|
*@return:
|
|
|
|
|
*@desc: getPatientRadiology
|
|
|
|
|
*/
|
|
|
|
|
handelCatchErrorCase(err) {
|
|
|
|
|
isLoading = false;
|
|
|
|
|
isError = true;
|
|
|
|
|
error = helpers.generateContactAdminMsg(err);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
throw err;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*@author: Elham Rababah
|
|
|
|
|
*@Date:3/5/2020
|
|
|
|
|
*@param: patient
|
|
|
|
|
@ -272,8 +291,8 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
error = 'Please Check The Internet Connection';
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
handelCatchErrorCase(err);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|