|
|
|
|
@ -18,11 +18,14 @@ 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_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_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 = [];
|
|
|
|
|
@ -30,7 +33,6 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
List<PrescriptionResModel> patientPrescriptionsList = [];
|
|
|
|
|
List<RadiologyResModel> patientRadiologyList = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Client client =
|
|
|
|
|
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
|
|
|
|
|
|
|
|
|
|
@ -87,6 +89,9 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
*@desc: getPatientVitalSign
|
|
|
|
|
*/
|
|
|
|
|
getPatientVitalSign(patient) async {
|
|
|
|
|
isLoading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (await Helpers.checkConnection()) {
|
|
|
|
|
final response = await client.post(GET_PATIENT_VITAL_SIGN,
|
|
|
|
|
@ -138,6 +143,9 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
*@desc: getLabResult Orders
|
|
|
|
|
*/
|
|
|
|
|
getLabResultOrders(patient) async {
|
|
|
|
|
isLoading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (await Helpers.checkConnection()) {
|
|
|
|
|
final response = await client.post(GET_PATIENT_LAB_OREDERS,
|
|
|
|
|
@ -180,10 +188,13 @@ class PatientsProvider with ChangeNotifier {
|
|
|
|
|
*@desc: getPatientPrescriptions
|
|
|
|
|
*/
|
|
|
|
|
getPatientPrescriptions(patient) async {
|
|
|
|
|
isLoading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
|
|
|
|
|
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 +208,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;
|
|
|
|
|
@ -222,10 +234,12 @@ getPatientPrescriptions(patient) async {
|
|
|
|
|
*@desc: getPatientRadiology
|
|
|
|
|
*/
|
|
|
|
|
getPatientRadiology(patient) async {
|
|
|
|
|
isLoading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
@ -256,6 +270,4 @@ getPatientRadiology(patient) async {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|