Merge branch 'development' into text-form-field

# Conflicts:
#	lib/config/localized_values.dart
text-form-field
mosazaid 5 years ago
commit 1d31a1a683

@ -328,4 +328,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0.rc.1 COCOAPODS: 1.10.1

@ -982,7 +982,7 @@ const Map<String, Map<String, String>> localizedValues = {
"medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"}, "medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"},
"medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"}, "medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"},
"comments": {"en": "Comments", "ar": "تعليقات"}, "comments": {"en": "Comments", "ar": "تعليقات"},
"initiateCall ": {"en": "Initiate Call ", "ar": "بدء الاتصال"}, "initiateCall": {"en": "Initiate Call ", "ar": "بدء الاتصال"},
"transferTo": {"en": "Transfer To ", "ar": "حول إلى"}, "transferTo": {"en": "Transfer To ", "ar": "حول إلى"},
"admin": {"en": "Admin", "ar": "مشرف"}, "admin": {"en": "Admin", "ar": "مشرف"},
"instructions": {"en": "Instructions", "ar": "تعليمات"}, "instructions": {"en": "Instructions", "ar": "تعليمات"},
@ -997,5 +997,5 @@ const Map<String, Map<String, String>> localizedValues = {
"impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"},
"onHold": {"en": "On Hold", "ar": "قيد الانتظار"}, "onHold": {"en": "On Hold", "ar": "قيد الانتظار"},
"verified": {"en": "Verified", "ar": "تم التحقق"}, "verified": {"en": "Verified", "ar": "تم التحقق"},
"endCall": {"en": "'End'", "ar": "انهاء"}, "endCall": {"en": "End Call", "ar": "انهاء"},
}; };

@ -32,6 +32,7 @@ class DashboardService extends BaseService {
Future checkDoctorHasLiveCare() async { Future checkDoctorHasLiveCare() async {
hasError = false; hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post( await baseAppClient.post(
DOCTOR_CHECK_HAS_LIVE_CARE, DOCTOR_CHECK_HAS_LIVE_CARE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -43,7 +44,7 @@ class DashboardService extends BaseService {
super.error = error; super.error = error;
}, },
body: { body: {
"DoctorID": 9920 "DoctorID": doctorProfile.doctorID// test user 9920
}, },
); );
} }

@ -2,18 +2,30 @@ 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/PendingPatientERForDoctorAppRequestModel.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';
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class LiveCarePatientServices extends BaseService{ class LiveCarePatientServices extends BaseService {
List<PatiantInformtion> _patientList = []; List<PatiantInformtion> _patientList = [];
List<PatiantInformtion> get patientList => _patientList; List<PatiantInformtion> get patientList => _patientList;
bool _isFinished = false; bool _isFinished = false;
bool get isFinished => _isFinished;
bool get isFinished => _isFinished;
setFinished(bool isFinished){
_isFinished = isFinished;
}
var endCallResponse = {}; var endCallResponse = {};
var transferToAdminResponse = {}; var transferToAdminResponse = {};
StartCallRes _startCallRes;
StartCallRes get startCallRes => _startCallRes;
Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -33,16 +45,27 @@ class LiveCarePatientServices extends BaseService{
} }
Future endCall(EndCallReq endCallReq) async { Future endCall(EndCallReq endCallReq) async {
hasError = false;
await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async { await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async {
_isFinished = true;
endCallResponse = response; endCallResponse = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
_isFinished = true;
throw error; hasError = true;
super.error = error;
}, body: endCallReq.toJson()); }, body: endCallReq.toJson());
} }
Future startCall(StartCallReq startCallReq) async {
hasError = false;
await baseAppClient.post(START_LIVECARE_CALL,
onSuccess: (response, statusCode) async {
_startCallRes = StartCallRes.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: startCallReq.toJson());
}
Future endCallWithCharge(int vcID) async{ Future endCallWithCharge(int vcID) async{
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -55,7 +78,7 @@ class LiveCarePatientServices extends BaseService{
super.error = error; super.error = error;
}, },
body: { body: {
"VC_ID": vcID, "VC_ID": vcID,"generalid":"Cs2020@2016\$2958",
}, },
); );
} }

