|
|
|
@ -18,19 +18,21 @@ import '../util/helpers.dart';
|
|
|
|
|
|
|
|
|
|
const GET_PATIENT_VITAL_SIGN =
|
|
|
|
|
BASE_URL + 'Doctors.svc/REST/Doctor_GetPatientVitalSign';
|
|
|
|
|
const GET_PATIENT_LAB_OREDERS =BASE_URL + 'DoctorApplication.svc/REST/GetPatientLabOreders';
|
|
|
|
|
const GET_PRESCRIPTION =BASE_URL+'Patients.svc/REST/GetPrescriptionApptList';
|
|
|
|
|
const GET_RADIOLOGY = BASE_URL+'DoctorApplication.svc/REST/GetPatientRadResult';
|
|
|
|
|
const GET_PATIENT_LAB_OREDERS =
|
|
|
|
|
BASE_URL + 'DoctorApplication.svc/REST/GetPatientLabOreders';
|
|
|
|
|
const GET_PRESCRIPTION = BASE_URL + 'Patients.svc/REST/GetPrescriptionApptList';
|
|
|
|
|
const GET_RADIOLOGY =
|
|
|
|
|
BASE_URL + 'DoctorApplication.svc/REST/GetPatientRadResult';
|
|
|
|
|
|
|
|
|
|
class PatientsProvider with ChangeNotifier {
|
|
|
|
|
bool isLoading = true;
|
|
|
|
|
bool isLoading = false;
|
|
|
|
|
bool isError = false;
|
|
|
|
|
String error = '';
|
|
|
|
|
List<VitalSignResModel> patientVitalSignList = [];
|
|
|
|
|
List <LabOrdersResModel>patientLabResultOrdersList = [];
|
|
|
|
|
List <PrescriptionResModel>patientPrescriptionsList = [];
|
|
|
|
|
List <RadiologyResModel >patientRadiologyList = [];
|
|
|
|
|
List<LabOrdersResModel> patientLabResultOrdersList = [];
|
|
|
|
|
List<PrescriptionResModel> patientPrescriptionsList = [];
|
|
|
|
|
List<RadiologyResModel> patientRadiologyList = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Client client =
|
|
|
|
|
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
|
|
|
|
|
|
|
|
|
@ -79,6 +81,13 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setBasicData() {
|
|
|
|
|
isLoading = true;
|
|
|
|
|
isError = false;
|
|
|
|
|
error = '';
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*@author: Elham Rababah
|
|
|
|
|
*@Date:27/4/2020
|
|
|
|
@ -87,6 +96,8 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
*@desc: getPatientVitalSign
|
|
|
|
|
*/
|
|
|
|
|
getPatientVitalSign(patient) async {
|
|
|
|
|
setBasicData();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (await Helpers.checkConnection()) {
|
|
|
|
|
final response = await client.post(GET_PATIENT_VITAL_SIGN,
|
|
|
|
@ -138,6 +149,10 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
*@desc: getLabResult Orders
|
|
|
|
|
*/
|
|
|
|
|
getLabResultOrders(patient) async {
|
|
|
|
|
// isLoading = true;
|
|
|
|
|
// notifyListeners();
|
|
|
|
|
setBasicData();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (await Helpers.checkConnection()) {
|
|
|
|
|
final response = await client.post(GET_PATIENT_LAB_OREDERS,
|
|
|
|
@ -179,11 +194,15 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
*@return:
|
|
|
|
|
*@desc: getPatientPrescriptions
|
|
|
|
|
*/
|
|
|
|
|
getPatientPrescriptions(patient) async {
|
|
|
|
|
getPatientPrescriptions(patient) async {
|
|
|
|
|
// isLoading = true;
|
|
|
|
|
// notifyListeners();
|
|
|
|
|
setBasicData();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (await Helpers.checkConnection()) {
|
|
|
|
|
final response = await client.post(GET_PRESCRIPTION,
|
|
|
|
|
body: json.encode(patient));
|
|
|
|
|
final response =
|
|
|
|
|
await client.post(GET_PRESCRIPTION, body: json.encode(patient));
|
|
|
|
|
final int statusCode = response.statusCode;
|
|
|
|
|
isLoading = false;
|
|
|
|
|
|
|
|
|
@ -197,7 +216,8 @@ getPatientPrescriptions(patient) async {
|
|
|
|
|
patientPrescriptionsList = [];
|
|
|
|
|
print("res['PatientPrescriptionList']");
|
|
|
|
|
res['PatientPrescriptionList'].forEach((v) {
|
|
|
|
|
patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v));
|
|
|
|
|
patientPrescriptionsList
|
|
|
|
|
.add(new PrescriptionResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
isError = true;
|
|
|
|
@ -221,11 +241,14 @@ getPatientPrescriptions(patient) async {
|
|
|
|
|
*@return:
|
|
|
|
|
*@desc: getPatientRadiology
|
|
|
|
|
*/
|
|
|
|
|
getPatientRadiology(patient) async {
|
|
|
|
|
getPatientRadiology(patient) async {
|
|
|
|
|
// isLoading = true;
|
|
|
|
|
// notifyListeners();
|
|
|
|
|
setBasicData();
|
|
|
|
|
try {
|
|
|
|
|
if (await Helpers.checkConnection()) {
|
|
|
|
|
final response = await client.post(GET_RADIOLOGY,
|
|
|
|
|
body: json.encode(patient));
|
|
|
|
|
final response =
|
|
|
|
|
await client.post(GET_RADIOLOGY, body: json.encode(patient));
|
|
|
|
|
final int statusCode = response.statusCode;
|
|
|
|
|
isLoading = false;
|
|
|
|
|
|
|
|
|
@ -239,7 +262,7 @@ getPatientRadiology(patient) async {
|
|
|
|
|
patientRadiologyList = [];
|
|
|
|
|
print("res['List_GetRadOreders']");
|
|
|
|
|
res['List_GetRadOreders'].forEach((v) {
|
|
|
|
|
patientRadiologyList.add(new RadiologyResModel .fromJson(v));
|
|
|
|
|
patientRadiologyList.add(new RadiologyResModel.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
isError = true;
|
|
|
|
@ -256,6 +279,4 @@ getPatientRadiology(patient) async {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|