Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan-patientapp

merge-update-with-lab-changes
Sultan Khan 5 years ago
commit 3c2539d5b9

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
//const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -471,6 +471,8 @@ const GET_ANCILLARY_ORDERS_DETAILS =
//Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
// pharmacy
const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
@ -592,8 +594,6 @@ const FILTERED_PRODUCTS = 'products?categoryids=';
const GET_DOCTOR_LIST_CALCULATION =
"Services/Doctors.svc/REST/GetCallculationDoctors";
const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
class AppGlobal {
static var context;

@ -42,39 +42,39 @@ final _mobileFormatter = NumberTextInputFormatter();
class NewTextFields extends StatefulWidget {
NewTextFields(
{Key key,
this.type,
this.hintText,
this.suffixIcon,
this.autoFocus,
this.onChanged,
this.initialValue,
this.minLines,
this.maxLines,
this.inputFormatters,
this.padding,
this.focus = false,
this.maxLengthEnforced = true,
this.suffixIconColor,
this.inputAction,
this.onSubmit,
this.keepPadding = true,
this.textCapitalization = TextCapitalization.none,
this.controller,
this.keyboardType,
this.validator,
this.borderOnlyError = false,
this.onSaved,
this.onSuffixTap,
this.readOnly: false,
this.maxLength,
this.prefixIcon,
this.bare = false,
this.onTap,
this.fontSize = 16.0,
this.fontWeight = FontWeight.w700,
this.autoValidate = false,
this.hintColor,
this.isEnabled = true,this.counterText=""})
this.type,
this.hintText,
this.suffixIcon,
this.autoFocus,
this.onChanged,
this.initialValue,
this.minLines,
this.maxLines,
this.inputFormatters,
this.padding,
this.focus = false,
this.maxLengthEnforced = true,
this.suffixIconColor,
this.inputAction,
this.onSubmit,
this.keepPadding = true,
this.textCapitalization = TextCapitalization.none,
this.controller,
this.keyboardType,
this.validator,
this.borderOnlyError = false,
this.onSaved,
this.onSuffixTap,
this.readOnly: false,
this.maxLength,
this.prefixIcon,
this.bare = false,
this.onTap,
this.fontSize = 16.0,
this.fontWeight = FontWeight.w700,
this.autoValidate = false,
this.hintColor,
this.isEnabled = true,this.counterText=""})
: super(key: key);
final String hintText;
@ -171,10 +171,10 @@ class _NewTextFieldsState extends State<NewTextFields> {
textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null
? widget.onSubmit
: (val) {
_focusNode.nextFocus();
})
? widget.onSubmit
: (val) {
_focusNode.nextFocus();
})
: widget.onSubmit,
textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1,
@ -194,15 +194,15 @@ class _NewTextFieldsState extends State<NewTextFields> {
fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter,
]
WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter,
]
: widget.inputFormatters,
decoration: InputDecoration(
labelText: widget.hintText,
counterText: widget.counterText,
labelStyle:
TextStyle(color: Theme.of(context).textTheme.bodyText1.color),
TextStyle(color: Theme.of(context).textTheme.bodyText1.color),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).errorColor.withOpacity(0.5),

