Refactor add_prescription_form

merge-requests/967/head
RoaaGhali98 4 years ago
parent 228237bf96
commit 7afe24c2bc

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart';
@ -7,12 +8,20 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/prescriptio
import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart';
import 'package:flutter/cupertino.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../model/Prescriptions/prescription_model.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class MedicineViewModel extends BaseViewModel { class MedicineViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
// dynamic route;
// dynamic frequency;
// dynamic duration;
// dynamic units;
MedicineService _medicineService = locator<MedicineService>(); MedicineService _medicineService = locator<MedicineService>();
ProcedureService _procedureService = locator<ProcedureService>(); ProcedureService _procedureService = locator<ProcedureService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>(); PrescriptionService _prescriptionService = locator<PrescriptionService>();
@ -21,6 +30,8 @@ class MedicineViewModel extends BaseViewModel {
_procedureService.templateList; _procedureService.templateList;
List<ProcedureTempleteDetailsModelList> templateList = List(); List<ProcedureTempleteDetailsModelList> templateList = List();
GetMedicationResponseModel _selectedMedication;
get pharmacyItemsList => _medicineService.pharmacyItemsList; get pharmacyItemsList => _medicineService.pharmacyItemsList;
get searchText => _medicineService.searchText; get searchText => _medicineService.searchText;
@ -56,6 +67,10 @@ class MedicineViewModel extends BaseViewModel {
List<dynamic> get itemMedicineListUnit => List<dynamic> get itemMedicineListUnit =>
_prescriptionService.itemMedicineListUnit; _prescriptionService.itemMedicineListUnit;
Future getItem({int itemID}) async { Future getItem({int itemID}) async {
//hasError = false; //hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
@ -90,6 +105,82 @@ class MedicineViewModel extends BaseViewModel {
print(templateList.length.toString()); print(templateList.length.toString());
} }
getPrescriptionForDrug(
List<PrescriptionModel> prescriptionList,
MedicineViewModel model,
) {
var prescriptionDetails = [];
if (prescriptionList.length > 0) {
prescriptionList[0].entityList.forEach((element) {
if (element.mediSpanGPICode != null) {
prescriptionDetails.add({
'DrugId': element.mediSpanGPICode,
'DrugName': element.medicationName,
'Dose': element.doseDailyQuantity,
'DoseType': element.doseDailyUnitID,
'Unit': element.uom,
'FrequencyType': element.frequencyID,
'Duration': element.doseDurationDays,
'RouteID': element.routeID,
'IsScreen': element.isSIG
});
}
});
}
// if (_selectedMedication.mediSpanGPICode != null) {
// prescriptionDetails.add({
// 'DrugId': _selectedMedication.mediSpanGPICode,
// 'DrugName': _selectedMedication.description,
// // 'Dose': strengthController.text,
// 'DoseType': model.itemMedicineListUnit.length == 1
// ? model.itemMedicineListUnit[0]['parameterCode'].toString()
// : units['parameterCode'].toString(),
// 'Unit': model.itemMedicineListUnit.length == 1
// ? model.itemMedicineListUnit[0]['description']
// : units['description'],
// 'FrequencyType': model.itemMedicineList.length == 1
// ? model.itemMedicineList[0]['parameterCode'].toString()
// : frequency['parameterCode'].toString(),
// 'Duration': duration['id'].toString(),
// 'RouteID': model.itemMedicineListRoute.length == 1
// ? model.itemMedicineListRoute[0]['parameterCode'].toString()
// : route['parameterCode'].toString(),
// 'IsScreen': true
// });
// }
return prescriptionDetails;
}
Future getAssessmentList ({
PatiantInformtion patientInfo,
bool isBusyLocal = false
}) async {
patientAssessmentList.map((element) {
return element.icdCode10ID;
});
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: patientInfo.appointmentNo);
if (medicationStrengthList.length == 0) {
await getMedicationStrength();
}
if (medicationDurationList.length == 0) {
await getMedicationDuration();
}
if (medicationDoseTimeList.length == 0) {
await getMedicationDoseTime();
}
await getPatientAssessment(getAssessmentReqModel);
}
Future getProcedureTemplate({String categoryID}) async { Future getProcedureTemplate({String categoryID}) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);

@ -32,7 +32,7 @@ class LivaCareTransferToAdmin extends StatefulWidget {
class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> { class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -168,7 +168,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
} }
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
} }
void requestPermissions() async { void requestPermissions() async {
@ -178,14 +178,14 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
} }
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
noteController.text += reconizedWord + '\n'; noteController.text += recognizedWord + '\n';
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);

