Compare commits

...

15 Commits

Author SHA1 Message Date
mosazaid 1c0f8a3c65 working on textfield validation 5 years ago
mosazaid fbc5b3ce54 Merge branch 'lab-result-special' into text-form-field 5 years ago
mosazaid 1d31a1a683 Merge branch 'development' into text-form-field
# Conflicts:
#	lib/config/localized_values.dart
5 years ago
mosazaid 52c5e128e1 comiit 5 years ago
Mohammad Aljammal bf0ec6a035 Merge branch 'live_cear_services' into 'development'
Live caer services

See merge request Cloud_Solution/doctor_app_flutter!693
5 years ago
Mohammad Aljammal 1391799101 fix live care user 5 years ago
Mohammad Aljammal e89d5b13ab Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into live_cear_services 5 years ago
Mohammad Aljammal 169e5301a0 Merge branch 'lab-result-special' into 'development'
lab-result-special

See merge request Cloud_Solution/doctor_app_flutter!692
5 years ago
Mohammad Aljammal 7d423d9457 Merge branch 'prescription_changes' into 'development'
procedure changes

See merge request Cloud_Solution/doctor_app_flutter!691
5 years ago
Mohammad Aljammal ac701c9806 fix live care issues 5 years ago
hussam al-habibeh 764578f28e procedure changes 5 years ago
Mohammad Aljammal ccdd6696be Merge branch 'live_care_patient' into 'development'
first step from show Video call

See merge request Cloud_Solution/doctor_app_flutter!690
5 years ago
Elham Rababah 69eca869b4 fix error after merge 5 years ago
Elham Rababah fdc23ce932 Merge branches 'development' and 'live_care_patient' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into live_care_patient
 Conflicts:
	lib/core/service/patient/LiveCarePatientServices.dart
	lib/core/viewModel/LiveCarePatientViewModel.dart
	lib/screens/patients/profile/profile_screen/patient_profile_screen.dart
5 years ago
Elham Rababah 401516403f first step from show Video call 5 years ago

