update prescription

merge-requests/331/head
hussam al-habibeh 5 years ago
parent bfe73ebe1d
commit 7063e924de

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

Loading…
Cancel
Save