@ -58,7 +58,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
double level = 0.0; double level = 0.0;
double minSoundLevel = 50000; double minSoundLevel = 50000;
double maxSoundLevel = -50000; double maxSoundLevel = -50000;
String reconizedWord; String recognizedWord;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
@ -264,9 +264,9 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
void resultListener(SpeechRecognitionResult result) { void resultListener(SpeechRecognitionResult result) {
setState(() { setState(() {
// lastWords = "${result.recognizedWords} - ${result.finalResult}"; // lastWords = "${result.recognizedWords} - ${result.finalResult}";
reconizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
lastStatus = ''; lastStatus = '';
myController.text = reconizedWord; myController.text = recognizedWord;
Future.delayed(const Duration(seconds: 2), () { Future.delayed(const Duration(seconds: 2), () {
// searchMedicine(context); // searchMedicine(context);
}); });

@ -51,7 +51,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
int selectedType; int selectedType;
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -296,7 +296,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
} }
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
} }
void requestPermissions() async { void requestPermissions() async {
@ -306,14 +306,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
} }
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
progressNoteController.text += reconizedWord + '\n'; progressNoteController.text += recognizedWord + '\n';
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);

@ -47,7 +47,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
int selectedType; int selectedType;
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;

@ -46,7 +46,7 @@ class _AddReplayOnReferralPatientState
int replay = 1; int replay = 1;
int reject = 2; int reject = 2;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
TextEditingController replayOnReferralController = TextEditingController(); TextEditingController replayOnReferralController = TextEditingController();
@ -248,7 +248,7 @@ class _AddReplayOnReferralPatientState
void errorListener(SpeechRecognitionError error) {} void errorListener(SpeechRecognitionError error) {}
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
} }
void requestPermissions() async { void requestPermissions() async {
@ -258,13 +258,13 @@ class _AddReplayOnReferralPatientState
} }
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
replayOnReferralController.text += reconizedWord + '\n'; replayOnReferralController.text += recognizedWord + '\n';
}); });
} }
} }

@ -49,7 +49,7 @@ class _PatientMakeInPatientReferralScreenState
String doctorError; String doctorError;
String frequencyError; String frequencyError;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
@override @override
@ -88,7 +88,7 @@ class _PatientMakeInPatientReferralScreenState
} }
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
} }
void requestPermissions() async { void requestPermissions() async {
@ -98,14 +98,14 @@ class _PatientMakeInPatientReferralScreenState
} }
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
_remarksController.text += reconizedWord + '\n'; _remarksController.text += recognizedWord + '\n';
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);

