|
|
|
@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
@ -36,6 +37,7 @@ class UpdatePrescriptionForm extends StatefulWidget {
|
|
|
|
final String startDate;
|
|
|
|
final String startDate;
|
|
|
|
final String frequency;
|
|
|
|
final String frequency;
|
|
|
|
final String drugNameGeneric;
|
|
|
|
final String drugNameGeneric;
|
|
|
|
|
|
|
|
|
|
|
|
final PrescriptionViewModel model;
|
|
|
|
final PrescriptionViewModel model;
|
|
|
|
|
|
|
|
|
|
|
|
UpdatePrescriptionForm(
|
|
|
|
UpdatePrescriptionForm(
|
|
|
|
@ -71,14 +73,44 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
GetMedicationResponseModel newSelectedMedication;
|
|
|
|
GetMedicationResponseModel newSelectedMedication;
|
|
|
|
GlobalKey key =
|
|
|
|
GlobalKey key =
|
|
|
|
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
|
|
|
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
|
|
|
|
|
|
|
List<dynamic> indicationList;
|
|
|
|
|
|
|
|
dynamic indication;
|
|
|
|
|
|
|
|
DateTime selectedDate;
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
remarksController.text = widget.remarks;
|
|
|
|
|
|
|
|
indicationList = List();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
|
|
|
|
|
|
|
|
dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"};
|
|
|
|
|
|
|
|
dynamic indication3 = {"id": 547, "name": "Hypertrichosis"};
|
|
|
|
|
|
|
|
dynamic indication4 = {"id": 548, "name": "Mild Dizziness"};
|
|
|
|
|
|
|
|
dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"};
|
|
|
|
|
|
|
|
dynamic indication6 = {
|
|
|
|
|
|
|
|
"id": 550,
|
|
|
|
|
|
|
|
"name": "Phenytoin Hypersensitivity Syndrome"
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
dynamic indication7 = {"id": 551, "name": "Asterixis"};
|
|
|
|
|
|
|
|
dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"};
|
|
|
|
|
|
|
|
dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"};
|
|
|
|
|
|
|
|
dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
indicationList.add(indication1);
|
|
|
|
|
|
|
|
indicationList.add(indication2);
|
|
|
|
|
|
|
|
indicationList.add(indication3);
|
|
|
|
|
|
|
|
indicationList.add(indication4);
|
|
|
|
|
|
|
|
indicationList.add(indication5);
|
|
|
|
|
|
|
|
indicationList.add(indication6);
|
|
|
|
|
|
|
|
indicationList.add(indication7);
|
|
|
|
|
|
|
|
indicationList.add(indication8);
|
|
|
|
|
|
|
|
indicationList.add(indication9);
|
|
|
|
|
|
|
|
indicationList.add(indication10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
return StatefulBuilder(builder:
|
|
|
|
return StatefulBuilder(builder:
|
|
|
|
(BuildContext context, StateSetter setState /*You can rename this!*/) {
|
|
|
|
(BuildContext context, StateSetter setState /*You can rename this!*/) {
|
|
|
|
return BaseView<MedicineViewModel>(
|
|
|
|
return BaseView<MedicineViewModel>(
|
|
|
|
@ -109,13 +141,14 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: DraggableScrollableSheet(
|
|
|
|
child: DraggableScrollableSheet(
|
|
|
|
initialChildSize: 0.95,
|
|
|
|
initialChildSize: 0.98,
|
|
|
|
maxChildSize: 0.99,
|
|
|
|
maxChildSize: 0.99,
|
|
|
|
minChildSize: 0.6,
|
|
|
|
minChildSize: 0.6,
|
|
|
|
builder:
|
|
|
|
builder:
|
|
|
|
(BuildContext context, ScrollController scrollController) {
|
|
|
|
(BuildContext context, ScrollController scrollController) {
|
|
|
|
return Container(
|
|
|
|
return SingleChildScrollView(
|
|
|
|
height: MediaQuery.of(context).size.height * 1.3,
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: MediaQuery.of(context).size.height * 2.0,
|
|
|
|
child: Form(
|
|
|
|
child: Form(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
@ -205,28 +238,33 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
// height: 12,
|
|
|
|
// height: 12,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
height:
|
|
|
|
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
0.060,
|
|
|
|
0.060,
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width:
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
MediaQuery.of(context).size.width *
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
0.4900,
|
|
|
|
0.4900,
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
.size
|
|
|
|
|
|
|
|
.height *
|
|
|
|
0.55,
|
|
|
|
0.55,
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
inputFormatters: [
|
|
|
|
inputFormatters: [
|
|
|
|
LengthLimitingTextInputFormatter(4),
|
|
|
|
LengthLimitingTextInputFormatter(
|
|
|
|
|
|
|
|
4),
|
|
|
|
WhitelistingTextInputFormatter
|
|
|
|
WhitelistingTextInputFormatter
|
|
|
|
.digitsOnly
|
|
|
|
.digitsOnly
|
|
|
|
],
|
|
|
|
],
|
|
|
|
hintText: widget.doseStreangth,
|
|
|
|
hintText: widget.doseStreangth,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
controller: strengthController,
|
|
|
|
controller: strengthController,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType:
|
|
|
|
|
|
|
|
TextInputType.number,
|
|
|
|
onChanged: (String value) {
|
|
|
|
onChanged: (String value) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
strengthChar = value.length;
|
|
|
|
strengthChar = value.length;
|
|
|
|
@ -251,35 +289,45 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
width: 10.0,
|
|
|
|
width: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width:
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
MediaQuery.of(context).size.width *
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
0.3700,
|
|
|
|
0.3700,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: model.medicationStrengthList !=
|
|
|
|
onTap:
|
|
|
|
|
|
|
|
model.medicationStrengthList !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
context);
|
|
|
|
|
|
|
|
ListSelectDialog
|
|
|
|
|
|
|
|
dialog =
|
|
|
|
ListSelectDialog(
|
|
|
|
ListSelectDialog(
|
|
|
|
list: model
|
|
|
|
list: model
|
|
|
|
.medicationStrengthList,
|
|
|
|
.medicationStrengthList,
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeName:
|
|
|
|
attributeValueId: 'id',
|
|
|
|
'nameEn',
|
|
|
|
okText: TranslationBase.of(
|
|
|
|
attributeValueId:
|
|
|
|
|
|
|
|
'id',
|
|
|
|
|
|
|
|
okText:
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
context)
|
|
|
|
context)
|
|
|
|
.ok,
|
|
|
|
.ok,
|
|
|
|
okFunction:
|
|
|
|
okFunction:
|
|
|
|
(selectedValue) {
|
|
|
|
(selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
units = selectedValue;
|
|
|
|
units =
|
|
|
|
|
|
|
|
selectedValue;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible:
|
|
|
|
|
|
|
|
false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder:
|
|
|
|
builder:
|
|
|
|
(BuildContext context) {
|
|
|
|
(BuildContext
|
|
|
|
|
|
|
|
context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -304,7 +352,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
height: 12,
|
|
|
|
height: 12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
height:
|
|
|
|
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
0.070,
|
|
|
|
0.070,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: model.medicationRouteList != null
|
|
|
|
onTap: model.medicationRouteList != null
|
|
|
|
@ -312,11 +361,12 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog(
|
|
|
|
ListSelectDialog(
|
|
|
|
list: model.medicationRouteList,
|
|
|
|
list:
|
|
|
|
|
|
|
|
model.medicationRouteList,
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
okText:
|
|
|
|
okText: TranslationBase.of(
|
|
|
|
TranslationBase.of(context)
|
|
|
|
context)
|
|
|
|
.ok,
|
|
|
|
.ok,
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
@ -330,14 +380,16 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
'Route',
|
|
|
|
'Route',
|
|
|
|
route != null
|
|
|
|
route != null
|
|
|
|
? route['nameEn']
|
|
|
|
? route['nameEn']
|
|
|
|
@ -351,20 +403,22 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
height:
|
|
|
|
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
0.070,
|
|
|
|
0.070,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: model.medicationDoseTimeList != null
|
|
|
|
onTap: model.medicationDoseTimeList !=
|
|
|
|
|
|
|
|
null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog(
|
|
|
|
ListSelectDialog(
|
|
|
|
list:
|
|
|
|
list: model
|
|
|
|
model.medicationDoseTimeList,
|
|
|
|
.medicationDoseTimeList,
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
okText:
|
|
|
|
okText: TranslationBase.of(
|
|
|
|
TranslationBase.of(context)
|
|
|
|
context)
|
|
|
|
.ok,
|
|
|
|
.ok,
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
@ -375,15 +429,18 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration:
|
|
|
|
TranslationBase.of(context).doseTime,
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.doseTime,
|
|
|
|
doseTime != null
|
|
|
|
doseTime != null
|
|
|
|
? doseTime['nameEn']
|
|
|
|
? doseTime['nameEn']
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
@ -396,20 +453,22 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
height:
|
|
|
|
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
0.070,
|
|
|
|
0.070,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: model.medicationFrequencyList != null
|
|
|
|
onTap: model.medicationFrequencyList !=
|
|
|
|
|
|
|
|
null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog(
|
|
|
|
ListSelectDialog(
|
|
|
|
list:
|
|
|
|
list: model
|
|
|
|
model.medicationFrequencyList,
|
|
|
|
.medicationFrequencyList,
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
okText:
|
|
|
|
okText: TranslationBase.of(
|
|
|
|
TranslationBase.of(context)
|
|
|
|
context)
|
|
|
|
.ok,
|
|
|
|
.ok,
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
@ -421,17 +480,21 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration:
|
|
|
|
TranslationBase.of(context).frequency,
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.frequency,
|
|
|
|
frequencyUpdate != null
|
|
|
|
frequencyUpdate != null
|
|
|
|
? frequencyUpdate['nameEn']
|
|
|
|
? frequencyUpdate[
|
|
|
|
|
|
|
|
'nameEn']
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
true),
|
|
|
|
true),
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
@ -442,20 +505,22 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
height:
|
|
|
|
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
0.070,
|
|
|
|
0.070,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: model.medicationDurationList != null
|
|
|
|
onTap: model.medicationDurationList !=
|
|
|
|
|
|
|
|
null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
ListSelectDialog(
|
|
|
|
ListSelectDialog(
|
|
|
|
list:
|
|
|
|
list: model
|
|
|
|
model.medicationDurationList,
|
|
|
|
.medicationDurationList,
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeName: 'nameEn',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
okText:
|
|
|
|
okText: TranslationBase.of(
|
|
|
|
TranslationBase.of(context)
|
|
|
|
context)
|
|
|
|
.ok,
|
|
|
|
.ok,
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
@ -467,17 +532,21 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration:
|
|
|
|
TranslationBase.of(context).duration,
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.duration,
|
|
|
|
updatedDuration != null
|
|
|
|
updatedDuration != null
|
|
|
|
? updatedDuration['nameEn']
|
|
|
|
? updatedDuration[
|
|
|
|
|
|
|
|
'nameEn']
|
|
|
|
.toString()
|
|
|
|
.toString()
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
true),
|
|
|
|
true),
|
|
|
|
@ -488,6 +557,106 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
|
|
|
|
0.29,
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
|
|
|
? () {
|
|
|
|
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
model.patientAssessmentList
|
|
|
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
|
|
|
? model
|
|
|
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.icdCode10ID
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: '',
|
|
|
|
|
|
|
|
indication != null
|
|
|
|
|
|
|
|
? indication['name']
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
true),
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
|
|
|
|
0.61,
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
|
|
|
? () {
|
|
|
|
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
|
|
|
|
context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
maxLines: 3,
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
model.patientAssessmentList
|
|
|
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
|
|
|
? model
|
|
|
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
|
|
|
0]
|
|
|
|
|
|
|
|
.asciiDesc
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: '',
|
|
|
|
|
|
|
|
indication != null
|
|
|
|
|
|
|
|
? indication['name']
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
true),
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 12.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: () =>
|
|
|
|
|
|
|
|
selectDate(context, widget.model),
|
|
|
|
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
decoration: Helpers
|
|
|
|
|
|
|
|
.textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
widget.startDate,
|
|
|
|
|
|
|
|
selectedDate != null
|
|
|
|
|
|
|
|
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
true,
|
|
|
|
|
|
|
|
suffixIcon: Icon(
|
|
|
|
|
|
|
|
Icons.calendar_today,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
enabled: false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 12.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
@ -496,18 +665,18 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText: widget.remarks,
|
|
|
|
|
|
|
|
controller: remarksController,
|
|
|
|
controller: remarksController,
|
|
|
|
maxLines: 7,
|
|
|
|
maxLines: 7,
|
|
|
|
minLines: 4,
|
|
|
|
minLines: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 12.0,
|
|
|
|
height: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height:
|
|
|
|
height:
|
|
|
|
MediaQuery.of(context).size.height * 0.12,
|
|
|
|
MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.08,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
@ -516,22 +685,24 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppButton(
|
|
|
|
AppButton(
|
|
|
|
title:
|
|
|
|
title: 'update prescription'
|
|
|
|
'update prescription'.toUpperCase(),
|
|
|
|
.toUpperCase(),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
updatePrescription(
|
|
|
|
updatePrescription(
|
|
|
|
|
|
|
|
newStartDate: selectedDate,
|
|
|
|
newDoseStreangth:
|
|
|
|
newDoseStreangth:
|
|
|
|
strengthController
|
|
|
|
strengthController
|
|
|
|
.text.isNotEmpty
|
|
|
|
.text.isNotEmpty
|
|
|
|
? strengthController.text
|
|
|
|
? strengthController
|
|
|
|
: widget.doseStreangth,
|
|
|
|
.text
|
|
|
|
newUnit: units !=
|
|
|
|
: widget
|
|
|
|
null
|
|
|
|
.doseStreangth,
|
|
|
|
|
|
|
|
newUnit: units != null
|
|
|
|
? units['id'].toString()
|
|
|
|
? units['id'].toString()
|
|
|
|
: widget.doseUnit,
|
|
|
|
: widget.doseUnit,
|
|
|
|
doseUnit: widget.doseUnit,
|
|
|
|
doseUnit: widget.doseUnit,
|
|
|
|
doseStreangth: widget
|
|
|
|
doseStreangth:
|
|
|
|
.doseStreangth,
|
|
|
|
widget.doseStreangth,
|
|
|
|
duration: widget.duration,
|
|
|
|
duration: widget.duration,
|
|
|
|
startDate: widget.startDate,
|
|
|
|
startDate: widget.startDate,
|
|
|
|
doseId: widget.dose,
|
|
|
|
doseId: widget.dose,
|
|
|
|
@ -539,27 +710,25 @@ 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[
|
|
|
|
? updatedDuration['id']
|
|
|
|
'id']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
.toString()
|
|
|
|
: widget.duration,
|
|
|
|
: widget.duration,
|
|
|
|
drugId: widget.drugId,
|
|
|
|
drugId: widget.drugId,
|
|
|
|
remarks: remarksController.text,
|
|
|
|
remarks:
|
|
|
|
route: route !=
|
|
|
|
remarksController.text,
|
|
|
|
null
|
|
|
|
route: route != null
|
|
|
|
? route['id'].toString()
|
|
|
|
? route['id'].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['id'].toString()
|
|
|
|
? doseTime['id']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
: widget.dose,
|
|
|
|
: widget.dose,
|
|
|
|
enteredRemarks:
|
|
|
|
enteredRemarks:
|
|
|
|
widget.enteredRemarks);
|
|
|
|
widget.enteredRemarks);
|
|
|
|
@ -574,7 +743,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
));
|
|
|
|
)),
|
|
|
|
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -582,6 +752,24 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectDate(BuildContext context, PrescriptionViewModel model) async {
|
|
|
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
|
|
|
DateTime selectedDate;
|
|
|
|
|
|
|
|
selectedDate = DateTime.now();
|
|
|
|
|
|
|
|
final DateTime picked = await showDatePicker(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
initialDate: selectedDate,
|
|
|
|
|
|
|
|
firstDate: DateTime.now(),
|
|
|
|
|
|
|
|
lastDate: DateTime(2040),
|
|
|
|
|
|
|
|
initialEntryMode: DatePickerEntryMode.calendar,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if (picked != null && picked != selectedDate) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
this.selectedDate = picked;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
InputDecoration textFieldSelectorDecoration(
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
{Icon suffixIcon}) {
|
|
|
|
{Icon suffixIcon}) {
|
|
|
|
@ -626,6 +814,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
String route,
|
|
|
|
String route,
|
|
|
|
String routeId,
|
|
|
|
String routeId,
|
|
|
|
String startDate,
|
|
|
|
String startDate,
|
|
|
|
|
|
|
|
DateTime newStartDate,
|
|
|
|
String doseUnit,
|
|
|
|
String doseUnit,
|
|
|
|
String doseStreangth,
|
|
|
|
String doseStreangth,
|
|
|
|
String newDoseStreangth,
|
|
|
|
String newDoseStreangth,
|
|
|
|
@ -664,7 +853,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
duration: newDuration.isNotEmpty
|
|
|
|
duration: newDuration.isNotEmpty
|
|
|
|
? int.parse(newDuration)
|
|
|
|
? int.parse(newDuration)
|
|
|
|
: int.parse(duration),
|
|
|
|
: int.parse(duration),
|
|
|
|
doseStartDate: startDate));
|
|
|
|
doseStartDate:
|
|
|
|
|
|
|
|
newStartDate != null ? newStartDate.toIso8601String() : startDate));
|
|
|
|
updatePrescriptionReqModel.prescriptionRequestModel = sss;
|
|
|
|
updatePrescriptionReqModel.prescriptionRequestModel = sss;
|
|
|
|
//postProcedureReqModel.procedures = controlsProcedure;
|
|
|
|
//postProcedureReqModel.procedures = controlsProcedure;
|
|
|
|
|
|
|
|
|
|
|
|
|