|
|
|
@ -115,7 +115,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
(BuildContext context, StateSetter setState /*You can rename this!*/) {
|
|
|
|
|
return BaseView<MedicineViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
await model.getMedicationList();
|
|
|
|
|
//await model.getMedicationList();
|
|
|
|
|
await model.getMedicationStrength();
|
|
|
|
|
await model.getMedicationDuration();
|
|
|
|
|
await model.getMedicationRoute();
|
|
|
|
@ -257,14 +257,17 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
LengthLimitingTextInputFormatter(
|
|
|
|
|
4),
|
|
|
|
|
WhitelistingTextInputFormatter
|
|
|
|
|
.digitsOnly
|
|
|
|
|
// WhitelistingTextInputFormatter
|
|
|
|
|
// .digitsOnly
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
hintText: widget.doseStreangth,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
controller: strengthController,
|
|
|
|
|
keyboardType:
|
|
|
|
|
TextInputType.number,
|
|
|
|
|
keyboardType: TextInputType
|
|
|
|
|
.numberWithOptions(
|
|
|
|
|
decimal: true,
|
|
|
|
|
),
|
|
|
|
|
onChanged: (String value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
strengthChar = value.length;
|
|
|
|
@ -558,25 +561,34 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
height: 12.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.070,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Row(
|
|
|
|
|
height: model.patientAssessmentList
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? screenSize.height * 0.070
|
|
|
|
|
: 0.0,
|
|
|
|
|
width: model.patientAssessmentList
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? double.infinity
|
|
|
|
|
: 0.0,
|
|
|
|
|
child: model.patientAssessmentList
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
width:
|
|
|
|
|
MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.29,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
onTap:
|
|
|
|
|
indicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
|
context);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
model.patientAssessmentList
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? model
|
|
|
|
@ -586,7 +598,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
.toString()
|
|
|
|
|
: '',
|
|
|
|
|
indication != null
|
|
|
|
|
? indication['name']
|
|
|
|
|
? indication[
|
|
|
|
|
'name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: true,
|
|
|
|
@ -595,12 +608,14 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
width:
|
|
|
|
|
MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.61,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: indicationList != null
|
|
|
|
|
onTap:
|
|
|
|
|
indicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(
|
|
|
|
|
context);
|
|
|
|
@ -608,8 +623,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
: null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
maxLines: 3,
|
|
|
|
|
decoration:
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
model.patientAssessmentList
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? model
|
|
|
|
@ -619,7 +633,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
.toString()
|
|
|
|
|
: '',
|
|
|
|
|
indication != null
|
|
|
|
|
? indication['name']
|
|
|
|
|
? indication[
|
|
|
|
|
'name']
|
|
|
|
|
: null,
|
|
|
|
|
true),
|
|
|
|
|
enabled: true,
|
|
|
|
@ -628,8 +643,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: null),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12.0,
|
|
|
|
|
),
|
|
|
|
@ -688,6 +703,27 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
|
|
|
|
|
title: 'update prescription'
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (int.parse(
|
|
|
|
|
strengthController.text) >
|
|
|
|
|
1000) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"1000 is the MAX for the strength");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (int.parse(strengthController
|
|
|
|
|
.text) ==
|
|
|
|
|
0) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Streangth can't be zero");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (strengthController
|
|
|
|
|
.text.length >
|
|
|
|
|
4) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
"Streangth can't be zero");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
updatePrescription(
|
|
|
|
|
newStartDate: selectedDate,
|
|
|
|
|
newDoseStreangth:
|
|
|
|
|