Merge branch 'development' into video-stream-floating

# Conflicts:
#	lib/core/service/VideoCallService.dart
video-stream-floating
mosazaid 5 years ago
commit a84027ad6f

@ -822,7 +822,7 @@ class VideoStreamFloatingWidgetService : Service(), Session.SessionListener,
mSubscriber!!.destroy() mSubscriber!!.destroy()
mSubscriber = null mSubscriber = null
} }
disconnectSession() // disconnectSession()
} }
private fun disconnectSession() { private fun disconnectSession() {
@ -855,7 +855,8 @@ class VideoStreamFloatingWidgetService : Service(), Session.SessionListener,
sessionStatusModel!!.vcid sessionStatusModel!!.vcid
) )
) )
stopService() // stopService()
onCallChangeCallStatusSuccessful()
} }
private fun subscribeToStream(stream: Stream) { private fun subscribeToStream(stream: Stream) {
@ -970,6 +971,13 @@ class VideoStreamFloatingWidgetService : Service(), Session.SessionListener,
} }
} }
fun onCallChangeCallStatusSuccessful(){
val returnIntent = Intent()
returnIntent.putExtra("CallEnd", sessionStatusModel)
videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED, returnIntent)
stopService()
}
override fun onCallChangeCallStatusSuccessful(sessionStatusModel: SessionStatusModel?) {} override fun onCallChangeCallStatusSuccessful(sessionStatusModel: SessionStatusModel?) {}
override fun onFailure() {} override fun onFailure() {}

@ -13,6 +13,7 @@ public interface VideoCallContract {
void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel); void onCallChangeCallStatusSuccessful(SessionStatusModel sessionStatusModel);
void onFailure(); void onFailure();
} }
interface VideoCallPresenter { interface VideoCallPresenter {

@ -59,7 +59,6 @@ public class VideoCallPresenterImpl implements VideoCallContract.VideoCallPresen
public void onResponse(@NotNull Call<SessionStatusModel> call, @NotNull Response<SessionStatusModel> response) { public void onResponse(@NotNull Call<SessionStatusModel> call, @NotNull Response<SessionStatusModel> response) {
if (!response.isSuccessful()) if (!response.isSuccessful())
view.onFailure(); view.onFailure();
} }
@Override @Override

@ -419,6 +419,20 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mSession = Session.Builder(context, apiKey, sessionId).build() mSession = Session.Builder(context, apiKey, sessionId).build()
mSession!!.setSessionListener(this) mSession!!.setSessionListener(this)
mSession!!.connect(token) mSession!!.connect(token)
mSession!!.setReconnectionListener(object :Session.ReconnectionListener{
override fun onReconnecting(p0: Session?) {
}
override fun onReconnected(session: Session?) {
session?.connect(token)
}
})
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
@ -456,10 +470,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
override fun onDisconnected(session: Session) { override fun onDisconnected(session: Session) {
Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId) Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId)
mSession = null // mSession = null
cmTimer.stop() // cmTimer.stop()
disconnectSession() // disconnectSession()
videoCallResponseListener?.minimizeVideoEvent(false) // videoCallResponseListener?.minimizeVideoEvent(false)
} }
override fun onError(session: Session, opentokError: OpentokError) { override fun onError(session: Session, opentokError: OpentokError) {
@ -503,7 +517,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
mSubscriber!!.destroy() mSubscriber!!.destroy()
mSubscriber = null mSubscriber = null
} }
disconnectSession() //disconnectSession()
} }
override fun onStreamCreated(publisherKit: PublisherKit?, stream: Stream) { override fun onStreamCreated(publisherKit: PublisherKit?, stream: Stream) {
@ -628,6 +642,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
sessionStatusModel!!.vcid sessionStatusModel!!.vcid
) )
) )
// if(isDismiss)
// dialog?.dismiss()
// else
onCallChangeCallStatusSuccessful()
}
fun onCallChangeCallStatusSuccessful(){
val returnIntent = Intent()
returnIntent.putExtra("CallEnd", sessionStatusModel)
videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED, returnIntent)
dialog?.dismiss() dialog?.dismiss()
} }