@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription/drugtodrug.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -122,8 +122,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TextEditingController indicationController = TextEditingController(); TextEditingController indicationController = TextEditingController();
TextEditingController instructionController = TextEditingController(); TextEditingController instructionController = TextEditingController();
bool visbiltyPrescriptionForm = false; bool visibilityPrescriptionForm = false;
bool visbiltySearch = true; bool visibilitySearch = true;
final myController = TextEditingController(); final myController = TextEditingController();
DateTime selectedDate; DateTime selectedDate;
@ -137,10 +137,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
final searchController = TextEditingController(); final searchController = TextEditingController();
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var event = RobotProvider(); var event = RobotProvider();
var reconizedWord; var recognizedWord;
final GlobalKey<FormState> formKey = GlobalKey<FormState>(); final GlobalKey<FormState> formKey = GlobalKey<FormState>();
final double spaceBetweenTextFileds = 12; final double spaceBetweenTextFields = 12;
dynamic route; dynamic route;
dynamic frequency; dynamic frequency;
dynamic duration; dynamic duration;
@ -151,19 +151,19 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic box; dynamic box;
dynamic x; dynamic x;
@override // @override
void initState() { // void initState() {
requestPermissions(); // requestPermissions();
event.controller.stream.listen((p) { // event.controller.stream.listen((p) {
if (p['startPopUp'] == 'true') { // if (p['startPopUp'] == 'true') {
if (this.mounted) { // if (this.mounted) {
initSpeechState().then((value) => {onVoiceText()}); // initSpeechState().then((value) => {onVoiceText()});
} // }
} // }
}); // });
selectedType = 1; // selectedType = 1;
super.initState(); // super.initState();
} // }
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
@ -193,24 +193,24 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} }
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
} }
void requestPermissions() async { // void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [ // Map<Permission, PermissionStatus> statuses = await [
Permission.microphone, // Permission.microphone,
].request(); // ].request();
} // }
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
instructionController.text += reconizedWord + '\n'; instructionController.text += recognizedWord + '\n';
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);
@ -227,42 +227,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) => model.getAssessmentList(
/// TODO Elham* Move this to view model patientInfo: widget.patient
x = model.patientAssessmentList.map((element) { ),
return element.icdCode10ID;
});
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patient.patientMRN,
episodeID: widget.patient.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: widget.patient.appointmentNo);
if (model.medicationStrengthList.length == 0) {
await model.getMedicationStrength();
}
if (model.medicationDurationList.length == 0) {
await model.getMedicationDuration();
}
if (model.medicationDoseTimeList.length == 0) {
await model.getMedicationDoseTime();
}
await model.getPatientAssessment(getAssessmentReqModel);
},
builder: ( builder: (
BuildContext context, BuildContext context,
MedicineViewModel model, MedicineViewModel model,
Widget child, Widget child,) =>
) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
initialChildSize: 0.98, initialChildSize: 0.98,
maxChildSize: 0.98, maxChildSize: 0.98,
minChildSize: 0.9, minChildSize: 0.9,
@ -285,7 +264,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
], ],
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds, height: spaceBetweenTextFields,
), ),
Container( Container(
child: Form( child: Form(
@ -304,8 +283,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppTextFormField( child: AppTextFormField(
onTap: () { onTap: () {
visbiltyPrescriptionForm = false; visibilityPrescriptionForm = false;
visbiltySearch = true; visibilitySearch = true;
}, },
borderColor: Colors.white, borderColor: Colors.white,
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
@ -323,7 +302,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
height: 15.0, height: 15.0,
), ),
Visibility( Visibility(
visible: visbiltySearch, visible: visibilitySearch,
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
@ -378,9 +357,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.allMedicationList[ .allMedicationList[
index] index]
.itemId); .itemId);
visbiltyPrescriptionForm = visibilityPrescriptionForm =
true; true;
visbiltySearch = false; visibilitySearch = false;
_selectedMedication = _selectedMedication =
model.allMedicationList[ model.allMedicationList[
index]; index];
@ -396,10 +375,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds, height: spaceBetweenTextFields,
), ),
Visibility( Visibility(
visible: visbiltyPrescriptionForm, visible: visibilityPrescriptionForm,
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
@ -424,7 +403,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(width: 18,), SizedBox(width: 18,),
Radio( Radio(
activeColor: activeColor:
Color(0xFFB9382C), AppGlobal.appRedColor,
value: 1, value: 1,
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
@ -540,14 +519,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
PrescriptionTextFiled( PrescriptionTextFiled(
elementList: elementList:
model.itemMedicineListRoute, model.itemMedicineListRoute,
element: model.itemMedicineListRoute element: model.itemMedicineListRoute
.length == .length ==
1 1
? model.itemMedicineListRoute[0] ? route = model.itemMedicineListRoute[0]
: route, : route,
elementError: routeError, elementError: routeError,
keyId: 'parameterCode', keyId: 'parameterCode',
@ -563,45 +542,37 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.route, .route,
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
PrescriptionTextFiled( PrescriptionTextFiled(
hintText: hintText: TranslationBase.of(context).frequency,
TranslationBase.of(context)
.frequency,
elementError: frequencyError, elementError: frequencyError,
element: frequency, // element: frequency,
elementList: element: model.itemMedicineListRoute
model.itemMedicineList, .length ==
1
? frequency = model.itemMedicineListRoute[0]
: frequency,
elementList: model.itemMedicineList,
keyId: 'parameterCode', keyId: 'parameterCode',
keyName: 'description', keyName: 'description',
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
frequency = selectedValue; frequency = selectedValue;
frequency['isDefault'] = true; frequency['isDefault'] = true;
if (_selectedMedication != if (_selectedMedication != null && duration != null && frequency != null && strengthController.text != null) {
null &&
duration != null &&
frequency != null &&
strengthController.text !=
null) {
model.getBoxQuantity( model.getBoxQuantity(
freq: frequency[ freq: frequency['parameterCode'],
'parameterCode'], duration: duration['id'],
duration: itemCode: _selectedMedication.itemId,
duration['id'], strength: double.parse(strengthController.text)
itemCode: );
_selectedMedication
.itemId,
strength: double.parse(
strengthController
.text));
return; return;
} }
}); });
}), }),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
PrescriptionTextFiled( PrescriptionTextFiled(
hintText: hintText:
TranslationBase.of(context) TranslationBase.of(context)
@ -618,7 +589,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
}), }),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
if (model if (model
.patientAssessmentList.isNotEmpty) .patientAssessmentList.isNotEmpty)
Container( Container(
@ -633,21 +604,19 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.size .size
.width * .width *
0.29, 0.29,
child: TextField( child: AppTextFieldCustom(
decoration: hintText:
textFieldSelectorDecoration(
model model
.patientAssessmentList[ .patientAssessmentList[
0] 0]
.icdCode10ID .icdCode10ID
.toString(), .toString(),
indication != null // indication != null
? indication[ // ? indication[
'name'] // 'name']
: null, // : null,
false),
enabled: true, enabled: true,
readOnly: true,
), ),
), ),
Container( Container(
@ -657,57 +626,68 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.width * .width *
0.57, 0.57,
color: Colors.white, color: Colors.white,
child: TextField( child: AppTextFieldCustom(
maxLines: 5, maxLines: 5,
decoration: hintText:
textFieldSelectorDecoration(
model model
.patientAssessmentList[ .patientAssessmentList[
0] 0]
.asciiDesc .asciiDesc
.toString(), .toString(),
indication != null // indication != null
? indication[ // ? indication[
'name'] // 'name']
: null, // : null,
false),
enabled: true, enabled: true,
readOnly: true,
), ),
), ),
], ],
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
Container( Container(
height: screenSize.height * 0.070, color: Colors.transparent,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: () => selectDate( onTap: () => selectDate(
context, widget.model), context, widget.model),
/// TODO Elham* Use customTextFields for all TextFields here child: AppTextFieldCustom(
child: TextField( validationError:
decoration: strengthError,
textFieldSelectorDecoration( hintText: 'Date',
TranslationBase.of( isTextFieldHasSuffix: true,
context) suffixIcon: IconButton(
.date, icon: Icon(
selectedDate != null Icons.calendar_today,
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" color: Colors.black,),
: null, ),
true, dropDownText: selectedDate != null
suffixIcon: Icon( ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
Icons.calendar_today, : null,
color: Colors.black,
)),
enabled: false, enabled: false,
controller: strengthController,
), ),
// TextField(
// decoration:
// textFieldSelectorDecoration(
// TranslationBase.of(
// context)
// .date,
// selectedDate != null
// ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
// : null,
// true,
// suffixIcon: Icon(
// Icons.calendar_today,
// color: Colors.black,
// )),
// enabled: false,
// ),
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
/// TODO Elham* Use customTextFields for all
PrescriptionTextFiled( PrescriptionTextFiled(
element: duration, element: duration,
elementError: durationError, elementError: durationError,
@ -746,7 +726,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}, },
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
Container( Container(
color: Colors.white, color: Colors.white,
child: AppTextFieldCustom( child: AppTextFieldCustom(
@ -758,7 +738,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
Container( Container(
color: Colors.white, color: Colors.white,
child: AppTextFieldCustom( child: AppTextFieldCustom(
@ -773,7 +753,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields
),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -814,7 +795,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFields),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5), SizeConfig.widthMultiplier * 5),
@ -1058,49 +1039,48 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
} }
} }
/// TODO Elham* Use it from the textfeild utils // InputDecoration textFieldSelectorDecoration(
InputDecoration textFieldSelectorDecoration( // String hintText, String selectedText, bool isDropDown,
String hintText, String selectedText, bool isDropDown, // {Icon suffixIcon}) {
{Icon suffixIcon}) { // return InputDecoration(
return InputDecoration( // focusedBorder: OutlineInputBorder(
focusedBorder: OutlineInputBorder( // borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), // borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), // ),
), // enabledBorder: OutlineInputBorder(
enabledBorder: OutlineInputBorder( // borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), // borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), // ),
), // disabledBorder: OutlineInputBorder(
disabledBorder: OutlineInputBorder( // borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), // borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), // ),
), // hintText: selectedText != null ? selectedText : hintText,
hintText: selectedText != null ? selectedText : hintText, // suffixIcon: isDropDown
suffixIcon: isDropDown // ? suffixIcon != null
? suffixIcon != null // ? suffixIcon
? suffixIcon // : Icon(
: Icon( // Icons.keyboard_arrow_down_sharp,
Icons.keyboard_arrow_down_sharp, // color: Color(0xff2E303A),
color: Color(0xff2E303A), // )
) // : null,
: null, // hintStyle: TextStyle(
hintStyle: TextStyle( // fontSize: 13,
fontSize: 13, // color: Color(0xff2E303A),
color: Color(0xff2E303A), // fontFamily: 'Poppins',
fontFamily: 'Poppins', // fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, // ),
), // labelText: selectedText != null ? '$hintText\n$selectedText' : null,
labelText: selectedText != null ? '$hintText\n$selectedText' : null, // labelStyle: TextStyle(
labelStyle: TextStyle( // fontSize: 13,
fontSize: 13, // color: Color(0xff2E303A),
color: Color(0xff2E303A), // fontFamily: 'Poppins',
fontFamily: 'Poppins', // fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, // ),
), // );
); // }
}
openDrugToDrug(model) { openDrugToDrug(MedicineViewModel model) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
builder: (context) { builder: (context) {
@ -1114,7 +1094,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: [ children: [
DrugToDrug( DrugToDrug(
widget.patient, widget.patient,
getPriscriptionforDrug(widget.prescriptionList, model), model.getPrescriptionForDrug(
widget.prescriptionList, model
),
model.patientAssessmentList), model.patientAssessmentList),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
@ -1158,57 +1140,53 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
)) ))
], ],
)), )),
//],
//)
); );
}); });
} }
/// TODO Elham* Move this to view model // getPrescriptionForDrug(
getPriscriptionforDrug( // List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
List<PrescriptionModel> prescriptionList, MedicineViewModel model) { // var prescriptionDetails = [];
var prescriptionDetails = []; // if (prescriptionList.length > 0) {
if (prescriptionList.length > 0) { // prescriptionList[0].entityList.forEach((element) {
prescriptionList[0].entityList.forEach((element) { // if (element.mediSpanGPICode != null) {
if (element.mediSpanGPICode != null) { // prescriptionDetails.add({
prescriptionDetails.add({ // 'DrugId': element.mediSpanGPICode,
'DrugId': element.mediSpanGPICode, // 'DrugName': element.medicationName,
'DrugName': element.medicationName, // 'Dose': element.doseDailyQuantity,
'Dose': element.doseDailyQuantity, // 'DoseType': element.doseDailyUnitID,
'DoseType': element.doseDailyUnitID, // 'Unit': element.uom,
'Unit': element.uom, // 'FrequencyType': element.frequencyID,
'FrequencyType': element.frequencyID, // 'Duration': element.doseDurationDays,
'Duration': element.doseDurationDays, // 'RouteID': element.routeID,
'RouteID': element.routeID, // 'IsScreen': element.isSIG
'IsScreen': element.isSIG // });
}); // }
} // });
}); // }
} // if (_selectedMedication.mediSpanGPICode != null) {
if (_selectedMedication.mediSpanGPICode != null) { // prescriptionDetails.add({
prescriptionDetails.add({ // 'DrugId': _selectedMedication.mediSpanGPICode,
'DrugId': _selectedMedication.mediSpanGPICode, // 'DrugName': _selectedMedication.description,
'DrugName': _selectedMedication.description, // 'Dose': strengthController.text,
'Dose': strengthController.text, // 'DoseType': model.itemMedicineListUnit.length == 1
'DoseType': model.itemMedicineListUnit.length == 1 // ? model.itemMedicineListUnit[0]['parameterCode'].toString()
? model.itemMedicineListUnit[0]['parameterCode'].toString() // : units['parameterCode'].toString(),
: units['parameterCode'].toString(), // 'Unit': model.itemMedicineListUnit.length == 1
'Unit': model.itemMedicineListUnit.length == 1 // ? model.itemMedicineListUnit[0]['description']
? model.itemMedicineListUnit[0]['description'] // : units['description'],
: units['description'], // 'FrequencyType': model.itemMedicineList.length == 1
'FrequencyType': model.itemMedicineList.length == 1 // ? model.itemMedicineList[0]['parameterCode'].toString()
? model.itemMedicineList[0]['parameterCode'].toString() // : frequency['parameterCode'].toString(),
: frequency['parameterCode'].toString(), // 'Duration': duration['id'].toString(),
'Duration': duration['id'].toString(), // 'RouteID': model.itemMedicineListRoute.length == 1
'RouteID': model.itemMedicineListRoute.length == 1 // ? model.itemMedicineListRoute[0]['parameterCode'].toString()
? model.itemMedicineListRoute[0]['parameterCode'].toString() // : route['parameterCode'].toString(),
: route['parameterCode'].toString(), // 'IsScreen': true
'IsScreen': true // });
}); // }
} // return prescriptionDetails;
return prescriptionDetails; // }
}
searchMedicine(context, MedicineViewModel model) async { searchMedicine(context, MedicineViewModel model) async {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();

@ -114,8 +114,8 @@ class _PrescriptionCheckOutScreenState
TextEditingController indicationController = TextEditingController(); TextEditingController indicationController = TextEditingController();
TextEditingController instructionController = TextEditingController(); TextEditingController instructionController = TextEditingController();
bool visbiltyPrescriptionForm = true; bool visibilityPrescriptionForm = true;
bool visbiltySearch = true; bool visibilitySearch = true;
final myController = TextEditingController(); final myController = TextEditingController();
DateTime selectedDate; DateTime selectedDate;
@ -129,10 +129,10 @@ class _PrescriptionCheckOutScreenState
final searchController = TextEditingController(); final searchController = TextEditingController();
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var event = RobotProvider(); var event = RobotProvider();
var reconizedWord; var recognizedWord;
final GlobalKey<FormState> formKey = GlobalKey<FormState>(); final GlobalKey<FormState> formKey = GlobalKey<FormState>();
final double spaceBetweenTextFileds = 12; final double spaceBetweenTextFields = 12;
dynamic route; dynamic route;
dynamic frequency; dynamic frequency;
dynamic duration; dynamic duration;
@ -179,7 +179,7 @@ class _PrescriptionCheckOutScreenState
} }
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
} }
void requestPermissions() async { void requestPermissions() async {
@ -189,14 +189,14 @@ class _PrescriptionCheckOutScreenState
} }
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": recognizedWord});
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
instructionController.text += reconizedWord + '\n'; instructionController.text += recognizedWord + '\n';
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);
@ -299,7 +299,7 @@ class _PrescriptionCheckOutScreenState
], ],
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds, height: spaceBetweenTextFields,
), ),
Container( Container(
child: Form( child: Form(
@ -316,10 +316,10 @@ class _PrescriptionCheckOutScreenState
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFileds, height: spaceBetweenTextFields,
), ),
Visibility( Visibility(
visible: visbiltyPrescriptionForm, visible: visibilityPrescriptionForm,
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
@ -337,7 +337,7 @@ class _PrescriptionCheckOutScreenState
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: AppGlobal.appRedColor,
value: 1, value: 1,
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
@ -349,7 +349,7 @@ class _PrescriptionCheckOutScreenState
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
Container( Container(
width: double.infinity, width: double.infinity,
child: Row( child: Row(
@ -410,7 +410,7 @@ class _PrescriptionCheckOutScreenState
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
PrescriptionTextFiled( PrescriptionTextFiled(
elementList: elementList:
model.itemMedicineListRoute, model.itemMedicineListRoute,
@ -427,7 +427,7 @@ class _PrescriptionCheckOutScreenState
hintText: hintText:
TranslationBase.of(context).route, TranslationBase.of(context).route,
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
PrescriptionTextFiled( PrescriptionTextFiled(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.frequency, .frequency,
@ -460,7 +460,7 @@ class _PrescriptionCheckOutScreenState
} }
}); });
}), }),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
PrescriptionTextFiled( PrescriptionTextFiled(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.doseTime, .doseTime,
@ -475,7 +475,7 @@ class _PrescriptionCheckOutScreenState
doseTime = selectedValue; doseTime = selectedValue;
}); });
}), }),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
if (model if (model
.patientAssessmentList.isNotEmpty) .patientAssessmentList.isNotEmpty)
Container( Container(
@ -533,7 +533,7 @@ class _PrescriptionCheckOutScreenState
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white, color: Colors.white,
@ -556,7 +556,7 @@ class _PrescriptionCheckOutScreenState
), ),
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
PrescriptionTextFiled( PrescriptionTextFiled(
element: duration, element: duration,
elementError: durationError, elementError: durationError,
@ -590,9 +590,9 @@ class _PrescriptionCheckOutScreenState
}); });
}, },
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -630,7 +630,7 @@ class _PrescriptionCheckOutScreenState
], ],
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFields),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5), SizeConfig.widthMultiplier * 5),

