Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into auth_refactor

auth_refactor
Elham Rababah 5 years ago
commit 7af300d455

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

@ -88,7 +88,6 @@ class BaseAppClient {
onFailure(Helpers.generateContactAdminMsg(), statusCode);
} else {
var parsed = json.decode(response.body.toString());
if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']);
@ -99,7 +98,7 @@ class BaseAppClient {
onFailure(getError(parsed), statusCode);
} else if (!isAllowAny) {
await Helpers.logout();
Helpers.showErrorToast('Your session expired Please login agian');
Helpers.showErrorToast('Your session expired Please login again');
}
if (isAllowAny) {
onFailure(getError(parsed), statusCode);

@ -47,7 +47,7 @@ const Map<String, Map<String, String>> localizedValues = {
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'My InPatients', 'ar': 'مرضاي'},
'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'},
'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'},
'operations': {'en': 'Operations', 'ar': 'عمليات'},

@ -44,7 +44,7 @@ class DischargedPatientService extends BaseService {
Future gtMyDischargeReferralPatient() async {
hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile();
await getDoctorProfile(isGetProfile: true);
body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0";
body['MiddleName'] = "0";

@ -24,7 +24,7 @@ class HomePageCard extends StatelessWidget {
return InkWell(
onTap: onTap,
child: Container(
width: 100,
width: 120,
height: MediaQuery.of(context).orientation == Orientation.portrait
? 130
: 250,

@ -504,8 +504,7 @@ class _HomeScreenState extends State<HomeScreen> {
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.inPatient,
"My\n"+TranslationBase.of(context).inPatient,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 15,

@ -107,7 +107,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> with Si
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length),
tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient, counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged),
],
),

@ -0,0 +1,8 @@
import 'package:flutter/cupertino.dart';
class MedicalReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}

@ -173,13 +173,12 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
),
),
bottomSheet: Container(
height: progressNoteController.text.isNotEmpty? 130:70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
child: Column(
children: <Widget>[
progressNoteController.text.isEmpty
? SizedBox()
: Container(
if(progressNoteController.text.isNotEmpty)
Container(
margin: EdgeInsets.all(5),
child: AppButton(
title: TranslationBase.of(context).clearText,

@ -22,7 +22,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel;
//TODO Jammal
const AddReplayOnReferralPatient(
{Key key, this.patientReferralViewModel, this.myReferralInPatientModel})
: super(key: key);
@ -38,7 +38,7 @@ class _AddReplayOnReferralPatientState
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
TextEditingController progressNoteController = TextEditingController();
TextEditingController replayOnReferralController = TextEditingController();
@override
void initState() {
requestPermissions();
@ -71,12 +71,12 @@ class _AddReplayOnReferralPatientState
children: [
AppTextFieldCustom(
hintText: 'Replay your responses here',
controller: progressNoteController,
controller: replayOnReferralController,
maxLines: 35,
minLines: 25,
hasBorder: true,
validationError:
progressNoteController.text.isEmpty &&
replayOnReferralController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
: null,
@ -107,11 +107,11 @@ class _AddReplayOnReferralPatientState
),
),
bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty? 130:70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
child: Column(
children: <Widget>[
progressNoteController.text.isEmpty
replayOnReferralController.text.isEmpty
? SizedBox()
: Container(
margin: EdgeInsets.all(5),
@ -120,7 +120,7 @@ class _AddReplayOnReferralPatientState
title: TranslationBase.of(context).clearText,
onPressed: () {
setState(() {
progressNoteController.text = '';
replayOnReferralController.text = '';
});
},
)),
@ -135,10 +135,10 @@ class _AddReplayOnReferralPatientState
setState(() {
isSubmitted = true;
});
if (progressNoteController.text.isNotEmpty) {
if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel.replay(
progressNoteController.text.trim(),
replayOnReferralController.text.trim(),
widget.myReferralInPatientModel);
if (widget.patientReferralViewModel.state ==
ViewState.ErrorLocal) {
@ -199,7 +199,7 @@ class _AddReplayOnReferralPatientState
if (result.finalResult == true) {
setState(() {
SpeechToText.closeAlertDialog(context);
progressNoteController.text += reconizedWord + '\n';
replayOnReferralController.text += reconizedWord + '\n';
});
}
}

@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -406,6 +407,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Container(
child: Column(
children: [
AppText(
_selectedMedication?.description ??
"",
bold: true,
),
Container(
child: Row(
children: [
@ -430,16 +436,25 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(
height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
//height: screenSize.height * 0.062,
height: MediaQuery.of(context)
.size
.height *
0.0749,
width: double.infinity,
child: Row(
children: [
Container(
// height: MediaQuery.of(context)
// .size
// .height *
// 0.02,
width: MediaQuery.of(context)
.size
.width *
0.550,
child: TextFields(
0.35,
child: AppTextFieldCustom(
isPrscription: true,
inputFormatters: [
LengthLimitingTextInputFormatter(
5),
@ -450,12 +465,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of(
context)
.strength,
// fontWeight: FontWeight.w500,
// fontSize: 14.0,
// borderWidth: 0.2,
controller:
strengthController,
keyboardType: TextInputType
.numberWithOptions(
decimal: true,
),
// keyboardType: TextInputType
// .numberWithOptions(
// decimal: true,
// ),
onChanged: (String value) {
setState(() {
strengthChar =
@ -470,30 +490,30 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
);
}
},
onSubmit: (_) {
if (_selectedMedication !=
null &&
duration != null &&
frequency != null &&
strengthController
.text !=
null) {
model.getBoxQuantity(
freq: frequency[
'parameterCode'],
duration:
duration['id'],
itemCode:
_selectedMedication
.itemId,
strength: double.parse(
strengthController
.text));
box = model.boxQuintity;
return;
}
},
// onClick: (_) {
// if (_selectedMedication !=
// null &&
// duration != null &&
// frequency != null &&
// strengthController
// .text !=
// null) {
// model.getBoxQuantity(
// freq: frequency[
// 'parameterCode'],
// duration:
// duration['id'],
// itemCode:
// _selectedMedication
// .itemId,
// strength: double.parse(
// strengthController
// .text));
// box = model.boxQuintity;
//
// return;
// }
// },
// validator: (value) {
// if (value.isEmpty &&
// strengthController.text.length >
@ -506,14 +526,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
),
),
SizedBox(
width: 10.0,
width: 5.0,
),
Container(
// height: MediaQuery.of(context)
// .size
// .height *
// 0.06,
color: Colors.white,
width: MediaQuery.of(context)
.size
.width *
0.350,
0.560,
child: InkWell(
onTap:
model.itemMedicineListUnit !=
@ -561,19 +585,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(
context)
.unit,
'Select',
model.itemMedicineListUnit
.length ==
1
? model.itemMedicineListUnit[
0][
? units = model
.itemMedicineListUnit[0]
[
'description']
: units !=
null
? units[
'description']
? units['description']
.toString()
: null,
true),
enabled: false),
@ -640,10 +663,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of(
context)
.route,
route != null
? route[
'description']
: null,
model.itemMedicineListRoute
.length ==
1
? model.itemMedicineListRoute[
0]
['description']
: route != null
? route[
'description']
: null,
true),
enabled: false,
),
@ -725,10 +754,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of(
context)
.frequency,
frequency != null
? frequency[
'description']
: null,
model.itemMedicineList
.length ==
1
? model.itemMedicineList[
0]
['description']
: frequency != null
? frequency[
'description']
: null,
true),
enabled: false,
),
@ -1138,12 +1173,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
formKey.currentState.save();
// Navigator.pop(context);
// openDrugToDrug();
if (route == null ||
frequency == null ||
if (frequency == null ||
strengthController
.text ==
"" ||
doseTime == null ||
duration == null ||
selectedDate == null ||
units == null) {
selectedDate == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
@ -1206,27 +1242,48 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// // .trim())
// // .toList()
// // .join(' '),
// dose:
// strengthController
// .text,
// doseUnit: units[
// 'parameterCode']
// .toString(),
// patient:
// widget.patient,
// dose: strengthController
// .text,
// doseUnit: model
// .itemMedicineListUnit
// .length ==
// 1
// ? model
// .itemMedicineListUnit[
// 0][
// 'parameterCode']
// .toString()
// : units['parameterCode']
// .toString(),
// patient: widget.patient,
// doseTimeIn:
// doseTime['id']
// .toString(),
// model: widget.model,
// duration:
// duration['id']
// .toString(),
// frequency: frequency[
// 'parameterCode']
// .toString(),
// route: route[
// 'parameterCode']
// duration: duration['id']
// .toString(),
// frequency: model
// .itemMedicineList
// .length ==
// 1
// ? model
// .itemMedicineList[
// 0][
// 'parameterCode']
// .toString()
// : frequency[
// 'parameterCode']
// .toString(),
// route: model.itemMedicineListRoute
// .length ==
// 1
// ? model
// .itemMedicineListRoute[
// 0][
// 'parameterCode']
// .toString()
// : route['parameterCode']
// .toString(),
// drugId:
// _selectedMedication
// .itemId
@ -1240,8 +1297,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// instruction:
// instructionController
// .text,
// doseTime:
// selectedDate,
// doseTime: selectedDate,
// );
}
}
@ -1350,7 +1406,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: [
DrugToDrug(
widget.patient,
getPriscriptionforDrug(widget.prescriptionList),
getPriscriptionforDrug(widget.prescriptionList, model),
model.patientAssessmentList),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
@ -1382,8 +1438,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTimeIn: doseTime['id'].toString(),
model: widget.model,
duration: duration['id'].toString(),
frequency: frequency['parameterCode'].toString(),
route: route['parameterCode'].toString(),
frequency: model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode']
: frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode']
: route['parameterCode'].toString(),
drugId: _selectedMedication.itemId.toString(),
strength: strengthController.text,
indication: indicationController.text,
@ -1431,7 +1491,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
});
}
getPriscriptionforDrug(List<PrescriptionModel> prescriptionList) {
// selectedValue(itemMdeicationList,key){
// // String selected = "";
// // units[key]=itemMdeicationList.length==1? itemMdeicationList[0][key]:units[key].toString();
// //
// // selected = units[key];
// //
// // return selected;
// // }
getPriscriptionforDrug(
List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
var prescriptionDetails = [];
if (prescriptionList.length > 0) {
prescriptionList[0].entityList.forEach((element) {
@ -1455,11 +1525,19 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
'DrugId': _selectedMedication.mediSpanGPICode,
'DrugName': _selectedMedication.description,
'Dose': strengthController.text,
'DoseType': units['parameterCode'].toString(),
'Unit': units['description'],
'FrequencyType': frequency['parameterCode'].toString(),
'DoseType': model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['parameterCode'].toString()
: units['parameterCode'].toString(),
'Unit': model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['description']
: units['description'],
'FrequencyType': model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode']
: frequency['parameterCode'].toString(),
'Duration': duration['id'].toString(),
'RouteID': route['parameterCode'].toString(),
'RouteID': model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString()
: route['parameterCode'].toString(),
'IsScreen': true
});
}

@ -303,7 +303,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 15,
),
if(isDischargedPatient)
if(isDischargedPatient && patient.dischargeDate!=null)
AppText(
"${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15,

@ -25,6 +25,7 @@ class AppTextFieldCustom extends StatefulWidget {
final List<TextInputFormatter> inputFormatters;
final Function(String) onChanged;
final String validationError;
final bool isPrscription;
AppTextFieldCustom({
this.height = 0,
@ -43,6 +44,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.inputFormatters,
this.onChanged,
this.validationError,
this.isPrscription = false,
});
@override
@ -57,7 +59,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
return Column(
children: [
Container(
height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null,
height: widget.height != 0 && widget.maxLines == 1
? widget.height + 8
: null,
decoration: widget.hasBorder
? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff),
@ -87,18 +91,23 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
AppText(
widget.hintText,
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.4,
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: TextField(
height:
widget.height != 0 && widget.maxLines == 1
? widget.height - 22
: null,
child: TextField(
textAlign: projectViewModel.isArabic
? TextAlign.right
: TextAlign.left,
decoration:
TextFieldsUtils.textFieldSelectorDecoration(
decoration: TextFieldsUtils
.textFieldSelectorDecoration(
widget.hintText, null, true),
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7,
@ -106,13 +115,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
color: Color(0xFF575757),
),
controller: widget.controller,
keyboardType: widget.inputType?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline),
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
: [],
inputFormatters:
widget.inputFormatters != null
? widget.inputFormatters
: [],
onChanged: (value) {
setState(() {});
if (widget.onChanged != null) {
@ -120,7 +133,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
}
},
),
)
)
: AppText(
widget.dropDownText,
fontFamily: 'Poppins',

@ -573,7 +573,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
version: "0.6.3-nullsafety.1"
json_annotation:
dependency: transitive
description:
@ -615,7 +615,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.4"
mime:
dependency: transitive
description:
@ -907,7 +907,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0-nullsafety.2"
sticky_headers:
dependency: "direct main"
description:
@ -1098,5 +1098,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0 <2.11.0"
dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save