diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart index c6e2dbff..9c456a2a 100644 --- a/lib/core/viewModel/profile/intervention_medication_view_model.dart +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -22,8 +22,8 @@ class InterventionMedicationViewModel extends BaseViewModel { List filterData = []; - DateTime selectedFromDate; - DateTime selectedToDate; + DateTime selectedFromDate = DateTime.now(); + DateTime selectedToDate = DateTime.now().add(Duration(days: 1)); PatiantInformtion patient; bool hasError = false; @@ -37,21 +37,21 @@ class InterventionMedicationViewModel extends BaseViewModel { _interventionMedicationService.allInterventionHistoryList; Future getInterventionMedication({ + int projectId, int patientId, DateTime fromDate, DateTime toDate, + }) async { InterventionMedicationReqModel interventionMedicationReqModel = InterventionMedicationReqModel( - projectID: 15, - //projectId, - patientID: 79941, - //patientId, - fromDate: "\/Date(1488322922)\/", - //AppDateUtils.convertDateToServerFormat(fromDate), - toDate: - "\/Date(1635886800000)\/", //AppDateUtils.convertDateToServerFormat(toDate), + + projectID: projectId, + patientID: patientId, + fromDate: AppDateUtils.convertDateToServerFormat(fromDate), + toDate: AppDateUtils.convertDateToServerFormat(toDate), + ); hasError = false; setState(ViewState.Busy); @@ -66,24 +66,24 @@ class InterventionMedicationViewModel extends BaseViewModel { } Future getInterventionMedicationHistory( - {int projectId, - int patientId, - int admissionNo, - int prescriptionNo, - int orderNo, + { + int projectId, + int patientId, + int admissionNo, + int prescriptionNo, + int orderNo, + bool isBusyLocal = false}) async { InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel = InterventionMedicationHistoryReqModel( - projectID: 15, - //projectId, - patientID: 79941, - //patientId, - admissionNo: 2018013900, - //admissionNo, - prescriptionNo: 2045165, - //prescriptionNo, - orderNo: 1171570, //orderNo, + + projectID: projectId, + patientID: patientId, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + ); hasError = false; if (isBusyLocal) @@ -105,6 +105,7 @@ class InterventionMedicationViewModel extends BaseViewModel { } Future setAcceptedOrRejected({ + String remarks, int memberId, int projectId, @@ -113,24 +114,23 @@ class InterventionMedicationViewModel extends BaseViewModel { int prescriptionNo, int orderNo, int interventionStatus, + int status, + }) async { AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( - projectID: 15, - //projectId, - patientID: 79941, - //patientID, - admissionNo: 2018013900, - //admissionNo, - prescriptionNo: 2045165, - //prescriptionNo, - orderNo: 1171570, - //orderNo, - accessLevel: 4, - lineItemNo: 1, - remarks: remarks, - memberID: 2804, - //memberId, - interventionStatus: interventionStatus, + + projectID: projectId, + patientID: patientID, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + accessLevel: 4, + lineItemNo: 1, + remarks: remarks, + memberID: memberId, + interventionStatus: interventionStatus, + status: status + ); hasError = false; setState(ViewState.BusyLocal); diff --git a/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart b/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart index b3660d59..67b234de 100644 --- a/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart +++ b/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart @@ -11,6 +11,7 @@ class AcceptOrRejectReqModel { int lineItemNo; bool patientOutSA; int interventionStatus; + int status; AcceptOrRejectReqModel( {this.patientID, @@ -25,6 +26,7 @@ class AcceptOrRejectReqModel { this.lineItemNo, this.patientOutSA, this.interventionStatus, + this.status }); AcceptOrRejectReqModel.fromJson(Map json) { @@ -40,6 +42,8 @@ class AcceptOrRejectReqModel { lineItemNo = json['LineItemNo']; patientOutSA = json['PatientOutSA']; interventionStatus = json['InterventionStatus']; + status = json['Status']; + } Map toJson() { @@ -56,6 +60,7 @@ class AcceptOrRejectReqModel { data['LineItemNo'] = this.lineItemNo; data['PatientOutSA'] = this.patientOutSA; data['InterventionStatus'] = this.interventionStatus; + data['Status'] = this.status; return data; } } \ No newline at end of file diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart index bb38b28a..3944d2b8 100644 --- a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart @@ -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/card_with_bg_widget.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:provider/provider.dart'; import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; @@ -102,22 +103,11 @@ class _InterventionMedicationScreenState CrossAxisAlignment .start, children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - model - .allInterventionList[ - index] - .cS, - fontWeight: - FontWeight.w600, - fontSize: 14, - ), - ], - ), + CustomRow( + valueSize: 14, + label: '', + value: model.allInterventionList[index].cS, + ) ], ), ), @@ -142,6 +132,7 @@ class _InterventionMedicationScreenState fontWeight: FontWeight.w600, fontSize: 14, + color: Color(0xFF2B353E), ), ], ), @@ -152,91 +143,39 @@ class _InterventionMedicationScreenState SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Description: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .description, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Description: ', + value: model.allInterventionList[index].description, + ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Medication: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .medication, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Medication: ', + value: model.allInterventionList[index].medication, + ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Doctor Comments: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .doctorComments, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Doctor Comments: ', + value: model.allInterventionList[index].doctorComments, + ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Status Description: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .statusDescription, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Status Description: ', + value: model.allInterventionList[index].statusDescription, + ), ], ), SizedBox( diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart index c7aaceeb..2ceab871 100644 --- a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../../../config/config.dart'; import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../../widgets/shared/user-guid/CusomRow.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -102,20 +103,11 @@ class _InterventionMedicationHistoryScreenState extends State - InterventionMedicationScreen(patient,previousModel: model,)), + InterventionMedicationScreen( + patient, + previousModel: model, + )), ); }, ),