|
|
|
@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/post_prescrition_req_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/livecare/transfer_to_admin.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
@ -29,27 +30,35 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
TextEditingController doseController = TextEditingController();
|
|
|
|
TextEditingController doseController = TextEditingController();
|
|
|
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
|
|
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
|
|
|
final double spaceBetweenTextFileds = 12;
|
|
|
|
final double spaceBetweenTextFileds = 12;
|
|
|
|
|
|
|
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
showModalBottomSheet(
|
|
|
|
isScrollControlled: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (BuildContext bc) {
|
|
|
|
builder: (BuildContext bc) {
|
|
|
|
return DraggableScrollableSheet(
|
|
|
|
return BaseView<PrescriptionViewModel>(
|
|
|
|
|
|
|
|
onModelReady: (model) => model.getDrugs(),
|
|
|
|
|
|
|
|
builder: (BuildContext context, PrescriptionViewModel model,
|
|
|
|
|
|
|
|
Widget child) =>
|
|
|
|
|
|
|
|
DraggableScrollableSheet(
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
minChildSize: 0.9,
|
|
|
|
minChildSize: 0.9,
|
|
|
|
builder: (BuildContext context, ScrollController scrollController) {
|
|
|
|
builder: (BuildContext context,
|
|
|
|
|
|
|
|
ScrollController scrollController) {
|
|
|
|
return SingleChildScrollView(
|
|
|
|
return SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
height: 980,
|
|
|
|
height: 980,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
|
|
|
horizontal: 12.0, vertical: 10.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
TranslationBase.of(context).medicines.toUpperCase(),
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.medicines
|
|
|
|
|
|
|
|
.toUpperCase(),
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -69,13 +78,15 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
hintText:
|
|
|
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
.searchMedicine,
|
|
|
|
.searchMedicine,
|
|
|
|
controller: drugIdController,
|
|
|
|
controller: drugIdController,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
if (value.isEmpty)
|
|
|
|
if (value.isEmpty)
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
return TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
.emptyMessage;
|
|
|
|
.emptyMessage;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
@ -92,8 +103,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context).orderType,
|
|
|
|
.orderType,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
@ -105,8 +116,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context).strength,
|
|
|
|
.strength,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
controller: strengthController,
|
|
|
|
controller: strengthController,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
@ -127,7 +138,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText: TranslationBase.of(context).route,
|
|
|
|
hintText:
|
|
|
|
|
|
|
|
TranslationBase.of(context).route,
|
|
|
|
controller: routeController,
|
|
|
|
controller: routeController,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
@ -148,8 +160,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context).frequency,
|
|
|
|
.frequency,
|
|
|
|
controller: frequencyController,
|
|
|
|
controller: frequencyController,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
@ -170,8 +182,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context).doseTime,
|
|
|
|
.doseTime,
|
|
|
|
controller: doseController,
|
|
|
|
controller: doseController,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
@ -192,8 +204,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context).indication,
|
|
|
|
.indication,
|
|
|
|
controller: indicationController,
|
|
|
|
controller: indicationController,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
@ -214,8 +226,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context).fromDate,
|
|
|
|
.fromDate,
|
|
|
|
keyboardType: TextInputType.datetime,
|
|
|
|
keyboardType: TextInputType.datetime,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
if (value.isEmpty)
|
|
|
|
if (value.isEmpty)
|
|
|
|
@ -236,13 +248,15 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText:
|
|
|
|
TranslationBase.of(context).duration,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.duration,
|
|
|
|
// borderColor: Colors.white,
|
|
|
|
// borderColor: Colors.white,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
controller: durationController,
|
|
|
|
controller: durationController,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
if (value.isEmpty)
|
|
|
|
if (value.isEmpty)
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
return TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
.emptyMessage;
|
|
|
|
.emptyMessage;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
@ -257,8 +271,8 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
width: 1.0,
|
|
|
|
width: 1.0,
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
child: TextFields(
|
|
|
|
child: TextFields(
|
|
|
|
hintText:
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context).instruction,
|
|
|
|
.instruction,
|
|
|
|
controller: indicationController,
|
|
|
|
controller: indicationController,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
@ -283,20 +297,27 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
formKey.currentState.save();
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
if (formKey.currentState
|
|
|
|
|
|
|
|
.validate()) {
|
|
|
|
postProcedure(
|
|
|
|
postProcedure(
|
|
|
|
model: model,
|
|
|
|
model: model,
|
|
|
|
duration: durationController.text,
|
|
|
|
duration:
|
|
|
|
|
|
|
|
durationController.text,
|
|
|
|
dose: doseController.text,
|
|
|
|
dose: doseController.text,
|
|
|
|
frequency:
|
|
|
|
frequency:
|
|
|
|
frequencyController.text,
|
|
|
|
frequencyController
|
|
|
|
|
|
|
|
.text,
|
|
|
|
route: routeController.text,
|
|
|
|
route: routeController.text,
|
|
|
|
drugId: drugIdController.text,
|
|
|
|
drugId:
|
|
|
|
strength: strengthController.text,
|
|
|
|
drugIdController.text,
|
|
|
|
|
|
|
|
strength:
|
|
|
|
|
|
|
|
strengthController.text,
|
|
|
|
indication:
|
|
|
|
indication:
|
|
|
|
indicationController.text,
|
|
|
|
indicationController
|
|
|
|
|
|
|
|
.text,
|
|
|
|
instruction:
|
|
|
|
instruction:
|
|
|
|
indicationController.text,
|
|
|
|
indicationController
|
|
|
|
|
|
|
|
.text,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -322,10 +343,28 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// openAllergiesList(BuildContext context) {
|
|
|
|
|
|
|
|
// showModalBottomSheet(
|
|
|
|
|
|
|
|
// backgroundColor: Colors.white,
|
|
|
|
|
|
|
|
// isScrollControlled: true,
|
|
|
|
|
|
|
|
// context: context,
|
|
|
|
|
|
|
|
// builder: (context) {
|
|
|
|
|
|
|
|
// return AddAllergies(
|
|
|
|
|
|
|
|
// addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// widget.myAllergiesList.add(mySelectedAllergy);
|
|
|
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
postProcedure(
|
|
|
|
postProcedure(
|
|
|
|
{String duration,
|
|
|
|
{String duration,
|
|
|
|
String dose,
|
|
|
|
String dose,
|
|
|
|
|