live care features added.
parent
f052ffc8f3
commit
bde86ef829
@ -1,8 +1,9 @@
|
||||
final TOKEN = 'token';
|
||||
final PROJECT_ID='projectID';
|
||||
final PROJECT_ID = 'projectID';
|
||||
//===========amjad============
|
||||
final DOCTOR_ID='doctorID';
|
||||
final DOCTOR_ID = 'doctorID';
|
||||
//=======================
|
||||
final SLECTED_PATIENT_TYPE='slectedPatientType';
|
||||
final SLECTED_PATIENT_TYPE = 'slectedPatientType';
|
||||
final APP_Language = 'language';
|
||||
final DOCTOR_PROFILE = 'doctorProfile';
|
||||
final DOCTOR_PROFILE = 'doctorProfile';
|
||||
final LIVE_CARE_PATIENT = 'livecare-patient-profile';
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
class LiveCarePendingListRequest {
|
||||
PatientData patientData;
|
||||
int doctorID;
|
||||
String sErServiceID;
|
||||
int projectID;
|
||||
int sourceID;
|
||||
|
||||
LiveCarePendingListRequest(
|
||||
{this.patientData,
|
||||
this.doctorID,
|
||||
this.sErServiceID,
|
||||
this.projectID,
|
||||
this.sourceID});
|
||||
|
||||
LiveCarePendingListRequest.fromJson(Map<String, dynamic> json) {
|
||||
patientData = new PatientData.fromJson(json['PatientData']);
|
||||
|
||||
doctorID = json['DoctorID'];
|
||||
sErServiceID = json['SErServiceID'];
|
||||
projectID = json['ProjectID'];
|
||||
sourceID = json['SourceID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientData'] = this.patientData.toJson();
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['SErServiceID'] = this.sErServiceID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['SourceID'] = this.sourceID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class PatientData {
|
||||
bool isOutKSA;
|
||||
|
||||
PatientData({this.isOutKSA});
|
||||
|
||||
PatientData.fromJson(Map<String, dynamic> json) {
|
||||
isOutKSA = json['IsOutKSA'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IsOutKSA'] = this.isOutKSA;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,168 @@
|
||||
class LiveCarePendingListResponse {
|
||||
Null acceptedBy;
|
||||
Null acceptedOn;
|
||||
int age;
|
||||
Null appointmentNo;
|
||||
String arrivalTime;
|
||||
String arrivalTimeD;
|
||||
int callStatus;
|
||||
String clientRequestID;
|
||||
String clinicName;
|
||||
Null consoltationEnd;
|
||||
Null consultationNotes;
|
||||
Null createdOn;
|
||||
String dateOfBirth;
|
||||
String deviceToken;
|
||||
String deviceType;
|
||||
Null doctorName;
|
||||
String editOn;
|
||||
String gender;
|
||||
bool isFollowUP;
|
||||
Null isFromVida;
|
||||
int isLoginB;
|
||||
bool isOutKSA;
|
||||
int isRejected;
|
||||
String language;
|
||||
double latitude;
|
||||
double longitude;
|
||||
String mobileNumber;
|
||||
Null openSession;
|
||||
Null openTokenID;
|
||||
String patientID;
|
||||
String patientName;
|
||||
int patientStatus;
|
||||
String preferredLanguage;
|
||||
int projectID;
|
||||
int scoring;
|
||||
int serviceID;
|
||||
Null tokenID;
|
||||
int vCID;
|
||||
String voipToken;
|
||||
|
||||
LiveCarePendingListResponse(
|
||||
{this.acceptedBy,
|
||||
this.acceptedOn,
|
||||
this.age,
|
||||
this.appointmentNo,
|
||||
this.arrivalTime,
|
||||
this.arrivalTimeD,
|
||||
this.callStatus,
|
||||
this.clientRequestID,
|
||||
this.clinicName,
|
||||
this.consoltationEnd,
|
||||
this.consultationNotes,
|
||||
this.createdOn,
|
||||
this.dateOfBirth,
|
||||
this.deviceToken,
|
||||
this.deviceType,
|
||||
this.doctorName,
|
||||
this.editOn,
|
||||
this.gender,
|
||||
this.isFollowUP,
|
||||
this.isFromVida,
|
||||
this.isLoginB,
|
||||
this.isOutKSA,
|
||||
this.isRejected,
|
||||
this.language,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
this.mobileNumber,
|
||||
this.openSession,
|
||||
this.openTokenID,
|
||||
this.patientID,
|
||||
this.patientName,
|
||||
this.patientStatus,
|
||||
this.preferredLanguage,
|
||||
this.projectID,
|
||||
this.scoring,
|
||||
this.serviceID,
|
||||
this.tokenID,
|
||||
this.vCID,
|
||||
this.voipToken});
|
||||
|
||||
LiveCarePendingListResponse.fromJson(Map<String, dynamic> json) {
|
||||
acceptedBy = json['AcceptedBy'];
|
||||
acceptedOn = json['AcceptedOn'];
|
||||
age = json['Age'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
arrivalTime = json['ArrivalTime'];
|
||||
arrivalTimeD = json['ArrivalTimeD'];
|
||||
callStatus = json['CallStatus'];
|
||||
clientRequestID = json['ClientRequestID'];
|
||||
clinicName = json['ClinicName'];
|
||||
consoltationEnd = json['ConsoltationEnd'];
|
||||
consultationNotes = json['ConsultationNotes'];
|
||||
createdOn = json['CreatedOn'];
|
||||
dateOfBirth = json['DateOfBirth'];
|
||||
deviceToken = json['DeviceToken'];
|
||||
deviceType = json['DeviceType'];
|
||||
doctorName = json['DoctorName'];
|
||||
editOn = json['EditOn'];
|
||||
gender = json['Gender'];
|
||||
isFollowUP = json['IsFollowUP'];
|
||||
isFromVida = json['IsFromVida'];
|
||||
isLoginB = json['IsLoginB'];
|
||||
isOutKSA = json['IsOutKSA'];
|
||||
isRejected = json['IsRejected'];
|
||||
language = json['Language'];
|
||||
latitude = json['Latitude'];
|
||||
longitude = json['Longitude'];
|
||||
mobileNumber = json['MobileNumber'];
|
||||
openSession = json['OpenSession'];
|
||||
openTokenID = json['OpenTokenID'];
|
||||
patientID = json['PatientID'];
|
||||
patientName = json['PatientName'];
|
||||
patientStatus = json['PatientStatus'];
|
||||
preferredLanguage = json['PreferredLanguage'];
|
||||
projectID = json['ProjectID'];
|
||||
scoring = json['Scoring'];
|
||||
serviceID = json['ServiceID'];
|
||||
tokenID = json['TokenID'];
|
||||
vCID = json['VC_ID'];
|
||||
voipToken = json['VoipToken'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['AcceptedBy'] = this.acceptedBy;
|
||||
data['AcceptedOn'] = this.acceptedOn;
|
||||
data['Age'] = this.age;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
data['ArrivalTime'] = this.arrivalTime;
|
||||
data['ArrivalTimeD'] = this.arrivalTimeD;
|
||||
data['CallStatus'] = this.callStatus;
|
||||
data['ClientRequestID'] = this.clientRequestID;
|
||||
data['ClinicName'] = this.clinicName;
|
||||
data['ConsoltationEnd'] = this.consoltationEnd;
|
||||
data['ConsultationNotes'] = this.consultationNotes;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['DateOfBirth'] = this.dateOfBirth;
|
||||
data['DeviceToken'] = this.deviceToken;
|
||||
data['DeviceType'] = this.deviceType;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['EditOn'] = this.editOn;
|
||||
data['Gender'] = this.gender;
|
||||
data['IsFollowUP'] = this.isFollowUP;
|
||||
data['IsFromVida'] = this.isFromVida;
|
||||
data['IsLoginB'] = this.isLoginB;
|
||||
data['IsOutKSA'] = this.isOutKSA;
|
||||
data['IsRejected'] = this.isRejected;
|
||||
data['Language'] = this.language;
|
||||
data['Latitude'] = this.latitude;
|
||||
data['Longitude'] = this.longitude;
|
||||
data['MobileNumber'] = this.mobileNumber;
|
||||
data['OpenSession'] = this.openSession;
|
||||
data['OpenTokenID'] = this.openTokenID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientName'] = this.patientName;
|
||||
data['PatientStatus'] = this.patientStatus;
|
||||
data['PreferredLanguage'] = this.preferredLanguage;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['Scoring'] = this.scoring;
|
||||
data['ServiceID'] = this.serviceID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['VC_ID'] = this.vCID;
|
||||
data['VoipToken'] = this.voipToken;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
class StartCallReq {
|
||||
int vCID;
|
||||
bool isrecall;
|
||||
String tokenID;
|
||||
String generalid;
|
||||
int doctorId;
|
||||
bool isOutKsa;
|
||||
String projectName;
|
||||
String docotrName;
|
||||
String clincName;
|
||||
String docSpec;
|
||||
int clinicId;
|
||||
|
||||
StartCallReq(
|
||||
{this.vCID,
|
||||
this.isrecall,
|
||||
this.tokenID,
|
||||
this.generalid,
|
||||
this.doctorId,
|
||||
this.isOutKsa,
|
||||
this.projectName,
|
||||
this.docotrName,
|
||||
this.clincName,
|
||||
this.docSpec,
|
||||
this.clinicId});
|
||||
|
||||
StartCallReq.fromJson(Map<String, dynamic> json) {
|
||||
vCID = json['VC_ID'];
|
||||
isrecall = json['isrecall'];
|
||||
tokenID = json['TokenID'];
|
||||
generalid = json['generalid'];
|
||||
doctorId = json['DoctorId'];
|
||||
isOutKsa = json['IsOutKsa'];
|
||||
projectName = json['projectName'];
|
||||
docotrName = json['DocotrName'];
|
||||
clincName = json['clincName'];
|
||||
docSpec = json['Doc_Spec'];
|
||||
clinicId = json['ClinicId'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VC_ID'] = this.vCID;
|
||||
data['isrecall'] = this.isrecall;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['generalid'] = this.generalid;
|
||||
data['DoctorId'] = this.doctorId;
|
||||
data['IsOutKsa'] = this.isOutKsa;
|
||||
data['projectName'] = this.projectName;
|
||||
data['DocotrName'] = this.docotrName;
|
||||
data['clincName'] = this.clincName;
|
||||
data['Doc_Spec'] = this.docSpec;
|
||||
data['ClinicId'] = this.clinicId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart';
|
||||
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||
|
||||
class LiveCareProvider with ChangeNotifier {
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
var liveCarePendingList = [];
|
||||
var inCallResponse = {};
|
||||
bool isFinished = true;
|
||||
bool hasError = false;
|
||||
String errorMsg = '';
|
||||
|
||||
LiveCarePendingListRequest _pendingRequestModel =
|
||||
LiveCarePendingListRequest();
|
||||
|
||||
Future<List> getpendingList() async {
|
||||
var profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
||||
_pendingRequestModel.projectID = await sharedPref.getInt(PROJECT_ID);
|
||||
_pendingRequestModel.doctorID = profile['DoctorID'];
|
||||
_pendingRequestModel.sErServiceID = "1,3";
|
||||
_pendingRequestModel.sourceID = 1;
|
||||
_pendingRequestModel.patientData = PatientData(isOutKSA: false);
|
||||
resetDefaultValues();
|
||||
// dynamic localRes;
|
||||
await BaseAppClient.post(GET_LIVECARE_PENDINGLIST,
|
||||
onSuccess: (response, statusCode) async {
|
||||
isFinished = true;
|
||||
liveCarePendingList = response["List_PendingPatientList"];
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
isFinished = true;
|
||||
throw error;
|
||||
}, body: _pendingRequestModel.toJson());
|
||||
return Future.value(liveCarePendingList);
|
||||
}
|
||||
|
||||
Future<Map> startCall(request, bool isReCall) async {
|
||||
var profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
||||
resetDefaultValues();
|
||||
/* the request model is not same hence added manually */
|
||||
var newRequest = new StartCallReq();
|
||||
newRequest.clinicId = profile["ClinicID"];
|
||||
newRequest.vCID = request["VC_ID"];
|
||||
newRequest.isrecall = isReCall;
|
||||
newRequest.doctorId = profile["DoctorID"];
|
||||
newRequest.isOutKsa = request["IsOutKSA"];
|
||||
newRequest.projectName = profile["ProjectName"];
|
||||
newRequest.docotrName = profile["DoctorName"];
|
||||
newRequest.clincName = profile["ClinicDescription"];
|
||||
newRequest.clincName = profile["ClinicDescription"];
|
||||
newRequest.docSpec = profile["DoctorTitleForProfile"];
|
||||
newRequest.generalid = 'Cs2020@2016\$2958';
|
||||
isFinished = false;
|
||||
await BaseAppClient.post(START_LIVECARE_CALL,
|
||||
onSuccess: (response, statusCode) async {
|
||||
isFinished = true;
|
||||
inCallResponse = response;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
isFinished = true;
|
||||
throw error;
|
||||
}, body: newRequest.toJson());
|
||||
return Future.value(inCallResponse);
|
||||
}
|
||||
|
||||
resetDefaultValues() {
|
||||
isFinished = false;
|
||||
hasError = false;
|
||||
errorMsg = '';
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue