merge-requests/320/head
Sultan Khan 5 years ago
commit 449540504c

@ -43,11 +43,11 @@ class MedicineViewModel extends BaseViewModel {
Future getItem({int itemID}) async { Future getItem({int itemID}) async {
//hasError = false; //hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal); setState(ViewState.Busy);
await _prescriptionService.getItem(itemID: itemID); await _prescriptionService.getItem(itemID: itemID);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
setState(ViewState.ErrorLocal); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -201,7 +201,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
//await model.getMedicationIndications(); //await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
await model.getItem(); //await model.getItem();
}, },
builder: ( builder: (
BuildContext context, BuildContext context,
@ -360,12 +360,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.width * .width *
0.550, 0.550,
child: TextFields( child: TextFields(
// inputFormatters: [ inputFormatters: [
// LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(
// 4), 4),
// WhitelistingTextInputFormatter // WhitelistingTextInputFormatter
// .digitsOnly // .digitsOnly
// ], ],
hintText: hintText:
TranslationBase.of(context) TranslationBase.of(context)
.strength, .strength,

@ -209,16 +209,17 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
child: Column( child: Column(
children: [ children: [
AppText( AppText(
DateTime.parse(model (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) !=
.prescriptionList[ null
0] ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year)
.entityList[ .toString()
index] : DateTime.now()
.createdOn) .year)
.day
.toString(), .toString(),
color: Colors color: Colors
.green, .green,
fontSize:
13.5,
), ),
AppText( AppText(
Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
@ -230,7 +231,19 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.toUpperCase(), .toUpperCase(),
color: Colors color: Colors
.green, .green,
) ),
AppText(
DateTime.parse(model
.prescriptionList[
0]
.entityList[
index]
.createdOn)
.day
.toString(),
color: Colors
.green,
),
], ],
), ),
), ),
@ -383,12 +396,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
"", // commening below code because there is an error coming in the model please fix it before pushing it // commening below code because there is an error coming in the model please fix it before pushing it
// model.prescriptionList[0].entityList[index].pharmacistRemarks == null model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks,
// ? "" fontSize: 15.0),
// : model.prescriptionList[0].entityList[index].pharmacistRemarks,
fontSize:
15.0),
) )
], ],
), ),

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

@ -227,43 +227,63 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
.entityList[ .entityList[
index] index]
.orderDate) .orderDate)
.day .year
.toString(), .toString(),
color: color: model
Colors.green,
),
AppText(
Helpers.getMonth(model
.procedureList[ .procedureList[
0] 0]
.entityList[ .entityList[
index] index]
.orderDate != .orderType ==
0
? Color(
0xFFB9382C)
: Colors
.green),
AppText(
Helpers.getMonth(model.procedureList[0].entityList[index].orderDate !=
null null
? (DateTime.parse(model ? (DateTime.parse(model.procedureList[0].entityList[index].orderDate)
.month)
: DateTime.now()
.month)
.toUpperCase(),
color: model
.procedureList[
0]
.entityList[
index]
.orderType ==
0
? Color(
0xFFB9382C)
: Colors
.green),
AppText(
DateTime.parse(model
.procedureList[ .procedureList[
0] 0]
.entityList[ .entityList[
index] index]
.orderDate) .orderDate)
.month) .day
: DateTime .toString(),
.now() color: model
.month) .procedureList[
.toUpperCase(), 0]
color: .entityList[
Colors.green, index]
) .orderType ==
0
? Color(
0xFFB9382C)
: Colors
.green),
], ],
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
// height: MediaQuery.of(
// context)
// .size
// .height *
// 0.21,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -308,17 +328,17 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
13.0, 13.0,
), ),
Expanded( Expanded(
child: child: AppText(
AppText(
model.procedureList[0].entityList[index].orderType == model.procedureList[0].entityList[index].orderType ==
1 1
? 'Routine' ? 'Routine'
: 'Urgent', : 'Urgent',
fontSize: fontSize:
11.5, 13.5,
color: Color( color: model.procedureList[0].entityList[index].orderType ==
0xFFB9382C), 0
), ? Color(0xFFB9382C)
: Colors.green),
), ),
], ],
), ),

Loading…
Cancel
Save