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

Loading…
Cancel
Save