updating prescription after backend fix

merge-requests/321/head
hussam al-habibeh 4 years ago
parent ae17998e0a
commit f32d25b007

@ -47,7 +47,7 @@ class PrescriptionRequestModel {
int itemId;
String doseStartDate;
int duration;
int dose;
double dose;
int doseUnitId;
int route;
int frequency;

@ -61,7 +61,7 @@ postProcedure(
sss.add(PrescriptionRequestModel(
covered: true,
dose: int.parse(dose),
dose: double.parse(dose),
itemId: drugId.isEmpty ? 1 : int.parse(drugId),
doseUnitId: int.parse(doseUnit),
route: route.isEmpty ? 1 : int.parse(route),
@ -361,8 +361,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
0.550,
child: TextFields(
inputFormatters: [
LengthLimitingTextInputFormatter(
4),
// LengthLimitingTextInputFormatter(
// 4),
// WhitelistingTextInputFormatter
// .digitsOnly
],
@ -767,16 +767,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
"Please Fill All Fields");
return;
}
if (int.parse(
if (double.parse(
strengthController.text) >
1000) {
1000.0) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (int.parse(
if (double.parse(
strengthController.text) ==
0) {
0.0) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;

@ -703,16 +703,17 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
title: 'update prescription'
.toUpperCase(),
onPressed: () {
if (int.parse(
if (double.parse(
strengthController.text) >
1000) {
1000.0) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (int.parse(strengthController
.text) ==
0) {
if (double.parse(
strengthController
.text) ==
0.0) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;
@ -872,8 +873,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
sss.add(PrescriptionRequestModel(
covered: true,
dose: newDoseStreangth.isNotEmpty
? int.parse(newDoseStreangth)
: int.parse(doseStreangth),
? double.parse(newDoseStreangth)
: double.parse(doseStreangth),
//frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId,
doseUnitId:

@ -25,14 +25,15 @@ postProcedure(
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List();
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
@ -41,16 +42,13 @@ postProcedure(
controls.add(
Controls(code: "ordertype", controlValue: element.type),
);
});
entityList.forEach((element) {
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {

@ -136,8 +136,8 @@ class _EntityListCheckboxSearchWidgetState
historyInfo.type =
setSelectedType(value)
.toString();
// historyInfo.type =
// value.toString();
historyInfo.type =
value.toString();
},
),
Text('routine'),
@ -149,8 +149,8 @@ class _EntityListCheckboxSearchWidgetState
historyInfo.type =
setSelectedType(value)
.toString();
// historyInfo.type =
// value.toString();
historyInfo.type =
value.toString();
},
),
Text(TranslationBase.of(context)

@ -91,7 +91,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
builder:
(BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: widget.model,
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
@ -310,12 +310,16 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
updateProcedureReqModel.lineItemNo = 1;
updateProcedureReqModel.orderNo = orderNo;
controls.add(
Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
);
controls.add(
Controls(code: "ordertype", controlValue: "1"),
);
entityList.forEach((element) {
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks.isNotEmpty ? element.remarks : ""),
);
controls.add(
Controls(code: "ordertype", controlValue: '1'),
);
});
entityList.isNotEmpty
? entityList.forEach((element) {

Loading…
Cancel
Save