diff --git a/assets/images/dr_avatar.png b/assets/images/dr_avatar.png new file mode 100644 index 00000000..693ebd7a Binary files /dev/null and b/assets/images/dr_avatar.png differ diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 033bc44c..eb0fe42d 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -64,6 +64,7 @@ class BaseAppClient { body['TokenID'] = token ?? ''; } // body['TokenID'] = "@dm!n" ?? ''; + if (!isFallLanguage) { String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/config.dart b/lib/config/config.dart index 9490ceb2..748ef31e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -386,6 +386,18 @@ const GET_PENDING_DISCHARGE_SUMMARY = const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; +const VTE_ASSESSMENT = + "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; + +const GET_INTERVENTION_MEDICATION = + "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; + +const GET_INTERVENTION_MEDICATION_HISTORY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; + +const SET_ACCEPTED_OR_REJECTED = + "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2f44f19a..5dc41d3e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -20,6 +20,7 @@ const Map> localizedValues = { "ar": "ليس لديك أي جدول" }, "verify": {"en": "VERIFY", "ar": "تحقق"}, + "pharmacy-intervention": {"en": "Pharmacy Intervention", "ar": "التدخل الصيدلاني"}, "referralDoctor": {"en": "Referral Doctor", "ar": "الطبيب المُحول إليه"}, "referringClinic": {"en": "Referring Clinic", "ar": "العيادة المُحول إليها"}, "frequency": {"en": "Frequency", "ar": "تكرر"}, @@ -537,6 +538,10 @@ const Map> localizedValues = { "selectSeverity": {"en": "Select Severity", "ar": "حدد الخطورة"}, "leaveCreated": {"en": "Leave has been created", "ar": "تم إنشاء الإجازة"}, "medications": {"en": "Medications", "ar": "الأدوية"}, + "medication": {"en": "Medication", "ar": "الدواء"}, + "createdByName": {"en": "Created By Name", "ar": "الدواء"}, + "statusDescription": {"en": "Status Description", "ar": "وصف الحالة"}, + "doctorComments": {"en": "Doctor Comments", "ar": "تعليقات الطبيب"}, "procedures": {"en": "Procedures", "ar": "الإجراءات"}, "vitalSignEmptyMsg": { "en": "There is no vital signs for this patient", @@ -663,6 +668,7 @@ const Map> localizedValues = { "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, + "riskScore": {"en": "Risk Score :", "ar": "درجة المخاطر"}, "editedBy": {"en": "Edited By :", "ar": "عدلت من : "}, "currentMedications": {"en": "Current Medications", "ar": "الأدوية الحالية"}, "noItem": { @@ -1053,6 +1059,8 @@ const Map> localizedValues = { "maritalStatus": {"en": "Marital Status", "ar": "الحالة الزوجية"}, "nursing": {"en": "Nursing", "ar": "تمريض"}, "diabetic": {"en": "Diabetic", "ar": "مرض السكري"}, + "pharmacy": {"en": "Pharmacy", "ar": "الصيدلاني"}, + "intervention": {"en": "Intervention", "ar": "التدخل"}, "chart": {"en": "Chart", "ar": "جدول"}, "operationTimeStart": { "en": "Operation Time Start :", @@ -1118,4 +1126,7 @@ const Map> localizedValues = { }, "planedProcedure": {"en": "Planed Procedure", "ar": "الإجراء المخطط"}, "moreDetails": {"en": "More Details", "ar": "المزيد من التفاصيل"}, + "VTE_Type": {"en": "VTE Type", "ar": "VTE Type"}, + "pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"}, + "reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"}, }; diff --git a/lib/core/model/vte_assessment/vte_assessment_req_model.dart b/lib/core/model/vte_assessment/vte_assessment_req_model.dart new file mode 100644 index 00000000..1f0bd1fa --- /dev/null +++ b/lib/core/model/vte_assessment/vte_assessment_req_model.dart @@ -0,0 +1,22 @@ +class VteAssessmentRequestModel { + String setupID; + int parameterGroup; + int transactionNo; + + VteAssessmentRequestModel( + {this.setupID = "010266", this.parameterGroup = 7, this.transactionNo}); + + VteAssessmentRequestModel.fromJson(Map json) { + setupID = json['SetupID']; + parameterGroup = json['ParameterGroup']; + transactionNo = json['TransactionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ParameterGroup'] = this.parameterGroup; + data['TransactionNo'] = this.transactionNo; + return data; + } +} diff --git a/lib/core/model/vte_assessment/vte_assessment_res_model.dart b/lib/core/model/vte_assessment/vte_assessment_res_model.dart new file mode 100644 index 00000000..8bd2c441 --- /dev/null +++ b/lib/core/model/vte_assessment/vte_assessment_res_model.dart @@ -0,0 +1,48 @@ +class VteAssessmentResponseModel { + int lineItemNo; + String vTEType; + String ambulationProtocol; + String pharmacology; + String reasonsThrombo; + String riskScore; + int totalScore; + int createdBy; + String createdOn; + + VteAssessmentResponseModel( + {this.lineItemNo, + this.vTEType, + this.ambulationProtocol, + this.pharmacology, + this.reasonsThrombo, + this.riskScore, + this.totalScore, + this.createdBy, + this.createdOn}); + + VteAssessmentResponseModel.fromJson(Map json) { + lineItemNo = json['LineItemNo']; + vTEType = json['VTE_Type']; + ambulationProtocol = json['AmbulationProtocol']; + pharmacology = json['Pharmacology']; + reasonsThrombo = json['ReasonsThrombo']; + riskScore = json['Risk_Score']; + totalScore = json['Total_Score']; + createdBy = json['Created_By']; + createdOn = json['Created_On']; + } + + Map toJson() { + final Map data = new Map(); + data['LineItemNo'] = this.lineItemNo; + data['VTE_Type'] = this.vTEType; + data['AmbulationProtocol'] = this.ambulationProtocol; + data['Pharmacology'] = this.pharmacology; + data['ReasonsThrombo'] = this.reasonsThrombo; + data['Risk_Score'] = this.riskScore; + data['Total_Score'] = this.totalScore; + data['Created_By'] = this.createdBy; + data['Created_On'] = this.createdOn; + return data; + } +} diff --git a/lib/core/service/patient/profile/intervention_medication_service.dart b/lib/core/service/patient/profile/intervention_medication_service.dart new file mode 100644 index 00000000..eab0fcab --- /dev/null +++ b/lib/core/service/patient/profile/intervention_medication_service.dart @@ -0,0 +1,68 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.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_res_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'; + + +class InterventionMedicationService extends BaseService { + + List _allInterventionList = []; + + List _allInterventionHistoryList = []; + + List get allInterventionList => + _allInterventionList; + + List get allInterventionHistoryList => + _allInterventionHistoryList; + + Future getInterventionMedication( + {InterventionMedicationReqModel interventionMedicationReqModel}) async { + hasError = false; + await baseAppClient.post(GET_INTERVENTION_MEDICATION, + onSuccess: (dynamic response, int statusCode) { + _allInterventionList.clear(); + response['List_InterventionMedications'].forEach( + (v) { + _allInterventionList.add(InterventionMedicationResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: interventionMedicationReqModel.toJson()); + } + + Future getInterventionMedicationHistory( + {InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel}) async { + hasError = false; + await baseAppClient.post(GET_INTERVENTION_MEDICATION_HISTORY, + onSuccess: (dynamic response, int statusCode) { + _allInterventionHistoryList.clear(); + response['List_InterventionHistory'].forEach( + (v) { + _allInterventionHistoryList.add(InterventionMedicationHistoryResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: interventionMedicationHistoryReqModel.toJson()); + } + + Future setAcceptedOrRejected( + {AcceptOrRejectReqModel acceptOrRejectReqModel}) async { + hasError = false; + await baseAppClient.post(SET_ACCEPTED_OR_REJECTED, + onSuccess: (dynamic response, int statusCode) { + _allInterventionHistoryList.clear(); + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: acceptOrRejectReqModel.toJson()); + } +} diff --git a/lib/core/service/patient/profile/vte_assessment_service.dart b/lib/core/service/patient/profile/vte_assessment_service.dart new file mode 100644 index 00000000..81ad0650 --- /dev/null +++ b/lib/core/service/patient/profile/vte_assessment_service.dart @@ -0,0 +1,30 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; + +class VteAssessmentService extends BaseService { + + List _allVteHistoryList = []; + + List get allVteHistoryList => + _allVteHistoryList; + Future getVteAssessment( + {VteAssessmentRequestModel vteAssessmentRequestModel}) async { + hasError = false; + await baseAppClient.post(VTE_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + _allVteHistoryList.clear(); + response['INP_VTEHistoryByTransactionNo_List'].forEach( + (v) { + _allVteHistoryList.add(VteAssessmentResponseModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: vteAssessmentRequestModel.toJson()); + } +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 5acc6f07..3d8f7b63 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -126,7 +126,7 @@ class PatientSearchViewModel extends BaseViewModel { } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = AppDateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), + DateTime.now().day + 7), 'yyyy-MM-dd'); dateFrom = AppDateUtils.convertDateToFormat( diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 861c110b..42888002 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -230,12 +230,12 @@ class PatientReferralViewModel extends BaseViewModel { Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, String remarks) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _referralPatientService.makeReferral( patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart new file mode 100644 index 00000000..9c456a2a --- /dev/null +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -0,0 +1,146 @@ +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/locator.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/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/new_medication_req_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/special_clinics/special_clinic_service.dart'; + +class InterventionMedicationViewModel extends BaseViewModel { + SpecialClinicsService _specialClinicsService = + locator(); + + List + get specialClinicalCareMappingList => + _specialClinicsService.specialClinicalCareMappingList; + + List filterData = []; + + DateTime selectedFromDate = DateTime.now(); + DateTime selectedToDate = DateTime.now().add(Duration(days: 1)); + + PatiantInformtion patient; + bool hasError = false; + InterventionMedicationService _interventionMedicationService = + locator(); + + List get allInterventionList => + _interventionMedicationService.allInterventionList; + + List get allInterventionHistoryList => + _interventionMedicationService.allInterventionHistoryList; + + Future getInterventionMedication({ + + int projectId, + int patientId, + DateTime fromDate, + DateTime toDate, + + }) async { + InterventionMedicationReqModel interventionMedicationReqModel = + InterventionMedicationReqModel( + + projectID: projectId, + patientID: patientId, + fromDate: AppDateUtils.convertDateToServerFormat(fromDate), + toDate: AppDateUtils.convertDateToServerFormat(toDate), + + ); + hasError = false; + setState(ViewState.Busy); + await _interventionMedicationService.getInterventionMedication( + interventionMedicationReqModel: interventionMedicationReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getInterventionMedicationHistory( + { + int projectId, + int patientId, + int admissionNo, + int prescriptionNo, + int orderNo, + + bool isBusyLocal = false}) async { + InterventionMedicationHistoryReqModel + interventionMedicationHistoryReqModel = + InterventionMedicationHistoryReqModel( + + projectID: projectId, + patientID: patientId, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + + ); + hasError = false; + if (isBusyLocal) + setState(ViewState.Busy); + else + setState(ViewState.Busy); + await _interventionMedicationService.getInterventionMedicationHistory( + interventionMedicationHistoryReqModel: + interventionMedicationHistoryReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + if (isBusyLocal) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future setAcceptedOrRejected({ + + String remarks, + int memberId, + int projectId, + int patientID, + int admissionNo, + int prescriptionNo, + int orderNo, + int interventionStatus, + int status, + + }) async { + AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( + + 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); + await _interventionMedicationService.setAcceptedOrRejected( + acceptOrRejectReqModel: acceptOrRejectReqModel); + if (_interventionMedicationService.hasError) { + error = _interventionMedicationService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart b/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart new file mode 100644 index 00000000..1bd1c4d2 --- /dev/null +++ b/lib/core/viewModel/profile/pharmacy_intervention_view_model.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; +import 'package:doctor_app_flutter/core/service/patient/patientInPatientService.dart'; +import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; +import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + + + +class PharmacyInterventionViewModel extends BaseViewModel { + OutPatientService _outPatientService = locator(); + SpecialClinicsService _specialClinicsService = + locator(); + + List get patientList => _outPatientService.patientList; + + List + get specialClinicalCareMappingList => + _specialClinicsService.specialClinicalCareMappingList; + + List filterData = []; + + DateTime selectedFromDate; + DateTime selectedToDate; + + int firstSubsetIndex = 0; + int inPatientPageSize = 20; + int lastSubsetIndex = 20; + + List InpatientClinicList = []; + + + PatientInPatientService _inPatientService = + locator(); + + List get inPatientList => _inPatientService.inPatientList; + + List get myIinPatientList => + _inPatientService.myInPatientList; + + List filteredInPatientItems = List(); + List filteredMyInPatientItems = List(); + +} diff --git a/lib/core/viewModel/profile/vte_assessment_view_model.dart b/lib/core/viewModel/profile/vte_assessment_view_model.dart new file mode 100644 index 00000000..0997805b --- /dev/null +++ b/lib/core/viewModel/profile/vte_assessment_view_model.dart @@ -0,0 +1,37 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; +import 'package:doctor_app_flutter/core/service/patient/profile/vte_assessment_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart'; +import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; + +class VteAssessmentViewModel extends BaseViewModel { + bool hasError = false; + VteAssessmentService _VteAssessmentService = + locator(); + + List get allVteHistoryList => + _VteAssessmentService.allVteHistoryList; + + Future getVteAssessment({ + int patientId, + int admissionNo, + }) async { + VteAssessmentRequestModel vteAssessmentRequestModel = + VteAssessmentRequestModel( + transactionNo: admissionNo); + hasError = false; + setState(ViewState.Busy); + await _VteAssessmentService.getVteAssessment( + vteAssessmentRequestModel: vteAssessmentRequestModel); + if (_VteAssessmentService.hasError) { + error = _VteAssessmentService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 89faeb0c..c069e7e7 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -49,16 +49,13 @@ class _LandingPageState extends State { backgroundColor: HexColor('#FFFFFF'), //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), title: currentTab != 0 - ? Padding( - padding: const EdgeInsets.only(right: 188,top: 36), - child: AppText( - getText(currentTab), - letterSpacing: -1.44, - fontWeight: FontWeight.w700, - fontSize: 24.0, - color: Color(0xff2B353E), - ), - ) + ? AppText( + getText(currentTab), + letterSpacing: -1.44, + fontWeight: FontWeight.w700, + fontSize: 24.0, + color: Color(0xff2B353E), + ) : SizedBox(), leading: Builder( builder: (BuildContext context) { diff --git a/lib/locator.dart b/lib/locator.dart index 28f4bfdf..fc42e632 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_ import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; - import 'core/service/AnalyticsService.dart'; import 'core/service/NavigationService.dart'; import 'core/service/PatientRegistrationService.dart'; @@ -32,7 +31,9 @@ import 'core/service/patient/out_patient_service.dart'; import 'core/service/patient/patient-doctor-referral-service.dart'; import 'core/service/patient/patientInPatientService.dart'; import 'core/service/patient/patient_service.dart'; +import 'core/service/patient/profile/intervention_medication_service.dart'; import 'core/service/patient/profile/operation_report_servive.dart'; +import 'core/service/patient/profile/vte_assessment_service.dart'; import 'core/service/patient/referral_patient_service.dart'; import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart'; import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart'; @@ -65,6 +66,8 @@ import 'core/viewModel/patient-referral-viewmodel.dart'; import 'core/viewModel/patient-ucaf-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/prescriptions_view_model.dart'; +import 'core/viewModel/profile/intervention_medication_view_model.dart'; +import 'core/viewModel/profile/vte_assessment_view_model.dart'; import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -112,6 +115,8 @@ void setupLocator() { locator.registerLazySingleton(() => PendingOrderService()); locator.registerLazySingleton(() => PatientRegistrationService()); locator.registerLazySingleton(() => DischargeSummaryService()); + locator.registerLazySingleton(() => VteAssessmentService()); + locator.registerLazySingleton(() => InterventionMedicationService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -144,4 +149,6 @@ void setupLocator() { locator.registerFactory(() => PatientRegistrationViewModel()); locator.registerFactory(() => PendingOrdersViewModel()); locator.registerFactory(() => DischargeSummaryViewModel()); + locator.registerFactory(() => VteAssessmentViewModel()); + locator.registerFactory(() => InterventionMedicationViewModel()); } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 9e4ebeb2..99127cc9 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,6 +1,7 @@ // TODO = it have to be changed. import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; class PatiantInformtion { PatiantInformtion patientDetails; @@ -199,8 +200,8 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = - json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescription = Helpers.convertToTitleCase( + json["ClinicDescription"] ?? json["clinicDescription"]??''); clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; nationalityName = json["NationalityName"] ?? diff --git a/lib/routes.dart b/lib/routes.dart index 8f636d74..23f1dcbc 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -18,10 +18,12 @@ import 'package:doctor_app_flutter/screens/patients/profile/notes/note/progress_ import 'package:doctor_app_flutter/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/operation_report.dart'; import 'package:doctor_app_flutter/screens/patients/profile/pending_orders/pending_orders_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vte_assessment/vte_assessment_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; @@ -80,7 +82,11 @@ const String NURSING_PROGRESS_NOTE = 'nursing_progress_note'; const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values'; +const String VTE_ASSESSMENT = 'vte_assessment '; const String DISCHARGE_SUMMARY = 'discharge_summary'; +const String PHARMACY_INTERVENTION = 'new_medication'; +const String INTERVENTION_MEDICATION = 'intervention_medication'; + //todo: change the routing way. var routes = { @@ -131,4 +137,6 @@ var routes = { DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), DIABETIC_CHART_VALUES: (_) => DiabeticChart(), + PHARMACY_INTERVENTION: (_) => PharmacyInterventionScreen(), + VTE_ASSESSMENT: (_) => VteAssessmentScreen(), }; diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index dce1d38c..e8d70786 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -207,10 +207,11 @@ class _DoctorReplyWidgetState extends State { label: TranslationBase.of(context).fileNumber, value: widget.reply.patientID.toString(), isCopyable: false, + isExpanded: false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", - isCopyable: false, + label: TranslationBase.of(context).age + " : ", isCopyable: false, + isExpanded: false, value: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index df810361..27ec03e2 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -424,24 +424,24 @@ class _HomeScreenState extends State { }, )); changeColorIndex(); - - patientCards.add(HomePatientCard( - gradient: backgroundColors[colorIndex], - backgroundIconColor: backgroundIconColors[colorIndex], - //TODO Elham* match the of the icon - cardIcon: DoctorApp.arrival_patients, - textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient, - onTap: () { - Navigator.push( - context, - FadePage( - page: RegisterPatientPage(), - ), - ); - }, - )); - changeColorIndex(); + //TODO Keep commented + // patientCards.add(HomePatientCard( + // gradient: backgroundColors[colorIndex], + // backgroundIconColor: backgroundIconColors[colorIndex], + // //TODO Elham* match the of the icon + // cardIcon: DoctorApp.arrival_patients, + // textColor: textColors[colorIndex], + // text: TranslationBase.of(context).registerNewPatient, + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: RegisterPatientPage(), + // ), + // ); + // }, + // )); + // changeColorIndex(); patientCards.add(HomePatientCard( gradient: backgroundColors[colorIndex], diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 87e36943..98592335 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -13,7 +13,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index 9155ffc1..0843ffd0 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/doctor_card.dart'; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index eb76ead9..99591e70 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -4,7 +4,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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/expandable-widget-header-body.dart'; diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index a2bc5a23..ed74ce80 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index d477f0cb..8e647b30 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -6,7 +6,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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 53932c99..e547430a 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card_insurance.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 4695b7d4..de530c3d 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/user-guid/CusomRow.dart'; diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index ddad858f..88e14e7a 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -38,6 +38,8 @@ class _UCAFInputScreenState extends State { final _whereController = TextEditingController(); final _managementsLineController = TextEditingController(); final _signsController = TextEditingController(); + + ///TODO Elham* fix this List conditionsData = [ {"name": "CHRONIC", "isChecked": false}, {"name": "RTA", "isChecked": false}, @@ -383,7 +385,7 @@ class _UCAFInputScreenState extends State { error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context))) + : TranslationBase.of(context).chiefComplaintEmptyMsg)) : Container(), ), ); diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index b2a28f9a..af2bbd0b 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -5,7 +5,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/patients/profile/UCAF/page-stepper-widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 9719b525..41a66b89 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -5,7 +5,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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index b74c2ef3..46a18f88 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -9,7 +9,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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index fb805129..30f75c7a 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -10,7 +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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 394112fa..dd18bcdb 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.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/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index de9f6476..32c79999 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 5a04c60a..5c7264c5 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 0878994a..bc97085d 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/text_fields/text_fields_utils.dart'; diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 0f550191..e6e20409 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/doctor_card.dart'; diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 0ead8fea..162f6a2e 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/labs_view_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/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 8352db28..458e7ec4 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_pag import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index da21ca3d..4b1e6b62 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.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/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index eb28c528..c189ac45 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportMod 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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index b124f2cc..ff4513fc 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index b8220939..2ac65ac6 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -16,7 +16,7 @@ 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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 06dc687a..3834e084 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 409e118d..405e903b 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/operation_report/update_operation_report.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.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:flutter/material.dart'; diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index 589c4680..0be4e409 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dar 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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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'; 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 new file mode 100644 index 00000000..67b234de --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart @@ -0,0 +1,66 @@ +class AcceptOrRejectReqModel { + int patientID; + int projectID; + int admissionNo; + int prescriptionNo; + int orderNo; + String remarks; + int memberID; + int accessLevel; + int languageID; + int lineItemNo; + bool patientOutSA; + int interventionStatus; + int status; + + AcceptOrRejectReqModel( + {this.patientID, + this.projectID, + this.admissionNo, + this.prescriptionNo, + this.orderNo, + this.remarks, + this.memberID, + this.accessLevel, + this.languageID, + this.lineItemNo, + this.patientOutSA, + this.interventionStatus, + this.status + }); + + AcceptOrRejectReqModel.fromJson(Map json) { + patientID = json['PatientID']; + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + prescriptionNo = json['PrescriptionNo']; + orderNo = json['OrderNo']; + remarks = json['Remarks']; + memberID = json['MemberID']; + accessLevel = json['AccessLevel']; + languageID = json['LanguageID']; + lineItemNo = json['LineItemNo']; + patientOutSA = json['PatientOutSA']; + interventionStatus = json['InterventionStatus']; + status = json['Status']; + + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['PrescriptionNo'] = this.prescriptionNo; + data['OrderNo'] = this.orderNo; + data['Remarks'] = this.remarks; + data['MemberID'] = this.memberID; + data['AccessLevel'] = this.accessLevel; + data['LanguageID'] = this.languageID; + 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-model/accept_or_reject_res_model.dart b/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_res_model.dart new file mode 100644 index 00000000..7e2448f6 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_res_model.dart @@ -0,0 +1,4 @@ +class AcceptOrRejectResModel { + + +} \ No newline at end of file diff --git a/lib/screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_req_model.dart b/lib/screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_req_model.dart new file mode 100644 index 00000000..122212b7 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_req_model.dart @@ -0,0 +1,32 @@ +class InterventionMedicationHistoryReqModel { + int projectID; + int patientID; + int admissionNo; + int orderNo; + int prescriptionNo; + + InterventionMedicationHistoryReqModel( + {this.projectID, + this.patientID, + this.admissionNo, + this.orderNo, + this.prescriptionNo}); + + InterventionMedicationHistoryReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + admissionNo = json['AdmissionNo']; + orderNo = json['OrderNo']; + prescriptionNo = json['PrescriptionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AdmissionNo'] = this.admissionNo; + data['OrderNo'] = this.orderNo; + data['PrescriptionNo'] = this.prescriptionNo; + return data; + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_res_model.dart b/lib/screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_res_model.dart new file mode 100644 index 00000000..451cccb8 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention-model/intervention_medication_history_res_model.dart @@ -0,0 +1,96 @@ +class InterventionMedicationHistoryResModel { + String setupId; + String projectId; + int patientId; + int admissionNo; + int prescriptionId; + int orderNo; + int id; + int interventionId; + Null intervention; + String remark; + int commentedBy; + bool isDoctor; + bool isActive; + int createdBy; + String createdByName; + String createdByNameN; + String createdOn; + Null editedBy; + Null editedByName; + Null editedByNameN; + Null editedOn; + + InterventionMedicationHistoryResModel( + {this.setupId, + this.projectId, + this.patientId, + this.admissionNo, + this.prescriptionId, + this.orderNo, + this.id, + this.interventionId, + this.intervention, + this.remark, + this.commentedBy, + this.isDoctor, + this.isActive, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.editedBy, + this.editedByName, + this.editedByNameN, + this.editedOn}); + + InterventionMedicationHistoryResModel.fromJson(Map json) { + setupId = json['SetupId']; + projectId = json['ProjectId']; + patientId = json['PatientId']; + admissionNo = json['AdmissionNo']; + prescriptionId = json['PrescriptionId']; + orderNo = json['OrderNo']; + id = json['Id']; + interventionId = json['InterventionId']; + intervention = json['Intervention']; + remark = json['Remark']; + commentedBy = json['CommentedBy']; + isDoctor = json['IsDoctor']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdByName = json['CreatedByName']; + createdByNameN = json['CreatedByNameN']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedByName = json['EditedByName']; + editedByNameN = json['EditedByNameN']; + editedOn = json['EditedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectId'] = this.projectId; + data['PatientId'] = this.patientId; + data['AdmissionNo'] = this.admissionNo; + data['PrescriptionId'] = this.prescriptionId; + data['OrderNo'] = this.orderNo; + data['Id'] = this.id; + data['InterventionId'] = this.interventionId; + data['Intervention'] = this.intervention; + data['Remark'] = this.remark; + data['CommentedBy'] = this.commentedBy; + data['IsDoctor'] = this.isDoctor; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedByName'] = this.createdByName; + data['CreatedByNameN'] = this.createdByNameN; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedByName'] = this.editedByName; + data['EditedByNameN'] = this.editedByNameN; + data['EditedOn'] = this.editedOn; + return data; + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/pharmacy-intervention-model/new_medication_req_model.dart b/lib/screens/patients/profile/pharmacy-intervention-model/new_medication_req_model.dart new file mode 100644 index 00000000..92cde706 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention-model/new_medication_req_model.dart @@ -0,0 +1,25 @@ +class InterventionMedicationReqModel { + int projectID; + int patientID; + String fromDate; + String toDate; + + InterventionMedicationReqModel( + {this.projectID, this.patientID, this.fromDate, this.toDate}); + + InterventionMedicationReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + patientID = json['PatientID']; + fromDate = json['FromDate']; + toDate = json['ToDate']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['FromDate'] = this.fromDate; + data['ToDate'] = this.toDate; + return data; + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/pharmacy-intervention-model/new_medication_res_model.dart b/lib/screens/patients/profile/pharmacy-intervention-model/new_medication_res_model.dart new file mode 100644 index 00000000..5d3dca39 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention-model/new_medication_res_model.dart @@ -0,0 +1,100 @@ +class InterventionMedicationResModel { + String cS; + String iHR; + String setupID; + int projectID; + int accessLevel; + int patientID; + String patientName; + String description; + int admissionNo; + int orderNo; + int prescriptionNo; + int lineItemNo; + int itemID; + String medication; + String doctorComments; + String startDatetime; + String stopDatetime; + int status; + int createdBy; + int authorizedby; + Null pharmacyRemarks; + String statusDescription; + + InterventionMedicationResModel( + {this.cS, + this.iHR, + this.setupID, + this.projectID, + this.accessLevel, + this.patientID, + this.patientName, + this.description, + this.admissionNo, + this.orderNo, + this.prescriptionNo, + this.lineItemNo, + this.itemID, + this.medication, + this.doctorComments, + this.startDatetime, + this.stopDatetime, + this.status, + this.createdBy, + this.authorizedby, + this.pharmacyRemarks, + this.statusDescription}); + + InterventionMedicationResModel.fromJson(Map json) { + cS = json['CS']; + iHR = json['IHR']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + accessLevel = json['AccessLevel']; + patientID = json['PatientID']; + patientName = json['PatientName']; + description = json['Description']; + admissionNo = json['AdmissionNo']; + orderNo = json['OrderNo']; + prescriptionNo = json['PrescriptionNo']; + lineItemNo = json['LineItemNo']; + itemID = json['ItemID']; + medication = json['Medication']; + doctorComments = json['DoctorComments']; + startDatetime = json['StartDatetime']; + stopDatetime = json['StopDatetime']; + status = json['Status']; + createdBy = json['CreatedBy']; + authorizedby = json['Authorizedby']; + pharmacyRemarks = json['PharmacyRemarks']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['CS'] = this.cS; + data['IHR'] = this.iHR; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AccessLevel'] = this.accessLevel; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['Description'] = this.description; + data['AdmissionNo'] = this.admissionNo; + data['OrderNo'] = this.orderNo; + data['PrescriptionNo'] = this.prescriptionNo; + data['LineItemNo'] = this.lineItemNo; + data['ItemID'] = this.itemID; + data['Medication'] = this.medication; + data['DoctorComments'] = this.doctorComments; + data['StartDatetime'] = this.startDatetime; + data['StopDatetime'] = this.stopDatetime; + data['Status'] = this.status; + data['CreatedBy'] = this.createdBy; + data['Authorizedby'] = this.authorizedby; + data['PharmacyRemarks'] = this.pharmacyRemarks; + data['StatusDescription'] = this.statusDescription; + 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 new file mode 100644 index 00000000..af54efab --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart @@ -0,0 +1,206 @@ +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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +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'; +import '../../../../widgets/transitions/fade_page.dart'; +import 'intervention_medication_history_screen.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class InterventionMedicationScreen extends StatefulWidget { + final PatiantInformtion patient; + final InterventionMedicationViewModel previousModel; + const InterventionMedicationScreen(this.patient, {Key key, this.previousModel}) : super(key: key); + + @override + _InterventionMedicationScreenState createState() => + _InterventionMedicationScreenState(); +} + +class _InterventionMedicationScreenState + extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) => model.getInterventionMedication( + patientId: widget.patient.patientId, + //admissionNo: int.parse(widget.patient.admissionNo), + fromDate: widget.previousModel.selectedFromDate, + toDate: widget.previousModel.selectedToDate, + ), + + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient: true, + ), + body: model.allInterventionList == null || + model.allInterventionList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allInterventionList.length, + itemBuilder: (BuildContext ctxt, int index) { + return InkWell( + child: FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + CustomRow( + valueSize: 14, + label: '', + value: model.allInterventionList[index].cS, + ) + ], + ), + ), + 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, + color: Color(0xFF2B353E), + ), + ], + ), + ], + ) + ], + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).description, + value: model.allInterventionList[index].description, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).medication, + value: model.allInterventionList[index].medication, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).doctorComments, + value: model.allInterventionList[index].doctorComments, + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).statusDescription, + value: model.allInterventionList[index].statusDescription, + ), + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ), + onTap: () { + Navigator.push( + context, + FadePage( + page: InterventionMedicationHistoryScreen(widget.patient, model.allInterventionList[index]), + ), + ); + }, + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} 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 new file mode 100644 index 00000000..ce1e69f0 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart @@ -0,0 +1,299 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +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/models/patient/patiant_info_model.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/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +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/loader/gif_loader_dialog_utils.dart'; +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(); + +class InterventionMedicationHistoryScreen extends StatefulWidget { + final PatiantInformtion patient; + final InterventionMedicationResModel interventionMedication; + const InterventionMedicationHistoryScreen(this.patient, this.interventionMedication, {Key key}) : super(key: key); + + @override + _InterventionMedicationHistoryScreenState createState() => _InterventionMedicationHistoryScreenState(); +} + +class _InterventionMedicationHistoryScreenState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + + return BaseView( + 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( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + widget.patient, + isInpatient: true, + ), + body: model.allInterventionHistoryList == null || + model.allInterventionHistoryList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allInterventionHistoryList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).createdByName, + value: model.allInterventionHistoryList[index].createdByName, + ), + ], + ), + ), + Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + model + .allInterventionHistoryList[ + index].createdOn) + ,isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontWeight: FontWeight.w600, + fontSize: 14, + color: Color(0xFF2B353E), + ), + ], + ), + ], + ) + ], + ), + SizedBox( + height: 8, + ), + CustomRow( + labelSize: 12, + valueSize: 12, + label: TranslationBase.of(context).remarks, + value: model.allInterventionHistoryList[index].remark, + ), + SizedBox( + height: 8, + ), + SizedBox( + height: 8, + ), + SizedBox( + height: 8, + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { + + GifLoaderDialogUtils.showMyDialog(context); + await model.setAcceptedOrRejected( + remarks: "", + 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, + interventionStatus: 1, + status: 61 + ); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + } else { + await model.getInterventionMedicationHistory(patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo,); + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Has been Successfully accepted"); + } + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appGreenColor, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .accept, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + + GifLoaderDialogUtils.showMyDialog(context); + await model.setAcceptedOrRejected( + remarks: "", + 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, + interventionStatus: 2, + status: 61 + ); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + } else { + await model.getInterventionMedicationHistory(patientId: widget.patient.patientId, + projectId: widget.interventionMedication.projectID, + admissionNo: widget.interventionMedication.admissionNo, + prescriptionNo: widget.interventionMedication.prescriptionNo, + orderNo: widget.interventionMedication.orderNo,); + GifLoaderDialogUtils.hideDialog(context); + + DrAppToastMsg.showSuccesToast( + "Has been Successfully Rejected"); + } + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appRedColor, + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .reject, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart new file mode 100644 index 00000000..96ae8052 --- /dev/null +++ b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart @@ -0,0 +1,261 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +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:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../../models/patient/patiant_info_model.dart'; +import '../../../base/base_view.dart'; +import 'intervention_medication.dart'; + +class PharmacyInterventionScreen extends StatefulWidget { + final OutPatientFilterType outPatientFilterType; + + const PharmacyInterventionScreen({ + Key key, + this.outPatientFilterType, + }) : super(key: key); + + @override + _PharmacyInterventionScreenState createState() => + _PharmacyInterventionScreenState(); +} + +class _PharmacyInterventionScreenState + extends State { + @override + void initState() { + // TODO: implement initState + super.initState(); + } + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( + title: (OutPatientFilterType.Previous == + widget.outPatientFilterType) + ? "" + : TranslationBase.of(context).pharmacyIntervention, + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + color: Colors.white, + child: InkWell( + onTap: () => selectDate( + context, + model, + firstDate: DateTime( + DateTime.now().year - 20, + DateTime.now().month, + DateTime.now().day), + lastDate: DateTime( + DateTime.now().year, + DateTime.now().month, + DateTime.now().day + 100), + selectedDate: model.selectedFromDate != null + ? model.selectedFromDate + : DateTime.now(), + ), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).fromDate, + "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}" + , + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + color: Colors.white, + child: InkWell( + onTap: () => selectDate( + context, + model, + isFromDate: false, + firstDate: DateTime( + DateTime.now().year - 20, + DateTime.now().month, + DateTime.now().day), + lastDate: DateTime( + DateTime.now().year, + DateTime.now().month, + DateTime.now().day + 100), + selectedDate: model.selectedToDate != null + ? model.selectedToDate + : DateTime.now().add(Duration(days: 1)), + ), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).toDate, + "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}" + , + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).search, + padding: 5, + color: Color(0xFF359846), + onPressed: () async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InterventionMedicationScreen( + patient, + previousModel: model, + )), + ); + }, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ))); + } + + selectDate(BuildContext context, InterventionMedicationViewModel model, + {bool isFromDate = true, + DateTime firstDate, + lastDate, + selectedDate}) async { + Helpers.hideKeyboard(context); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: firstDate, + lastDate: lastDate, + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null) { + if (isFromDate) { + setState(() { + model.selectedFromDate = picked; + var date = picked.add(Duration(days: 1)); + if (date.isBefore(lastDate)) { + model.selectedToDate = date; + } else + model.selectedToDate = lastDate; + }); + } else { + setState(() { + model.selectedToDate = picked; + }); + } + } + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), + ) + : null, + hintStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + ); + } +} diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 0c12b913..906a1487 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -18,7 +18,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profi import 'package:doctor_app_flutter/util/NotificationPermissionUtils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart'; 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/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 22d784e7..7aed8f6f 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -167,6 +167,20 @@ class ProfileGridForInPatient extends StatelessWidget { 'assets/images/svgs/profile_screen/diabetic chart.svg', isInPatient: isInpatient, ), + PatientProfileCardModel( + "VTE", + "Assessment", + VTE_ASSESSMENT, + 'assets/images/svgs/profile_screen/diabetic chart.svg', + isInPatient: isInpatient, + ), + PatientProfileCardModel( + TranslationBase.of(context).pharmacy, + TranslationBase.of(context).intervention, + PHARMACY_INTERVENTION, + 'assets/images/svgs/profile_screen/medical report.svg', + isInPatient: isInpatient, + ), ]; return Padding( diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index df3bbb06..c1957260 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/radiology_view_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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; @@ -50,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget { ), isShowAppBar: true, baseViewModel: model, - body: SingleChildScrollView( + body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index cc7ada28..6bf24f42 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/doctor_card.dart'; diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 5ecba4a1..500378f9 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -8,7 +8,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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 622c7927..b8da5a14 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -7,9 +7,10 @@ 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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/buttons/app_buttons_widget.dart'; @@ -209,19 +210,28 @@ class _PatientMakeReferralScreenState extends State { _selectedClinic == null || _selectedDoctor == null || _remarksController.text == null) return; - model + GifLoaderDialogUtils.showMyDialog(context); + await model .makeReferral( patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], - _remarksController.text) - .then((_) { + _remarksController.text); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); - }); + } + }, ), ) diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index c7e82b5f..14b790d7 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -142,318 +142,327 @@ class _UpdateAssessmentPageState extends State return Container( margin: EdgeInsets.only( left: 5, right: 5, top: 15, bottom: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + child: Column( children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Row( + children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.4), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), - ), - new TextSpan( - text: assessment - .selectedICD.code - .trim() - .toUpperCase() ?? - ""), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 5, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.64, - ), - children: [ - new TextSpan( - text: assessment - .selectedICD.description - .toString(), - ), - ], - ), - ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( + RichText( + text: new TextSpan( + style: new TextStyle( fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + .getTextMultiplierBasedOnWidth() * + 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), ), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - letterSpacing: -0.4, - color: Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment.appointmentId - .toString() ?? - "", - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), - ), - ], - ), + new TextSpan( + text: assessment + .selectedICD.code + .trim() + .toUpperCase() ?? + ""), + ], ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment + .createdOn), isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + AppText( + assessment.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], + ), + ], + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4.3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), + children: [ + new TextSpan( + text: assessment + .selectedICD.description + .toString(), + ), + ], ), ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, + ), + RichText( + text: new TextSpan( style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), + 3.5, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, ), - ), - ], - ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( + children: [ + new TextSpan( + text: TranslationBase.of( context) - .dType + - ' : ', - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), - ), + .appointmentNo, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: assessment.appointmentId + .toString() ?? + "", + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, + ), + RichText( + text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), - ), - ], - ), - ), - if (assessment.doctorName != null) - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .doctor + - ' : ', - style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * 3, - letterSpacing: -0.4, - color: Color(0xFF575757), + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .condition + + " : ", + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: - assessment.doctorName ?? - '', - style: new TextStyle( + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * - 3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .dType + + ' : ', + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), ), - ), - ], + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), ), - ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ + if (assessment.doctorName != null) + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .doctor + + ' : ', + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: + assessment.doctorName ?? + '', + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), SizedBox( height: 6, ), - AppText( - (assessment.remark != null && - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - RemarkText( - remark: assessment.remark ?? "", - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( + Row( + mainAxisAlignment: + MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.end, + CrossAxisAlignment.start, children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + SizedBox( + height: 6, ), AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + (assessment.remark != null && + assessment.remark != + '') + ? TranslationBase.of( + context) + .remarks + + " : " + : '', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + RemarkText( + remark: assessment.remark ?? "", ), ], ), ], ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, + ), + ) + ], ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon( - DoctorApp.edit, - size: 18, - ), - ) ], ), ], diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart index ea75d348..d43168e3 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart @@ -39,7 +39,7 @@ class StatusLabel extends StatelessWidget { : TranslationBase.of(context).locked, fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < selectedStepId diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index fd6a62d8..e8e65d57 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -7,7 +7,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/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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:flutter/cupertino.dart'; diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 8fa55b37..d1fcfef1 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -16,8 +16,8 @@ class LineChartCurved extends StatelessWidget { List yAxixs = List(); // DateFormat format = DateFormat("yyyy-MM-dd"); - DateFormat yearFormat = DateFormat("yyyy/MMM"); - DateFormat monthFormat = DateFormat("MMM"); + DateFormat yearFormat = DateFormat("yyyy/MMM/dd"); + DateFormat monthFormat = DateFormat("dd/MMM"); bool isDatesSameYear = true; @override @@ -96,6 +96,7 @@ class LineChartCurved extends StatelessWidget { } } + LineChartData sampleData1(context) { return LineChartData( lineTouchData: LineTouchData( @@ -162,31 +163,25 @@ class LineChartCurved extends StatelessWidget { return ''; }, ), - leftTitles: SideTitles( - showTitles: true, - getTextStyles: (context, value) { - return TextStyle( + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( color: Colors.black, + fontWeight: FontWeight.bold, fontSize: 10, - ); - }, - getTitles: (value) { - // if (timeSeries.length < 10) { - // return '${value.toInt()}'; - // } else { - // if (value == getMinY()) - // return '${value.toInt()}'; - // if (value == getMaxY()) + ), + interval:getInterval(), + + // getTitles: (value) { + // if (value.toInt() == 0) // return '${value.toInt()}'; - // if (yAxixs.contains(value)) { + // else if (value.toInt() % horizontalInterval == 0) // return '${value.toInt()}'; - // } - // return ''; - // } - return '${value.toInt()}'; - }, - margin: 12, - ), + // else + // return ''; + // }, + margin: 12, + ), ), borderData: FlBorderData( show: true, @@ -208,12 +203,44 @@ class LineChartCurved extends StatelessWidget { ), minX: 0, maxX: (timeSeries.length - 1).toDouble(), - maxY: getMaxY() + 0.3, - minY: getMinY(), + maxY: getMaxY() + getInterval(), + minY: 0, lineBarsData: getData(context), ); } + // double getMaxY() { + // double max = 0; + // timeSeries.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // + // return max.roundToDouble(); + // } + // + // double getMinY() { + // double min = timeSeries[0].sales; + // timeSeries.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // int value = min.toInt(); + // + // return value.toDouble(); + // } + + + double getInterval(){ + + return getMaxY() - getMinY() <= 100 + ? 20 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200; + + } + double getMaxY() { double max = 0; timeSeries.forEach((element) { diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 0af3c575..a84cd045 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -168,12 +168,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, - getTextStyles: (context, value) { - return TextStyle( - color: Colors.black, - fontSize: 10, - ); - }, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + interval:getInterval(), getTitles: (value) { return '${value.toInt()}'; }, @@ -199,23 +199,31 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries1.length - 1).toDouble(), - maxY: getMaxY() + 0.3, - minY: getMinY(), + maxX: 0, + maxY: getMaxY() + getInterval(), + minY: 0, lineBarsData: getData(context), ); } + double getInterval(){ + + return getMaxY() - getMinY() <= 100 + ? 20 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200; + + } + + + double getMaxY() { double max = 0; timeSeries1.forEach((element) { double resultValueDouble = element.sales; if (resultValueDouble > max) max = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble > max) max = resultValueDouble; - }); return max.roundToDouble(); } @@ -226,15 +234,39 @@ class LineChartCurvedBloodPressure extends StatelessWidget { double resultValueDouble = element.sales; if (resultValueDouble < min) min = resultValueDouble; }); - timeSeries2.forEach((element) { - double resultValueDouble = element.sales; - if (resultValueDouble < min) min = resultValueDouble; - }); - int value = min.toInt(); return value.toDouble(); } + // double getMaxY() { + // double max = 0; + // timeSeries1.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble > max) max = resultValueDouble; + // }); + // + // return max.roundToDouble(); + // } + // + // double getMinY() { + // double min = timeSeries1[0].sales; + // timeSeries1.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // timeSeries2.forEach((element) { + // double resultValueDouble = element.sales; + // if (resultValueDouble < min) min = resultValueDouble; + // }); + // + // int value = min.toInt(); + // + // return value.toDouble(); + // } List getData(context) { List spots = List(); diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart index af67f3e3..8eaf8672 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart @@ -79,14 +79,18 @@ class VitalSignDetailPainScale extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 16), padding: EdgeInsets.only(left: 8), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Expanded( flex: 2, child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Container( @@ -268,13 +272,24 @@ class VitalSignDetailPainScale extends StatelessWidget { ), Expanded( child: Container( - padding: EdgeInsets.all(8), + padding: EdgeInsets.symmetric(horizontal: 8), child: Center( - child: AppText( - "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM, yyyy hh:mm a")}", - fontWeight: FontWeight.w700, - color: Color(0XFF28353E), - fontSize: SizeConfig.textMultiplier * 1.6, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "E , dd MMM")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + AppText( + "${AppDateUtils.convertDateFromServerFormat(vitalList[index].createdOn, "hh:mm a")}", + fontWeight: FontWeight.w700, + color: Color(0XFF28353E), + fontSize: SizeConfig.textMultiplier * 1.6, + ), + ], ), ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 33c796b0..31f3cb09 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/errors/error_message.dart'; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 26f418e8..8bf76370 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sig import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart b/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart new file mode 100644 index 00000000..a0b18aab --- /dev/null +++ b/lib/screens/patients/profile/vte_assessment/vte_assessment_screen.dart @@ -0,0 +1,282 @@ +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/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/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; +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:flutter/material.dart'; +import 'package:provider/provider.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +class VteAssessmentScreen extends StatefulWidget { + const VteAssessmentScreen({Key key}) : super(key: key); + + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + bool isDischargedPatient = false; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; + return BaseView( + onModelReady: (model) => model.getVteAssessment(patientId: patient.patientId, + // admissionNo: 2016023498 + + admissionNo:int.parse(patient.admissionNo) + ), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: PatientProfileAppBar( + patient, + isInpatient: true, + ), + body: model.allVteHistoryList == null || + model.allVteHistoryList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + ), + ) + : Container( + color: Colors.grey[200], + child: Column( + children: [ + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.allVteHistoryList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.transparent, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + model + .allVteHistoryList[ + index].riskScore, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .allVteHistoryList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromString(model + .allVteHistoryList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model + .allVteHistoryList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromString(model + .allVteHistoryList[ + index] + .createdOn)) + : 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 + .allVteHistoryList[ + index] + .vTEType, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .pharmacology + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .pharmacology, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .reasonsThrombo + + " : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .reasonsThrombo, + fontSize: 12, + isCopyable: true, + ), + ), + ]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Ambulation Protocol : ", + fontSize: 12, + ), + Expanded( + child: AppText( + model + .allVteHistoryList[ + index] + .ambulationProtocol, + fontSize: 12, + isCopyable: true, + ), + ), + ]) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 8c07afcf..a8ee8cb8 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -229,6 +229,7 @@ class _PrescriptionFormWidgetState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { + /// TODO Elham* Move this to view model x = model.patientAssessmentList.map((element) { return element.icdCode10ID; }); @@ -331,7 +332,6 @@ class _PrescriptionFormWidgetState extends State { child: Wrap( alignment: WrapAlignment.center, children: [ - // TODO change it secondary button and add loading AppButton( title: TranslationBase.of( context) @@ -647,6 +647,7 @@ class _PrescriptionFormWidgetState extends State { child: InkWell( onTap: () => selectDate( context, widget.model), + /// TODO Elham* Use customTextFields for all TextFields here child: TextField( decoration: textFieldSelectorDecoration( @@ -667,6 +668,7 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox( height: spaceBetweenTextFileds), + /// TODO Elham* Use customTextFields for all PrescriptionTextFiled( element: duration, elementError: durationError, @@ -787,6 +789,7 @@ class _PrescriptionFormWidgetState extends State { .addMedication, fontWeight: FontWeight.w600, onPressed: () async { + /// TODO Elham* Use it to separate function await locator< AnalyticsService>() .logEvent( @@ -1016,7 +1019,7 @@ class _PrescriptionFormWidgetState extends State { }); } } - + /// TODO Elham* Use it from the textfeild utils InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { @@ -1062,6 +1065,7 @@ class _PrescriptionFormWidgetState extends State { showModalBottomSheet( context: context, builder: (context) { + /// TODO Elham* Move this to widget return Container( height: SizeConfig.realScreenHeight * .8, width: SizeConfig.realScreenWidth, @@ -1122,6 +1126,7 @@ class _PrescriptionFormWidgetState extends State { }); } + /// TODO Elham* Move this to view model getPriscriptionforDrug( List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 78f5afae..d744dcda 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -28,6 +28,7 @@ class DrugToDrug extends StatefulWidget { class _DrugToDrug extends State { int typeID = 1; bool isLoaded = false; + /// TODO Elham* fix this List> expandableList = [ {'name': 'CRITICAL', 'level': 'LEVEL_4'}, {'name': 'HIGH', 'level': 'LEVEL_3'}, @@ -35,15 +36,7 @@ class _DrugToDrug extends State { {'name': 'LOW', 'level': 'LEVEL_1'}, {'name': 'INFO', 'level': 'INFO'}, ]; - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: 2954208, - //widget.patient.patientMRN, - episodeId: 210011002, - //widget.patient.episodeNo, - appointmentNo: 2016055308, - //widget.patient.appointmentNo, - doctorID: '', - editedBy: ''); + VitalSignsViewModel model = new VitalSignsViewModel(); SOAPViewModel model2 = new SOAPViewModel(); @@ -114,6 +107,18 @@ class _DrugToDrug extends State { } getRequestedData() async { + + + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + /// TODO Elham* fix this today + patientMRN: widget.patient.patientMRN, + episodeId: widget.patient.episodeNo, + appointmentNo: + widget.patient.appointmentNo, + doctorID: '', + editedBy: ''); + /// TODO Elham* rename model to meaning full not just modle with number + await model.getPatientVitalSign(widget.patient); await model2.getPatientAllergy(generalGetReqForSOAP); await model2.getMasterLookup(MasterKeysService.DiagnosisType); diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 608dd643..f94c3b52 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -862,6 +862,8 @@ class _PrescriptionCheckOutScreenState } } + /// TODO Elham* Use it from the textfeild utils + InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index eb95257b..960bee9e 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -5,7 +5,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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 751a3deb..1e83eebe 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -4,7 +4,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/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/dialogs/ShowImageDialog.dart'; diff --git a/lib/screens/prescription/prescription_text_filed.dart b/lib/screens/prescription/prescription_text_filed.dart index 8f2676bc..95b70182 100644 --- a/lib/screens/prescription/prescription_text_filed.dart +++ b/lib/screens/prescription/prescription_text_filed.dart @@ -44,7 +44,7 @@ class _PrescriptionTextFiledState extends State { list: widget.elementList, attributeName: '${widget.keyName}', attributeValueId: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyId}'] + ? widget.elementList[0]['${widget.keyId}'].toString() : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index ef66b82b..4776d470 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 1a39f7e6..92518fad 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -68,6 +68,7 @@ class _UpdatePrescriptionFormState extends State { int testNum = 0; int strengthChar; PatiantInformtion patient; + /// TODO Elham* add type dynamic route; dynamic doseTime; dynamic frequencyUpdate; @@ -86,6 +87,7 @@ class _UpdatePrescriptionFormState extends State { strengthController.text = widget.doseStreangth; remarksController.text = widget.remarks; indicationList = List(); + /// TODO Elham* create model and try to have them form service and add translation dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; @@ -112,6 +114,7 @@ class _UpdatePrescriptionFormState extends State { indicationList.add(indication9); indicationList.add(indication10); } + /// TODO Elham* Add Translation @override Widget build(BuildContext context) { @@ -120,6 +123,8 @@ class _UpdatePrescriptionFormState extends State { (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) async { + /// TODO Elham* Move this to view model and remove unused data + await model.getMedicationList(); await model.getMedicationStrength(); await model.getMedicationDuration(); @@ -172,78 +177,6 @@ class _UpdatePrescriptionFormState extends State { ), Column( 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: AppText(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( height: MediaQuery.of(context).size.height * @@ -284,15 +217,6 @@ class _UpdatePrescriptionFormState extends State { "Only 5 Digits allowed for strength"); } }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, ), ), SizedBox( @@ -805,6 +729,9 @@ class _UpdatePrescriptionFormState extends State { title: 'update prescription' .toUpperCase(), onPressed: () { + + /// TODO Elham* Move this to function + if (double.parse( strengthController.text) > 1000.0) { @@ -912,7 +839,7 @@ class _UpdatePrescriptionFormState extends State { }); } } - + // /// TODO Elham* Use it from the textfeild utils InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { @@ -945,6 +872,7 @@ class _UpdatePrescriptionFormState extends State { ); } + /// TODO Elham* Move this to view model and pass all data as model updatePrescription( {PrescriptionViewModel model, int drugId, @@ -1030,6 +958,9 @@ void updatePrescriptionForm( String uom, int box, String startDate}) { + + /// TODO Elham* remove unused code. + TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index d531cf35..cb59885d 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -1,15 +1,19 @@ //import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + class ProcedureCard extends StatelessWidget { final Function onTap; @@ -82,14 +86,15 @@ class ProcedureCard extends StatelessWidget { : 'Urgent', color: entityList.orderType == 0 ? Colors.black - : Colors.red[800], + : AppGlobal.appRedColor, fontWeight: FontWeight.w600, ), SizedBox( height: 5, ), AppText( - entityList.procedureName, + Helpers.convertToTitleCase( + entityList.procedureName), bold: true, fontSize: 14, ), @@ -104,13 +109,18 @@ class ProcedureCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertISOStringToDateTime( + entityList.createdOn), + isMonthShort: true, + isArabic: projectViewModel.isArabic, + )}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.orderDate))}', + '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.createdOn))}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -154,8 +164,8 @@ class ProcedureCard extends StatelessWidget { height: 40, child: ClipRRect( borderRadius: BorderRadius.circular(20.0), - child: Image.network( - 'assets/images/male_avatar.png', + child: Image.asset( + 'assets/images/dr_avatar.png', height: 25, width: 30, errorBuilder: (BuildContext context, @@ -174,7 +184,8 @@ class ProcedureCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - entityList.doctorName, + Helpers.convertToTitleCase( + entityList.doctorName), fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.7 * SizeConfig.textMultiplier, @@ -182,7 +193,8 @@ class ProcedureCard extends StatelessWidget { ), if (entityList.clinicDescription != null) AppText( - entityList.clinicDescription, + Helpers.convertToTitleCase( + entityList.clinicDescription), fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 1.4 * SizeConfig.textMultiplier, @@ -201,7 +213,9 @@ class ProcedureCard extends StatelessWidget { children: [ Expanded( child: AppText( - entityList.remarks.toString() ?? '', + entityList.remarks!= null?Helpers.convertToTitleCase( + entityList.remarks.toString()) : + '', fontSize: 12, ), ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 16937262..ebb112d9 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; 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/transitions/slide_up_page.dart'; diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 7c68d649..b9d9e060 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -28,6 +28,10 @@ class AppDateUtils { return '/Date(${DateFormat(dateFormat).parse(date).millisecondsSinceEpoch})/'; } + static String convertDateToServerFormat(DateTime date) { + return '/Date(${date.millisecondsSinceEpoch})/'; + } + static convertDateFromServerFormat(String str, dateFormat) { var date = getDateTimeFromServerFormat(str); @@ -301,7 +305,7 @@ class AppDateUtils { /// get data formatted like 26 Apr 2020 /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime, - {bool isArabic = false, bool isMonthShort = false}) { + {bool isArabic = false, bool isMonthShort = true}) { if (dateTime != null) return dateTime.day.toString() + " " + diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6aa9c6c7..1cd4c79c 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -580,6 +580,9 @@ class TranslationBase { String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; + String get pharmacyIntervention => + localizedValues['pharmacy-intervention'][locale.languageCode]; + String get add => localizedValues['add'][locale.languageCode]; String get addSickLeaverequest => @@ -906,6 +909,14 @@ class TranslationBase { String get medications => localizedValues['medications'][locale.languageCode]; + String get medication => localizedValues['medication'][locale.languageCode]; + + String get doctorComments => localizedValues['doctorComments'][locale.languageCode]; + + String get statusDescription => localizedValues['statusDescription'][locale.languageCode]; + + String get createdByName => localizedValues['createdByName'][locale.languageCode]; + String get procedures => localizedValues['procedures'][locale.languageCode]; String get chiefComplaints => @@ -1123,6 +1134,8 @@ class TranslationBase { String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String get riskScore => localizedValues['riskScore'][locale.languageCode]; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; String get currentMedications => @@ -1723,6 +1736,10 @@ class TranslationBase { 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 investigation => @@ -1735,6 +1752,9 @@ class TranslationBase { localizedValues['planedProcedure'][locale.languageCode]; String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; + String get VTE_Type => localizedValues['VTE_Type'][locale.languageCode]; + String get pharmacology => localizedValues['pharmacology'][locale.languageCode]; + String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/app_bar/header_row.dart b/lib/widgets/patients/profile/app_bar/header_row.dart new file mode 100644 index 00000000..c5a0cd42 --- /dev/null +++ b/lib/widgets/patients/profile/app_bar/header_row.dart @@ -0,0 +1,44 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class HeaderRow extends StatelessWidget { + final String label; + final String value; + final bool isExpanded; + + const HeaderRow({Key key, this.label, this.value, this.isExpanded = false}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + label, + isCopyable: true, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 1, + ), + isExpanded?Expanded(child: AppText( + value, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), ): + AppText( + value, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + isCopyable: true, + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart similarity index 94% rename from lib/widgets/patients/profile/patient-profile-app-bar.dart rename to lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index 974d3590..d9e10fa3 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -11,7 +11,8 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'large_avatar.dart'; +import '../large_avatar.dart'; +import 'header_row.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; @@ -342,7 +343,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - '${TranslationBase.of(context).dr}$doctorName', + Helpers.convertToTitleCase( + '${TranslationBase.of(context).dr}$doctorName'), color: Color(0xFF2E303A), fontWeight: FontWeight.w700, fontSize: SizeConfig @@ -366,9 +368,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { value: branch ?? '', ), if (clinic != null) - HeaderRow( - label: 'Clinic: ', - value: clinic ?? '', + Container( + width: + MediaQuery.of(context).size.width * + 0.51, + child: HeaderRow( + label: 'Clinic: ', + value: Helpers.convertToTitleCase( + clinic) ?? + '', + isExpanded: true), ), if (isMedicalFile && episode != null) HeaderRow( @@ -410,7 +419,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? isInpatient ? (isFromLabResult ? 210 : 200) : isAppointmentHeader - ? 290 + ? 340 : SizeConfig.isHeightVeryShort ? 137 : SizeConfig.isHeightShort @@ -419,35 +428,3 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { (SizeConfig.isWidthLarge ? 25 : 20) : height); } - -class HeaderRow extends StatelessWidget { - final String label; - final String value; - - const HeaderRow({Key key, this.label, this.value}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Row( - children: [ - AppText( - label, - isCopyable: true, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - SizedBox( - width: 1, - ), - AppText( - value, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - isCopyable: true, - ), - ], - ); - } -} diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart similarity index 99% rename from lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart rename to lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index 72e0bc59..5415717a 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -7,13 +7,14 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'header_row.dart'; + class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 21875e4d..006e0fa4 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -12,6 +12,7 @@ class CustomRow extends StatelessWidget { this.valueSize, this.width, this.isCopyable = true, + this.isExpanded = true, }) : super(key: key); final String label; @@ -20,6 +21,7 @@ class CustomRow extends StatelessWidget { final double valueSize; final double width; final bool isCopyable; + final bool isExpanded; @override Widget build(BuildContext context) { @@ -38,6 +40,7 @@ class CustomRow extends StatelessWidget { width: 1, ), Expanded( + flex: isExpanded ? 1 : 0, child: AppText( value, fontSize: diff --git a/pubspec.lock b/pubspec.lock index 85e7f11e..e4f5a19f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -489,6 +489,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.5.0" + flutter_datetime_picker: + dependency: "direct main" + description: + name: flutter_datetime_picker + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" flutter_device_type: dependency: "direct main" description: @@ -763,13 +770,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" meta: dependency: transitive description: @@ -1173,7 +1173,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.3" timing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 766f55cb..dfc76868 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -112,6 +112,7 @@ dependencies: # Hijri # hijri: ^2.0.3 hijri_picker: ^3.0.0 + flutter_datetime_picker: ^1.5.1 # flutter_math_fork: ^0.6.0 # flutter_math_fork: ^0.6.0