@ -1,33 +1,33 @@
{ {
"project_info": { "project_info": {
"project_number": "157373154094", "project_number": "1095694324958",
"project_id": "hmg-doctor-app-1553688619744", "project_id": "mobapp-bb272",
"storage_bucket": "hmg-doctor-app-1553688619744.appspot.com" "storage_bucket": "mobapp-bb272.appspot.com"
}, },
"client": [ "client": [
{ {
"client_info": { "client_info": {
"mobilesdk_app_id": "1:157373154094:android:daeea3a4e1f4462a1bf0bf", "mobilesdk_app_id": "1:1095694324958:android:70a42e30fcc98ea33fde4f",
"android_client_info": { "android_client_info": {
"package_name": "com.hmg.hmgDr" "package_name": "com.hmg.hmgDr"
} }
}, },
"oauth_client": [ "oauth_client": [
{ {
"client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_id": "1095694324958-5psabq8tpbti0uqo8bt46atjtbas9uhr.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
} }
], ],
"api_key": [ "api_key": [
{ {
"current_key": "AIzaSyDX8RPwu00MyrpqC-T2zXtrUQvTQGRv1mM" "current_key": "AIzaSyCuPtf1hTikWXrp5OQIVfqO-TJWubI-Vd8"
} }
], ],
"services": { "services": {
"appinvite_service": { "appinvite_service": {
"other_platform_oauth_client": [ "other_platform_oauth_client": [
{ {
"client_id": "157373154094-egrhbfr861l7k722g3v2gd4a0opi3r1u.apps.googleusercontent.com", "client_id": "1095694324958-5psabq8tpbti0uqo8bt46atjtbas9uhr.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
} }
] ]

@ -231,6 +231,9 @@ const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/R
const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport";
const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves";
const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor";
const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue";
var selectedPatientType = 1; var selectedPatientType = 1;
@ -283,7 +286,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 6.1; const VERSION_ID = 6.2;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

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

@ -0,0 +1,28 @@
class GetSickLeaveDoctorRequestModel {
int patientMRN;
String appointmentNo;
int status;
String vidaAuthTokenID;
String vidaRefreshTokenID;
GetSickLeaveDoctorRequestModel(
{this.patientMRN, this.appointmentNo, this.status, this.vidaAuthTokenID, this.vidaRefreshTokenID});
GetSickLeaveDoctorRequestModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
status = json['status'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['status'] = this.status;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
return data;
}
}

@ -36,6 +36,11 @@ class SickLeavePatientModel {
String strRequestDate; String strRequestDate;
String startDate; String startDate;
String endDate; String endDate;
dynamic isExtendedLeave;
dynamic noOfDays;
dynamic patientMRN;
dynamic remarks;
dynamic status;
SickLeavePatientModel( SickLeavePatientModel(
{this.setupID, {this.setupID,
@ -72,10 +77,19 @@ class SickLeavePatientModel {
// this.speciality, // this.speciality,
this.strRequestDate, this.strRequestDate,
this.startDate, this.startDate,
this.endDate}); this.endDate,
this.isExtendedLeave,
this.noOfDays,
this.patientMRN,
this.remarks,
this.status});
SickLeavePatientModel.fromJson(Map<String, dynamic> json) { SickLeavePatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
isExtendedLeave = json['isExtendedLeave'];
noOfDays = json['noOfDays'];
patientMRN = json['patientMRN'];
status = json['status'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
patientID = json['PatientID']; patientID = json['PatientID'];
@ -109,13 +123,17 @@ class SickLeavePatientModel {
qR = json['QR']; qR = json['QR'];
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
strRequestDate = json['StrRequestDate']; strRequestDate = json['StrRequestDate'];
startDate = json['StartDate']; startDate = json['StartDate'] ?? json['startDate'];
endDate = json['EndDate']; endDate = json['EndDate'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['status'] = this.status;
data['isExtendedLeave'] = this.isExtendedLeave;
data['noOfDays'] = this.noOfDays;
data['patientMRN'] = this.patientMRN;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;

@ -10,6 +10,7 @@ class SickLeavePatientRequestModel {
int patientTypeID; int patientTypeID;
String tokenID; String tokenID;
int patientID; int patientID;
int patientMRN;
String sessionID; String sessionID;
SickLeavePatientRequestModel( SickLeavePatientRequestModel(
@ -24,10 +25,12 @@ class SickLeavePatientRequestModel {
this.patientTypeID, this.patientTypeID,
this.tokenID, this.tokenID,
this.patientID, this.patientID,
this.sessionID}); this.sessionID,
this.patientMRN});
SickLeavePatientRequestModel.fromJson(Map<String, dynamic> json) { SickLeavePatientRequestModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
patientMRN = json['PatientMRN'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; languageID = json['LanguageID'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
@ -44,6 +47,7 @@ class SickLeavePatientRequestModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID; data['VersionID'] = this.versionID;
data['PatientMRN'] = this.patientMRN;
data['Channel'] = this.channel; data['Channel'] = this.channel;
data['LanguageID'] = this.languageID; data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;

@ -0,0 +1,22 @@
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
class AnalyticsService {
final FirebaseAnalytics _analytics = FirebaseAnalytics();
FirebaseAnalyticsObserver getAnalyticsObserver() =>
FirebaseAnalyticsObserver(analytics: _analytics);
Future logEvent(
{String eventCategory,
String eventLabel,
String eventAction,
String eventValue}) async {
await _analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory,
"eventLabel": eventLabel,
"eventAction": eventAction,
"eventValue": eventValue
});
}
}

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart';
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.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/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
@ -35,14 +35,12 @@ class LiveCarePatientServices extends BaseService {
StartCallRes get startCallRes => _startCallRes; StartCallRes get startCallRes => _startCallRes;
Future getPendingPatientERForDoctorApp( Future getPendingPatientERForDoctorApp(
PendingPatientERForDoctorAppRequestModel PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async {
pendingPatientERForDoctorAppRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
List<PatiantInformtion> localPatientList = [];
List<PatiantInformtion> localPatientList= [];
response['List_PendingPatientList'].forEach((v) { response['List_PendingPatientList'].forEach((v) {
localPatientList.add(PatiantInformtion.fromJson(v)); localPatientList.add(PatiantInformtion.fromJson(v));
@ -50,22 +48,19 @@ class LiveCarePatientServices extends BaseService {
/// add new items. /// add new items.
localPatientList.forEach((element) { localPatientList.forEach((element) {
if ((_patientList.singleWhere((it) => it.patientId == element.patientId, if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
orElse: () => null)) == null) {
_patientList.add(element); _patientList.add(element);
} }
}); });
/// remove items. /// remove items.
List<PatiantInformtion> removedPatientList= []; List<PatiantInformtion> removedPatientList = [];
_patientList.forEach((element) { _patientList.forEach((element) {
if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) {
orElse: () => null)) == null) {
removedPatientList.add(element); removedPatientList.add(element);
} }
}); });
removedPatientList.forEach((element) { removedPatientList.forEach((element) {
_patientList.remove(element); _patientList.remove(element);
}); });
@ -105,11 +100,7 @@ class LiveCarePatientServices extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: { }, body: {"VC_ID": vcID, "AltServiceList": altServiceList, "generalid": GENERAL_ID}, isLiveCare: _isLive);
"VC_ID": vcID,
"AltServiceList": altServiceList,
"generalid":GENERAL_ID
}, isLiveCare: _isLive);
} }
Future transferToAdmin(int vcID, String notes) async { Future transferToAdmin(int vcID, String notes) async {
@ -128,20 +119,17 @@ class LiveCarePatientServices extends BaseService {
Future sendSMSInstruction(int vcID) async { Future sendSMSInstruction(int vcID) async {
hasError = false; hasError = false;
await baseAppClient.post(SEND_SMS_INSTRUCTIONS, await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response; transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
"VC_ID": vcID, "generalid": GENERAL_ID
}, isLiveCare: _isLive);
} }
Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async { Future isLogin({LiveCareUserLoginRequestModel isLoginRequestModel, int loginStatus}) async {
hasError = false; hasError = false;
await getDoctorProfile( ); await getDoctorProfile();
isLoginRequestModel.doctorId = super.doctorProfile.doctorID; isLoginRequestModel.doctorId = super.doctorProfile.doctorID;
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async { await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
isLoginResponse = response; isLoginResponse = response;
@ -155,17 +143,48 @@ class LiveCarePatientServices extends BaseService {
hasError = false; hasError = false;
alternativeServicesList.clear(); alternativeServicesList.clear();
await baseAppClient.post(GET_ALTERNATIVE_SERVICE, await baseAppClient.post(GET_ALTERNATIVE_SERVICE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
response['AlternativeServicesList'].forEach((v) { response['AlternativeServicesList'].forEach((v) {
alternativeServicesList.add(AlternativeService.fromJson(v)); alternativeServicesList.add(AlternativeService.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
"VC_ID": vcID, }
"generalid": GENERAL_ID
}, isLiveCare: _isLive); Future addPatientToDoctorList({int vcID}) async {
hasError = false;
await getDoctorProfile();
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
}
Future removePatientFromDoctorList({int vcID}) async {
hasError = false;
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
await getDoctorProfile();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive);
} }
} }

@ -15,9 +15,8 @@ class PatientMedicalReportService extends BaseService {
body['AdmissionNo'] = patient.admissionNo; body['AdmissionNo'] = patient.admissionNo;
body['SetupID'] = doctorProfile.setupID; body['SetupID'] = doctorProfile.setupID;
body['ProjectID'] = doctorProfile.projectID; body['ProjectID'] = doctorProfile.projectID;
medicalReportList = [];
await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) {
medicalReportList.clear();
if (response['DAPP_ListMedicalReportList'] != null) { if (response['DAPP_ListMedicalReportList'] != null) {
response['DAPP_ListMedicalReportList'].forEach((v) { response['DAPP_ListMedicalReportList'].forEach((v) {
medicalReportList.add(MedicalReportModel.fromJson(v)); medicalReportList.add(MedicalReportModel.fromJson(v));

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_doctor_request_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart';
import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
@ -21,8 +22,7 @@ class SickLeaveService extends BaseService {
List get coveringDoctorsList => _coveringDoctors; List get coveringDoctorsList => _coveringDoctors;
List _coveringDoctors = []; List _coveringDoctors = [];
List<GetRescheduleLeavesResponse> get getAllRescheduleLeave => List<GetRescheduleLeavesResponse> get getAllRescheduleLeave => _getReScheduleLeave;
_getReScheduleLeave;
List<GetRescheduleLeavesResponse> _getReScheduleLeave = []; List<GetRescheduleLeavesResponse> _getReScheduleLeave = [];
dynamic get postReschedule => _postReschedule; dynamic get postReschedule => _postReschedule;
dynamic _postReschedule; dynamic _postReschedule;
@ -31,9 +31,11 @@ class SickLeaveService extends BaseService {
dynamic _sickLeaveResponse; dynamic _sickLeaveResponse;
List<SickLeavePatientModel> getAllSickLeavePatient = List(); List<SickLeavePatientModel> getAllSickLeavePatient = List();
List<SickLeavePatientModel> getAllSickLeaveDoctor = List();
//getAllSickLeavePatient.addAll(getAllSickLeaveDoctor);
SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel();
SickLeavePatientRequestModel(); GetSickLeaveDoctorRequestModel _sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel();
Future getStatistics(appoNo, patientMRN) async { Future getStatistics(appoNo, patientMRN) async {
hasError = false; hasError = false;
@ -56,6 +58,7 @@ class SickLeaveService extends BaseService {
// addSickLeaveRequest.appointmentNo = '2016054661'; // addSickLeaveRequest.appointmentNo = '2016054661';
// addSickLeaveRequest.patientMRN = '3120746'; // addSickLeaveRequest.patientMRN = '3120746';
hasError = false; hasError = false;
_sickLeaveResponse.clear();
await baseAppClient.post( await baseAppClient.post(
ADD_SICK_LEAVE, ADD_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -73,8 +76,7 @@ class SickLeaveService extends BaseService {
Future extendSickLeave(GetAllSickLeaveResponse request) async { Future extendSickLeave(GetAllSickLeaveResponse request) async {
var extendSickLeaveRequest = ExtendSickLeaveRequest(); var extendSickLeaveRequest = ExtendSickLeaveRequest();
extendSickLeaveRequest.patientMRN = extendSickLeaveRequest.patientMRN = request.patientMRN.toString(); //'3120746';
request.patientMRN.toString(); //'3120746';
extendSickLeaveRequest.previousRequestNo = request.requestNo.toString(); extendSickLeaveRequest.previousRequestNo = request.requestNo.toString();
extendSickLeaveRequest.noOfDays = request.noOfDays.toString(); extendSickLeaveRequest.noOfDays = request.noOfDays.toString();
extendSickLeaveRequest.remarks = request.remarks; extendSickLeaveRequest.remarks = request.remarks;
@ -114,8 +116,8 @@ class SickLeaveService extends BaseService {
} }
Future getSickLeavePatient(patientMRN) async { Future getSickLeavePatient(patientMRN) async {
_sickLeavePatientRequestModel = SickLeavePatientRequestModel( _sickLeavePatientRequestModel =
patientID: patientMRN, patientTypeID: 2, patientType: 1); SickLeavePatientRequestModel(patientID: patientMRN, patientTypeID: 2, patientType: 1);
hasError = false; hasError = false;
getAllSickLeavePatient = []; getAllSickLeavePatient = [];
getAllSickLeavePatient.clear(); getAllSickLeavePatient.clear();
@ -136,6 +138,28 @@ class SickLeaveService extends BaseService {
); );
} }
Future getSickLeaveDoctor(patientMRN) async {
_sickLeaveDoctorRequestModel = GetSickLeaveDoctorRequestModel(patientMRN: patientMRN);
hasError = false;
getAllSickLeaveDoctor = [];
getAllSickLeaveDoctor.clear();
await baseAppClient.post(
GET_SICK_LEAVE_DOCTOR_APP,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
getAllSickLeaveDoctor.clear();
response['SickLeavesList']['entityList'].forEach((v) {
getAllSickLeaveDoctor.add(SickLeavePatientModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _sickLeaveDoctorRequestModel.toJson(),
);
}
Future getRescheduleLeave() async { Future getRescheduleLeave() async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(

@ -20,8 +20,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
List<AlternativeService> get alternativeServicesList => List<AlternativeService> get alternativeServicesList => _liveCarePatientServices.alternativeServicesList;
_liveCarePatientServices.alternativeServicesList;
DashboardService _dashboardService = locator<DashboardService>(); DashboardService _dashboardService = locator<DashboardService>();
@ -106,8 +105,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
selectedServices = getSelectedAlternativeServices(); selectedServices = getSelectedAlternativeServices();
} }
await _liveCarePatientServices.endCallWithCharge( await _liveCarePatientServices.endCallWithCharge(vcID, selectedServices);
vcID, selectedServices);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -209,8 +207,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 2, serviceName: "LABORATORY"), AlternativeService(serviceID: 2, serviceName: "LABORATORY"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService( AlternativeService(serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"), AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"),
@ -231,25 +228,46 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"), AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService( AlternativeService(serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"),
); );
} }
updateInCallPatient({PatiantInformtion patient, appointmentNo}){ updateInCallPatient({PatiantInformtion patient, appointmentNo}) {
_liveCarePatientServices.patientList.forEach((e) {
_liveCarePatientServices.patientList.forEach((e) { if (e.patientId == patient.patientId) {
if(e.patientId == patient.patientId) { e.episodeNo = 0;
e.episodeNo = 0 ;
e.appointmentNo = appointmentNo; e.appointmentNo = appointmentNo;
return; return;
} }
}); });
setState(ViewState.Idle); setState(ViewState.Idle);
}
Future addPatientToDoctorList(int vcID) async {
await getDoctorProfile(isGetProfile: true);
setState(ViewState.BusyLocal);
await _liveCarePatientServices.addPatientToDoctorList(vcID: vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future removePatientFromDoctorList(int vcID) async {
await getDoctorProfile(isGetProfile: true);
setState(ViewState.BusyLocal);
await _liveCarePatientServices.removePatientFromDoctorList(vcID: vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
} }
} }

@ -60,10 +60,12 @@ class PatientMedicalReportViewModel extends BaseViewModel {
await _service.addMedicalReport(patient, htmlText); await _service.addMedicalReport(patient, htmlText);
if (_service.hasError) { if (_service.hasError) {
error = _service.error; error = _service.error;
await getMedicalReportList(patient);
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
await getMedicalReportList(patient); { await getMedicalReportList(patient);
setState(ViewState.Idle); setState(ViewState.Idle);
}
} }
Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async {
@ -71,9 +73,11 @@ class PatientMedicalReportViewModel extends BaseViewModel {
await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber);
if (_service.hasError) { if (_service.hasError) {
error = _service.error; error = _service.error;
await getMedicalReportList(patient);
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
await getMedicalReportList(patient); {
setState(ViewState.Idle); await getMedicalReportList(patient);
setState(ViewState.Idle);}
} }
} }

@ -303,13 +303,13 @@ class PatientReferralViewModel extends BaseViewModel {
String getReferralStatusNameByCode(int statusCode, BuildContext context) { String getReferralStatusNameByCode(int statusCode, BuildContext context) {
switch (statusCode) { switch (statusCode) {
case 1: case 1:
return TranslationBase.of(context).pending /*referralStatusHold*/; return TranslationBase.of(context).referralStatusHold /*pending*/;
case 2: case 2:
return TranslationBase.of(context).accepted /*referralStatusActive*/; return TranslationBase.of(context).referralStatusActive /* accepted*/;
case 4: case 4:
return TranslationBase.of(context).rejected /*referralStatusCancelled*/; return TranslationBase.of(context).referralStatusCancelled /*rejected*/;
case 46: case 46:
return TranslationBase.of(context).accepted /*referralStatusCompleted*/; return TranslationBase.of(context).referralStatusCompleted /*accepted*/;
case 63: case 63:
return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; return TranslationBase.of(context).rejected /*referralStatusNotSeen*/;
default: default:

@ -107,8 +107,8 @@ class ProjectViewModel with ChangeNotifier {
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); //print(error);
throw error; //throw error;
} }
} }

@ -10,13 +10,17 @@ class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>(); SickLeaveService _sickLeaveService = locator<SickLeaveService>();
get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave; get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient; //get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient;
get sickleaveResponse => _sickLeaveService.sickLeaveResponse;
List get allOffTime => _sickLeaveService.getOffTimeList; List get allOffTime => _sickLeaveService.getOffTimeList;
List get allReasons => _sickLeaveService.getReasons; List get allReasons => _sickLeaveService.getReasons;
List get coveringDoctors => _sickLeaveService.coveringDoctorsList; List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
List get sickLeaveDoctor => _sickLeaveService.getAllSickLeaveDoctor;
get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave;
get postSechedule => _sickLeaveService.postReschedule; get postSechedule => _sickLeaveService.postReschedule;
get sickleaveResponse => _sickLeaveService.sickLeaveResponse; get getAllSIckLeavePatient =>
[..._sickLeaveService.getAllSickLeavePatient, ..._sickLeaveService.getAllSickLeaveDoctor];
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.addSickLeave(addSickLeaveRequest); await _sickLeaveService.addSickLeave(addSickLeaveRequest);
@ -67,6 +71,16 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getSickLeaveDoctor(patientMRN) async {
setState(ViewState.Busy);
await _sickLeaveService.getSickLeaveDoctor(patientMRN);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getRescheduleLeave() async { Future getRescheduleLeave() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.getRescheduleLeave(); await _sickLeaveService.getRescheduleLeave();

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/AnalyticsService.dart';
import 'core/service/NavigationService.dart'; import 'core/service/NavigationService.dart';
import 'core/service/VideoCallService.dart'; import 'core/service/VideoCallService.dart';
import 'core/service/home/dasboard_service.dart'; import 'core/service/home/dasboard_service.dart';
@ -98,6 +99,7 @@ void setupLocator() {
locator.registerLazySingleton(() => ScanQrService()); locator.registerLazySingleton(() => ScanQrService());
locator.registerLazySingleton(() => SpecialClinicsService()); locator.registerLazySingleton(() => SpecialClinicsService());
locator.registerLazySingleton(() => VideoCallService()); locator.registerLazySingleton(() => VideoCallService());
locator.registerLazySingleton(() => AnalyticsService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -11,6 +13,7 @@ import 'package:provider/provider.dart';
import './config/size_config.dart'; import './config/size_config.dart';
import './routes.dart'; import './routes.dart';
import 'config/config.dart'; import 'config/config.dart';
import 'core/service/AnalyticsService.dart';
import 'core/service/NavigationService.dart'; import 'core/service/NavigationService.dart';
import 'core/viewModel/authentication_view_model.dart'; import 'core/viewModel/authentication_view_model.dart';
import 'locator.dart'; import 'locator.dart';
@ -67,7 +70,10 @@ class MyApp extends StatelessWidget {
dividerColor: Colors.grey[350], dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
), ),
navigatorKey: locator<NavigationService>().navigatorKey, navigatorKey: locator<NavigationService>().navigatorKey,
navigatorObservers:[
locator<AnalyticsService>().getAnalyticsObserver(),
],
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,
routes: routes, routes: routes,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,

@ -24,7 +24,7 @@ class StartCallRes {
isAuthenticated = json['IsAuthenticated']; isAuthenticated = json['IsAuthenticated'];
messageStatus = json['MessageStatus']; messageStatus = json['MessageStatus'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
isRecording = json['isRecording']; isRecording = json['IsRecordedSession'] ?? false;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -35,7 +35,7 @@ class StartCallRes {
data['IsAuthenticated'] = this.isAuthenticated; data['IsAuthenticated'] = this.isAuthenticated;
data['MessageStatus'] = this.messageStatus; data['MessageStatus'] = this.messageStatus;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['isRecording'] = this.isRecording; data['IsRecordedSession'] = this.isRecording ?? false;
return data; return data;
} }
} }

@ -409,13 +409,6 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
onTap: () { onTap: () {
authenticationViewModel.deleteUser(); authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
// Navigator.pushAndRemoveUntil(
// AppGlobal.CONTEX,
// FadePage(
// page: RootPage(),
// ),
// (r) => false);
// Navigator.of(context).pushNamed(LOGIN);
}, },
), ),
@ -548,13 +541,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({value}) async { checkActivationCode({String value}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value); await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
await authenticationViewModel.onCheckActivationCodeSuccess(); await authenticationViewModel.onCheckActivationCodeSuccess();
if(value !=null)
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
navigateToLandingPage(); navigateToLandingPage();
@ -569,6 +563,4 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
} }

@ -194,10 +194,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
); );
} }
callConnected(){ callConnected() {}
} callDisconnected() {}
callDisconnected(){
}
} }

@ -43,7 +43,9 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
String txtOfMedicalReport; String txtOfMedicalReport;
return BaseView<PatientMedicalReportViewModel>( return BaseView<PatientMedicalReportViewModel>(
onModelReady: (model) async {}, onModelReady: (model) async {
model.getMedicalReportTemplate();
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
@ -103,12 +105,12 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
if (txtOfMedicalReport.isNotEmpty) { if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.medicalReport != null widget.medicalReport != null
? widget.model.updateMedicalReport( ?await widget.model.updateMedicalReport(
widget.patient, widget.patient,
txtOfMedicalReport, txtOfMedicalReport,
widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, widget.medicalReport != null ? widget.medicalReport.lineItemNo : null,
widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) widget.medicalReport != null ? widget.medicalReport.invoiceNo : null)
: widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport);
//model.getMedicalReportList(patient); //model.getMedicalReportList(patient);
Navigator.pop(context); Navigator.pop(context);

@ -92,29 +92,15 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
)), )),
); );
// Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: {
// 'patient': patient,
// 'patientType': patientType,
// 'arrivalType': arrivalType,
// 'type': MedicalReportStatus.ADD,
// 'model': model,
// });
}, },
label: TranslationBase.of(context).createNewMedicalReport, label: TranslationBase.of(context).createNewMedicalReport,
), ),
if (model.state != ViewState.ErrorLocal) // if (model.state != ViewState.ErrorLocal)ß
...List.generate( ...List.generate(
model.medicalReportList.length, model.medicalReportList.length,
(index) => InkWell( (index) => InkWell(
onTap: () { onTap: () {
if (model.medicalReportList[index].status == 1) { if (model.medicalReportList[index].status == 1) {
// Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: {
// 'patient': patient,
// 'patientType': patientType,
// 'arrivalType': arrivalType,
// 'medicalReport': model.medicalReportList[index],
// 'model': model,
// });
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(

@ -32,6 +32,7 @@ class PatientProfileScreen extends StatefulWidget {
class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin { class _PatientProfileScreenState extends State<PatientProfileScreen> with SingleTickerProviderStateMixin {
PatiantInformtion patient; PatiantInformtion patient;
LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel();
bool isFromSearch = false; bool isFromSearch = false;
bool isFromLiveCare = false; bool isFromLiveCare = false;
@ -63,6 +64,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
void dispose() { void dispose() {
_tabController.dispose(); _tabController.dispose();
super.dispose(); super.dispose();
if (isFromLiveCare) {
_liveCareViewModel.removePatientFromDoctorList(patient.vcId);
}
} }
@override @override
@ -123,6 +127,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<LiveCarePatientViewModel>( return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).patientProfile, appBarTitle: TranslationBase.of(context).patientProfile,
@ -317,43 +324,35 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) => EndCallScreen(patient: patient)));
EndCallScreen(patient: patient)));
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.startCall( await model.startCall(isReCall: false, vCID: patient.vcId);
isReCall: false, vCID: patient.vcId);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
await model.getDoctorProfile(); await model.getDoctorProfile();
patient.appointmentNo = int.parse(model patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
.startCallRes.appointmentNo
.toString());
patient.episodeNo = 0; patient.episodeNo = 0;
model.updateInCallPatient( model.updateInCallPatient(
patient: patient, patient: patient,
appointmentNo: int.parse(model appointmentNo: int.parse(model.startCallRes.appointmentNo.toString()));
.startCallRes.appointmentNo
.toString()));
setState(() { setState(() {
isCallStarted = true; isCallStarted = true;
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils AppPermissionsUtils.requestVideoCallPermission(
.requestVideoCallPermission( context: context,
context: context, onTapGrant: () {
onTapGrant: () { locator<VideoCallService>().openVideo(
locator<VideoCallService>() model.startCallRes,
.openVideo( patient,
model.startCallRes, model.startCallRes != null ? model.startCallRes.isRecording : true,
patient, callConnected,
model.startCallRes != null ? model.startCallRes.isRecording : true callDisconnected);
, callConnected, });
callDisconnected);
});
} }
}*/ }*/
}, },

@ -28,8 +28,10 @@ class AddSickLeavScreen extends StatelessWidget {
patient = routeArgs['patient']; patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) => onModelReady: (model) async {
model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), await model.getSickLeavePatient(patient.patientMRN ?? patient.patientId);
await model.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
@ -61,56 +63,59 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
], ],
)), )),
Container( InkWell(
width: SizeConfig.screenWidth, onTap: () {
margin: EdgeInsets.only( openSickLeave(
left: 20, right: 20, top: 10, bottom: 10), context,
padding: EdgeInsets.all(20), false,
decoration: BoxDecoration( );
borderRadius: BorderRadius.circular(10), },
color: HexColor('#EAEAEA')), child: Container(
child: Column( width: SizeConfig.screenWidth,
mainAxisAlignment: MainAxisAlignment.start, margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
children: [ padding: EdgeInsets.all(20),
Container( decoration:
child: Container( BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')),
decoration: BoxDecoration( child: Column(
color: Colors.grey, mainAxisAlignment: MainAxisAlignment.start,
borderRadius: BorderRadius.circular(10)), children: [
padding: EdgeInsets.all(3), Container(
child: IconButton( child: Container(
decoration:
BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon( icon: Icon(
Icons.add, Icons.add,
size: 35, size: 35,
color: Colors.white, color: Colors.white,
), ),
onPressed: () { // onPressed: () {
openSickLeave( // openSickLeave(
context, // context,
false, // false,
); // );
}), // },
)), ),
Padding( )),
child: AppText( Padding(
TranslationBase.of(context) child: AppText(TranslationBase.of(context).noSickLeaveApplied,
.noSickLeaveApplied, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontFamily: 'Poppins',
fontFamily: 'Poppins', fontSize: 16,
fontSize: 16, textAlign: TextAlign.center,
textAlign: TextAlign.center, color: HexColor('#7E7E7E')),
color: HexColor('#7E7E7E')), padding: EdgeInsets.all(10),
padding: EdgeInsets.all(10), ),
), ],
], )),
)), ),
], ],
) )
: SizedBox(), : SizedBox(),
model.getAllSIckLeavePatient.length > 0 model.getAllSIckLeavePatient.length > 0
? Column( ? Column(
children: model.getAllSIckLeavePatient children: model.getAllSIckLeavePatient.map<Widget>((SickLeavePatientModel item) {
.map<Widget>((SickLeavePatientModel item) {
return RoundedContainer( return RoundedContainer(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(
@ -129,8 +134,7 @@ class AddSickLeavScreen extends StatelessWidget {
// ))), // ))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
@ -139,13 +143,12 @@ class AddSickLeavScreen extends StatelessWidget {
// MainAxisAlignment.start, // MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
child: AppText( child: AppText(
item.doctorName, item.doctorName ?? "",
// item.status == 1 // item.status == 1
// ? TranslationBase.of( // ? TranslationBase.of(
// context) // context)
@ -158,8 +161,7 @@ class AddSickLeavScreen extends StatelessWidget {
// : TranslationBase // : TranslationBase
// .of(context) // .of(context)
// .all, // .all,
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
// color: item.status == 1 // color: item.status == 1
// ? Colors.yellow[800] // ? Colors.yellow[800]
// : item.status == 2 // : item.status == 2
@ -170,34 +172,25 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Row( Row(
children: [ children: [
AppText(TranslationBase AppText(TranslationBase.of(context).daysSickleave + ": "),
.of(context)
.daysSickleave +
": "),
AppText( AppText(
item.sickLeaveDays item.sickLeaveDays ?? item.noOfDays.toString(),
.toString(), fontWeight: FontWeight.bold,
fontWeight:
FontWeight.bold,
), ),
], ],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context).startDate + ' ' ?? "",
context)
.startDate +
' ',
), ),
Flexible( Flexible(
child: AppText( child: AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils item.startDate.contains("/Date(")
.convertStringToDate( ? AppDateUtils.convertStringToDate(item.startDate)
item.startDate)), : DateTime.parse(item.startDate)),
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
), ),
) )
], ],
@ -205,42 +198,21 @@ class AddSickLeavScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).endDate + ' ' ?? "",
.endDate +
' ',
), ),
Flexible( Flexible(
child: AppText( child: AppText(
AppDateUtils AppDateUtils.getDayMonthYearDateFormatted(
.getDayMonthYearDateFormatted( item.startDate.contains("/Date(")
AppDateUtils ? AppDateUtils.convertStringToDate(item.endDate)
.convertStringToDate( .add(Duration(days: item.noOfDays))
item.endDate, : DateTime.parse(item.startDate)
)), .add(Duration(days: item.noOfDays))),
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
), ),
) )
], ],
), ),
Row(children: [
AppText(TranslationBase.of(
context)
.branch +
": "),
AppText(
item.projectName ?? "",
),
]),
Row(children: [
AppText(TranslationBase.of(
context)
.clinic +
": "),
AppText(
item.clinicName ?? "",
),
]),
], ],
), ),
SizedBox( SizedBox(
@ -266,8 +238,7 @@ class AddSickLeavScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: AppText( child: AppText(TranslationBase.of(context).noSickLeave),
TranslationBase.of(context).noSickLeave),
) )
], ],
), ),
@ -276,8 +247,7 @@ class AddSickLeavScreen extends StatelessWidget {
])))); ]))));
} }
openSickLeave(BuildContext context, isExtend, openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse extendedData}) {
{GetAllSickLeaveResponse extendedData}) {
// showModalBottomSheet( // showModalBottomSheet(
// context: context, // context: context,
// builder: (context) { // builder: (context) {
@ -287,12 +257,9 @@ class AddSickLeavScreen extends StatelessWidget {
context, context,
FadePage( FadePage(
page: SickLeaveScreen( page: SickLeaveScreen(
appointmentNo: isExtend == true appointmentNo:
? extendedData.appointmentNo isExtend == true ? extendedData.appointmentNo : patient.appointmentNo, //extendedData.appointmentNo,
: patient.appointmentNo, //extendedData.appointmentNo, patientMRN: isExtend == true ? extendedData.patientMRN : patient.patientMRN,
patientMRN: isExtend == true
? extendedData.patientMRN
: patient.patientMRN,
isExtended: isExtend, isExtended: isExtend,
extendedData: extendedData, extendedData: extendedData,
patient: patient))); patient: patient)));