@ -27,13 +27,13 @@ class AddWeightPage extends StatefulWidget {
AddWeightPage(
{Key key,
this.model,
this.isUpdate = false,
this.dayWeightDate,
this.lineItemNo,
this.weightValue,
this.measureTimeSelectedType,
this.weightUnit})
this.model,
this.isUpdate = false,
this.dayWeightDate,
this.lineItemNo,
this.weightValue,
this.measureTimeSelectedType,
this.weightUnit})
: super(key: key);
@override
@ -79,39 +79,39 @@ class _AddWeightPageState extends State<AddWeightPage> {
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.deleteWeightResult(lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.deleteWeightResult(lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
@ -246,12 +246,12 @@ class _AddWeightPageState extends State<AddWeightPage> {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.updateWeightResult(
weightDate:
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured:
_weightValueController.text.toString(),
weightUnit: weightUnit,
lineItemNo: widget.lineItemNo)
weightDate:
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured:
_weightValueController.text.toString(),
weightUnit: weightUnit,
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
@ -263,7 +263,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
widget.model
.addWeightResult(
weightDate:
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
)

@ -27,13 +27,13 @@ class AddBloodPressurePage extends StatefulWidget {
const AddBloodPressurePage(
{Key key,
this.bloodSugarDate,
this.measureTimeSelectedType,
this.isUpdate = false,
this.lineItemNo,
this.model,
this.bloodSystolicValue,
this.bloodDiastolicValue})
this.bloodSugarDate,
this.measureTimeSelectedType,
this.isUpdate = false,
this.lineItemNo,
this.model,
this.bloodSystolicValue,
this.bloodDiastolicValue})
: super(key: key);
@override
@ -42,10 +42,12 @@ class AddBloodPressurePage extends StatefulWidget {
class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodSystolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController =
TextEditingController();
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
int measuredArm = 1;
bool isButtonDisabled = false;
final List<String> measureTimeEnList = [
'Left',
'Right',
@ -69,6 +71,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
_bloodSystolicValueController.text = widget.bloodSystolicValue;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue;
validateForm();
}
}
@ -78,38 +81,44 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold(
isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
appBarTitle: widget.isUpdate
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.deactivateDiabeticStatus(
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
@ -124,6 +133,8 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
hintText: TranslationBase.of(context).systolicAdd,
controller: _bloodSystolicValueController,
keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
@ -132,19 +143,25 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
hintText: TranslationBase.of(context).diastolicAdd,
controller: _bloodDiastolicValueController,
keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList);
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureTimeEnList
: measureTimeArList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -166,18 +183,22 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) {
setState(
() {
bloodSugarDate = date;
setState(
() {
bloodSugarDate = date;
},
);
},
);
}, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
currentTime: bloodSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -192,22 +213,30 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
),
InkWell(
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
setState(
() {
timeSugarDate = date;
DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) {
setState(
() {
timeSugarDate = date;
},
);
},
);
}, currentTime: timeSugarDate, locale: projectViewModel.localeType);
currentTime: timeSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
),
),
),
@ -225,17 +254,23 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white,
color: isButtonDisabled
? Colors.grey[900]
: Colors.grey,
onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
if (_bloodSystolicValueController.text.isNotEmpty &&
_bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.addORUpdateDiabtecResult(
isUpdate: widget.isUpdate,
bloodPressureDate:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(),
systolicePressure: _bloodSystolicValueController.text.toString(),
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure:
_bloodDiastolicValueController.text.toString(),
systolicePressure:
_bloodSystolicValueController.text.toString(),
measuredArm: measuredArm,
)
.then((value) {
@ -275,9 +310,43 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
setState(() {
measureTimeSelectedType = value;
measuredArm = list.indexOf(value);
validateForm();
});
},
),
);
}
void validateForm() {
print("_bloodSystolicValueController "+_bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) {
setState(() {
isButtonDisabled = true;
});
} else {
setState(() {
isButtonDisabled = false;
});
}
// if(measureTimeSelectedType == 'Left Arm'){
// setState(() {
// isButtonDisabled = false;
// });
// }else if(_bloodSystolicValueController.text.length < 0){
// setState(() {
// isButtonDisabled = false;
// });
// }else if(_bloodDiastolicValueController.text.length < 0){
// setState(() {
// isButtonDisabled = false;
// });
// }else{
// setState(() {
// isButtonDisabled = true;
// });
// }
}
}

@ -27,13 +27,13 @@ class AddBloodSugarPage extends StatefulWidget {
AddBloodSugarPage(
{Key key,
this.bloodSugarDate,
this.measureUnitSelectedType,
this.isUpdate = false,
this.measuredTime,
this.bloodSugarValue,
this.lineItemNo,
this.bloodSugarViewMode})
this.bloodSugarDate,
this.measureUnitSelectedType,
this.isUpdate = false,
this.measuredTime,
this.bloodSugarValue,
this.lineItemNo,
this.bloodSugarViewMode})
: super(key: key);
@override
@ -99,42 +99,42 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
? [
IconButton(
icon: Icon(Icons.delete),
color: Colors.white,
onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode
.deactivateDiabeticStatus(
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode
.deactivateDiabeticStatus(
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal)
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
@ -186,10 +186,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) {
setState(() {
bloodSugarDate = date;
});
},
setState(() {
bloodSugarDate = date;
});
},
currentTime: bloodSugarDate,
locale: projectViewModel.localeType);
},
@ -216,10 +216,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) {
setState(() {
timeSugarDate = date;
});
},
setState(() {
timeSugarDate = date;
});
},
currentTime: timeSugarDate,
locale: projectViewModel.localeType);
},
@ -288,13 +288,13 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode
.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult:
_bloodSugarValueController.text.toString())
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult:
_bloodSugarValueController.text.toString())
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state ==
@ -310,9 +310,9 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
bloodSugerResult:
_bloodSugarValueController.text.toString(),
_bloodSugarValueController.text.toString(),
bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);

Loading…
Cancel
Save