@ -1,9 +1,12 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.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/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -14,7 +17,8 @@ class LiveCarePatientViewModel extends BaseViewModel {
LiveCarePatientServices _liveCarePatientServices = LiveCarePatientServices _liveCarePatientServices =
locator<LiveCarePatientServices>(); locator<LiveCarePatientServices>();
bool get isFinished => _liveCarePatientServices.isFinished;
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
DashboardService _dashboardService = DashboardService _dashboardService =
locator<DashboardService>(); locator<DashboardService>();
@ -36,12 +40,12 @@ class LiveCarePatientViewModel extends BaseViewModel {
} }
} }
Future endCall(request, isPatient, doctorID) async { Future endCall(int vCID, bool isPatient) async {
await getDoctorProfile(isGetProfile: true);
EndCallReq endCallReq = new EndCallReq(); EndCallReq endCallReq = new EndCallReq();
endCallReq.doctorId = doctorID; //profile["DoctorID"]; endCallReq.doctorId = doctorProfile.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = request.vCID; //["VC_ID"]; endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient; endCallReq.isDestroy = isPatient;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -49,14 +53,41 @@ class LiveCarePatientViewModel extends BaseViewModel {
.endCall(endCallReq); .endCall(endCallReq);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
filterData = _liveCarePatientServices.patientList;
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
getToken()async{
String token = await sharedPref.getString(TOKEN);
return token;
}
Future startCall({int vCID, bool isReCall}) async {
StartCallReq startCallReq = new StartCallReq();
await getDoctorProfile();
startCallReq.clinicId = super.doctorProfile.clinicID;
startCallReq.vCID = vCID; //["VC_ID"];
startCallReq.isrecall = isReCall;
startCallReq.doctorId = doctorProfile.doctorID;
startCallReq.isOutKsa = false; //["IsOutKSA"];
startCallReq.projectName = doctorProfile.projectName;
startCallReq.docotrName = doctorProfile.doctorName;
startCallReq.clincName = doctorProfile.clinicDescription;
startCallReq.docSpec = doctorProfile.doctorTitleForProfile;
startCallReq.generalid = 'Cs2020@2016\$2958';
setState(ViewState.BusyLocal);
await _liveCarePatientServices.startCall(startCallReq);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future endCallWithCharge(int vcID) async { Future endCallWithCharge(int vcID) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _liveCarePatientServices await _liveCarePatientServices

@ -60,6 +60,8 @@ class ProcedureViewModel extends BaseViewModel {
Future getProcedure({int mrn, String patientType}) async { Future getProcedure({int mrn, String patientType}) async {
hasError = false; hasError = false;
await getDoctorProfile();
doctorProfile.doctorID;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn); await _procedureService.getProcedure(mrn: mrn);
@ -289,7 +291,6 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
getPatientLabOrdersResults( getPatientLabOrdersResults(
{PatientLabOrders patientLabOrder, {PatientLabOrders patientLabOrder,
String procedure, String procedure,

@ -1,10 +1,13 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/live_care/live-care_transfer_to_admin.dart'; import 'package:doctor_app_flutter/screens/live_care/live-care_transfer_to_admin.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart';
import 'package:doctor_app_flutter/util/VideoChannel.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';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -44,10 +47,51 @@ class _EndCallScreenState extends State<EndCallScreen> {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).resume, PatientProfileCardModel(TranslationBase.of(context).resume,
TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', TranslationBase.of(context).theCall, '', 'patient/vital_signs.png',
isInPatient: isInpatient, isInPatient: isInpatient, onTap: () async {
onTap: () {}, GifLoaderDialogUtils.showMyDialog(context);
isDartIcon: true, await liveCareModel
dartIcon: DoctorApp.call), .startCall(isReCall: false, vCID: widget.patient.vcId)
.then((value) async{
await liveCareModel.getDoctorProfile();
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
}else
await VideoChannel.openVideoCallScreen(
kToken: liveCareModel.startCallRes.openTokenID,
kSessionId: liveCareModel.startCallRes.openSessionID,
kApiKey: '46209962',
vcId: widget.patient.vcId,
tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID,
doctorId: liveCareModel.doctorProfile.doctorID,
onFailure: (String error) {
DrAppToastMsg.showErrorToast(error);
},
onCallEnd: () async{
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall(widget.patient.vcId, false,);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
}
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) async{
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall(widget.patient.vcId, sessionStatusModel.sessionStatus == 3,);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
}
});
});
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
}
}, isDartIcon: true, dartIcon: DoctorApp.call),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).endLC, TranslationBase.of(context).endLC,
TranslationBase.of(context).consultation, TranslationBase.of(context).consultation,
@ -59,7 +103,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
() async { () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
liveCareModel.endCallWithCharge(widget.patient.vcId); await liveCareModel.endCallWithCharge(widget.patient.vcId);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
@ -77,14 +121,19 @@ class _EndCallScreenState extends State<EndCallScreen> {
onTap: () {}, onTap: () {},
isInPatient: isInpatient, isInPatient: isInpatient,
isDartIcon: true, isDartIcon: true,
isDisable: true,
dartIcon: DoctorApp.send_instruction), dartIcon: DoctorApp.send_instruction),
PatientProfileCardModel(TranslationBase.of(context).transferTo, PatientProfileCardModel(
TranslationBase.of(context).admin, '', 'patient/health_summary.png', TranslationBase.of(context).transferTo,
onTap: () { TranslationBase.of(context).admin,
Navigator.push(context, MaterialPageRoute( '',
'patient/health_summary.png', onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
LivaCareTransferToAdmin(patient:widget.patient))); LivaCareTransferToAdmin(patient: widget.patient)));
}, },
isInPatient: isInpatient, isInPatient: isInpatient,
isDartIcon: true, isDartIcon: true,
dartIcon: DoctorApp.transfer_to_admin), dartIcon: DoctorApp.transfer_to_admin),
@ -197,7 +246,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Colors.red[600], color: Colors.red[600],
title: "Close", //TranslationBase.of(context).close, title: "Close", //TranslationBase.of(context).close,
onPressed: () async {}, onPressed: () {
Navigator.of(context).pop();
},
), ),
), ),
), ),

