change client to AppClient

merge-requests/63/head
Elham Rababah 6 years ago
parent 81dd4206e8
commit de6f814f56

@ -6,12 +6,41 @@ const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://uat.hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems";
const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList";
const GET_PROJECTS = 'Lists.svc/REST/GetProjectForDoctorAPP';
const GET_PATIENT_VITAL_SIGN = 'Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_LAB_OREDERS =
'DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList';
const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult';
//*********change value to decode json from Dropdown ************
var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"];
var SERVICES_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient","List_MyDischargePatient" ,"List_MyReferredPatient","List_MyDischargeReferralPatient","List_MyTomorrowPatient","List_MyReferralPatient"];
var SERVICES_PATIANT_HEADER = ["OutPatient", "InPatient", "Discharge","Referred","Referral Discharge","Tomorrow","Referral"];
var SERVICES_PATIANT = [
"GetMyOutPatient",
"GetMyInPatient",
"GtMyDischargePatient",
"GtMyReferredPatient",
"GtMyDischargeReferralPatient",
"GtMyTomorrowPatient",
"GtMyReferralPatient"
];
var SERVICES_PATIANT2 = [
"List_MyOutPatient",
"List_MyInPatient",
"List_MyDischargePatient",
"List_MyReferredPatient",
"List_MyDischargeReferralPatient",
"List_MyTomorrowPatient",
"List_MyReferralPatient"
];
var SERVICES_PATIANT_HEADER = [
"OutPatient",
"InPatient",
"Discharge",
"Referred",
"Referral Discharge",
"Tomorrow",
"Referral"
];
//******************
// Colors ////// by : ibrahim
const PRIMARY_COLOR = 0xff58434F;
const PRIMARY_COLOR = 0xff58434F;

@ -1,23 +1,11 @@
import 'dart:convert';
import 'package:doctor_app_flutter/client/app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import '../interceptor/http_interceptor.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart';
import 'package:http_interceptor/http_client_with_interceptor.dart';
const GET_PROJECTS = BASE_URL + 'Lists.svc/REST/GetProjectForDoctorAPP';
class HospitalProvider with ChangeNotifier {
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
Future<Map> getProjectsList() async {
const url = GET_PROJECTS;
var info = {
@ -31,7 +19,7 @@ class HospitalProvider with ChangeNotifier {
"IsLoginForDoctorApp": true
};
try {
final response = await client.post(url, body: json.encode(info));
final response = await AppClient.post(url, body: json.encode(info));
return Future.value(json.decode(response.body));
} catch (error) {
throw error;

@ -1,29 +1,20 @@
import 'dart:convert';
import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart';
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';
import '../client/app_client.dart';
import '../config/config.dart';
import '../interceptor/http_interceptor.dart';
import '../models/patient/lab_orders_res_model.dart';
import '../models/patient/patiant_info_model.dart';
import '../models/patient/patient_model.dart';
import '../models/patient/prescription_res_model.dart';
import '../models/patient/radiology_res_model.dart';
import '../models/patient/vital_sign_res_model.dart';
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';
Helpers helpers = Helpers();
class PatientsProvider with ChangeNotifier {
@ -43,12 +34,12 @@ class PatientsProvider with ChangeNotifier {
Future<Map> getPatientList(PatientModel patient, patientType) async {
/* const url =
BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/
int val = int.parse(patientType);
//**********Modify url by amjad amireh for patiant type*********
final url =BASE_URL+"DoctorApplication.svc/REST/"+ SERVICES_PATIANT[val];
//**********Modify url by amjad amireh for patiant type*********
final url =
BASE_URL + "DoctorApplication.svc/REST/" + SERVICES_PATIANT[val];
// print("a===========$url=======a");
try {
@ -103,7 +94,7 @@ class PatientsProvider with ChangeNotifier {
try {
if (await Helpers.checkConnection()) {
final response = await client.post(GET_PATIENT_VITAL_SIGN,
final response = await AppClient.post(GET_PATIENT_VITAL_SIGN,
body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
@ -136,15 +127,6 @@ class PatientsProvider with ChangeNotifier {
}
}
PatiantInformtion getSelectedPatient() {
return _selectedPatient;
}
setSelectedPatient(PatiantInformtion patient) {
// return _selectedPatient;
_selectedPatient = patient;
}
/*@author: Elham Rababah
*@Date:27/4/2020
*@param: patient
@ -158,7 +140,7 @@ class PatientsProvider with ChangeNotifier {
try {
if (await Helpers.checkConnection()) {
final response = await client.post(GET_PATIENT_LAB_OREDERS,
final response = await AppClient.post(GET_PATIENT_LAB_OREDERS,
body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
@ -204,7 +186,7 @@ class PatientsProvider with ChangeNotifier {
try {
if (await Helpers.checkConnection()) {
final response =
await client.post(GET_PRESCRIPTION, body: json.encode(patient));
await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
@ -263,7 +245,7 @@ class PatientsProvider with ChangeNotifier {
try {
if (await Helpers.checkConnection()) {
final response =
await client.post(GET_RADIOLOGY, body: json.encode(patient));
await AppClient.post(GET_RADIOLOGY, body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;

@ -1,9 +1,6 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/size_config.dart';
import '../../shared/profile_image_widget.dart';

Loading…
Cancel
Save