@ -328,4 +328,4 @@ SPEC CHECKSUMS:
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": "إضافة تقرير طبي"},
"medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"},
"comments": {"en": "Comments", "ar": "تعليقات"},
"initiateCall ": {"en": "Initiate Call ", "ar": "بدء الاتصال"},
"initiateCall": {"en": "Initiate Call ", "ar": "بدء الاتصال"},
"transferTo": {"en": "Transfer To ", "ar": "حول إلى"},
"admin": {"en": "Admin", "ar": "مشرف"},
"instructions": {"en": "Instructions", "ar": "تعليمات"},
@ -997,5 +997,5 @@ const Map<String, Map<String, String>> localizedValues = {
"impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"},
"onHold": {"en": "On Hold", "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 {
hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post(
DOCTOR_CHECK_HAS_LIVE_CARE,
onSuccess: (dynamic response, int statusCode) {
@ -43,7 +44,7 @@ class DashboardService extends BaseService {
super.error = error;
},
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/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.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> get patientList => _patientList;
bool _isFinished = false;
bool get isFinished => _isFinished;
bool get isFinished => _isFinished;
setFinished(bool isFinished){
_isFinished = isFinished;
}
var endCallResponse = {};
var transferToAdminResponse = {};
StartCallRes _startCallRes;
StartCallRes get startCallRes => _startCallRes;
Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{
hasError = false;
await baseAppClient.post(
@ -33,16 +45,27 @@ class LiveCarePatientServices extends BaseService{
}
Future endCall(EndCallReq endCallReq) async {
hasError = false;
await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async {
_isFinished = true;
endCallResponse = response;
}, onFailure: (String error, int statusCode) {
_isFinished = true;
throw error;
hasError = true;
super.error = error;
}, 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{
hasError = false;
await baseAppClient.post(
@ -55,7 +78,7 @@ class LiveCarePatientServices extends BaseService{
super.error = error;
},
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/model/live_care/PendingPatientERForDoctorAppRequestModel.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/viewModel/base_view_model.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 '../../locator.dart';
@ -14,7 +17,8 @@ class LiveCarePatientViewModel extends BaseViewModel {
LiveCarePatientServices _liveCarePatientServices =
locator<LiveCarePatientServices>();
bool get isFinished => _liveCarePatientServices.isFinished;
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
DashboardService _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.doctorId = doctorID; //profile["DoctorID"];
endCallReq.doctorId = doctorProfile.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = request.vCID; //["VC_ID"];
endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient;
setState(ViewState.BusyLocal);
@ -49,14 +53,41 @@ class LiveCarePatientViewModel extends BaseViewModel {
.endCall(endCallReq);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
filterData = _liveCarePatientServices.patientList;
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 {
setState(ViewState.BusyLocal);
await _liveCarePatientServices

@ -60,6 +60,8 @@ class ProcedureViewModel extends BaseViewModel {
Future getProcedure({int mrn, String patientType}) async {
hasError = false;
await getDoctorProfile();
doctorProfile.doctorID;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn);
@ -289,7 +291,6 @@ class ProcedureViewModel extends BaseViewModel {
}
}
getPatientLabOrdersResults(
{PatientLabOrders patientLabOrder,
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/viewModel/LiveCarePatientViewModel.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/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/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/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -44,10 +47,51 @@ class _EndCallScreenState extends State<EndCallScreen> {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).resume,
TranslationBase.of(context).theCall, '', 'patient/vital_signs.png',
isInPatient: isInpatient,
onTap: () {},
isDartIcon: true,
dartIcon: DoctorApp.call),
isInPatient: isInpatient, onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel
.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(
TranslationBase.of(context).endLC,
TranslationBase.of(context).consultation,
@ -59,7 +103,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
liveCareModel.endCallWithCharge(widget.patient.vcId);
await liveCareModel.endCallWithCharge(widget.patient.vcId);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
@ -77,14 +121,19 @@ class _EndCallScreenState extends State<EndCallScreen> {
onTap: () {},
isInPatient: isInpatient,
isDartIcon: true,
isDisable: true,
dartIcon: DoctorApp.send_instruction),
PatientProfileCardModel(TranslationBase.of(context).transferTo,
TranslationBase.of(context).admin, '', 'patient/health_summary.png',
onTap: () {
Navigator.push(context, MaterialPageRoute(
PatientProfileCardModel(
TranslationBase.of(context).transferTo,
TranslationBase.of(context).admin,
'',
'patient/health_summary.png', onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
LivaCareTransferToAdmin(patient:widget.patient)));
},
LivaCareTransferToAdmin(patient: widget.patient)));
},
isInPatient: isInpatient,
isDartIcon: true,
dartIcon: DoctorApp.transfer_to_admin),
@ -197,7 +246,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
fontWeight: FontWeight.w700,
color: Colors.red[600],
title: "Close", //TranslationBase.of(context).close,
onPressed: () async {},
onPressed: () {
Navigator.of(context).pop();
},
),
),
),

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

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

@ -14,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom2.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
@ -48,6 +50,8 @@ class _AdmissionRequestThirdScreenState
String medicalHistoryError;
String surgicalHistoryError;
final _formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -102,100 +106,91 @@ class _AdmissionRequestThirdScreenState
Container(
margin:
EdgeInsets.symmetric(vertical: 0, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.specialityAndDoctorDetail,
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
isTextFieldHasSuffix: true,
validationError: clinicError,
dropDownText: _selectedClinic != null
? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish']
: null,
enabled: false,
onClick: model.clinicList != null &&
model.clinicList.length > 0
? () {
openListDialogField(
projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish',
'clinicID',
model.clinicList, (selectedValue) {
setState(() {
_selectedClinic = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getClinics().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.clinicList.length > 0) {
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.specialityAndDoctorDetail,
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
isTextFieldHasSuffix: true,
validationError: clinicError,
dropDownText: _selectedClinic != null
? projectViewModel.isArabic
? _selectedClinic['clinicNameArabic']
: _selectedClinic['clinicNameEnglish']
: null,
enabled: false,
onClick: model.clinicList != null &&
model.clinicList.length > 0
? () {
openListDialogField(
projectViewModel.isArabic? 'clinicNameArabic' : 'clinicNameEnglish',
projectViewModel.isArabic
? 'clinicNameArabic'
: 'clinicNameEnglish',
'clinicID',
model.clinicList, (selectedValue) {
setState(() {
_selectedClinic = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
),
SizedBox(
height: 20,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
isTextFieldHasSuffix: true,
dropDownText: _selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
enabled: false,
validationError: doctorError,
onClick: _selectedClinic != null
? model.doctorsList != null &&
model.doctorsList.length > 0
? () {
openListDialogField('DoctorName',
'DoctorID', model.doctorsList,
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getClinics().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.clinicList.length > 0) {
openListDialogField(
projectViewModel.isArabic
? 'clinicNameArabic'
: 'clinicNameEnglish',
'clinicID',
model.clinicList,
(selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
_selectedClinic = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinicDoctors(
_selectedClinic['clinicID'])
.then((_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle &&
model.doctorsList.length > 0) {
},
),
SizedBox(
height: 20,
),
AppTextFieldCustom2(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
isTextFieldHasSuffix: true,
dropDownText: _selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
enabled: false,
validationError: doctorError,
onClick: _selectedClinic != null
? model.doctorsList != null &&
model.doctorsList.length > 0
? () {
openListDialogField('DoctorName',
'DoctorID', model.doctorsList,
(selectedValue) {
@ -203,104 +198,111 @@ class _AdmissionRequestThirdScreenState
_selectedDoctor = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
}
: null,
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).patientDetails,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
),
SizedBox(
height: 10,
),
if(patient.gender != 1)
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getClinicDoctors(
_selectedClinic['clinicID'])
.then((_) =>
GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle &&
model.doctorsList.length > 0) {
openListDialogField('DoctorName',
'DoctorID', model.doctorsList,
(selectedValue) {
setState(() {
_selectedDoctor =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
}
: null,
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).patientDetails,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.w700,
),
SizedBox(
height: 10,
),
if (patient.gender != 1)
CheckboxListTile(
title: AppText(
TranslationBase.of(context).patientPregnant,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
),
value: _patientPregnant,
activeColor: HexColor("#D02127"),
onChanged: (newValue) {
setState(() {
_patientPregnant = newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context).patientPregnant,
TranslationBase.of(context)
.isSickLeaveRequired,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
),
value: _patientPregnant,
value: _isSickLeaveRequired,
activeColor: HexColor("#D02127"),
onChanged: (newValue) {
setState(() {
_patientPregnant = newValue;
_isSickLeaveRequired = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context).isSickLeaveRequired,
fontWeight: FontWeight.normal,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.0,
AppTextFieldCustom2(
hintText: TranslationBase.of(context)
.sickLeaveComments,
controller: _sickLeaveCommentsController,
minLines: 2,
maxLines: 4,
validationError: sickLeaveCommentError,
inputType: TextInputType.multiline,
),
value: _isSickLeaveRequired,
activeColor: HexColor("#D02127"),
onChanged: (newValue) {
setState(() {
_isSickLeaveRequired = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).sickLeaveComments,
controller: _sickLeaveCommentsController,
minLines: 2,
maxLines: 4,
validationError: sickLeaveCommentError,
inputType: TextInputType.multiline,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).dietType,
isTextFieldHasSuffix: true,
validationError: dietTypeError,
dropDownText: _selectedDietType != null
? _selectedDietType['nameEn']
: null,
enabled: false,
onClick: model.dietTypesList != null &&
model.dietTypesList.length > 0
? () {
openListDialogField(
'nameEn', 'id', model.dietTypesList,
(selectedValue) {
setState(() {
_selectedDietType = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getDietTypes(patient.patientId).then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.dietTypesList.length > 0) {
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).dietType,
isTextFieldHasSuffix: true,
validationError: dietTypeError,
dropDownText: _selectedDietType != null
? _selectedDietType['nameEn']
: null,
enabled: false,
onClick: model.dietTypesList != null &&
model.dietTypesList.length > 0
? () {
openListDialogField(
'nameEn', 'id', model.dietTypesList,
(selectedValue) {
@ -308,50 +310,71 @@ class _AdmissionRequestThirdScreenState
_selectedDietType = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).dietTypeRemarks,
controller: _dietTypeRemarksController,
minLines: 4,
maxLines: 6,
inputType: TextInputType.multiline,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).pastMedicalHistory,
controller: _postMedicalHistoryController,
minLines: 4,
maxLines: 6,
validationError: medicalHistoryError,
inputType: TextInputType.multiline,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context).pastSurgicalHistory,
controller: _postSurgicalHistoryController,
minLines: 2,
maxLines: 4,
validationError: surgicalHistoryError,
inputType: TextInputType.multiline,
),
],
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getDietTypes(patient.patientId)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.dietTypesList.length > 0) {
openListDialogField('nameEn', 'id',
model.dietTypesList,
(selectedValue) {
setState(() {
_selectedDietType = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText:
TranslationBase.of(context).dietTypeRemarks,
controller: _dietTypeRemarksController,
minLines: 4,
maxLines: 6,
inputType: TextInputType.multiline,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.pastMedicalHistory,
controller: _postMedicalHistoryController,
minLines: 4,
maxLines: 6,
validationError: medicalHistoryError,
inputType: TextInputType.multiline,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.pastSurgicalHistory,
controller: _postSurgicalHistoryController,
minLines: 2,
maxLines: 4,
validationError: surgicalHistoryError,
inputType: TextInputType.multiline,
),
],
),
),
),
],
@ -364,6 +387,13 @@ class _AdmissionRequestThirdScreenState
title: TranslationBase.of(context).next,
color: HexColor("#D02127"),
onPressed: () {
// Validate returns true if the form is valid, or false otherwise.
if (_formKey.currentState.validate()) {
DrAppToastMsg.showErrorToast("all good");
} else {
DrAppToastMsg.showErrorToast("not valid");
}
model.admissionRequestData = AdmissionRequest();
if (_selectedClinic != null &&
_selectedDoctor != null &&
@ -411,34 +441,40 @@ class _AdmissionRequestThirdScreenState
TranslationBase.of(context).pleaseFill);
setState(() {
if(_selectedClinic == null){
clinicError = TranslationBase.of(context).fieldRequired;
}else {
if (_selectedClinic == null) {
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if(_selectedDoctor == null){
doctorError = TranslationBase.of(context).fieldRequired;
}else {
if (_selectedDoctor == null) {
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
if(_sickLeaveCommentsController.text == ""){
sickLeaveCommentError = TranslationBase.of(context).fieldRequired;
}else {
if (_sickLeaveCommentsController.text == "") {
sickLeaveCommentError =
TranslationBase.of(context).fieldRequired;
} else {
sickLeaveCommentError = null;
}
if(_selectedDietType == null){
dietTypeError = TranslationBase.of(context).fieldRequired;
}else {
if (_selectedDietType == null) {
dietTypeError =
TranslationBase.of(context).fieldRequired;
} else {
dietTypeError = null;
}
if(_postMedicalHistoryController.text == ""){
medicalHistoryError = TranslationBase.of(context).fieldRequired;
}else {
if (_postMedicalHistoryController.text == "") {
medicalHistoryError =
TranslationBase.of(context).fieldRequired;
} else {
medicalHistoryError = null;
}
if(_postSurgicalHistoryController.text == ""){
surgicalHistoryError = TranslationBase.of(context).fieldRequired;
}else {
if (_postSurgicalHistoryController.text == "") {
surgicalHistoryError =
TranslationBase.of(context).fieldRequired;
} else {
surgicalHistoryError = null;
}
});

@ -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/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/livecare/session_status_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/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_other.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/widgets/patients/profile/patient-profile-header-new-design-app-bar.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 isInpatient = false;
bool isCallFinished = false;
bool isDischargedPatient = false;
bool isSearchAndOut = false;
String patientType;
@ -272,20 +277,67 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
color: model.isFinished?Colors.red[600]:Colors.green[600],
title: model.isFinished?TranslationBase
.of(context)
.endCall:TranslationBase
.of(context)
.initiateCall,
color: isCallFinished?Colors.red[600]:Colors.green[600],
title: isCallFinished?
TranslationBase.of(context).endCall:
TranslationBase.of(context).initiateCall,
disabled: model.state == ViewState.BusyLocal,
onPressed: () async {
// if(model.isFinished) {
if(isCallFinished) {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) =>
EndCallScreen(patient:patient)));
// } else {
// // TODO Call initiateCall service
// }
} else {
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.doctorID,
}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -253,9 +254,9 @@ class ProcedureCard extends StatelessWidget {
fontSize: 12,
),
),
if (entityList.categoryID == 2 ||
entityList.categoryID == 4 &&
doctorID == entityList.doctorID)
if ((entityList.categoryID == 2 ||
entityList.categoryID == 4) &&
doctorID == entityList.doctorID)
InkWell(
child: Icon(DoctorApp.edit),
onTap: onTap,

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

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

@ -0,0 +1,177 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_field_error.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import '../app_texts_widget.dart';
class AppTextFieldCustom2 extends StatefulWidget {
final double height;
final Function onClick;
final String hintText;
final TextEditingController controller;
final bool isTextFieldHasSuffix;
final bool hasBorder;
final String dropDownText;
final IconButton suffixIcon;
final Color dropDownColor;
final bool enabled;
final TextInputType inputType;
final int minLines;
final int maxLines;
final List<TextInputFormatter> inputFormatters;
final Function(String) onChanged;
final String validationError;
final bool isPrscription;
final bool isSecure;
AppTextFieldCustom2({
this.height = 0,
this.onClick,
this.hintText,
this.controller,
this.hasBorder = true,
this.isTextFieldHasSuffix = false,
this.dropDownText,
this.suffixIcon,
this.dropDownColor,
this.enabled = true,
this.inputType,
this.minLines = 1,
this.maxLines = 1,
this.inputFormatters,
this.onChanged,
this.validationError,
this.isPrscription = false,
this.isSecure = false,
});
@override
_AppTextFieldCustomState createState() => _AppTextFieldCustomState();
}
class _AppTextFieldCustomState extends State<AppTextFieldCustom2> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column(
children: [
Container(
height: widget.height != 0 && widget.maxLines == 1
? widget.height + 8
: null,
decoration: widget.hasBorder
? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff),
widget.validationError == null
? Color(0xFFEFEFEF)
: Colors.red.shade700)
: null,
padding:
EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0),
child: InkWell(
onTap: widget.onClick ?? null,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
padding: widget.dropDownText == null
? EdgeInsets.symmetric(vertical: 0)
: EdgeInsets.symmetric(vertical: 0), // 8.0
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
if ((widget.controller != null &&
widget.controller.text != "") ||
widget.dropDownText != null)
AppText(
widget.hintText,
color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false
? SizeConfig.textMultiplier * 1.3
: 0,
fontWeight: FontWeight.w700,
),
widget.dropDownText == null
? Container(
height:
widget.height != 0 && widget.maxLines == 1
? widget.height - 22
: null,
child: TextFormField(
textAlign: projectViewModel.isArabic
? TextAlign.right
: TextAlign.left,
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
widget.hintText, null, true),
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7,
fontFamily: 'Poppins',
color: Color(0xFF575757),
),
controller: widget.controller,
keyboardType: widget.inputType ??
(widget.maxLines == 1
? TextInputType.text
: TextInputType.multiline),
enabled: widget.enabled,
minLines: widget.minLines,
maxLines: widget.maxLines,
inputFormatters:
widget.inputFormatters != null
? widget.inputFormatters
: [],
onChanged: (value) {
setState(() {});
if (widget.onChanged != null) {
widget.onChanged(value);
}
},
obscureText: widget.isSecure,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
}
return null;
},
),
)
: AppText(
widget.dropDownText,
fontFamily: 'Poppins',
color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.7,
),
],
),
),
),
widget.isTextFieldHasSuffix
? widget.suffixIcon != null
? widget.suffixIcon
: InkWell(
child: Icon(
Icons.keyboard_arrow_down,
color: widget.dropDownColor != null
? widget.dropDownColor
: Colors.black,
),
)
: Container(),
],
),
),
),
if (widget.validationError != null)
TextFieldsError(error: widget.validationError),
],
);
}
}

@ -32,20 +32,16 @@ class TextFieldsUtils{
borderSide: BorderSide(color: Color(0Xffffffff)),
),
border: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
borderSide: BorderSide(color: Color(0Xffffffff) /*, width: 2.0),
borderRadius: BorderRadius.circular(8),*/),
),
/*focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.red.shade700),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
errorStyle: TextStyle(
fontSize: 14.0,
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),*/
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,),

Loading…
Cancel
Save