finish add Prescription

new_prescreption
Elham Rababh 4 years ago
parent 954402fe52
commit ba62056c4d

@ -1129,7 +1129,7 @@ const Map<String, Map<String, String>> localizedValues = {
"VTE_Type": {"en": "VTE Type", "ar": "VTE Type"}, "VTE_Type": {"en": "VTE Type", "ar": "VTE Type"},
"pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"}, "pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"},
"reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"}, "reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"},
"youDoNotHaveFavoritePrescription": {"en": "you Don't Have Favorite Prescription", "ar": "ليس لديك وصفة طبية مفضلة"}, "youDoNotHaveFavoritePrescription": {"en": "You Don't Have Favorite Prescription", "ar": "ليس لديك وصفة طبية مفضلة"},
"pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"}, "pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"},
"searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"}, "searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"},
"sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"}, "sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"},

@ -25,7 +25,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patie
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vte_assessment/vte_assessment_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vte_assessment/vte_assessment_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/new_prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/prescription/new_prescriptions_page.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/prescription/old_prescriptions_page.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart';
import './screens/auth/login_screen.dart'; import './screens/auth/login_screen.dart';
@ -71,8 +71,8 @@ const String PATIENT_UCAF_REQUEST = 'patients/ucaf';
const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail'; const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail';
const String PATIENT_ECG = 'patients/ecg'; const String PATIENT_ECG = 'patients/ecg';
const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
const String ORDER_PRESCRIPTION_OLD = 'prescription/prescription_old';
const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new';
const String ORDER_PRESCRIPTION_NEW_By_Elham = 'prescription/prescription_new_elham';
const String ORDER_PROCEDURE = 'procedure/procedure'; const String ORDER_PROCEDURE = 'procedure/procedure';
const String ADD_SICKLEAVE = 'add-sickleave'; const String ADD_SICKLEAVE = 'add-sickleave';
const String RADIOLOGY_PATIENT = 'radiology-patient'; const String RADIOLOGY_PATIENT = 'radiology-patient';
@ -125,8 +125,8 @@ var routes = {
), ),
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
ADD_SICKLEAVE: (_) => PatientSickLeaveScreen(), ADD_SICKLEAVE: (_) => PatientSickLeaveScreen(),
ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), ORDER_PRESCRIPTION_OLD: (_) => OldPrescriptionsPage(),
ORDER_PRESCRIPTION_NEW_By_Elham: (_) => NewPrescriptionsPage(), ORDER_PRESCRIPTION_NEW: (_) => NewPrescriptionsPage(),
ORDER_PROCEDURE: (_) => ProcedureScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(),
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(),

@ -61,13 +61,13 @@ class ProfileGridForInPatient extends StatelessWidget {
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_NEW, ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
TranslationBase.of(context).prescription, TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW_By_Elham, ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),