@ -1,12 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -28,12 +30,7 @@ class SickLeaveScreen extends StatefulWidget {
final appointmentNo; final appointmentNo;
final patientMRN; final patientMRN;
final patient; final patient;
SickLeaveScreen( SickLeaveScreen({this.appointmentNo, this.patientMRN, this.isExtended = false, this.extendedData, this.patient});
{this.appointmentNo,
this.patientMRN,
this.isExtended = false,
this.extendedData,
this.patient});
@override @override
_SickLeaveScreenState createState() => _SickLeaveScreenState(); _SickLeaveScreenState createState() => _SickLeaveScreenState();
} }
@ -76,8 +73,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => model2.preSickLeaveStatistics( onModelReady: (model2) => model2.preSickLeaveStatistics(widget.appointmentNo, widget.patientMRN),
widget.appointmentNo, widget.patientMRN),
builder: (_, model2, w) => GestureDetector( builder: (_, model2, w) => GestureDetector(
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
@ -108,46 +104,35 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"), color: HexColor("#CCCCCC"),
), ),
color: Colors.white), color: Colors.white),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
crossAxisAlignment: Padding(
CrossAxisAlignment.start, padding: EdgeInsets.only(top: 5, left: 10, right: 10),
children: [ child: AppText(TranslationBase.of(context).sickLeave +
Padding( ' ' +
padding: EdgeInsets.only( TranslationBase.of(context).days)),
top: 5, left: 10, right: 10), AppTextFormField(
child: AppText( borderColor: Colors.white,
TranslationBase.of(context) onChanged: (value) {
.sickLeave + addSickLeave.noOfDays = value;
' ' + if (widget.extendedData != null) {
TranslationBase.of(context) widget.extendedData.noOfDays = int.parse(value);
.days)), }
AppTextFormField( },
borderColor: Colors.white, hintText:
onChanged: (value) { widget.extendedData != null ? widget.extendedData.noOfDays.toString() : '',
addSickLeave.noOfDays = value; // validator: (value) {
if (widget.extendedData != null) { // return TextValidator().validateName(value);
widget.extendedData.noOfDays = // },
int.parse(value); textInputType: TextInputType.number,
} inputFormatter: ONLY_NUMBERS)
}, ]),
hintText: widget.extendedData != null
? widget.extendedData.noOfDays
.toString()
: '',
// validator: (value) {
// return TextValidator().validateName(value);
// },
textInputType:TextInputType.number,
inputFormatter: ONLY_NUMBERS)
]),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -155,146 +140,107 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 5, left: 10, right: 10),
top: 5, left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).sickLeaveDate,
.sickLeaveDate,
)), )),
AppTextFormField( AppTextFormField(
hintText: widget.extendedData != null hintText: widget.extendedData != null ? widget.extendedData.startDate : '',
? widget.extendedData.startDate
: '',
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(icon: Icon(Icons.calendar_today)),
icon: Icon(Icons.calendar_today)),
textInputType: TextInputType.number, textInputType: TextInputType.number,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker('_selectedToDate');
'_selectedToDate');
}, },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
addSickLeave.startDate = value; addSickLeave.startDate = value;
if (widget.extendedData != null) { if (widget.extendedData != null) {
widget.extendedData.startDate = widget.extendedData.startDate = value;
value;
} }
}), }),
], ],
)), )),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 10, left: 10, right: 10),
top: 10, left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: bottom: SizeConfig.widthMultiplier * 0.9,
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).clinicName,
.clinicName,
)), )),
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: new IgnorePointer(
child: new IgnorePointer( ignoring: true,
ignoring: true, child: DropdownButton(
child: DropdownButton( isExpanded: true,
isExpanded: true, value: getClinicName(model) ?? "",
value: getClinicName( iconSize: 0,
model) ?? elevation: 16,
"", selectedItemBuilder: (BuildContext context) {
iconSize: 0, return model.getClinicNameList().map((item) {
elevation: 16, return Row(
selectedItemBuilder: mainAxisSize: MainAxisSize.max,
(BuildContext children: <Widget>[
context) { AppText(
return model
.getClinicNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize
.max,
children: <
Widget>[
AppText(
item,
fontSize:
SizeConfig.textMultiplier *
2.1,
color: Colors
.grey,
),
],
);
}).toList();
},
onChanged:
(newValue) =>
{},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value: item
.toString(),
child: Text(
item, item,
textAlign: fontSize: SizeConfig.textMultiplier * 2.1,
TextAlign color: Colors.grey,
.end,
), ),
); ],
}).toList(), );
))), }).toList();
},
onChanged: (newValue) => {},
items: model.getClinicNameList().map((item) {
return DropdownMenuItem(
value: item.toString(),
child: Text(
item,
textAlign: TextAlign.end,
),
);
}).toList(),
))),
), ),
], ],
) )
], ],
), ),
)), )),
model2.sickLeaveStatistics[ model2.sickLeaveStatistics['recommendedSickLeaveDays'] != null
'recommendedSickLeaveDays'] !=
null
? Padding( ? Padding(
child: AppText( child: AppText(
model2.sickLeaveStatistics[ model2.sickLeaveStatistics['recommendedSickLeaveDays'],
'recommendedSickLeaveDays'],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
), ),
@ -306,10 +252,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
@ -317,11 +261,9 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 5, left: 10, right: 10),
top: 5, left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).doctorName,
.doctorName,
)), )),
new IgnorePointer( new IgnorePointer(
ignoring: true, ignoring: true,
@ -343,10 +285,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC")),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
@ -354,8 +294,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 5, left: 10, right: 10),
top: 5, left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context).remarks, TranslationBase.of(context).remarks,
)), )),
@ -364,9 +303,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.all(20.0), contentPadding: EdgeInsets.all(20.0),
border: InputBorder.none, border: InputBorder.none,
hintText: widget.extendedData != null hintText: widget.extendedData != null ? widget.extendedData.remarks : ''),
? widget.extendedData.remarks
: ''),
onChanged: (value) { onChanged: (value) {
addSickLeave.remarks = value; addSickLeave.remarks = value;
if (widget.extendedData != null) { if (widget.extendedData != null) {
@ -378,40 +315,60 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
), ),
), ),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.isExtended == true title: widget.isExtended == true
? TranslationBase.of(context).extend ? TranslationBase.of(context).extend
: TranslationBase.of(context) : TranslationBase.of(context).addSickLeaverequest,
.addSickLeaverequest,
color: Colors.green, color: Colors.green,
onPressed: () async { onPressed: () async {
if (widget.isExtended) { if (widget.isExtended) {
await model2.extendSickLeave( await model2.extendSickLeave(widget.extendedData);
widget.extendedData);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
model2.sickleaveResponse[ model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
'ListSickLeavesToExtent'] Navigator.of(context).popUntil((route) {
['success']); return route.settings.name == PATIENTS_PROFILE;
Navigator.of(context)
.popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
}); });
Navigator.of(context).pushNamed( Navigator.of(context)
ADD_SICKLEAVE, .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
arguments: {
'patient': widget.patient
});
//print(value); //print(value);
//}); //});
} else { } else {
_validateInputs(model2); try {
if (addSickLeave.noOfDays == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseEnterNoOfDays);
} else if (addSickLeave.remarks == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseEnterRemarks);
} else if (addSickLeave.startDate == null) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterDate);
} else {
addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
await model2.addSickLeave(addSickLeave);
if (model2.sickleaveResponse['SickLeavesList']['success'] != null)
DrAppToastMsg.showSuccesToast(
model2.sickleaveResponse['SickLeavesList']['success']);
}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => AddSickLeavScreen()),
// );
// Navigator.of(context).popUntil((route) {
// return route.settings.name == PATIENTS_PROFILE;
// });
// Navigator.of(context)
// .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
} catch (err) {
print(err);
}
} }
}, },
), ),
@ -437,26 +394,21 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
void _validateInputs(model2) async { void _validateInputs(model2) async {
try { try {
if (addSickLeave.noOfDays == null) { if (addSickLeave.noOfDays == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterNoOfDays);
TranslationBase.of(context).pleaseEnterNoOfDays);
} else if (addSickLeave.remarks == null) { } else if (addSickLeave.remarks == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterRemarks);
TranslationBase.of(context).pleaseEnterRemarks);
} else if (addSickLeave.startDate == null) { } else if (addSickLeave.startDate == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseEnterDate);
TranslationBase.of(context).pleaseEnterDate);
} else { } else {
addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
await model2.addSickLeave(addSickLeave).then((value) => print(value)); await model2.addSickLeave(addSickLeave).then((value) => print(value));
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
model2.sickleaveResponse['ListSickLeavesToExtent']['success']);
Navigator.of(context).popUntil((route) { Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE; return route.settings.name == PATIENTS_PROFILE;
}); });
Navigator.of(context) Navigator.of(context).pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
.pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient});
} }
} catch (err) { } catch (err) {
print(err); print(err);
@ -471,9 +423,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
} }
getClinicName(model) { getClinicName(model) {
var clinicInfo = model.clinicsList var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == this.profile['ClinicID']).toList();
.where((i) => i['ClinicID'] == this.profile['ClinicID'])
.toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
} }
} }

