|
|
|
@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
@ -107,6 +108,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
|
|
|
|
|
|
|
TextEditingController drugIdController = TextEditingController();
|
|
|
|
TextEditingController drugIdController = TextEditingController();
|
|
|
|
TextEditingController doseController = TextEditingController();
|
|
|
|
TextEditingController doseController = TextEditingController();
|
|
|
|
|
|
|
|
final searchController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var notesList;
|
|
|
|
|
|
|
|
var filteredNotesList;
|
|
|
|
|
|
|
|
String textSeartch = "Amoxicillin";
|
|
|
|
|
|
|
|
|
|
|
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
|
|
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
|
|
|
final double spaceBetweenTextFileds = 12;
|
|
|
|
final double spaceBetweenTextFileds = 12;
|
|
|
|
List<dynamic> referToList;
|
|
|
|
List<dynamic> referToList;
|
|
|
|
@ -165,6 +172,24 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
dynamic route7 = {"id": 27, "name": "In Both EYES"};
|
|
|
|
dynamic route7 = {"id": 27, "name": "In Both EYES"};
|
|
|
|
dynamic route8 = {"id": 28, "name": "In Both Ears"};
|
|
|
|
dynamic route8 = {"id": 28, "name": "In Both Ears"};
|
|
|
|
dynamic route9 = {"id": 32, "name": "Intramuscular"};
|
|
|
|
dynamic route9 = {"id": 32, "name": "Intramuscular"};
|
|
|
|
|
|
|
|
dynamic route10 = {"id": 60, "name": "TRANSDERMAL"};
|
|
|
|
|
|
|
|
dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"};
|
|
|
|
|
|
|
|
dynamic route12 = {"id": 15, "name": "for INJECTION"};
|
|
|
|
|
|
|
|
dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"};
|
|
|
|
|
|
|
|
dynamic route14 = {"id": 57, "name": "NASOGASTRIC"};
|
|
|
|
|
|
|
|
dynamic route15 = {"id": 56, "name": "IRRIGATION"};
|
|
|
|
|
|
|
|
dynamic route16 = {"id": 55, "name": "INTRAVITREAL"};
|
|
|
|
|
|
|
|
dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"};
|
|
|
|
|
|
|
|
dynamic route18 = {"id": 51, "name": "EPIDURAL"};
|
|
|
|
|
|
|
|
dynamic route19 = {"id": 47, "name": "Parenteral"};
|
|
|
|
|
|
|
|
dynamic route20 = {"id": 43, "name": "IM"};
|
|
|
|
|
|
|
|
dynamic route21 = {"id": 42, "name": "IV"};
|
|
|
|
|
|
|
|
dynamic route22 = {"id": 41, "name": "Sublingual"};
|
|
|
|
|
|
|
|
dynamic route23 = {"id": 40, "name": "For Nebulization"};
|
|
|
|
|
|
|
|
dynamic route24 = {"id": 39, "name": "Nasal"};
|
|
|
|
|
|
|
|
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
|
|
|
|
|
|
|
|
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
|
|
|
|
|
|
|
|
dynamic route27 = {"id": 31, "name": "In Each Nostril"};
|
|
|
|
dynamic frequency1 = {"id": 1, "name": "2 Times a day"};
|
|
|
|
dynamic frequency1 = {"id": 1, "name": "2 Times a day"};
|
|
|
|
dynamic frequency2 = {"id": 2, "name": "3 Times a day"};
|
|
|
|
dynamic frequency2 = {"id": 2, "name": "3 Times a day"};
|
|
|
|
dynamic frequency3 = {"id": 3, "name": "4 Times a day"};
|
|
|
|
dynamic frequency3 = {"id": 3, "name": "4 Times a day"};
|
|
|
|
@ -258,6 +283,24 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
routeList.add(route7);
|
|
|
|
routeList.add(route7);
|
|
|
|
routeList.add(route8);
|
|
|
|
routeList.add(route8);
|
|
|
|
routeList.add(route9);
|
|
|
|
routeList.add(route9);
|
|
|
|
|
|
|
|
routeList.add(route10);
|
|
|
|
|
|
|
|
routeList.add(route11);
|
|
|
|
|
|
|
|
routeList.add(route12);
|
|
|
|
|
|
|
|
routeList.add(route13);
|
|
|
|
|
|
|
|
routeList.add(route14);
|
|
|
|
|
|
|
|
routeList.add(route15);
|
|
|
|
|
|
|
|
routeList.add(route16);
|
|
|
|
|
|
|
|
routeList.add(route17);
|
|
|
|
|
|
|
|
routeList.add(route18);
|
|
|
|
|
|
|
|
routeList.add(route19);
|
|
|
|
|
|
|
|
routeList.add(route20);
|
|
|
|
|
|
|
|
routeList.add(route21);
|
|
|
|
|
|
|
|
routeList.add(route22);
|
|
|
|
|
|
|
|
routeList.add(route23);
|
|
|
|
|
|
|
|
routeList.add(route24);
|
|
|
|
|
|
|
|
routeList.add(route25);
|
|
|
|
|
|
|
|
routeList.add(route26);
|
|
|
|
|
|
|
|
routeList.add(route27);
|
|
|
|
strengthList.add(strength1);
|
|
|
|
strengthList.add(strength1);
|
|
|
|
strengthList.add(strength2);
|
|
|
|
strengthList.add(strength2);
|
|
|
|
strengthList.add(strength3);
|
|
|
|
strengthList.add(strength3);
|
|
|
|
@ -295,12 +338,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
ListSelectDialog drugDialog;
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
// final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
// final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
// patient = routeArgs['patient'];
|
|
|
|
// patient = routeArgs['patient'];
|
|
|
|
|
|
|
|
|
|
|
|
return BaseView<PrescriptionViewModel>(
|
|
|
|
return BaseView<PrescriptionViewModel>(
|
|
|
|
onModelReady: (model) => model.getDrugs(),
|
|
|
|
onModelReady: (model) => model.getDrugs(drugName: textSeartch),
|
|
|
|
builder:
|
|
|
|
builder:
|
|
|
|
(BuildContext context, PrescriptionViewModel model, Widget child) =>
|
|
|
|
(BuildContext context, PrescriptionViewModel model, Widget child) =>
|
|
|
|
NetworkBaseView(
|
|
|
|
NetworkBaseView(
|
|
|
|
@ -339,7 +383,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
onTap: model.drugsList != null &&
|
|
|
|
onTap: model.drugsList != null &&
|
|
|
|
model.drugsList.length > 0
|
|
|
|
model.drugsList.length > 0
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
return drugDialog =
|
|
|
|
ListSelectDialog(
|
|
|
|
ListSelectDialog(
|
|
|
|
list: model.drugsList,
|
|
|
|
list: model.drugsList,
|
|
|
|
attributeName: 'GenericName',
|
|
|
|
attributeName: 'GenericName',
|
|
|
|
@ -352,17 +396,121 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
selectedDrug = selectedValue;
|
|
|
|
selectedDrug = selectedValue;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
/* searchWidget: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
decoration: Helpers
|
|
|
|
|
|
|
|
.textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.search,
|
|
|
|
|
|
|
|
searchController.text !=
|
|
|
|
|
|
|
|
null &&
|
|
|
|
|
|
|
|
searchController
|
|
|
|
|
|
|
|
.text !=
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
|
|
? searchController
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onChanged: (String str) {
|
|
|
|
|
|
|
|
textSeartch = str;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
controller:
|
|
|
|
|
|
|
|
searchController,
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
child: Icon(
|
|
|
|
|
|
|
|
Icons.search,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
|
|
|
.pop();
|
|
|
|
|
|
|
|
await searchMedicine(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
model,
|
|
|
|
|
|
|
|
textSeartch);
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
|
|
|
barrierDismissible:
|
|
|
|
|
|
|
|
false,
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
builder: (BuildContext
|
|
|
|
|
|
|
|
context) {
|
|
|
|
|
|
|
|
return drugDialog;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(
|
|
|
|
|
|
|
|
horizontal: 8),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),*/
|
|
|
|
);
|
|
|
|
);
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return drugDialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
decoration: Helpers
|
|
|
|
|
|
|
|
.textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.search,
|
|
|
|
|
|
|
|
searchController.text != null &&
|
|
|
|
|
|
|
|
searchController.text !=
|
|
|
|
|
|
|
|
""
|
|
|
|
|
|
|
|
? searchController.text
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onChanged: (String str) {
|
|
|
|
|
|
|
|
textSeartch = str;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
controller: searchController,
|
|
|
|
|
|
|
|
enabled: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
child: Icon(
|
|
|
|
|
|
|
|
Icons.search,
|
|
|
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
// Navigator.of(context)
|
|
|
|
|
|
|
|
// .pop();
|
|
|
|
|
|
|
|
await searchMedicine(
|
|
|
|
|
|
|
|
context, model, textSeartch);
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
|
|
|
return drugDialog;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
|
|
|
|
horizontal: 8),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
), /*TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context)
|
|
|
|
.searchMedicine,
|
|
|
|
.searchMedicine,
|
|
|
|
@ -374,8 +522,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
Icons.search,
|
|
|
|
Icons.search,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
enabled: false,
|
|
|
|
enabled: true,
|
|
|
|
),
|
|
|
|
),*/
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -808,9 +956,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
.addMedication,
|
|
|
|
.addMedication,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
formKey.currentState.save();
|
|
|
|
// formKey.currentState.save();
|
|
|
|
Navigator.pop(context);
|
|
|
|
// Navigator.pop(context);
|
|
|
|
openDrugToDrug();
|
|
|
|
// openDrugToDrug();
|
|
|
|
if (strength == null ||
|
|
|
|
if (strength == null ||
|
|
|
|
route == null ||
|
|
|
|
route == null ||
|
|
|
|
frequency == null ||
|
|
|
|
frequency == null ||
|
|
|
|
@ -945,4 +1093,41 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// searchData(String str, PrescriptionViewModel model) {
|
|
|
|
|
|
|
|
// var strExist = str.length > 0 ? true : false;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (strExist) {
|
|
|
|
|
|
|
|
// filteredNotesList = null;
|
|
|
|
|
|
|
|
// filteredNotesList = model.drugsList
|
|
|
|
|
|
|
|
// .where((note) =>
|
|
|
|
|
|
|
|
// note["GenericName"].toString().contains(str.toUpperCase()))
|
|
|
|
|
|
|
|
// .toList();
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// notesList = filteredNotesList;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// notesList = model.drugsList;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchMedicine(context, PrescriptionViewModel model, String str) async {
|
|
|
|
|
|
|
|
FocusScope.of(context).unfocus();
|
|
|
|
|
|
|
|
// if (searchController.text.isEmpty()) {
|
|
|
|
|
|
|
|
// helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
|
|
|
|
|
|
|
|
// //"Type Medicine Name")
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
if (searchController.text.length < 0) {
|
|
|
|
|
|
|
|
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await model.getDrugs(drugName: searchController.text);
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|