@ -1,168 +0,0 @@
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class PrescriptionDetailsPage extends StatelessWidget {
final PrescriptionReport prescriptionReport;
PrescriptionDetailsPage({Key key, this.prescriptionReport});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescriptions,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReport.imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: AppText(
prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN),
),
),
)
],
),
),
Container(
color: Colors.white,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
outside: BorderSide(width: 0.5)),
children: [
TableRow(
children: [
Container(
color: Colors.white,
height: 30,
width: double.infinity,
child: Center(
child: AppText(
TranslationBase.of(context).route,
fontSize: 14,
))),
Container(
color: Colors.white,
height: 30,
width: double.infinity,
child: Center(
child: AppText(
TranslationBase.of(context).frequency,
fontSize: 14,
))),
Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4),
child: Center(
child: AppText(
"${TranslationBase.of(context).dailyDoses}",
fontSize: 14,
))),
Container(
color: Colors.white,
height: 30,
width: double.infinity,
child: Center(
child: AppText(
TranslationBase.of(context).duration,
fontSize: 14,
))),
],
),
TableRow(
children: [
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child:
Center(child: Text(prescriptionReport.routeN))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child:
Text(prescriptionReport.frequencyN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child: Text(
'${prescriptionReport.doseDailyQuantity}'))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child:
Center(child: Text('${prescriptionReport.days}')))
],
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.all(5),
child: Center(
child: Column(
children: <Widget>[
AppText(TranslationBase.of(context).notes),
SizedBox(
height: 5,
),
Divider(
height: 0.5,
color: Colors.grey[300],
),
SizedBox(
height: 5,
),
AppText(prescriptionReport.remarks ?? ''),
],
),
),
)
],
),
),
);
}
}

