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,8 +63,8 @@ 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,
@ -58,13 +74,13 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
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,
) )
@ -75,15 +91,18 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
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]
.icdCode10ID
.toString() .toString()
: "test", : "test",
dose: widget.strength, dose: widget.strength,
doseUnit: widget.medicineModel.itemMedicineListUnit.length == 1 doseUnit:
? widget.medicineModel.itemMedicineListUnit[0]['parameterCode'] widget.medicineModel.itemMedicineListUnit.length == 1
? widget.medicineModel
.itemMedicineListUnit[0]['parameterCode']
.toString() .toString()
: widget.units['parameterCode'].toString(), : widget.units['parameterCode'].toString(),
patient: widget.patient, patient: widget.patient,
@ -91,11 +110,13 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
model: widget.modelPrescription, model: widget.modelPrescription,
duration: widget.duration['id'].toString(), duration: widget.duration['id'].toString(),
frequency: widget.medicineModel.itemMedicineList.length == 1 frequency: widget.medicineModel.itemMedicineList.length == 1
? widget.medicineModel.itemMedicineList[0]['parameterCode'] ? widget
.medicineModel.itemMedicineList[0]['parameterCode']
.toString() .toString()
: widget.frequency['parameterCode'].toString(), : widget.frequency['parameterCode'].toString(),
route: widget.medicineModel.itemMedicineListRoute.length == 1 route: widget.medicineModel.itemMedicineListRoute.length == 1
? widget.medicineModel.itemMedicineListRoute[0]['parameterCode'] ? widget.medicineModel
.itemMedicineListRoute[0]['parameterCode']
.toString() .toString()
: widget.route['parameterCode'].toString(), : widget.route['parameterCode'].toString(),
drugId: widget.selectedMedication.itemId.toString(), drugId: widget.selectedMedication.itemId.toString(),
@ -108,9 +129,13 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(widget.medicineModel.error); Helpers.showErrorToast(widget.medicineModel.error);
} else if (widget.modelPrescription.state == ViewState.Idle) { } else if (widget.modelPrescription.state == ViewState.Idle) {
widget.modelPrescription.getPrescriptions(widget.patient); await widget.modelPrescription.getPrescriptionListNew(
appNo: widget.patient.appointmentNo,
mrn: widget.patient.patientMRN,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).medicationHasBeenAdded); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).medicationHasBeenAdded);
Navigator.of(context).pop(); Navigator.of(context).pop();
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,8 +51,7 @@ 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(
@ -78,15 +78,11 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
}, },
), ),
) )
: Container( : ErrorMessage(
child: Padding( error: TranslationBase.of(context)
padding: EdgeInsets.symmetric(vertical: 50.0), .youDoNotHaveFavoritePrescription,
child: AppText(
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