@ -204,13 +204,13 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
// .pushNamed( // .pushNamed(
// VIDEO_CALL, // VIDEO_CALL,
// item) // item)
Navigator.push( // Navigator.push(
context, // context,
MaterialPageRoute( // MaterialPageRoute(
builder: (context) => // builder: (context) =>
VideoCallPage( // VideoCallPage(
item, // item,
context))) // context)))
}, },
), ),
) )

@ -1,10 +1,12 @@
import 'dart:async'; import 'dart:async';
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/core/viewModel/LiveCarePatientViewModel.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/models/livecare/get_pending_res_list.dart'; import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart';
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/VideoChannel.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/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -13,9 +15,10 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class VideoCallPage extends StatefulWidget { class VideoCallPage extends StatefulWidget {
final LiveCarePendingListResponse patientData; final PatiantInformtion patientData;
final listContext; final listContext;
VideoCallPage(this.patientData, this.listContext); final LiveCarePatientViewModel model;
VideoCallPage({this.patientData, this.listContext, this.model});
@override @override
_VideoCallPageState createState() => _VideoCallPageState(); _VideoCallPageState createState() => _VideoCallPageState();
@ -41,7 +44,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
_liveCareProvider = Provider.of<LiveCareViewModel>(context); _liveCareProvider = Provider.of<LiveCareViewModel>(context);
startCall(false); connectOpenTok(widget.model.startCallRes);
// widget.model.startCall(vCID: widget.patientData.vcId, isReCall: false);
} }
_isInit = false; _isInit = false;
} }
@ -61,7 +65,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
kSessionId: tokenData.openSessionID, kSessionId: tokenData.openSessionID,
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962', kApiKey: '46209962',
vcId: widget.patientData.vCID, vcId: widget.patientData.vcId,
tokenID: token, //"hfkjshdf347r8743", tokenID: token, //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958", generalId: "Cs2020@2016\$2958",
doctorId: doctorprofile['DoctorID'], doctorId: doctorprofile['DoctorID'],
@ -130,7 +134,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
height: MediaQuery.of(context).size.height * 0.02, height: MediaQuery.of(context).size.height * 0.02,
), ),
Text( Text(
widget.patientData.patientName, widget.patientData.fullName,
style: TextStyle( style: TextStyle(
color: Colors.deepPurpleAccent, color: Colors.deepPurpleAccent,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
@ -319,7 +323,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
endCallWithCharge() { endCallWithCharge() {
_liveCareProvider _liveCareProvider
.endCallWithCharge(widget.patientData.vCID, doctorprofile['DoctorID']) .endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID'])
.then((result) { .then((result) {
closeRoute(); closeRoute();
print('end callwith charge'); print('end callwith charge');

@ -1,13 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart';
import 'package:doctor_app_flutter/util/VideoChannel.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -31,7 +36,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
bool isFromLiveCare = false; bool isFromLiveCare = false;
bool isInpatient = false; bool isInpatient = false;
bool isCallFinished = false;
bool isDischargedPatient = false; bool isDischargedPatient = false;
bool isSearchAndOut = false; bool isSearchAndOut = false;
String patientType; String patientType;
@ -272,20 +277,67 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
child: Center( child: Center(
child: AppButton( child: AppButton(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: model.isFinished?Colors.red[600]:Colors.green[600], color: isCallFinished?Colors.red[600]:Colors.green[600],
title: model.isFinished?TranslationBase title: isCallFinished?
.of(context) TranslationBase.of(context).endCall:
.endCall:TranslationBase TranslationBase.of(context).initiateCall,
.of(context) disabled: model.state == ViewState.BusyLocal,
.initiateCall,
onPressed: () async { onPressed: () async {
// if(model.isFinished) { if(isCallFinished) {
Navigator.push(context, MaterialPageRoute( Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
EndCallScreen(patient:patient))); EndCallScreen(patient:patient)));
// } else { } else {
// // TODO Call initiateCall service GifLoaderDialogUtils.showMyDialog(context);
// } await model.startCall( isReCall : false, vCID: patient.vcId);
if(model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(model.error);
} else {
await model.getDoctorProfile();
GifLoaderDialogUtils.hideDialog(context);
await VideoChannel.openVideoCallScreen(
kToken: model.startCallRes.openTokenID,
kSessionId: model.startCallRes.openSessionID,
kApiKey: '46209962',
vcId: patient.vcId,
tokenID: await model.getToken(),
generalId: GENERAL_ID,
doctorId: model.doctorProfile.doctorID,
onFailure: (String error) {
DrAppToastMsg.showErrorToast(error);
},
onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog(context);
model.endCall(patient.vcId, false,).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
setState(() {
isCallFinished = true;
});
});
});
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog(context);
model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
setState(() {
isCallFinished = true;
});
});
});
});
}
}
}, },
), ),