@ -51,6 +51,7 @@ class PrescriptionItemsPage extends StatelessWidget {
children: [ children: [
if (!prescriptions.isInOutPatient) if (!prescriptions.isInOutPatient)
...List.generate( ...List.generate(
// TODO Elham* List.generate to list.builder
model.prescriptionReportList.length, model.prescriptionReportList.length,
(index) => Container( (index) => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -204,6 +205,7 @@ class PrescriptionItemsPage extends StatelessWidget {
)) ))
else else
...List.generate( ...List.generate(
// TODO Elham* List.generate to list.builder
model.prescriptionReportEnhList.length, model.prescriptionReportEnhList.length,
(index) => Container( (index) => Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -211,6 +213,7 @@ class PrescriptionItemsPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
), ),
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
// TODO Elham* use custom card
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(

@ -1,168 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
void prescriptionWarning(context) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Container(
height: 600,
child: Column(
children: [
...List.generate(
5,
(index) => Container(
child: ExpansionTile(
title: AppText('Prescription warning and alerts(0)'),
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
'DOSESCREENINGRESULTFORETCETC',
color: Color(0XFFB8382C),
)
],
)
],
),
),
),
SizedBox(
height: 10.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border:
Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Remarks',
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(
height: 95.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'CONTINUE',
onPressed: () {
Navigator.pop(context);
authorizationForm(context);
},
),
],
),
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
color: Colors.white,
title: 'remove',
fontColor: Colors.red,
onPressed: () {
Navigator.pop(context);
prescriptionWarning(context);
},
),
],
),
),
],
),
),
));
});
}
void authorizationForm(context) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return Container(
height: 500,
child: Form(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'Prescription authorization'.toUpperCase(),
fontWeight: FontWeight.w900,
),
SizedBox(
height: 30.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Auth ID',
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField(
labelText: 'Password',
borderColor: Colors.white,
textInputType: TextInputType.text,
inputFormatter: ONLY_LETTERS,
obscureText: true,
),
),
SizedBox(
height: 190.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'CONTINUE',
onPressed: () {
Navigator.pop(context);
authorizationForm(context);
},
),
],
),
),
],
),
),
));
});
}

