Wrapping the Row cards with CustomRow in intervention_medication.dart and intervention_medication_history_screen.dart and fix the accept or reject issue, fix the lable in intervention_medication_history_screen.dart and edit the initial date in pharmacy_intervention_screen.dart

merge-requests/957/head
RoaaGhali98 4 years ago
parent a829532717
commit 19d981d9e0

@ -113,6 +113,7 @@ class InterventionMedicationViewModel extends BaseViewModel {
int prescriptionNo, int prescriptionNo,
int orderNo, int orderNo,
int interventionStatus, int interventionStatus,
int status,
}) async { }) async {
AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel(
projectID: 15, projectID: 15,
@ -131,6 +132,7 @@ class InterventionMedicationViewModel extends BaseViewModel {
memberID: 2804, memberID: 2804,
//memberId, //memberId,
interventionStatus: interventionStatus, interventionStatus: interventionStatus,
status: status
); );
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);

@ -11,6 +11,7 @@ class AcceptOrRejectReqModel {
int lineItemNo; int lineItemNo;
bool patientOutSA; bool patientOutSA;
int interventionStatus; int interventionStatus;
int status;
AcceptOrRejectReqModel( AcceptOrRejectReqModel(
{this.patientID, {this.patientID,
@ -25,6 +26,7 @@ class AcceptOrRejectReqModel {
this.lineItemNo, this.lineItemNo,
this.patientOutSA, this.patientOutSA,
this.interventionStatus, this.interventionStatus,
this.status
}); });
AcceptOrRejectReqModel.fromJson(Map<String, dynamic> json) { AcceptOrRejectReqModel.fromJson(Map<String, dynamic> json) {
@ -40,6 +42,8 @@ class AcceptOrRejectReqModel {
lineItemNo = json['LineItemNo']; lineItemNo = json['LineItemNo'];
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
interventionStatus = json['InterventionStatus']; interventionStatus = json['InterventionStatus'];
status = json['Status'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -56,6 +60,7 @@ class AcceptOrRejectReqModel {
data['LineItemNo'] = this.lineItemNo; data['LineItemNo'] = this.lineItemNo;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;
data['InterventionStatus'] = this.interventionStatus; data['InterventionStatus'] = this.interventionStatus;
data['Status'] = this.status;
return data; return data;
} }
} }

@ -10,6 +10,7 @@ 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/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; import '../../../../core/viewModel/profile/intervention_medication_view_model.dart';
@ -102,22 +103,11 @@ class _InterventionMedicationScreenState
CrossAxisAlignment CrossAxisAlignment
.start, .start,
children: [ children: [
Row( CustomRow(
crossAxisAlignment: valueSize: 14,
CrossAxisAlignment label: '',
.start, value: model.allInterventionList[index].cS,
children: [ )
AppText(
model
.allInterventionList[
index]
.cS,
fontWeight:
FontWeight.w600,
fontSize: 14,
),
],
),
], ],
), ),
), ),
@ -142,6 +132,7 @@ class _InterventionMedicationScreenState
fontWeight: fontWeight:
FontWeight.w600, FontWeight.w600,
fontSize: 14, fontSize: 14,
color: Color(0xFF2B353E),
), ),
], ],
), ),
@ -152,91 +143,39 @@ class _InterventionMedicationScreenState
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( CustomRow(
mainAxisAlignment: labelSize: 12,
MainAxisAlignment.start, valueSize: 12,
children: [ label: 'Description: ',
AppText( value: model.allInterventionList[index].description,
'Description: ', ),
fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionList[
index]
.description,
fontSize: 12,
isCopyable: true,
),
),
]),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( CustomRow(
mainAxisAlignment: labelSize: 12,
MainAxisAlignment.start, valueSize: 12,
children: [ label: 'Medication: ',
AppText( value: model.allInterventionList[index].medication,
'Medication: ', ),
fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionList[
index]
.medication,
fontSize: 12,
isCopyable: true,
),
),
]),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( CustomRow(
mainAxisAlignment: labelSize: 12,
MainAxisAlignment.start, valueSize: 12,
children: [ label: 'Doctor Comments: ',
AppText( value: model.allInterventionList[index].doctorComments,
'Doctor Comments: ', ),
fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionList[
index]
.doctorComments,
fontSize: 12,
isCopyable: true,
),
),
]),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( CustomRow(
mainAxisAlignment: labelSize: 12,
MainAxisAlignment.start, valueSize: 12,
children: [ label: 'Status Description: ',
AppText( value: model.allInterventionList[index].statusDescription,
'Status Description: ', ),
fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionList[
index]
.statusDescription,
fontSize: 12,
isCopyable: true,
),
),
]),
], ],
), ),
SizedBox( SizedBox(

@ -19,6 +19,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../config/config.dart'; import '../../../../config/config.dart';
import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; import '../../../../core/viewModel/profile/intervention_medication_view_model.dart';
import '../../../../widgets/shared/user-guid/CusomRow.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -102,20 +103,11 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Row( CustomRow(
crossAxisAlignment: labelSize: 14,
CrossAxisAlignment valueSize: 14,
.start, label: 'Created By: ',
children: [ value: model.allInterventionHistoryList[index].createdBy.toString(),
AppText(
model
.allInterventionHistoryList[
index].setupId,
fontWeight: FontWeight.w600,
fontSize: 14,
),
],
), ),
], ],
), ),
@ -128,6 +120,7 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
.start, .start,
children: [ children: [
AppText( AppText(
AppDateUtils.getDayMonthYearDateFormatted( AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate( AppDateUtils.convertStringToDate(
model model
@ -139,6 +132,7 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
isMonthShort: true), isMonthShort: true),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
color: Color(0xFF2B353E),
), ),
], ],
), ),
@ -149,69 +143,24 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( CustomRow(
mainAxisAlignment: labelSize: 12,
MainAxisAlignment.start, valueSize: 12,
children: [ label: 'Remark: ',
AppText( value: model.allInterventionHistoryList[index].remark,
'Remark: ', ),
fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionHistoryList[
index]
.remark,
fontSize: 12,
isCopyable: true,
),
),
]),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( CustomRow(
mainAxisAlignment: labelSize: 12,
MainAxisAlignment.start, valueSize: 12,
children: [ label: 'Created By Name: ',
AppText( value: model.allInterventionHistoryList[index].createdByName,
'Created By Name: ', ),
fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionHistoryList[
index]
.createdByName,
fontSize: 12,
isCopyable: true,
),
),
]),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
'SetUp ID: ',
fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionHistoryList[
index]
.setupId,
fontSize: 12,
isCopyable: true,
),
),
]),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
@ -233,6 +182,7 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
orderNo: model.allInterventionHistoryList[index].orderNo, orderNo: model.allInterventionHistoryList[index].orderNo,
admissionNo: model.allInterventionHistoryList[index].admissionNo, admissionNo: model.allInterventionHistoryList[index].admissionNo,
interventionStatus: 1, interventionStatus: 1,
status: 61
); );
if(model.state == ViewState.ErrorLocal) { if(model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -288,7 +238,8 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
patientID: model.allInterventionHistoryList[index].patientId, patientID: model.allInterventionHistoryList[index].patientId,
orderNo: model.allInterventionHistoryList[index].orderNo, orderNo: model.allInterventionHistoryList[index].orderNo,
admissionNo: model.allInterventionHistoryList[index].admissionNo, admissionNo: model.allInterventionHistoryList[index].admissionNo,
interventionStatus: 2 interventionStatus: 2,
status: 61
); );
if(model.state == ViewState.ErrorLocal) { if(model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; import '../../../../core/viewModel/profile/intervention_medication_view_model.dart';
import '../../../../models/patient/patiant_info_model.dart'; import '../../../../models/patient/patiant_info_model.dart';
import '../../../base/base_view.dart'; import '../../../base/base_view.dart';
@ -15,7 +16,6 @@ import 'intervention_medication.dart';
class PharmacyInterventionScreen extends StatefulWidget { class PharmacyInterventionScreen extends StatefulWidget {
final OutPatientFilterType outPatientFilterType; final OutPatientFilterType outPatientFilterType;
const PharmacyInterventionScreen({ const PharmacyInterventionScreen({
Key key, Key key,
this.outPatientFilterType, this.outPatientFilterType,
@ -78,17 +78,16 @@ class _PharmacyInterventionScreenState
DateTime.now().year, DateTime.now().year,
DateTime.now().month, DateTime.now().month,
DateTime.now().day + 100), DateTime.now().day + 100),
selectedDate: DateTime( selectedDate: model.selectedFromDate != null
DateTime.now().year, ? model.selectedFromDate
DateTime.now().month, : DateTime.now(),
DateTime.now().day),
), ),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).fromDate, TranslationBase.of(context).fromDate,
model.selectedFromDate != null model.selectedFromDate != null
? "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}" ? "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}"
: null, : "${AppDateUtils.convertStringToDateFormat(DateTime.now().toString(), "yyyy-MM-dd")}",
true, true,
suffixIcon: Icon( suffixIcon: Icon(
Icons.calendar_today, Icons.calendar_today,
@ -116,17 +115,16 @@ class _PharmacyInterventionScreenState
DateTime.now().year, DateTime.now().year,
DateTime.now().month, DateTime.now().month,
DateTime.now().day + 100), DateTime.now().day + 100),
selectedDate: DateTime( selectedDate: model.selectedToDate != null
DateTime.now().year, ? model.selectedToDate
DateTime.now().month, : DateTime.now().add(Duration(days: 1)),
DateTime.now().day),
), ),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).toDate, TranslationBase.of(context).toDate,
model.selectedToDate != null model.selectedToDate != null
? "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}" ? "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}"
: null, : "${AppDateUtils.convertStringToDateFormat(DateTime.now().add(Duration(days: 1)).toString(), "yyyy-MM-dd")}",
true, true,
suffixIcon: Icon( suffixIcon: Icon(
Icons.calendar_today, Icons.calendar_today,
@ -173,7 +171,10 @@ class _PharmacyInterventionScreenState
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
InterventionMedicationScreen(patient,previousModel: model,)), InterventionMedicationScreen(
patient,
previousModel: model,
)),
); );
}, },
), ),

Loading…
Cancel
Save