jira bugs fix

merge-requests/294/head
hussam al-habibeh 5 years ago
parent 6dd1d9ef90
commit 539f7facc7

@ -57,6 +57,8 @@ class EntityList {
dynamic status; dynamic status;
dynamic stopDate; dynamic stopDate;
dynamic uom; dynamic uom;
dynamic pharmacistRemarks;
dynamic refill;
EntityList( EntityList(
{this.appointmentNo, {this.appointmentNo,
@ -87,7 +89,9 @@ class EntityList {
this.startDate, this.startDate,
this.status, this.status,
this.stopDate, this.stopDate,
this.uom}); this.uom,
this.pharmacistRemarks,
this.refill});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
@ -119,6 +123,8 @@ class EntityList {
status = json['status']; status = json['status'];
stopDate = json['stopDate']; stopDate = json['stopDate'];
uom = json['uom']; uom = json['uom'];
pharmacistRemarks = json['pharmacistRemarks'];
refill = json['refill'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -152,6 +158,8 @@ class EntityList {
data['status'] = this.status; data['status'] = this.status;
data['stopDate'] = this.stopDate; data['stopDate'] = this.stopDate;
data['uom'] = this.uom; data['uom'] = this.uom;
data['pharmacistRemarks'] = this.pharmacistRemarks;
data['refill'] = this.refill;
return data; return data;
} }
} }

@ -48,6 +48,7 @@ postProcedure(
PrescriptionViewModel model, PrescriptionViewModel model,
DateTime doseTime, DateTime doseTime,
String doseUnit, String doseUnit,
String icdCode,
PatiantInformtion patient}) async { PatiantInformtion patient}) async {
PostPrescriptionReqModel postProcedureReqModel = PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel(); new PostPrescriptionReqModel();
@ -67,7 +68,7 @@ postProcedure(
frequency: frequency.isEmpty ? 1 : int.parse(frequency), frequency: frequency.isEmpty ? 1 : int.parse(frequency),
remarks: instruction, remarks: instruction,
approvalRequired: true, approvalRequired: true,
icdcode10Id: "test2", icdcode10Id: icdCode.toString(),
doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn),
duration: duration.isEmpty ? 1 : int.parse(duration), duration: duration.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime.toIso8601String())); doseStartDate: doseTime.toIso8601String()));
@ -127,6 +128,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic doseTime; dynamic doseTime;
dynamic indication; dynamic indication;
dynamic units; dynamic units;
dynamic x;
List<dynamic> indicationList; List<dynamic> indicationList;
String routeInatial = 'By Mouth'; String routeInatial = 'By Mouth';
@ -176,11 +178,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ListSelectDialog drugDialog; ListSelectDialog drugDialog;
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
// final routeArgs = ModalRoute.of(context).settings.arguments as Map; // final routeArgs = ModalRoute.of(context).settings.arguments as Map;
// patient = routeArgs['patient']; // patient = routeArgs['patient'];
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
x = model.patientAssessmentList.map((element) {
return element.icdCode10ID;
});
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patient.patientMRN, patientMRN: widget.patient.patientMRN,
episodeID: widget.patient.episodeNo.toString(), episodeID: widget.patient.episodeNo.toString(),
@ -193,7 +199,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
await model.getMedicationRoute(); await model.getMedicationRoute();
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
await model.getMedicationIndications(); //await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
}, },
builder: ( builder: (
@ -210,7 +216,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
builder: (BuildContext context, ScrollController scrollController) { builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: 980, height: 1010,
child: Padding( child: Padding(
padding: padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
@ -691,7 +697,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// openDrugToDrug(); // openDrugToDrug();
if (route == null || if (route == null ||
frequency == null || frequency == null ||
indication == null ||
doseTime == null || doseTime == null ||
duration == null || duration == null ||
selectedDate == null || selectedDate == null ||
@ -704,30 +709,54 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
if (formKey.currentState.validate()) { if (formKey.currentState.validate()) {
Navigator.pop(context); Navigator.pop(context);
{ {
// var x = model
// .patientAssessmentList
// .map((value) =>
// value.icdCode10ID)
// .toList()
// .join(',');
postProcedure( postProcedure(
dose: strengthController.text, icdCode: model
doseUnit: .patientAssessmentList[
units['id'].toString(), 0]
patient: widget.patient, .icdCode10ID
doseTimeIn: .isEmpty
doseTime['id'].toString(), ? "test"
model: widget.model, : model
duration: .patientAssessmentList[
duration['id'].toString(), 0]
frequency: frequency['id'] .icdCode10ID
.toString(), .toString(),
route: route['id'].toString(), // icdCode: model
drugId: _selectedMedication // .patientAssessmentList
.itemId // .map((value) => value
.toString(), // .icdCode10ID
strength: // .trim())
strengthController.text, // .toList()
indication: // .join(' '),
indicationController.text, dose: strengthController.text,
instruction: doseUnit:
instructionController units['id'].toString(),
.text, patient: widget.patient,
doseTime: selectedDate); doseTimeIn:
doseTime['id'].toString(),
model: widget.model,
duration:
duration['id'].toString(),
frequency:
frequency['id'].toString(),
route: route['id'].toString(),
drugId: _selectedMedication
.itemId
.toString(),
strength:
strengthController.text,
indication:
indicationController.text,
instruction:
instructionController.text,
doseTime: selectedDate,
);
} }
} }
{ {

@ -200,7 +200,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.24, 0.33,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -239,7 +239,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.3499, 0.3899,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -357,6 +357,28 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
) )
], ],
), ),
SizedBox(
height:
5.0),
Row(
children: [
AppText(
'pharmacist Remarks : ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child: AppText(
model.prescriptionList[0].entityList[index].pharmacistRemarks == null
? ""
: model.prescriptionList[0].entityList[index].pharmacistRemarks,
fontSize: 15.0),
)
],
),
SizedBox( SizedBox(
height: 20.0, height: 20.0,
), ),
@ -383,20 +405,23 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
) )
], ],
), ),
SizedBox(
height: 8.0,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: child:
Container( Container(
height: height:
30, 25,
child: child:
AppText( AppText(
model.prescriptionList[0].entityList[index].remarks == null model.prescriptionList[0].entityList[index].remarks == null
? "" ? ""
: model.prescriptionList[0].entityList[index].remarks, : model.prescriptionList[0].entityList[index].remarks,
fontSize: fontSize:
11.5, 12.5,
), ),
), ),
), ),
@ -417,7 +442,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.08, 0.16,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -431,32 +456,31 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit), .edit),
onTap: () { onTap: () {
updatePrescriptionForm( updatePrescriptionForm(
doseUnit: drugNameGeneric: model
model.prescriptionList[0].entityList[index].doseDailyUnitID
.toString(),
doseStreangth:
model.prescriptionList[0].entityList[index].doseDailyQuantity
.toString(),
duration:
model.prescriptionList[0].entityList[index].doseDurationDays
.toString(),
startDate:
model.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.doseTimingID .medicationName,
doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID
.toString(), .toString(),
frequency: model doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity
.toString(),
duration: model.prescriptionList[0].entityList[index].doseDurationDays
.toString(),
startDate:
model.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.frequencyID .doseTimingID
.toString(), .toString(),
frequency:
model.prescriptionList[0].entityList[index].frequencyID
.toString(),
rouat: model rouat: model
.prescriptionList[ .prescriptionList[
0] 0]

@ -1,6 +1,8 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.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/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
@ -8,6 +10,7 @@ import 'package:doctor_app_flutter/models/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/util/dr_app_toast_msg.dart'; 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/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -31,6 +34,7 @@ class UpdatePrescriptionForm extends StatefulWidget {
final String enteredRemarks; final String enteredRemarks;
final String startDate; final String startDate;
final String frequency; final String frequency;
final String drugNameGeneric;
final PrescriptionViewModel model; final PrescriptionViewModel model;
UpdatePrescriptionForm( UpdatePrescriptionForm(
@ -46,7 +50,8 @@ class UpdatePrescriptionForm extends StatefulWidget {
this.doseUnit, this.doseUnit,
this.enteredRemarks, this.enteredRemarks,
this.frequency, this.frequency,
this.model}); this.model,
this.drugNameGeneric});
@override @override
_UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState();
} }
@ -62,6 +67,9 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
dynamic frequencyUpdate; dynamic frequencyUpdate;
dynamic updatedDuration; dynamic updatedDuration;
dynamic units; dynamic units;
GetMedicationResponseModel newSelectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
@override @override
void initState() { void initState() {
@ -80,7 +88,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
await model.getMedicationRoute(); await model.getMedicationRoute();
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
await model.getMedicationIndications(); //await model.getMedicationIndications();
route = model.getLookupById(model.medicationRouteList, widget.route); route = model.getLookupById(model.medicationRouteList, widget.route);
doseTime = doseTime =
model.getLookupById(model.medicationDoseTimeList, widget.dose); model.getLookupById(model.medicationDoseTimeList, widget.dose);
@ -96,13 +104,13 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
initialChildSize: 0.90, initialChildSize: 0.95,
maxChildSize: 0.90, maxChildSize: 0.99,
minChildSize: 0.6, minChildSize: 0.6,
builder: builder:
(BuildContext context, ScrollController scrollController) { (BuildContext context, ScrollController scrollController) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 1.0, height: MediaQuery.of(context).size.height * 1.3,
child: Form( child: Form(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@ -119,6 +127,78 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
), ),
Column( Column(
children: [ children: [
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: model.allMedicationList != null
? () {
setState(() {
newSelectedMedication = null;
});
}
: null,
child: newSelectedMedication == null
? AutoCompleteTextField<
GetMedicationResponseModel>(
decoration:
textFieldSelectorDecoration(
widget.drugNameGeneric,
newSelectedMedication != null
? newSelectedMedication
.genericName
: null,
true,
),
itemSubmitted: (item) => setState(
() => newSelectedMedication =
item),
key: key,
suggestions:
model.allMedicationList,
itemBuilder: (context,
suggestion) =>
new Padding(
child: Texts(suggestion
.description +
'/' +
suggestion.genericName),
padding:
EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.genericName
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(
input.toLowerCase()),
)
: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
newSelectedMedication != null
? newSelectedMedication
.description +
('${newSelectedMedication.genericName}')
: null,
true,
),
enabled: false,
),
),
),
SizedBox(
height: 12,
),
Container( Container(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height *
0.060, 0.060,
@ -428,18 +508,23 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
'update prescription'.toUpperCase(), 'update prescription'.toUpperCase(),
onPressed: () { onPressed: () {
updatePrescription( updatePrescription(
newDrugId:
newSelectedMedication != null
? newSelectedMedication
.itemId
.toString()
: widget.drugId,
newDoseStreangth: newDoseStreangth:
strengthController strengthController
.text.isNotEmpty .text.isNotEmpty
? strengthController.text ? strengthController.text
: widget.doseStreangth, : widget.doseStreangth,
newUnit: units != newUnit: units != null
null
? units['id'].toString() ? units['id'].toString()
: widget.doseUnit, : widget.doseUnit,
doseUnit: widget.doseUnit, doseUnit: widget.doseUnit,
doseStreangth: widget doseStreangth:
.doseStreangth, widget.doseStreangth,
duration: widget.duration, duration: widget.duration,
startDate: widget.startDate, startDate: widget.startDate,
doseId: widget.dose, doseId: widget.dose,
@ -447,25 +532,20 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
routeId: widget.route, routeId: widget.route,
patient: widget.patient, patient: widget.patient,
model: widget.model, model: widget.model,
newDuration: newDuration: updatedDuration !=
updatedDuration != null
null ? updatedDuration['id']
? updatedDuration[ .toString()
'id'] : widget.duration,
.toString()
: widget.duration,
drugId: widget.drugId, drugId: widget.drugId,
remarks: remarksController.text, remarks: remarksController.text,
route: route != route: route != null
null
? route['id'].toString() ? route['id'].toString()
: widget.route, : widget.route,
frequency: frequency: frequencyUpdate != null
frequencyUpdate != ? frequencyUpdate['id']
null .toString()
? frequencyUpdate['id'] : widget.frequency,
.toString()
: widget.frequency,
dose: doseTime != null dose: doseTime != null
? doseTime['id'].toString() ? doseTime['id'].toString()
: widget.dose, : widget.dose,
@ -524,6 +604,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
updatePrescription( updatePrescription(
{PrescriptionViewModel model, {PrescriptionViewModel model,
int drugId, int drugId,
int newDrugId,
String frequencyId, String frequencyId,
String remarks, String remarks,
String dose, String dose,
@ -556,7 +637,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
? int.parse(newDoseStreangth) ? int.parse(newDoseStreangth)
: int.parse(doseStreangth), : int.parse(doseStreangth),
//frequency.isNotEmpty ? int.parse(dose) : 1, //frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId, itemId: newDrugId != 0 ? newDrugId : drugId,
doseUnitId: doseUnitId:
newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit),
route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
@ -588,6 +669,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
void updatePrescriptionForm( void updatePrescriptionForm(
{context, {context,
String drugName, String drugName,
String drugNameGeneric,
int drugId, int drugId,
String remarks, String remarks,
PrescriptionViewModel model, PrescriptionViewModel model,
@ -622,6 +704,7 @@ void updatePrescriptionForm(
route: rouat, route: rouat,
startDate: startDate, startDate: startDate,
model: model, model: model,
drugNameGeneric: drugNameGeneric,
); );
}); });
} }

Loading…
Cancel
Save