Merge branch 'fix-issues' into 'development'

Prescription update filters

See merge request Cloud_Solution/doctor_app_flutter!332
merge-requests/333/merge
Mohammad Aljammal 4 years ago
commit 3a703da5d5

@ -424,6 +424,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
(selectedValue) { (selectedValue) {
setState(() { setState(() {
units = selectedValue; units = selectedValue;
units['isDefault'] =
true;
}); });
}, },
); );
@ -472,6 +474,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
route = selectedValue; route = selectedValue;
route['isDefault'] = true;
}); });
if (route == null) { if (route == null) {
helpers.showErrorToast( helpers.showErrorToast(
@ -519,6 +522,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
frequency = selectedValue; frequency = selectedValue;
frequency['isDefault'] =
true;
}); });
}, },
); );

@ -122,15 +122,16 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
await model.getMedicationRoute(); await model.getMedicationRoute();
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
//await model.getItem(itemID: widget.drugId); await model.getItem(itemID: widget.drugId);
//await model.getMedicationIndications(); //await model.getMedicationIndications();
route = model.getLookupById(model.medicationRouteList, widget.route); route = model.getLookupByIdFilter(
model.itemMedicineListRoute, widget.route);
doseTime = doseTime =
model.getLookupById(model.medicationDoseTimeList, widget.dose); model.getLookupById(model.medicationDoseTimeList, widget.dose);
updatedDuration = model.getLookupById( updatedDuration = model.getLookupById(
model.medicationDurationList, widget.duration); model.medicationDurationList, widget.duration);
units = model.getLookupById( units = model.getLookupByIdFilter(
model.medicationStrengthList, widget.doseUnit); model.itemMedicineListUnit, widget.doseUnit);
frequencyUpdate = model.getLookupById( frequencyUpdate = model.getLookupById(
model.medicationFrequencyList, widget.frequency); model.medicationFrequencyList, widget.frequency);
}, },
@ -300,7 +301,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
0.3700, 0.3700,
child: InkWell( child: InkWell(
onTap: onTap:
model.medicationStrengthList != model.itemMedicineListUnit !=
null null
? () { ? () {
Helpers.hideKeyboard( Helpers.hideKeyboard(
@ -309,11 +310,11 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
dialog = dialog =
ListSelectDialog( ListSelectDialog(
list: model list: model
.medicationStrengthList, .itemMedicineListUnit,
attributeName: attributeName:
'nameEn', 'description',
attributeValueId: attributeValueId:
'id', 'parameterCode',
okText: okText:
TranslationBase.of( TranslationBase.of(
context) context)
@ -343,7 +344,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
textFieldSelectorDecoration( textFieldSelectorDecoration(
'UNIT Type', 'UNIT Type',
units != null units != null
? units['nameEn'] ? units[
'description']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -361,15 +363,17 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
MediaQuery.of(context).size.height * MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationRouteList != null onTap: model.itemMedicineListRoute !=
null
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: list: model
model.medicationRouteList, .itemMedicineListRoute,
attributeName: 'nameEn', attributeName: 'description',
attributeValueId: 'id', attributeValueId:
'parameterCode',
okText: TranslationBase.of( okText: TranslationBase.of(
context) context)
.ok, .ok,
@ -397,7 +401,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
textFieldSelectorDecoration( textFieldSelectorDecoration(
'Route', 'Route',
route != null route != null
? route['nameEn'] ? route['description']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -737,7 +741,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
: widget : widget
.doseStreangth, .doseStreangth,
newUnit: units != null newUnit: units != null
? units['id'].toString() ? units['parameterCode']
.toString()
: widget.doseUnit, : widget.doseUnit,
doseUnit: widget.doseUnit, doseUnit: widget.doseUnit,
doseStreangth: doseStreangth:
@ -749,20 +754,22 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
routeId: widget.route, routeId: widget.route,
patient: widget.patient, patient: widget.patient,
model: widget.model, model: widget.model,
newDuration: updatedDuration != newDuration:
null updatedDuration != null
? updatedDuration['id'] ? updatedDuration['id']
.toString() .toString()
: widget.duration, : widget.duration,
drugId: widget.drugId, drugId: widget.drugId,
remarks: remarks: remarksController
remarksController.text, .text,
route: route != null route: route != null
? route['id'].toString() ? route['parameterCode']
.toString()
: widget.route, : widget.route,
frequency: frequencyUpdate != frequency:
null frequencyUpdate != null
? frequencyUpdate['id'] ? frequencyUpdate[
'id']
.toString() .toString()
: widget.frequency, : widget.frequency,
dose: doseTime != null dose: doseTime != null

Loading…
Cancel
Save