@ -101,7 +101,8 @@ class PrescriptionsPage extends StatelessWidget {
label: TranslationBase.of(context) label: TranslationBase.of(context)
.applyForNewPrescriptionsOrder, .applyForNewPrescriptionsOrder,
), ),
...List.generate( ...List.generate
(
model.prescriptionsList.length, model.prescriptionsList.length,
(index) => InkWell( (index) => InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(

@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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:doctor_app_flutter/widgets/shared/network_base_view.dart';

@ -9,6 +9,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../config/config.dart';
class EntityListCheckboxSearchWidget extends StatefulWidget { class EntityListCheckboxSearchWidget extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel model;
final Function addSelectedHistories; final Function addSelectedHistories;
@ -229,7 +231,7 @@ class _EntityListCheckboxSearchWidgetState
: Center( : Center(
child: Container( child: Container(
child: AppText("Sorry , No Match", child: AppText("Sorry , No Match",
color: Color(0xFFB9382C)), color: AppGlobal.appRedColor),
), ),
) )
], ],

@ -8,6 +8,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../config/config.dart';
import 'ExpansionProcedure.dart'; import 'ExpansionProcedure.dart';
class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget {
@ -125,7 +126,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
: Center( : Center(
child: Container( child: Container(
child: AppText("Sorry , No Match", child: AppText("Sorry , No Match",
color: Color(0xFFB9382C)), color: AppGlobal.appRedColor),
), ),
) )
], ],

@ -247,7 +247,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
children: [ children: [
AppText(TranslationBase.of(context).orderType), AppText(TranslationBase.of(context).orderType),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: AppGlobal.appRedColor,
value: 0, value: 0,
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
@ -256,7 +256,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
), ),
Text('routine'), Text('routine'),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: AppGlobal.appRedColor,
groupValue: selectedType, groupValue: selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../config/config.dart';
class ListSelectDialog extends StatefulWidget { class ListSelectDialog extends StatefulWidget {
final List<dynamic> list; final List<dynamic> list;
final String attributeName; final String attributeName;
@ -104,7 +106,7 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
.selectedValue[widget.attributeValueId] .selectedValue[widget.attributeValueId]
.toString(), .toString(),
value: item[widget.attributeValueId].toString(), value: item[widget.attributeValueId].toString(),
activeColor: Color(0xFFB9382C), activeColor: AppGlobal.appRedColor,
selected: item[widget.attributeValueId] selected: item[widget.attributeValueId]
.toString() == .toString() ==
widget.selectedValue[widget.attributeValueId] widget.selectedValue[widget.attributeValueId]

@ -134,7 +134,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
} }
void statusListener(String status) { void statusListener(String status) {
recognizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....';
} }
void requestPermissions() async { void requestPermissions() async {

Loading…
Cancel
Save