You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/providers/patients_provider.dart

46 lines
1.6 KiB
Dart

import 'dart:convert';
import 'package:flutter/cupertino.dart';
5 years ago
import 'package:http/http.dart';
import 'package:http_interceptor/http_client_with_interceptor.dart';
import '../interceptor/http_interceptor.dart';
import '../models/patient_model.dart';
class PatientsProvider with ChangeNotifier {
5 years ago
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
Future<Map> getPatientList(PatientModel patient, patientType) async {
const url =
'https://hmgwebservices.com/Services/DoctorApplication.svc/REST/GetMyInPatient';
try {
5 years ago
final response = await client.post(url,
body: json.encode({
"ProjectID": patient.PatientID,
"ClinicID": patient.ClinicID,
"DoctorID": patient.DoctorID,
"FirstName": patient.FirstName,
"MiddleName": patient.MiddleName,
"LastName": patient.LastName,
"PatientMobileNumber": patient.PatientMobileNumber,
"PatientIdentificationID": patient.PatientIdentificationID,
"PatientID": patient.PatientID,
"From": patient.From,
"To": patient.To,
"LanguageID": patient.LanguageID,
"stamp": patient.stamp,
"IPAdress": patient.IPAdress,
"VersionID": patient.VersionID,
"Channel": patient.Channel,
"TokenID": patient.TokenID,
"SessionID": patient.SessionID,
"IsLoginForDoctorApp": patient.IsLoginForDoctorApp,
"PatientOutSA": patient.PatientOutSA
}));
return Future.value(json.decode(response.body));
} catch (error) {
throw error;
}
}
}