Fix some issues

merge-requests/953/head
RoaaGhali98 4 years ago
parent 37928c1757
commit fde96fbce7

@ -1054,6 +1054,8 @@ const Map<String, Map<String, String>> localizedValues = {
"maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"},
"nursing": {"en": "Nursing", "ar": "تمريض"}, "nursing": {"en": "Nursing", "ar": "تمريض"},
"diabetic": {"en": "Diabetic", "ar": "مرض السكري"}, "diabetic": {"en": "Diabetic", "ar": "مرض السكري"},
"pharmacy": {"en": "Pharmacy", "ar": "الصيدلاني"},
"intervention": {"en": "Intervention", "ar": "التدخل"},
"chart": {"en": "Chart", "ar": "جدول"}, "chart": {"en": "Chart", "ar": "جدول"},
"operationTimeStart": { "operationTimeStart": {
"en": "Operation Time Start :", "en": "Operation Time Start :",

@ -2,14 +2,30 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../../models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart';
import '../../../screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart'; import '../../../screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart';
import '../../../screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_req_model.dart'; import '../../../screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_req_model.dart';
import '../../../screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_res_model.dart'; import '../../../screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_res_model.dart';
import '../../../screens/patients/profile/pharmacy-intervention-model/new_medication_req_model.dart'; import '../../../screens/patients/profile/pharmacy-intervention-model/new_medication_req_model.dart';
import '../../../screens/patients/profile/pharmacy-intervention-model/new_medication_res_model.dart'; import '../../../screens/patients/profile/pharmacy-intervention-model/new_medication_res_model.dart';
import '../../../util/date-utils.dart';
import '../../service/patient/profile/intervention_medication_service.dart'; import '../../service/patient/profile/intervention_medication_service.dart';
import '../../service/special_clinics/special_clinic_service.dart';
class InterventionMedicationViewModel extends BaseViewModel { class InterventionMedicationViewModel extends BaseViewModel {
SpecialClinicsService _specialClinicsService =
locator<SpecialClinicsService>();
List<GetSpecialClinicalCareMappingListResponseModel>
get specialClinicalCareMappingList =>
_specialClinicsService.specialClinicalCareMappingList;
List<PatiantInformtion> filterData = [];
DateTime selectedFromDate;
DateTime selectedToDate;
PatiantInformtion patient; PatiantInformtion patient;
bool hasError = false; bool hasError = false;
InterventionMedicationService _interventionMedicationService = InterventionMedicationService _interventionMedicationService =
@ -23,18 +39,25 @@ class InterventionMedicationViewModel extends BaseViewModel {
Future getInterventionMedication({ Future getInterventionMedication({
int projectId,
int patientId, int patientId,
int admissionNo, int admissionNo,
DateTime fromDate,
DateTime toDate,
}) async { }) async {
InterventionMedicationReqModel interventionMedicationReqModel = InterventionMedicationReqModel interventionMedicationReqModel =
InterventionMedicationReqModel( InterventionMedicationReqModel(
projectID: 15, projectID: projectId,
patientID: 79941, patientID: patientId,
fromDate: '\/Date(1488322922)\/', fromDate: AppDateUtils.convertToServerFormat(
toDate: '\/Date(1635886800000)\/', fromDate.toString(),
'MM/dd/yyyy'),
toDate: AppDateUtils.convertToServerFormat(
toDate.toString(),
'MM/dd/yyyy'),
); );
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _interventionMedicationService.getInterventionMedication( await _interventionMedicationService.getInterventionMedication(
interventionMedicationReqModel: interventionMedicationReqModel); interventionMedicationReqModel: interventionMedicationReqModel);
if (_interventionMedicationService.hasError) { if (_interventionMedicationService.hasError) {
@ -47,18 +70,22 @@ class InterventionMedicationViewModel extends BaseViewModel {
Future getInterventionMedicationHistory({ Future getInterventionMedicationHistory({
int projectId,
int patientId, int patientId,
int admissionNo,
int prescriptionNo,
int orderNo,
}) async { }) async {
InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel = InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel =
InterventionMedicationHistoryReqModel( InterventionMedicationHistoryReqModel(
projectID: 15, projectID: projectId,
patientID: 79941, patientID: patientId,
admissionNo: 2018013900, admissionNo: admissionNo,
prescriptionNo: 2045165, prescriptionNo: prescriptionNo,
orderNo: 1171570, orderNo: orderNo,
); );
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _interventionMedicationService.getInterventionMedicationHistory( await _interventionMedicationService.getInterventionMedicationHistory(
interventionMedicationHistoryReqModel: interventionMedicationHistoryReqModel); interventionMedicationHistoryReqModel: interventionMedicationHistoryReqModel);
if (_interventionMedicationService.hasError) { if (_interventionMedicationService.hasError) {
@ -72,15 +99,24 @@ class InterventionMedicationViewModel extends BaseViewModel {
Future setAcceptedOrRejected({ Future setAcceptedOrRejected({
String remarks, String remarks,
int memberId,
int projectId,
int patientID,
int admissionNo,
int prescriptionNo,
int orderNo,
}) async { }) async {
AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel acceptOrRejectReqModel =
AcceptOrRejectReqModel( AcceptOrRejectReqModel(
projectID: 15, projectID: projectId,
patientID: 79941, patientID: patientID,
admissionNo: 2018013900, admissionNo: admissionNo,
prescriptionNo: 2045165, prescriptionNo: prescriptionNo,
orderNo: 1171570, orderNo: orderNo,
remarks: remarks accessLevel: 4,
lineItemNo: 1,
remarks: remarks,
memberID: memberId,
); );
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);

@ -67,7 +67,6 @@ import 'core/viewModel/patient-ucaf-viewmodel.dart';
import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart';
import 'core/viewModel/prescriptions_view_model.dart'; import 'core/viewModel/prescriptions_view_model.dart';
import 'core/viewModel/profile/intervention_medication_view_model.dart'; import 'core/viewModel/profile/intervention_medication_view_model.dart';
import 'core/viewModel/profile/pharmacy_intervention_view_model.dart';
import 'core/viewModel/profile/vte_assessment_view_model.dart'; import 'core/viewModel/profile/vte_assessment_view_model.dart';
import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/radiology_view_model.dart';
import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referral_view_model.dart';
@ -150,7 +149,6 @@ void setupLocator() {
locator.registerFactory(() => PatientRegistrationViewModel()); locator.registerFactory(() => PatientRegistrationViewModel());
locator.registerFactory(() => PendingOrdersViewModel()); locator.registerFactory(() => PendingOrdersViewModel());
locator.registerFactory(() => DischargeSummaryViewModel()); locator.registerFactory(() => DischargeSummaryViewModel());
locator.registerFactory(() => PharmacyInterventionViewModel());
locator.registerFactory(() => VteAssessmentViewModel()); locator.registerFactory(() => VteAssessmentViewModel());
locator.registerFactory(() => InterventionMedicationViewModel()); locator.registerFactory(() => InterventionMedicationViewModel());
} }

@ -1,8 +1,4 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/vte_assessment_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; 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';
@ -16,7 +12,6 @@ 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: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';
import '../../../../widgets/transitions/fade_page.dart'; import '../../../../widgets/transitions/fade_page.dart';
import 'intervention_medication_history_screen.dart'; import 'intervention_medication_history_screen.dart';
@ -28,10 +23,12 @@ class InterventionMedicationScreen extends StatefulWidget {
const InterventionMedicationScreen(this.patient, {Key key}) : super(key: key); const InterventionMedicationScreen(this.patient, {Key key}) : super(key: key);
@override @override
_InterventionMedicationScreenState createState() => _InterventionMedicationScreenState(); _InterventionMedicationScreenState createState() =>
_InterventionMedicationScreenState();
} }
class _InterventionMedicationScreenState extends State<InterventionMedicationScreen> { class _InterventionMedicationScreenState
extends State<InterventionMedicationScreen> {
bool isDischargedPatient = false; bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel; AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -42,11 +39,13 @@ class _InterventionMedicationScreenState extends State<InterventionMedicationScr
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<InterventionMedicationViewModel>( return BaseView<InterventionMedicationViewModel>(
onModelReady: (model) => model.getInterventionMedication(patientId: widget.patient.patientId, onModelReady: (model) => model.getInterventionMedication(
// admissionNo: 2016023498 patientId: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo),
admissionNo:int.parse(widget.patient.admissionNo) fromDate: model.selectedFromDate,
toDate: model.selectedToDate,
), ),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -55,270 +54,212 @@ class _InterventionMedicationScreenState extends State<InterventionMedicationScr
isInpatient: true, isInpatient: true,
), ),
body: model.allInterventionList == null || body: model.allInterventionList == null ||
model.allInterventionList.length == 0 model.allInterventionList.length == 0
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,
), ),
) )
: InkWell( : Container(
child: Container( color: Colors.grey[200],
color: Colors.grey[200], child: Column(
child: Column( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Container(
child: Container( child: ListView.builder(
child: ListView.builder( itemCount: model.allInterventionList.length,
itemCount: model.allInterventionList.length, itemBuilder: (BuildContext ctxt, int index) {
itemBuilder: (BuildContext ctxt, int index) { return InkWell(
return FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.95, widthFactor: 0.95,
child: CardWithBgWidget( child: CardWithBgWidget(
hasBorder: false, hasBorder: false,
bgColor: Colors.transparent, bgColor: Colors.transparent,
widget: Column( widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.60,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
model
.allInterventionList[
index].cS,
fontWeight: FontWeight.w600,
fontSize: 14,
),
],
),
],
),
),
Column( Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: 10,
),
Row( Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment.start,
.start,
children: [ children: [
AppText( Container(
AppDateUtils.getDayMonthYearDateFormatted( width: MediaQuery.of(context)
AppDateUtils.convertStringToDate( .size
model .width *
.allInterventionList[ 0.60,
index].startDatetime) child: Column(
,isArabic: crossAxisAlignment:
projectViewModel CrossAxisAlignment
.isArabic, .start,
isMonthShort: true), children: [
fontWeight: FontWeight.w600, Row(
fontSize: 14, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
model
.allInterventionList[
index]
.cS,
fontWeight:
FontWeight.w600,
fontSize: 14,
),
],
),
],
),
), ),
Column(
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
AppText(
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(model
.allInterventionList[
index]
.startDatetime),
isArabic:
projectViewModel
.isArabic,
isMonthShort:
true),
fontWeight:
FontWeight.w600,
fontSize: 14,
),
],
),
],
)
], ],
), ),
], SizedBox(
) height: 8,
// Column(
// children: [
// AppText(
// model
// .allInterventionList[
// index]
// .startDatetime !=
// null
// ? AppDateUtils.getDayMonthYearDateFormatted(
// AppDateUtils
// .getDateTimeFromString(model
// .allInterventionList[
// index]
// .startDatetime),
// isArabic:
// projectViewModel
// .isArabic,
// isMonthShort: true)
// : AppDateUtils
// .getDayMonthYearDateFormatted(
// DateTime.now(),
// isArabic:
// projectViewModel
// .isArabic),
// fontWeight: FontWeight.w600,
// fontSize: 14,
// isCopyable: true,
// ),
// AppText(
// model
// .allInterventionList[
// index]
// .startDatetime !=
// null
// ? AppDateUtils.getHour(
// AppDateUtils
// .getDateTimeFromString(model
// .allInterventionList[
// index]
// .startDatetime))
// : AppDateUtils.getHour(
// DateTime.now()),
// fontWeight: FontWeight.w600,
// fontSize: 14,
// isCopyable: true,
// ),
// ],
// crossAxisAlignment:
// CrossAxisAlignment.end,
// )
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context)
// .VTE_Type +
// " : ",
// fontSize: 12,
// ),
Expanded(
child: AppText(
model
.allInterventionList[
index]
.description,
fontSize: 12,
isCopyable: true,
), ),
), Row(
]), mainAxisAlignment:
SizedBox( MainAxisAlignment.start,
height: 8, children: [
), AppText(
Row( 'Description: ',
mainAxisAlignment: fontSize: 12,
MainAxisAlignment.start, ),
children: [ Expanded(
// AppText( child: AppText(
// TranslationBase.of(context) model
// .pharmacology + .allInterventionList[
// " : ", index]
// fontSize: 12, .description,
// ), fontSize: 12,
Expanded( isCopyable: true,
child: AppText( ),
model ),
.allInterventionList[ ]),
index] SizedBox(
.medication, height: 8,
fontSize: 12,
isCopyable: true,
), ),
), Row(
]), mainAxisAlignment:
SizedBox( MainAxisAlignment.start,
height: 8, children: [
), AppText(
Row( 'Medication: ',
mainAxisAlignment: fontSize: 12,
MainAxisAlignment.start, ),
children: [ Expanded(
// AppText( child: AppText(
// TranslationBase.of(context) model
// .reasonsThrombo + .allInterventionList[
// " : ", index]
// fontSize: 12, .medication,
// ), fontSize: 12,
Expanded( isCopyable: true,
child: AppText( ),
model ),
.allInterventionList[ ]),
index] SizedBox(
.doctorComments, height: 8,
fontSize: 12,
isCopyable: true,
), ),
), Row(
]), mainAxisAlignment:
SizedBox( MainAxisAlignment.start,
height: 8, children: [
), AppText(
'Doctor Comments: ',
Row( fontSize: 12,
mainAxisAlignment: ),
MainAxisAlignment.start, Expanded(
children: [ child: AppText(
// AppText( model
// TranslationBase.of(context) .allInterventionList[
// .reasonsThrombo + index]
// " : ", .doctorComments,
// fontSize: 12, fontSize: 12,
// ), isCopyable: true,
Expanded( ),
child: AppText( ),
model ]),
.allInterventionList[ SizedBox(
index] height: 8,
.statusDescription,
fontSize: 12,
isCopyable: true,
), ),
), Row(
]), mainAxisAlignment:
MainAxisAlignment.start,
], children: [
), AppText(
SizedBox( 'Status Description: ',
height: 20, fontSize: 12,
),
Expanded(
child: AppText(
model
.allInterventionList[
index]
.statusDescription,
fontSize: 12,
isCopyable: true,
),
),
]),
],
),
SizedBox(
height: 20,
),
],
),
),
), ),
], onTap: () {
), Navigator.push(
), context,
); FadePage(
}), page: InterventionMedicationHistoryScreen(widget.patient, model.allInterventionList[index]),
),
);
},
);
}),
),
),
],
), ),
), ),
],
),
),
onTap: () {
// PatiantInformtion patient;
Navigator.push(
context,
FadePage(
page: InterventionMedicationHistoryScreen(widget.patient),
),
);
},
),
), ),
); );
} }

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; 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/screens/patients/profile/pharmacy-intervention-model/new_medication_res_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -24,7 +25,8 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class InterventionMedicationHistoryScreen extends StatefulWidget { class InterventionMedicationHistoryScreen extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
const InterventionMedicationHistoryScreen(this.patient, {Key key}) : super(key: key); final InterventionMedicationResModel interventionMedication;
const InterventionMedicationHistoryScreen(this.patient, this.interventionMedication, {Key key}) : super(key: key);
@override @override
_InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState(); _InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState();
@ -41,7 +43,12 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<InterventionMedicationViewModel>( return BaseView<InterventionMedicationViewModel>(
onModelReady: (model) => model.getInterventionMedicationHistory(patientId: widget.patient.patientId, onModelReady: (model) => model.getInterventionMedicationHistory(
patientId: widget.patient.patientId,
projectId: widget.interventionMedication.projectID,
admissionNo: widget.interventionMedication.admissionNo,
prescriptionNo: widget.interventionMedication.prescriptionNo,
orderNo: widget.interventionMedication.orderNo,
), ),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -133,61 +140,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
], ],
), ),
], ],
) )
// Column(
// children: [
// AppText(
// model
// .allInterventionList[
// index]
// .startDatetime !=
// null
// ? AppDateUtils.getDayMonthYearDateFormatted(
// AppDateUtils
// .getDateTimeFromString(model
// .allInterventionList[
// index]
// .startDatetime),
// isArabic:
// projectViewModel
// .isArabic,
// isMonthShort: true)
// : AppDateUtils
// .getDayMonthYearDateFormatted(
// DateTime.now(),
// isArabic:
// projectViewModel
// .isArabic),
// fontWeight: FontWeight.w600,
// fontSize: 14,
// isCopyable: true,
// ),
// AppText(
// model
// .allInterventionList[
// index]
// .startDatetime !=
// null
// ? AppDateUtils.getHour(
// AppDateUtils
// .getDateTimeFromString(model
// .allInterventionList[
// index]
// .startDatetime))
// : AppDateUtils.getHour(
// DateTime.now()),
// fontWeight: FontWeight.w600,
// fontSize: 14,
// isCopyable: true,
// ),
// ],
// crossAxisAlignment:
// CrossAxisAlignment.end,
// )
], ],
), ),
SizedBox( SizedBox(
@ -197,12 +153,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
// AppText( AppText(
// TranslationBase.of(context) 'Remark: ',
// .VTE_Type + fontSize: 12,
// " : ", ),
// fontSize: 12,
// ),
Expanded( Expanded(
child: AppText( child: AppText(
model model
@ -221,12 +175,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
// AppText( AppText(
// TranslationBase.of(context) 'Created By Name: ',
// .pharmacology + fontSize: 12,
// " : ", ),
// fontSize: 12,
// ),
Expanded( Expanded(
child: AppText( child: AppText(
model model
@ -245,12 +197,10 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
// AppText( AppText(
// TranslationBase.of(context) 'SetUp ID: ',
// .reasonsThrombo + fontSize: 12,
// " : ", ),
// fontSize: 12,
// ),
Expanded( Expanded(
child: AppText( child: AppText(
model model
@ -265,28 +215,6 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context)
// .reasonsThrombo +
// " : ",
// fontSize: 12,
// ),
Expanded(
child: AppText(
model
.allInterventionHistoryList[
index]
.setupId,
fontSize: 12,
isCopyable: true,
),
),
]),
Row( Row(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
@ -295,9 +223,16 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
children: [ children: [
InkWell( InkWell(
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.setAcceptedOrRejected(remarks: "Accepted", ); GifLoaderDialogUtils.showMyDialog(context);
model.setAcceptedOrRejected(
remarks: "Accepted",
memberId: model.allInterventionHistoryList[index].commentedBy,
prescriptionNo: model.allInterventionHistoryList[index].prescriptionId,
patientID: model.allInterventionHistoryList[index].patientId,
orderNo: model.allInterventionHistoryList[index].orderNo,
admissionNo: model.allInterventionHistoryList[index].admissionNo,
);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal) { if(model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
@ -305,7 +240,6 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
"Has been Successfully accepted"); "Has been Successfully accepted");
} }
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -339,8 +273,14 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.setAcceptedOrRejected(
model.setAcceptedOrRejected(remarks: "Rejected"); remarks: "Rejected",
memberId: model.allInterventionHistoryList[index].commentedBy,
prescriptionNo: model.allInterventionHistoryList[index].prescriptionId,
patientID: model.allInterventionHistoryList[index].patientId,
orderNo: model.allInterventionHistoryList[index].orderNo,
admissionNo: model.allInterventionHistoryList[index].admissionNo,
);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal) { if(model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
@ -376,7 +316,6 @@ class _InterventionMedicationHistoryScreenState extends State<InterventionMedica
), ),
], ],
), ),
], ],
), ),
SizedBox( SizedBox(

@ -7,8 +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/pharmacy_intervention_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';
import 'intervention_medication.dart'; import 'intervention_medication.dart';
@ -16,6 +15,7 @@ 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,
@ -38,7 +38,7 @@ class _PharmacyInterventionScreenState
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
return BaseView<PharmacyInterventionViewModel>( return BaseView<InterventionMedicationViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -173,7 +173,7 @@ class _PharmacyInterventionScreenState
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
InterventionMedicationScreen(patient)), InterventionMedicationScreen(patient,)),
); );
}, },
), ),
@ -188,7 +188,7 @@ class _PharmacyInterventionScreenState
))); )));
} }
selectDate(BuildContext context, PharmacyInterventionViewModel model, selectDate(BuildContext context, InterventionMedicationViewModel model,
{bool isFromDate = true, {bool isFromDate = true,
DateTime firstDate, DateTime firstDate,
lastDate, lastDate,
@ -205,7 +205,7 @@ class _PharmacyInterventionScreenState
if (isFromDate) { if (isFromDate) {
setState(() { setState(() {
model.selectedFromDate = picked; model.selectedFromDate = picked;
var date = picked.add(Duration(days: 30)); var date = picked.add(Duration(days: 1));
if (date.isBefore(lastDate)) { if (date.isBefore(lastDate)) {
model.selectedToDate = date; model.selectedToDate = date;
} else } else
@ -219,26 +219,6 @@ class _PharmacyInterventionScreenState
} }
} }
// getFirstDate(OutPatientFilterType outPatientFilterType) {
// if (outPatientFilterType == OutPatientFilterType.Previous) {
// return DateTime(F
// DateTime.now().year - 20, DateTime.now().month, DateTime.now().day);
// } else {
// return DateTime(
// DateTime.now().year, DateTime.now().month, DateTime.now().day + 1);
// }
// }
// getLastDate(OutPatientFilterType outPatientFilterType) {
// if (outPatientFilterType == OutPatientFilterType.Previous) {
// return DateTime(
// DateTime.now().year, DateTime.now().month, DateTime.now().day - 1);
// } else {
// return DateTime(
// DateTime.now().year , DateTime.now().month , DateTime.now().day + 100);
// }
// }
InputDecoration textFieldSelectorDecoration( InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown, String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) { {Icon suffixIcon}) {

@ -176,10 +176,10 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: isInpatient, isInPatient: isInpatient,
), ),
PatientProfileCardModel( PatientProfileCardModel(
'Pharmacy', TranslationBase.of(context).pharmacy,
'intervention', TranslationBase.of(context).intervention,
PHARMACY_INTERVENTION, PHARMACY_INTERVENTION,
'', 'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
), ),
]; ];

@ -1725,6 +1725,10 @@ class TranslationBase {
String get diabetic => localizedValues['diabetic'][locale.languageCode]; String get diabetic => localizedValues['diabetic'][locale.languageCode];
String get pharmacy => localizedValues['pharmacy'][locale.languageCode];
String get intervention => localizedValues['intervention'][locale.languageCode];
String get chart => localizedValues['chart'][locale.languageCode]; String get chart => localizedValues['chart'][locale.languageCode];
String get investigation => String get investigation =>

Loading…
Cancel
Save