|
|
@ -22,6 +22,7 @@ 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/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:flutter/services.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class NewPrescriptionScreen extends StatefulWidget {
|
|
|
|
class NewPrescriptionScreen extends StatefulWidget {
|
|
|
@ -32,15 +33,21 @@ class NewPrescriptionScreen extends StatefulWidget {
|
|
|
|
class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
PersistentBottomSheetController _controller;
|
|
|
|
PersistentBottomSheetController _controller;
|
|
|
|
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
|
|
|
|
TextEditingController strengthController = TextEditingController();
|
|
|
|
int testNum = 0;
|
|
|
|
int testNum = 0;
|
|
|
|
|
|
|
|
int strengthChar;
|
|
|
|
PatiantInformtion patient;
|
|
|
|
PatiantInformtion patient;
|
|
|
|
dynamic route;
|
|
|
|
dynamic route;
|
|
|
|
dynamic doseTime;
|
|
|
|
dynamic doseTime;
|
|
|
|
dynamic frequencyUpdate;
|
|
|
|
dynamic frequencyUpdate;
|
|
|
|
|
|
|
|
dynamic updatedDuration;
|
|
|
|
|
|
|
|
dynamic units;
|
|
|
|
|
|
|
|
|
|
|
|
List<dynamic> doseTimeList;
|
|
|
|
List<dynamic> doseTimeList;
|
|
|
|
List<dynamic> routeList;
|
|
|
|
List<dynamic> routeList;
|
|
|
|
List<dynamic> frequencyList;
|
|
|
|
List<dynamic> frequencyList;
|
|
|
|
|
|
|
|
List<dynamic> durationList;
|
|
|
|
|
|
|
|
List<dynamic> unitsList;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
@ -48,7 +55,12 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
routeList = List();
|
|
|
|
routeList = List();
|
|
|
|
doseTimeList = List();
|
|
|
|
doseTimeList = List();
|
|
|
|
frequencyList = List();
|
|
|
|
frequencyList = List();
|
|
|
|
|
|
|
|
durationList = List();
|
|
|
|
|
|
|
|
unitsList = List();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dynamic unit1 = {"id": 1, "name": "MG"};
|
|
|
|
|
|
|
|
dynamic unit2 = {"id": 2, "name": "MCG"};
|
|
|
|
|
|
|
|
dynamic unit3 = {"id": 3, "name": "GM"};
|
|
|
|
dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
|
|
|
|
dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
|
|
|
|
dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
|
|
|
|
dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
|
|
|
|
dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
|
|
|
|
dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
|
|
|
@ -115,7 +127,39 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
|
|
|
|
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
|
|
|
|
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
|
|
|
|
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
|
|
|
|
dynamic route27 = {"id": 31, "name": "In Each Nostril"};
|
|
|
|
dynamic route27 = {"id": 31, "name": "In Each Nostril"};
|
|
|
|
|
|
|
|
dynamic duration1 = {"id": 1, "name": "For 1 Day"};
|
|
|
|
|
|
|
|
dynamic duration2 = {"id": 2, "name": "For 2 Days"};
|
|
|
|
|
|
|
|
dynamic duration3 = {"id": 3, "name": "For 3 Days"};
|
|
|
|
|
|
|
|
dynamic duration4 = {"id": 4, "name": "For 4 Days"};
|
|
|
|
|
|
|
|
dynamic duration5 = {"id": 5, "name": "For 5 Days"};
|
|
|
|
|
|
|
|
dynamic duration6 = {"id": 6, "name": "For 6 Days"};
|
|
|
|
|
|
|
|
dynamic duration7 = {"id": 7, "name": "For 7 Days"};
|
|
|
|
|
|
|
|
dynamic duration8 = {"id": 8, "name": "For 8 Days"};
|
|
|
|
|
|
|
|
dynamic duration9 = {"id": 9, "name": "For 9 Days"};
|
|
|
|
|
|
|
|
dynamic duration10 = {"id": 10, "name": "For 10 Days"};
|
|
|
|
|
|
|
|
dynamic duration11 = {"id": 14, "name": "For 14 Days"};
|
|
|
|
|
|
|
|
dynamic duration12 = {"id": 21, "name": "For 21 Days"};
|
|
|
|
|
|
|
|
dynamic duration13 = {"id": 30, "name": "For 30 Days"};
|
|
|
|
|
|
|
|
dynamic duration14 = {"id": 45, "name": "For 45 Days"};
|
|
|
|
|
|
|
|
dynamic duration15 = {"id": 60, "name": "For 60 Days"};
|
|
|
|
|
|
|
|
dynamic duration16 = {"id": 90, "name": "For 90 Days"};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
durationList.add(duration1);
|
|
|
|
|
|
|
|
durationList.add(duration2);
|
|
|
|
|
|
|
|
durationList.add(duration3);
|
|
|
|
|
|
|
|
durationList.add(duration4);
|
|
|
|
|
|
|
|
durationList.add(duration5);
|
|
|
|
|
|
|
|
durationList.add(duration6);
|
|
|
|
|
|
|
|
durationList.add(duration7);
|
|
|
|
|
|
|
|
durationList.add(duration8);
|
|
|
|
|
|
|
|
durationList.add(duration9);
|
|
|
|
|
|
|
|
durationList.add(duration10);
|
|
|
|
|
|
|
|
durationList.add(duration11);
|
|
|
|
|
|
|
|
durationList.add(duration12);
|
|
|
|
|
|
|
|
durationList.add(duration13);
|
|
|
|
|
|
|
|
durationList.add(duration14);
|
|
|
|
|
|
|
|
durationList.add(duration15);
|
|
|
|
|
|
|
|
durationList.add(duration16);
|
|
|
|
frequencyList.add(frequency1);
|
|
|
|
frequencyList.add(frequency1);
|
|
|
|
frequencyList.add(frequency2);
|
|
|
|
frequencyList.add(frequency2);
|
|
|
|
frequencyList.add(frequency3);
|
|
|
|
frequencyList.add(frequency3);
|
|
|
@ -182,6 +226,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
routeList.add(route25);
|
|
|
|
routeList.add(route25);
|
|
|
|
routeList.add(route26);
|
|
|
|
routeList.add(route26);
|
|
|
|
routeList.add(route27);
|
|
|
|
routeList.add(route27);
|
|
|
|
|
|
|
|
unitsList.add(unit1);
|
|
|
|
|
|
|
|
unitsList.add(unit2);
|
|
|
|
|
|
|
|
unitsList.add(unit3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
@ -442,7 +489,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
context)
|
|
|
|
context)
|
|
|
|
.size
|
|
|
|
.size
|
|
|
|
.height *
|
|
|
|
.height *
|
|
|
|
0.282,
|
|
|
|
0.295,
|
|
|
|
width: MediaQuery.of(
|
|
|
|
width: MediaQuery.of(
|
|
|
|
context)
|
|
|
|
context)
|
|
|
|
.size
|
|
|
|
.size
|
|
|
@ -581,6 +628,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height:
|
|
|
|
|
|
|
|
30,
|
|
|
|
child:
|
|
|
|
child:
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
model
|
|
|
|
model
|
|
|
@ -588,7 +639,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
.entityList[index]
|
|
|
|
.entityList[index]
|
|
|
|
.remarks,
|
|
|
|
.remarks,
|
|
|
|
fontSize:
|
|
|
|
fontSize:
|
|
|
|
14.0,
|
|
|
|
11.5,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -792,12 +844,18 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return StatefulBuilder(builder: (BuildContext context,
|
|
|
|
return StatefulBuilder(builder: (BuildContext context,
|
|
|
|
StateSetter setState /*You can rename this!*/) {
|
|
|
|
StateSetter setState /*You can rename this!*/) {
|
|
|
|
|
|
|
|
return DraggableScrollableSheet(
|
|
|
|
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
|
|
|
|
minChildSize: 0.6,
|
|
|
|
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context, ScrollController scrollController) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.73,
|
|
|
|
height: MediaQuery.of(context).size.height * 1.0,
|
|
|
|
child: Form(
|
|
|
|
child: Form(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0),
|
|
|
|
horizontal: 20.0, vertical: 12.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
@ -806,13 +864,106 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 30.0,
|
|
|
|
height: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
MediaQuery.of(context).size.height * 0.070,
|
|
|
|
0.070,
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
|
|
|
|
0.550,
|
|
|
|
|
|
|
|
child: TextFields(
|
|
|
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
|
|
|
LengthLimitingTextInputFormatter(
|
|
|
|
|
|
|
|
4)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
hintText:
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.strength,
|
|
|
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
|
|
|
onChanged: (String value) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
strengthChar = value.length;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (strengthChar >= 4) {
|
|
|
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
|
|
|
"Only 4 Digits allowed for strength");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
|
|
|
// if (value.isEmpty &&
|
|
|
|
|
|
|
|
// strengthController.text.length >
|
|
|
|
|
|
|
|
// 4)
|
|
|
|
|
|
|
|
// return TranslationBase.of(context)
|
|
|
|
|
|
|
|
// .emptyMessage;
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 10.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
|
|
|
.size
|
|
|
|
|
|
|
|
.width *
|
|
|
|
|
|
|
|
0.3200,
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: unitsList != null
|
|
|
|
|
|
|
|
? () {
|
|
|
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
|
|
|
list: unitsList,
|
|
|
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
|
|
|
okText:
|
|
|
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.ok,
|
|
|
|
|
|
|
|
okFunction:
|
|
|
|
|
|
|
|
(selectedValue) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
units = selectedValue;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
builder: (BuildContext
|
|
|
|
|
|
|
|
context) {
|
|
|
|
|
|
|
|
return dialog;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
'UNIT Type',
|
|
|
|
|
|
|
|
units != null
|
|
|
|
|
|
|
|
? units['name']
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
true),
|
|
|
|
|
|
|
|
enabled: false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.070,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: routeList != null
|
|
|
|
onTap: routeList != null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
@ -822,7 +973,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
attributeName: 'name',
|
|
|
|
attributeName: 'name',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
okText:
|
|
|
|
okText:
|
|
|
|
TranslationBase.of(context).ok,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.ok,
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
route = selectedValue;
|
|
|
|
route = selectedValue;
|
|
|
@ -835,7 +987,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -844,7 +997,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
TranslationBase.of(context).route,
|
|
|
|
TranslationBase.of(context).route,
|
|
|
|
route != null ? route['name'] : null,
|
|
|
|
route != null
|
|
|
|
|
|
|
|
? route['name']
|
|
|
|
|
|
|
|
: null,
|
|
|
|
true),
|
|
|
|
true),
|
|
|
|
enabled: false,
|
|
|
|
enabled: false,
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -854,8 +1009,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
MediaQuery.of(context).size.height * 0.070,
|
|
|
|
0.070,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: doseTimeList != null
|
|
|
|
onTap: doseTimeList != null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
@ -865,7 +1020,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
attributeName: 'name',
|
|
|
|
attributeName: 'name',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
okText:
|
|
|
|
okText:
|
|
|
|
TranslationBase.of(context).ok,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.ok,
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
doseTime = selectedValue;
|
|
|
|
doseTime = selectedValue;
|
|
|
@ -875,7 +1031,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -883,7 +1040,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
TranslationBase.of(context).doseTime,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.doseTime,
|
|
|
|
doseTime != null
|
|
|
|
doseTime != null
|
|
|
|
? doseTime['name']
|
|
|
|
? doseTime['name']
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
@ -896,8 +1054,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height:
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
MediaQuery.of(context).size.height * 0.070,
|
|
|
|
0.070,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: frequencyList != null
|
|
|
|
onTap: frequencyList != null
|
|
|
|
? () {
|
|
|
|
? () {
|
|
|
@ -907,17 +1065,20 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
attributeName: 'name',
|
|
|
|
attributeName: 'name',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
attributeValueId: 'id',
|
|
|
|
okText:
|
|
|
|
okText:
|
|
|
|
TranslationBase.of(context).ok,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.ok,
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
frequencyUpdate = selectedValue;
|
|
|
|
frequencyUpdate =
|
|
|
|
|
|
|
|
selectedValue;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierDismissible: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
return dialog;
|
|
|
|
return dialog;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -925,7 +1086,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
TranslationBase.of(context).frequency,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.frequency,
|
|
|
|
frequencyUpdate != null
|
|
|
|
frequencyUpdate != null
|
|
|
|
? frequencyUpdate['name']
|
|
|
|
? frequencyUpdate['name']
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
@ -937,12 +1099,60 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.070,
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: durationList != null
|
|
|
|
|
|
|
|
? () {
|
|
|
|
|
|
|
|
ListSelectDialog dialog =
|
|
|
|
|
|
|
|
ListSelectDialog(
|
|
|
|
|
|
|
|
list: durationList,
|
|
|
|
|
|
|
|
attributeName: 'name',
|
|
|
|
|
|
|
|
attributeValueId: 'id',
|
|
|
|
|
|
|
|
okText:
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.ok,
|
|
|
|
|
|
|
|
okFunction: (selectedValue) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
updatedDuration =
|
|
|
|
|
|
|
|
selectedValue;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
builder:
|
|
|
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
|
|
|
return dialog;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.duration,
|
|
|
|
|
|
|
|
updatedDuration != null
|
|
|
|
|
|
|
|
? updatedDuration['name']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
true),
|
|
|
|
|
|
|
|
enabled: false,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 12.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
border: Border.all(
|
|
|
|
border: Border.all(
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
width: 1.0,
|
|
|
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText: remarks,
|
|
|
|
hintText: remarks,
|
|
|
|
controller: remarksController,
|
|
|
|
controller: remarksController,
|
|
|
@ -954,7 +1164,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
height: 12.0,
|
|
|
|
height: 12.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.12,
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
|
|
|
|
0.12,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
margin: EdgeInsets.all(
|
|
|
@ -963,9 +1174,19 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppButton(
|
|
|
|
AppButton(
|
|
|
|
title: 'update prescription'.toUpperCase(),
|
|
|
|
title: 'update prescription'
|
|
|
|
|
|
|
|
.toUpperCase(),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
updatePrescription(
|
|
|
|
updatePrescription(
|
|
|
|
|
|
|
|
newDoseStreangth:
|
|
|
|
|
|
|
|
strengthController
|
|
|
|
|
|
|
|
.text.isNotEmpty
|
|
|
|
|
|
|
|
? strengthController
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
: doseStreangth,
|
|
|
|
|
|
|
|
newUnit: units != null
|
|
|
|
|
|
|
|
? units['id'].toString()
|
|
|
|
|
|
|
|
: doseUnit,
|
|
|
|
doseUnit: doseUnit,
|
|
|
|
doseUnit: doseUnit,
|
|
|
|
doseStreangth: doseStreangth,
|
|
|
|
doseStreangth: doseStreangth,
|
|
|
|
duration: duration,
|
|
|
|
duration: duration,
|
|
|
@ -975,13 +1196,19 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
routeId: rouat,
|
|
|
|
routeId: rouat,
|
|
|
|
patient: patient,
|
|
|
|
patient: patient,
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
|
|
|
|
newDuration: updatedDuration !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? updatedDuration['id']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: duration,
|
|
|
|
drugId: drugId,
|
|
|
|
drugId: drugId,
|
|
|
|
remarks: remarksController.text,
|
|
|
|
remarks: remarksController.text,
|
|
|
|
route: route != null
|
|
|
|
route: route != null
|
|
|
|
? route['id'].toString()
|
|
|
|
? route['id'].toString()
|
|
|
|
: rouat,
|
|
|
|
: rouat,
|
|
|
|
frequency: frequencyUpdate != null
|
|
|
|
frequency: frequencyUpdate != null
|
|
|
|
? frequencyUpdate['id'].toString()
|
|
|
|
? frequencyUpdate['id']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
: frequency,
|
|
|
|
: frequency,
|
|
|
|
dose: doseTime != null
|
|
|
|
dose: doseTime != null
|
|
|
|
? doseTime['id'].toString()
|
|
|
|
? doseTime['id'].toString()
|
|
|
@ -1001,6 +1228,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
));
|
|
|
|
));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
updatePrescription(
|
|
|
|
updatePrescription(
|
|
|
@ -1016,7 +1244,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
String startDate,
|
|
|
|
String startDate,
|
|
|
|
String doseUnit,
|
|
|
|
String doseUnit,
|
|
|
|
String doseStreangth,
|
|
|
|
String doseStreangth,
|
|
|
|
|
|
|
|
String newDoseStreangth,
|
|
|
|
String duration,
|
|
|
|
String duration,
|
|
|
|
|
|
|
|
String newDuration,
|
|
|
|
|
|
|
|
String newUnit,
|
|
|
|
String enteredRemarks,
|
|
|
|
String enteredRemarks,
|
|
|
|
PatiantInformtion patient}) async {
|
|
|
|
PatiantInformtion patient}) async {
|
|
|
|
//PrescriptionViewModel model = PrescriptionViewModel();
|
|
|
|
//PrescriptionViewModel model = PrescriptionViewModel();
|
|
|
@ -1031,10 +1262,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
sss.add(PrescriptionRequestModel(
|
|
|
|
sss.add(PrescriptionRequestModel(
|
|
|
|
covered: true,
|
|
|
|
covered: true,
|
|
|
|
dose: int.parse(
|
|
|
|
dose: newDoseStreangth.isNotEmpty
|
|
|
|
|
|
|
|
? int.parse(newDoseStreangth)
|
|
|
|
|
|
|
|
: int.parse(
|
|
|
|
doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1,
|
|
|
|
doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1,
|
|
|
|
itemId: drugId,
|
|
|
|
itemId: drugId,
|
|
|
|
doseUnitId: int.parse(doseUnit),
|
|
|
|
doseUnitId:
|
|
|
|
|
|
|
|
newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit),
|
|
|
|
route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
|
|
|
|
route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
|
|
|
|
frequency: frequency.isNotEmpty
|
|
|
|
frequency: frequency.isNotEmpty
|
|
|
|
? int.parse(frequency)
|
|
|
|
? int.parse(frequency)
|
|
|
@ -1043,7 +1277,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
|
|
|
|
approvalRequired: true,
|
|
|
|
approvalRequired: true,
|
|
|
|
icdcode10Id: "test2",
|
|
|
|
icdcode10Id: "test2",
|
|
|
|
doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId),
|
|
|
|
doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId),
|
|
|
|
duration: int.parse(duration),
|
|
|
|
duration: newDuration.isNotEmpty
|
|
|
|
|
|
|
|
? int.parse(newDuration)
|
|
|
|
|
|
|
|
: int.parse(duration),
|
|
|
|
doseStartDate: startDate));
|
|
|
|
doseStartDate: startDate));
|
|
|
|
updatePrescriptionReqModel.prescriptionRequestModel = sss;
|
|
|
|
updatePrescriptionReqModel.prescriptionRequestModel = sss;
|
|
|
|
//postProcedureReqModel.procedures = controlsProcedure;
|
|
|
|
//postProcedureReqModel.procedures = controlsProcedure;
|
|
|
|