@ -28,6 +28,7 @@ class ProcedureCard extends StatelessWidget {
this.patient, this.patient,
this.doctorID, this.doctorID,
}) : super(key: key); }) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -253,9 +254,9 @@ class ProcedureCard extends StatelessWidget {
fontSize: 12, fontSize: 12,
), ),
), ),
if (entityList.categoryID == 2 || if ((entityList.categoryID == 2 ||
entityList.categoryID == 4 && entityList.categoryID == 4) &&
doctorID == entityList.doctorID) doctorID == entityList.doctorID)
InkWell( InkWell(
child: Icon(DoctorApp.edit), child: Icon(DoctorApp.edit),
onTap: onTap, onTap: onTap,

@ -92,9 +92,7 @@ class ProcedureScreen extends StatelessWidget {
fontSize: 13, fontSize: 13,
), ),
AppText( AppText(
TranslationBase TranslationBase.of(context).procedure,
.of(context)
.procedure,
bold: true, bold: true,
fontSize: 22, fontSize: 22,
), ),
@ -102,15 +100,14 @@ class ProcedureScreen extends StatelessWidget {
), ),
), ),
if ((patient.patientStatusType != null && if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) || patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) => AddProcedureHome(
AddProcedureHome(
patient: patient, patient: patient,
model: model, model: model,
)), )),
@ -192,7 +189,7 @@ class ProcedureScreen extends StatelessWidget {
// 'You Cant Update This Procedure'); // 'You Cant Update This Procedure');
}, },
patient: patient, patient: patient,
doctorID: doctorNameP, doctorID: model.doctorProfile.doctorID,
), ),
), ),
if (model.state == ViewState.ErrorLocal || if (model.state == ViewState.ErrorLocal ||

@ -1338,8 +1338,8 @@ class TranslationBase {
String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode];
String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode];
String get comments => localizedValues['comments'][locale.languageCode]; String get comments => localizedValues['comments'][locale.languageCode];
String get initiateCall => localizedValues['initiateCall '][locale.languageCode]; String get initiateCall => localizedValues['initiateCall'][locale.languageCode];
String get endCall => localizedValues['endCall '][locale.languageCode]; String get endCall => localizedValues['endCall'][locale.languageCode];
String get transferTo => localizedValues['transferTo'][locale.languageCode]; String get transferTo => localizedValues['transferTo'][locale.languageCode];
String get admin => localizedValues['admin'][locale.languageCode]; String get admin => localizedValues['admin'][locale.languageCode];

Loading…
Cancel
Save