|
|
|
|
@ -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;
|
|
|
|
|
|
|
|
|
|
|