|
|
|
@ -5,250 +5,355 @@ 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/viewModel/prescription_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.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/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
|
|
|
|
|
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_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
void addPrescriptionForm(context) {
|
|
|
|
|
void addPrescriptionForm(context, PrescriptionViewModel model) {
|
|
|
|
|
TextEditingController durationController = TextEditingController();
|
|
|
|
|
TextEditingController strengthController = TextEditingController();
|
|
|
|
|
TextEditingController routeController = TextEditingController();
|
|
|
|
|
TextEditingController frequencyController = TextEditingController();
|
|
|
|
|
TextEditingController indicationController = TextEditingController();
|
|
|
|
|
TextEditingController instructions = TextEditingController();
|
|
|
|
|
|
|
|
|
|
TextEditingController drugIdController = TextEditingController();
|
|
|
|
|
TextEditingController doseController = TextEditingController();
|
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
|
|
|
|
final double spaceBetweenTextFileds = 12;
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext bc) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 700,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).medicines.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Form(
|
|
|
|
|
key: _formKey,
|
|
|
|
|
child: Column(
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).searchMedicine,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.text,
|
|
|
|
|
inputFormatter: ONLY_LETTERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).orderType,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).strength,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).route,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).frequency,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).doseTime,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
controller: doseController,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).indication,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).fromDate,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText: TranslationBase.of(context).duration,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
controller: durationController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value == null || value == "")
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0, color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
labelText:
|
|
|
|
|
TranslationBase.of(context).instruction,
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title:
|
|
|
|
|
TranslationBase.of(context).addMedication,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
//prescriptionWarning(context);
|
|
|
|
|
postProcedure(
|
|
|
|
|
duration: durationController.text,
|
|
|
|
|
dose: doseController.text);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
return DraggableScrollableSheet(
|
|
|
|
|
initialChildSize: 0.90,
|
|
|
|
|
maxChildSize: 0.90,
|
|
|
|
|
minChildSize: 0.9,
|
|
|
|
|
builder: (BuildContext context, ScrollController scrollController) {
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 980,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).medicines.toUpperCase(),
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Form(
|
|
|
|
|
key: formKey,
|
|
|
|
|
child: Column(
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchMedicine,
|
|
|
|
|
controller: drugIdController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).orderType,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).strength,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText: TranslationBase.of(context).route,
|
|
|
|
|
controller: routeController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).frequency,
|
|
|
|
|
controller: frequencyController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).doseTime,
|
|
|
|
|
controller: doseController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).indication,
|
|
|
|
|
controller: indicationController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).fromDate,
|
|
|
|
|
keyboardType: TextInputType.datetime,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).duration,
|
|
|
|
|
// borderColor: Colors.white,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
controller: durationController,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
child: TextFields(
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(context).instruction,
|
|
|
|
|
controller: indicationController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (value.isEmpty)
|
|
|
|
|
return TranslationBase.of(context)
|
|
|
|
|
.emptyMessage;
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFileds),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(
|
|
|
|
|
SizeConfig.widthMultiplier * 5),
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context)
|
|
|
|
|
.addMedication,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
|
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
|
postPrescription(
|
|
|
|
|
model: model,
|
|
|
|
|
duration: durationController.text,
|
|
|
|
|
dose: doseController.text,
|
|
|
|
|
frequency:
|
|
|
|
|
frequencyController.text,
|
|
|
|
|
route: routeController.text,
|
|
|
|
|
drugId: drugIdController.text,
|
|
|
|
|
strength: strengthController.text,
|
|
|
|
|
indication:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
instruction:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) =>
|
|
|
|
|
// NewPrescriptionScreen()),
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
postProcedure({String duration, String dose}) async {
|
|
|
|
|
PrescriptionViewModel model = new PrescriptionViewModel();
|
|
|
|
|
postPrescription(
|
|
|
|
|
{String duration,
|
|
|
|
|
String dose,
|
|
|
|
|
String drugId,
|
|
|
|
|
String strength,
|
|
|
|
|
String route,
|
|
|
|
|
String frequency,
|
|
|
|
|
String indication,
|
|
|
|
|
String instruction,
|
|
|
|
|
PrescriptionViewModel model}) async {
|
|
|
|
|
PostPrescriptionReqModel postProcedureReqModel =
|
|
|
|
|
new PostPrescriptionReqModel();
|
|
|
|
|
List<PrescriptionRequestModel> sss = List();
|
|
|
|
|
|
|
|
|
|
postProcedureReqModel.appointmentNo = 2016055175;
|
|
|
|
|
postProcedureReqModel.clinicID = 1;
|
|
|
|
|
postProcedureReqModel.episodeID = 200012335;
|
|
|
|
|
postProcedureReqModel.patientMRN = 1234;
|
|
|
|
|
postProcedureReqModel.appointmentNo = 2016055159;
|
|
|
|
|
postProcedureReqModel.clinicID = 17;
|
|
|
|
|
postProcedureReqModel.episodeID = 200012330;
|
|
|
|
|
postProcedureReqModel.patientMRN = 3120877;
|
|
|
|
|
postProcedureReqModel.vidaAuthTokenID =
|
|
|
|
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
|
|
|
|
|
sss.add(PrescriptionRequestModel(
|
|
|
|
|
covered: true,
|
|
|
|
|
dose: int.parse(dose),
|
|
|
|
|
itemId: 8,
|
|
|
|
|
itemId: int.parse(drugId),
|
|
|
|
|
doseUnitId: 1,
|
|
|
|
|
route: 1,
|
|
|
|
|
frequency: 1,
|
|
|
|
|
remarks: "test2",
|
|
|
|
|
route: int.parse(route),
|
|
|
|
|
frequency: int.parse(frequency),
|
|
|
|
|
remarks: instruction,
|
|
|
|
|
approvalRequired: true,
|
|
|
|
|
icdcode10Id: "test2",
|
|
|
|
|
doseTime: 1,
|
|
|
|
@ -261,7 +366,7 @@ postProcedure({String duration, String dose}) async {
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
} else if (model.state == ViewState.Idle) {
|
|
|
|
|
DrAppToastMsg.showSuccesToast('Medication has been added');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|