@ -59,13 +59,13 @@ class ProfileGridForOther extends StatelessWidget {
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).orders, TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_NEW, ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
TranslationBase.of(context).prescription, TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW_By_Elham, ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(

@ -56,13 +56,13 @@ class ProfileGridForSearch extends StatelessWidget {
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).orders, TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_NEW, ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
TranslationBase.of(context).prescription, TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW_By_Elham, ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(

@ -34,9 +34,25 @@ class AddDrugWidget extends StatefulWidget {
final String instruction; final String instruction;
final DateTime selectedDate; final DateTime selectedDate;
const AddDrugWidget({Key key, this.patient, this.prescriptionList, this.medicineModel, const AddDrugWidget(
this.modelPrescription, this.units, this.route, this.frequency, this.duration, this.doseTime, {Key key,
this.uom, this.x, this.selectedMedication, this.strength, this.indication, this.instruction, this.selectedDate}) : super(key: key); this.patient,
this.prescriptionList,
this.medicineModel,
this.modelPrescription,
this.units,
this.route,
this.frequency,
this.duration,
this.doseTime,
this.uom,
this.x,
this.selectedMedication,
this.strength,
this.indication,
this.instruction,
this.selectedDate})
: super(key: key);
@override @override
_AddDrugWidgetState createState() => _AddDrugWidgetState(); _AddDrugWidgetState createState() => _AddDrugWidgetState();
@ -47,75 +63,84 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
baseViewModel: widget.medicineModel, baseViewModel: widget.medicineModel,
appBar: BottomSheetTitle( appBar:
title: TranslationBase.of(context).addMedication), BottomSheetTitle(title: TranslationBase.of(context).addMedication),
body: Container( body: Container(
height: SizeConfig.realScreenHeight * .8, height: SizeConfig.realScreenHeight * .8,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
DrugToDrug( DrugToDrug(
widget.patient, widget.patient,
widget.medicineModel.getPrescriptionForDrug( widget.medicineModel.getPrescriptionForDrug(
widget.prescriptionList, widget.medicineModel widget.prescriptionList, widget.medicineModel),
), widget.medicineModel.patientAssessmentList),
widget.medicineModel.patientAssessmentList), ],
], )),
)),
), ),
bottomSheet: widget.medicineModel.state == ViewState.BusyLocal || widget.medicineModel.state == ViewState.Busy bottomSheet: widget.medicineModel.state == ViewState.BusyLocal ||
widget.medicineModel.state == ViewState.Busy
? Container( ? Container(
height: 0, height: 0,
) )
: BottomSheetDialogButton( : BottomSheetDialogButton(
label: TranslationBase.of(context).addMedication, label: TranslationBase.of(context).addMedication,
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.medicineModel.postPrescription( await widget.medicineModel.postPrescription(
isLocalBusy: true, isLocalBusy: true,
icdCode: widget.medicineModel.patientAssessmentList.isNotEmpty icdCode: widget.medicineModel.patientAssessmentList.isNotEmpty
? widget.medicineModel.patientAssessmentList[0].icdCode10ID ? widget.medicineModel.patientAssessmentList[0]
.isEmpty .icdCode10ID.isEmpty
? "test" ? "test"
: widget.medicineModel.patientAssessmentList[0].icdCode10ID : widget.medicineModel.patientAssessmentList[0]
.toString() .icdCode10ID
: "test", .toString()
dose: widget.strength, : "test",
doseUnit: widget.medicineModel.itemMedicineListUnit.length == 1 dose: widget.strength,
? widget.medicineModel.itemMedicineListUnit[0]['parameterCode'] doseUnit:
.toString() widget.medicineModel.itemMedicineListUnit.length == 1
: widget.units['parameterCode'].toString(), ? widget.medicineModel
patient: widget.patient, .itemMedicineListUnit[0]['parameterCode']
doseTimeIn: widget.doseTime['id'].toString(), .toString()
model: widget.modelPrescription, : widget.units['parameterCode'].toString(),
duration: widget.duration['id'].toString(), patient: widget.patient,
frequency: widget.medicineModel.itemMedicineList.length == 1 doseTimeIn: widget.doseTime['id'].toString(),
? widget.medicineModel.itemMedicineList[0]['parameterCode'] model: widget.modelPrescription,
.toString() duration: widget.duration['id'].toString(),
: widget.frequency['parameterCode'].toString(), frequency: widget.medicineModel.itemMedicineList.length == 1
route: widget.medicineModel.itemMedicineListRoute.length == 1 ? widget
? widget.medicineModel.itemMedicineListRoute[0]['parameterCode'] .medicineModel.itemMedicineList[0]['parameterCode']
.toString() .toString()
: widget.route['parameterCode'].toString(), : widget.frequency['parameterCode'].toString(),
drugId: widget.selectedMedication.itemId.toString(), route: widget.medicineModel.itemMedicineListRoute.length == 1
strength: widget.strength, ? widget.medicineModel
indication: widget.indication, .itemMedicineListRoute[0]['parameterCode']
instruction: widget.instruction, .toString()
doseTime: widget.selectedDate, : widget.route['parameterCode'].toString(),
); drugId: widget.selectedMedication.itemId.toString(),
if (widget.medicineModel.state == ViewState.ErrorLocal) { strength: widget.strength,
GifLoaderDialogUtils.hideDialog(context); indication: widget.indication,
Helpers.showErrorToast(widget.medicineModel.error); instruction: widget.instruction,
} else if (widget.modelPrescription.state == ViewState.Idle) { doseTime: widget.selectedDate,
widget.modelPrescription.getPrescriptions(widget.patient); );
GifLoaderDialogUtils.hideDialog(context); if (widget.medicineModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).medicationHasBeenAdded); GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(); Helpers.showErrorToast(widget.medicineModel.error);
Navigator.of(context).pop(); } else if (widget.modelPrescription.state == ViewState.Idle) {
} await widget.modelPrescription.getPrescriptionListNew(
}, appNo: widget.patient.appointmentNo,
), mrn: widget.patient.patientMRN,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).medicationHasBeenAdded);
Navigator.of(context).pop();
Navigator.of(context).pop();
}
},
),
); );
} }
} }