@ -44,7 +44,9 @@ class PatientReferralItemWidget extends StatelessWidget {
this.doctorAvatar, this.doctorAvatar,
this.referralDoctorName, this.referralDoctorName,
this.clinicDescription, this.clinicDescription,
this.infoIcon,this.isReferralClinic=false,this.referralClinic}); this.infoIcon,
this.isReferralClinic = false,
this.referralClinic});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -58,9 +60,13 @@ class PatientReferralItemWidget extends StatelessWidget {
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: referralStatusCode == 1 bgColor: referralStatusCode == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referralStatusCode == 46 || referralStatusCode == 2 : referralStatusCode == 2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : referralStatusCode == 46
? Colors.green[900]
: referralStatusCode == 4
? Colors.red[700]
: Colors.red[900],
hasBorder: false, hasBorder: false,
widget: Container( widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
@ -78,9 +84,13 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: referralStatusCode == 1 color: referralStatusCode == 1
? Color(0xffc4aa54) ? Color(0xffc4aa54)
: referralStatusCode == 46 || referralStatusCode == 2 : referralStatusCode == 2
? Colors.green[700] ? Colors.green[700]
: Colors.red[700], : referralStatusCode == 46
? Colors.green[900]
: referralStatusCode == 4
? Colors.red[700]
: Colors.red[900],
), ),
AppText( AppText(
referredDate, referredDate,
@ -158,7 +168,10 @@ class PatientReferralItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
isSameBranch ? TranslationBase.of(context).referredFrom :TranslationBase.of(context).refClinic, isSameBranch
? TranslationBase.of(context)
.referredFrom
: TranslationBase.of(context).refClinic,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
@ -166,7 +179,13 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
!isReferralClinic? isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch: " "+referralClinic, !isReferralClinic
? isSameBranch
? TranslationBase.of(context)
.sameBranch
: TranslationBase.of(context)
.otherBranch
: " " + referralClinic,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -217,7 +236,7 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
remark??"", remark ?? "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,
@ -261,13 +280,13 @@ class PatientReferralItemWidget extends StatelessWidget {
}, },
)) ))
: Container( : Container(
child: Image.asset( child: Image.asset(
patientGender == 1 patientGender == 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
), ),
), ),
Expanded( Expanded(

@ -351,6 +351,34 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.2.1" version: "5.2.1"
firebase:
dependency: transitive
description:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "7.3.3"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "6.3.0"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
firebase_core: firebase_core:
dependency: transitive dependency: transitive
description: description:

@ -71,6 +71,7 @@ dependencies:
# Firebase # Firebase
firebase_messaging: ^7.0.3 firebase_messaging: ^7.0.3
firebase_analytics: 6.3.0
#GIF image #GIF image
flutter_gifimage: ^1.0.1 flutter_gifimage: ^1.0.1

Loading…
Cancel
Save