Live care Is Login service

favourite_prescription
hussam al-habibeh 5 years ago
parent 4af94e6b71
commit 6989235334

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
@ -217,6 +217,8 @@ const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RE
const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare";
const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

@ -0,0 +1,27 @@
class LiveCareUserLoginRequestModel {
String tokenID;
String generalid;
int doctorId;
int isOutKsa;
int isLogin;
LiveCareUserLoginRequestModel({this.tokenID, this.generalid, this.doctorId, this.isOutKsa, this.isLogin});
LiveCareUserLoginRequestModel.fromJson(Map<String, dynamic> json) {
tokenID = json['TokenID'];
generalid = json['generalid'];
doctorId = json['DoctorId'];
isOutKsa = json['IsOutKsa'];
isLogin = json['IsLogin'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['TokenID'] = this.tokenID;
data['generalid'] = this.generalid;
data['DoctorId'] = this.doctorId;
data['IsOutKsa'] = this.isOutKsa;
data['IsLogin'] = this.isLogin;
return data;
}
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
@ -15,18 +16,19 @@ class LiveCarePatientServices extends BaseService {
bool get isFinished => _isFinished;
setFinished(bool isFinished){
setFinished(bool isFinished) {
_isFinished = isFinished;
}
var endCallResponse = {};
var transferToAdminResponse = {};
var isLoginResponse = {};
StartCallRes _startCallRes;
StartCallRes get startCallRes => _startCallRes;
Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{
Future getPendingPatientERForDoctorApp(
PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
@ -47,58 +49,57 @@ class LiveCarePatientServices extends BaseService {
Future endCall(EndCallReq endCallReq) async {
hasError = false;
await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async {
endCallResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: endCallReq.toJson(),isLiveCare: true);
}, body: endCallReq.toJson(), isLiveCare: true);
}
Future startCall(StartCallReq startCallReq) async {
hasError = false;
await baseAppClient.post(START_LIVE_CARE_CALL,
onSuccess: (response, statusCode) async {
_startCallRes = StartCallRes.fromJson(response);
await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async {
_startCallRes = StartCallRes.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: startCallReq.toJson(),isLiveCare: true);
}, body: startCallReq.toJson(), isLiveCare: true);
}
Future endCallWithCharge(int vcID) async{
Future endCallWithCharge(int vcID) async {
hasError = false;
await baseAppClient.post(
END_CALL_WITH_CHARGE,
onSuccess: (dynamic response, int statusCode) {
endCallResponse = response;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"VC_ID": vcID,"generalid":"Cs2020@2016\$2958",
},isLiveCare: true
);
await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) {
endCallResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"VC_ID": vcID,
"generalid": "Cs2020@2016\$2958",
}, isLiveCare: true);
}
Future transferToAdmin(int vcID, String notes) async{
Future transferToAdmin(int vcID, String notes) async {
hasError = false;
await baseAppClient.post(
TRANSFERT_TO_ADMIN,
onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"VC_ID": vcID,
"IsOutKsa": false,
"Notes": notes,
},isLiveCare: true
);
await baseAppClient.post(TRANSFERT_TO_ADMIN, onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"VC_ID": vcID,
"IsOutKsa": false,
"Notes": notes,
}, isLiveCare: true);
}
Future isLogin(LiveCareUserLoginRequestModel isLoginRequestModel) async {
hasError = false;
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: isLoginRequestModel.toJson(), isLiveCare: true);
}
}
}

@ -421,7 +421,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 5.0,
),
PrescriptionTextFiled(
width: MediaQuery.of(context).size.width * 0.560,
width: MediaQuery.of(context).size.width * 0.517,
element: units,
elementError: unitError,
keyName: 'description',
@ -512,7 +512,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
),
),
Container(
width: MediaQuery.of(context).size.width * 0.65,
width: MediaQuery.of(context).size.width * 0.59,
color: Colors.white,
child: TextField(
maxLines: 5,

Loading…
Cancel
Save