@ -68,8 +68,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
final myController = TextEditingController(); final myController = TextEditingController();
DateTime selectedDate; DateTime selectedDate;
int strengthChar; int strengthChar;
PrescriptionViewModel prescriptionViewModel;
GlobalKey key = GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();

@ -21,8 +21,7 @@ import 'package:flutter/material.dart';
import '../../util/helpers.dart'; import '../../util/helpers.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
///TODO Elham* the design should be fixed By roaa class OldPrescriptionsPage extends StatelessWidget {
class PrescriptionsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -64,31 +63,12 @@ class PrescriptionsPage extends StatelessWidget {
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).orders, title: TranslationBase.of(context).orders,
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.prescriptions, .prescriptions + "(${TranslationBase.of(context)
.old }) ",
), ),
], ],
), ),
), ),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
SlideUpPageRoute(
widget: BaseAddProcedureTabPage(
patient: patient,
prescriptionModel: model,
procedureType:
ProcedureType.PRESCRIPTION,
),
settingRoute: 'AddProcedureTabPage'),
);
},
label: TranslationBase.of(context)
.applyForNewPrescriptionsOrder,
),
ListView.builder( ListView.builder(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,

@ -11,6 +11,7 @@ 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/util/translations_delegate_base.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/errors/error_message.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
@ -50,43 +51,38 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(children: [
children: [ (widget.previousProcedureViewModel.templateList.length != 0)
(widget.previousProcedureViewModel.templateList.length != 0) ? Expanded(
? Expanded( child: EntityListCheckboxSearchFavProceduresWidget(
child: EntityListCheckboxSearchFavProceduresWidget( isProcedure: !(widget.procedureType ==
isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION),
ProcedureType.PRESCRIPTION), model: widget.previousProcedureViewModel,
model: widget.previousProcedureViewModel, removeFavProcedure: (item) {
removeFavProcedure: (item) { setState(() {
setState(() { entityList.remove(item);
entityList.remove(item); });
}); },
}, addFavProcedure: (history) {
addFavProcedure: (history) { setState(() {
setState(() { entityList.add(history);
entityList.add(history); });
}); },
}, isEntityFavListSelected: (master) =>
isEntityFavListSelected: (master) => isEntityListSelected(master),
isEntityListSelected(master), groupProcedures: groupProcedures,
groupProcedures: groupProcedures, selectProcedures: (selectedProcedure) {
selectProcedures: (selectedProcedure) { setState(() {
setState(() { groupProcedures = selectedProcedure;
groupProcedures = selectedProcedure; });
}); },
},
),
)
: Container(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 50.0),
child: AppText(
TranslationBase.of(context).youDoNotHaveFavoritePrescription,),
),
), ),
], )
), : ErrorMessage(
error: TranslationBase.of(context)
.youDoNotHaveFavoritePrescription,
),
]),
bottomSheet: BottomSheetDialogButton( bottomSheet: BottomSheetDialogButton(
label: widget.procedureType.getAddButtonTitle(context) ?? label: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures, TranslationBase.of(context).addSelectedProcedures,

@ -102,7 +102,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_OLD,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'assets/images/svgs/profile_screen/order prescription.svg'), icon: 'assets/images/svgs/profile_screen/order prescription.svg'),

@ -75,7 +75,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_OLD,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2:TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', nameLine2:TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
icon: 'assets/images/svgs/profile_screen/order prescription.svg'), icon: 'assets/images/svgs/profile_screen/order prescription.svg'),
@ -84,7 +84,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW_By_Elham, route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'assets/images/svgs/profile_screen/order prescription.svg'), icon: 'assets/images/svgs/profile_screen/order prescription.svg'),

@ -114,7 +114,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_OLD,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: icon:

Loading…
Cancel
Save