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"},
"pharmacology": {"en": "Pharmacology", "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": "الرجاء اختيار عنصر"},
"searchFavoriteTemplate": {"en": "search Favorites Template", "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/vte_assessment/vte_assessment_screen.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 './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_ECG = 'patients/ecg';
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_By_Elham = 'prescription/prescription_new_elham';
const String ORDER_PROCEDURE = 'procedure/procedure';
const String ADD_SICKLEAVE = 'add-sickleave';
const String RADIOLOGY_PATIENT = 'radiology-patient';
@ -125,8 +125,8 @@ var routes = {
),
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
ADD_SICKLEAVE: (_) => PatientSickLeaveScreen(),
ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(),
ORDER_PRESCRIPTION_NEW_By_Elham: (_) => NewPrescriptionsPage(),
ORDER_PRESCRIPTION_OLD: (_) => OldPrescriptionsPage(),
ORDER_PRESCRIPTION_NEW: (_) => NewPrescriptionsPage(),
ORDER_PROCEDURE: (_) => ProcedureScreen(),
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(),

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

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

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

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

@ -21,8 +21,7 @@ import 'package:flutter/material.dart';
import '../../util/helpers.dart';
import '../../widgets/shared/errors/error_message.dart';
///TODO Elham* the design should be fixed By roaa
class PrescriptionsPage extends StatelessWidget {
class OldPrescriptionsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -64,31 +63,12 @@ class PrescriptionsPage extends StatelessWidget {
ServiceTitle(
title: TranslationBase.of(context).orders,
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(
physics: BouncingScrollPhysics(),
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/widgets/shared/app_scaffold_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/material.dart';
import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
@ -50,43 +51,38 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: Column(
children: [
(widget.previousProcedureViewModel.templateList.length != 0)
? Expanded(
child: EntityListCheckboxSearchFavProceduresWidget(
isProcedure: !(widget.procedureType ==
ProcedureType.PRESCRIPTION),
model: widget.previousProcedureViewModel,
removeFavProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addFavProcedure: (history) {
setState(() {
entityList.add(history);
});
},
isEntityFavListSelected: (master) =>
isEntityListSelected(master),
groupProcedures: groupProcedures,
selectProcedures: (selectedProcedure) {
setState(() {
groupProcedures = selectedProcedure;
});
},
),
)
: Container(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 50.0),
child: AppText(
TranslationBase.of(context).youDoNotHaveFavoritePrescription,),
),
body: Column(children: [
(widget.previousProcedureViewModel.templateList.length != 0)
? Expanded(
child: EntityListCheckboxSearchFavProceduresWidget(
isProcedure: !(widget.procedureType ==
ProcedureType.PRESCRIPTION),
model: widget.previousProcedureViewModel,
removeFavProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addFavProcedure: (history) {
setState(() {
entityList.add(history);
});
},
isEntityFavListSelected: (master) =>
isEntityListSelected(master),
groupProcedures: groupProcedures,
selectProcedures: (selectedProcedure) {
setState(() {
groupProcedures = selectedProcedure;
});
},
),
],
),
)
: ErrorMessage(
error: TranslationBase.of(context)
.youDoNotHaveFavoritePrescription,
),
]),
bottomSheet: BottomSheetDialogButton(
label: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures,

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

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

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

Loading…
Cancel
Save