From 0e2bcd79164182366886fa070d50f18275344729 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 21 Jun 2021 10:10:12 +0300 Subject: [PATCH 1/5] Fix Qr issues --- lib/config/config.dart | 4 ++-- .../model/patient_muse/PatientSearchRequestModel.dart | 8 +++++--- lib/core/viewModel/scan_qr_view_model.dart | 2 +- lib/screens/qr_reader/QR_reader_screen.dart | 6 ++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index eb361798..8241b36c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index c2658c9f..124f463a 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -9,6 +9,7 @@ class PatientSearchRequestModel { String from; String to; int searchType; + int projectID; String mobileNo; String identificationNo; int nursingStationID; @@ -28,7 +29,7 @@ class PatientSearchRequestModel { this.from = "0", this.to = "0", this.clinicID, - this.nursingStationID = 0}); + this.nursingStationID = 0,this.projectID=0}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -45,11 +46,12 @@ class PatientSearchRequestModel { identificationNo = json['IdentificationNo']; nursingStationID = json['NursingStationID']; clinicID = json['ClinicID']; + projectID = json['ProjectID']; } Map toJson() { final Map data = new Map(); - data['DoctorID'] = this.doctorID; + data['DoctorID'] = 0; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; data['LastName'] = this.lastName; @@ -63,7 +65,7 @@ class PatientSearchRequestModel { data['IdentificationNo'] = this.identificationNo; data['NursingStationID'] = this.nursingStationID; data['ClinicID'] = this.clinicID; - data['ProjectID'] = 0; + data['ProjectID'] =this.projectID; return data; } } diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index 86e975e3..b49078c7 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -13,7 +13,7 @@ class ScanQrViewModel extends BaseViewModel { await getDoctorProfile(); setState(ViewState.Busy); - await _scanQrService.getInPatient(requestModel, true); + await _scanQrService.getInPatient(requestModel, isMyInpatient); if (_scanQrService.hasError) { error = _scanQrService.error; diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index c70563f9..3d50d53a 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -76,9 +76,6 @@ class _QrReaderScreenState extends State { } _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { - /// When give qr we will change this method to get data - /// var result = await BarcodeScanner.scan(); - /// int patientID = get from qr result var result = await BarcodeScanner.scan(); if (result != "") { List listOfParams = result.split(','); @@ -86,9 +83,10 @@ class _QrReaderScreenState extends State { if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( patientID: patientID, + projectID: int.parse(listOfParams[0]) ); - await model.getInPatientList(patientSearchRequestModel, isMyInpatient: true).then((d) { + await model.getInPatientList(patientSearchRequestModel, isMyInpatient: false).then((d) { if (model.state != ViewState.ErrorLocal) { if (model.inPatientList.isEmpty) DrAppToastMsg.showErrorToast('No patient'); From 9da1bff7238543f372991bb6c4efda4ebaf9db70 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 21 Jun 2021 12:15:47 +0300 Subject: [PATCH 2/5] first step form sort --- .../viewModel/PatientSearchViewModel.dart | 16 + lib/models/patient/patiant_info_model.dart | 13 +- lib/screens/patients/InPatientPage.dart | 55 +- .../out_patient/out_patient_screen.dart | 87 +- pubspec.lock | 1123 ----------------- 5 files changed, 126 insertions(+), 1168 deletions(-) delete mode 100644 pubspec.lock diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index e0ee8948..12d94498 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -75,6 +75,14 @@ class PatientSearchViewModel extends BaseViewModel { } } + sortOutPatient({bool isDes = false}){ + if(isDes) + filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm)); + else + filterData.sort((PatiantInformtion a, PatiantInformtion b)=>AppDateUtils.convertStringToDate(a.appointmentDate).compareTo(AppDateUtils.convertStringToDate(b.appointmentDate))); + setState(ViewState.Idle); + } + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { setState(ViewState.Busy); @@ -169,6 +177,14 @@ class PatientSearchViewModel extends BaseViewModel { } } + sortInPatient({bool isDes = false}){ + if(isDes) + filteredInPatientItems.sort((PatiantInformtion a, PatiantInformtion b)=>b.admissionDateWithDateTimeForm.compareTo(a.admissionDateWithDateTimeForm)); + else + filteredInPatientItems.sort((PatiantInformtion a, PatiantInformtion b)=>a.admissionDateWithDateTimeForm.compareTo(b.admissionDateWithDateTimeForm)); + setState(ViewState.Idle); + } + Future setDefaultInPatientList() async { setState(ViewState.BusyLocal); await getDoctorProfile(); diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 29dc6198..4facbc3c 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,10 +1,13 @@ // TODO : it have to be changed. +import 'package:doctor_app_flutter/util/date-utils.dart'; + class PatiantInformtion { final PatiantInformtion patientDetails; int genderInt; dynamic age; String appointmentDate; + DateTime appointmentDateWithDateTimeForm; dynamic appointmentNo; dynamic appointmentType; String arrivalTime; @@ -52,6 +55,7 @@ class PatiantInformtion { int patientMRN; String admissionNo; String admissionDate; + DateTime admissionDateWithDateTimeForm; String createdOn; String roomId; String bedId; @@ -148,7 +152,8 @@ class PatiantInformtion { this.dischargeDate, this.status, this.vcId, - this.voipToken}); + this.voipToken, + this.admissionDateWithDateTimeForm, this.appointmentDateWithDateTimeForm}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -254,5 +259,11 @@ class PatiantInformtion { consultationNotes: json['ConsultationNotes'], patientStatus: json['PatientStatus'], voipToken: json['VoipToken'], + admissionDateWithDateTimeForm: json["AdmissionDate"] != null + ? AppDateUtils.convertStringToDate(json["AdmissionDate"]) + : json["admissionDate"] != null ? AppDateUtils.convertStringToDate( + json["admissionDate"]) : null, + + appointmentDateWithDateTimeForm: json["AppointmentDate"]!= null?AppDateUtils.convertStringToDate(json["AppointmentDate"]):null ); } diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index ec2a8107..cf4b6120 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -7,8 +7,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import '../../routes.dart'; @@ -24,6 +26,8 @@ class InPatientPage extends StatefulWidget { class _InPatientPageState extends State { TextEditingController _searchController = TextEditingController(); + bool isSortDes = true; + @override void dispose() { _searchController.dispose(); @@ -47,20 +51,45 @@ class _InPatientPageState extends State { ), Container( margin: EdgeInsets.all(16.0), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).searchPatientName, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, + child: Stack( + children: [ + AppTextFieldCustom( + hintText: TranslationBase.of(context).searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + + Positioned( + right: 35, + top:5, + child: IconButton( + icon: Icon( + isSortDes + ? FontAwesomeIcons.sortAmountDown + : FontAwesomeIcons.sortAmountUp, + color: Colors.black, + ), + iconSize: 20, + // padding: EdgeInsets.only(bottom: 30), + onPressed: () { + GifLoaderDialogUtils.showMyDialog(context); + model.sortInPatient(isDes: isSortDes); + isSortDes = !isSortDes; + GifLoaderDialogUtils.hideDialog(context); + }, ), - onPressed: () {}, - ), - controller: _searchController, - onChanged: (value) { - model.filterSearchResults(value); - }), + ) + ], + ), ), model.state == ViewState.Idle?model.filteredInPatientItems.length > 0 ? Expanded( diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 0a85ff26..8b699db2 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -77,6 +77,7 @@ class _OutPatientsScreenState extends State { PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; + bool isSortDes = true; @override Widget build(BuildContext context) { @@ -201,7 +202,7 @@ class _OutPatientsScreenState extends State { SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, - height: 75, + height: 85, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( @@ -218,37 +219,61 @@ class _OutPatientsScreenState extends State { TranslationBase.of(context).searchPatientName, fontSize: 13, )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - _activeLocation != 0 - ? DoctorApp.filter_1 - : FontAwesomeIcons.slidersH, - color: Colors.black, + Stack( + children: [ + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + _activeLocation != 0 + ? DoctorApp.filter_1 + : FontAwesomeIcons.slidersH, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), + onPressed: _activeLocation != 0 + ? null + : () { + Navigator.push( + context, + MaterialPageRoute( + builder: + (BuildContext context) => + FilterDatePage( + outPatientFilterType: + outPatientFilterType, + patientSearchViewModel: + model, + ))); + }, + ), + onChanged: (String str) { + model.searchData(str); + }), + Positioned( + right: 25, + child: IconButton( + icon: Icon( + isSortDes + ? FontAwesomeIcons.sortAmountDown + : FontAwesomeIcons.sortAmountUp, + color: Colors.black, + ), + iconSize: 20, + padding: EdgeInsets.only(bottom: 30), + onPressed: () { + model.sortOutPatient(isDes: isSortDes); + isSortDes = !isSortDes; + }, ), - iconSize: 20, - padding: EdgeInsets.only(bottom: 30), - onPressed: _activeLocation != 0 - ? null - : () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - FilterDatePage( - outPatientFilterType: - outPatientFilterType, - patientSearchViewModel: - model, - ))); - }, - ), - onChanged: (String str) { - model.searchData(str); - }), + ) + ], + + + ), ])), SizedBox( height: 10.0, diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index e4fdc2dc..00000000 --- a/pubspec.lock +++ /dev/null @@ -1,1123 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "12.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.40.6" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.13" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.0-nullsafety.1" - autocomplete_textfield: - dependency: "direct main" - description: - name: autocomplete_textfield - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - barcode_scan_fix: - dependency: "direct main" - description: - name: barcode_scan_fix - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.25" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.5" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.7" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "2.12.2" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.3" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - chewie: - dependency: transitive - description: - name: chewie - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.10" - chewie_audio: - dependency: transitive - description: - name: chewie_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0+1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0-nullsafety.3" - connectivity: - dependency: "direct main" - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9+5" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+4" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+7" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - css_colors: - dependency: transitive - description: - name: css_colors - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.2" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.10" - date_time_picker: - dependency: "direct main" - description: - name: date_time_picker - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - device_info: - dependency: "direct main" - description: - name: device_info - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2+10" - device_info_platform_interface: - dependency: transitive - description: - name: device_info_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - dropdown_search: - dependency: "direct main" - description: - name: dropdown_search - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.9" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.6" - eva_icons_flutter: - dependency: "direct main" - description: - name: eva_icons_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - expandable: - dependency: "direct main" - description: - name: expandable - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.4" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "5.2.1" - firebase_core: - dependency: transitive - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.3" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1+1" - firebase_messaging: - dependency: "direct main" - description: - name: firebase_messaging - url: "https://pub.dartlang.org" - source: hosted - version: "7.0.3" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.3" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_device_type: - dependency: "direct main" - description: - name: flutter_device_type - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - flutter_flexible_toast: - dependency: "direct main" - description: - name: flutter_flexible_toast - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - flutter_gifimage: - dependency: "direct main" - description: - name: flutter_gifimage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_html: - dependency: "direct main" - description: - name: flutter_html - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - flutter_inappwebview: - dependency: transitive - description: - name: flutter_inappwebview - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0+4" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_page_indicator: - dependency: transitive - description: - name: flutter_page_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.11" - flutter_staggered_grid_view: - dependency: "direct main" - description: - name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.18.1" - flutter_swiper: - dependency: "direct main" - description: - name: flutter_swiper - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: "direct main" - description: - name: font_awesome_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "8.12.0" - get_it: - dependency: "direct main" - description: - name: get_it - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.4" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - hexcolor: - dependency: "direct main" - description: - name: hexcolor - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.6" - html: - dependency: "direct main" - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+4" - html_editor_enhanced: - dependency: "direct main" - description: - name: html_editor_enhanced - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.2" - http_interceptor: - dependency: "direct main" - description: - name: http_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - imei_plugin: - dependency: "direct main" - description: - name: imei_plugin - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.2" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.1" - local_auth: - dependency: "direct main" - description: - name: local_auth - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3+4" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - maps_launcher: - dependency: "direct main" - description: - name: maps_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.2+2" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10-nullsafety.1" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.3" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - open_iconic_flutter: - dependency: transitive - description: - name: open_iconic_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1+1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+2" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" - percent_indicator: - dependency: "direct main" - description: - name: percent_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.9+1" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0+2" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.13" - progress_hud_v2: - dependency: "direct main" - description: - name: progress_hud_v2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.3" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8" - quiver: - dependency: "direct main" - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.5" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - screen: - dependency: transitive - description: - name: screen - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.5" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.12+4" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+4" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+11" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+7" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.2+3" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.9" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.4+1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.9" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0-nullsafety.2" - speech_to_text: - dependency: "direct main" - description: - path: speech_to_text - relative: true - source: path - version: "0.0.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0-nullsafety.1" - sticky_headers: - dependency: "direct main" - description: - name: sticky_headers - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8+1" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.1" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0-nullsafety.1" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0-nullsafety.1" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.19-nullsafety.2" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+3" - transformer_page_view: - dependency: transitive - description: - name: transformer_page_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.6" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0-nullsafety.3" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "5.7.10" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+4" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+9" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.9" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5+3" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.1+3" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.2" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0-nullsafety.3" - video_player: - dependency: transitive - description: - name: video_player - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.12+5" - video_player_platform_interface: - dependency: transitive - description: - name: video_player_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - video_player_web: - dependency: transitive - description: - name: video_player_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+1" - wakelock: - dependency: transitive - description: - name: wakelock - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4+2" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - webview_flutter: - dependency: transitive - description: - name: webview_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.24" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.4+1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "4.5.1" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.10.0 <2.11.0" - flutter: ">=1.22.0 <2.0.0" From 321bf7825efbb5684ea55273752bf2c6627b8fcb Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 21 Jun 2021 14:49:23 +0300 Subject: [PATCH 3/5] solve video stream publisher popup window bug --- android/app/build.gradle | 24 +++++++++++++++++++ .../hmgDr/ui/fragment/VideoCallFragment.kt | 23 ++++++++++++++---- lib/core/service/VideoCallService.dart | 6 ++--- .../viewModel/authentication_view_model.dart | 2 +- .../patient_profile_screen.dart | 10 ++++---- 5 files changed, 52 insertions(+), 13 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 96428f49..2e124398 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -28,6 +28,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 30 +// signingConfigs { +// release { +// storeFile file('C:\\Users\\admin\\Downloads\\DQKey.jks') +// storePassword 'HmGsa123' +// keyAlias 'key' +// keyPassword 'HmGsa123' +// } +// } + sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -50,10 +59,25 @@ android { buildTypes { release { // TODO: Add your own signing config for the release build. + signingConfig signingConfigs.debug + } + debug { // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } + +// flavorDimensions 'environment' +// productFlavors { +// production { +// dimension 'environment' +// } +// } +// +// configurations { +// productionDebugImplementation +// productionReleaseImplementation +// } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 35e28b23..7a66f80b 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -284,7 +284,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session // progressBar=findViewById(R.id.progress_bar); // progressBarTextView=findViewById(R.id.progress_bar_text); // progressBar.setVisibility(View.GONE); - hiddenButtons() + + +// hiddenButtons() checkClientConnected() if (appLang == "ar") { @@ -359,6 +361,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } mPublisherViewContainer.addView(mPublisher!!.view) + mSession!!.publish(mPublisher) if (!resume) { @@ -562,7 +565,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape) } else { videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) - mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color)) + mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground)) } } @@ -635,6 +638,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session localPreviewLayoutParam.width = localPreviewWidth localPreviewLayoutParam.height = localPreviewHeight localPreviewLayoutParam.setMargins(0, localPreviewMargin, localPreviewMargin, 0) + if (mPublisher != null && mPublisher!!.view.parent == null){ + mPublisherViewContainer.addView(mPublisher!!.view) + } + mPublisherViewContainer.visibility = View.VISIBLE + // remotePreviewLayoutParam = FrameLayout.LayoutParams(remotePreviewIconSize, remotePreviewIconSize) remotePreviewLayoutParam.width = remotePreviewIconSize remotePreviewLayoutParam.height = remotePreviewIconSize @@ -657,6 +665,11 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session localPreviewLayoutParam.width = 0 localPreviewLayoutParam.height = 0 localPreviewLayoutParam.setMargins(0, localPreviewMargin / 2, localPreviewMargin / 2, 0) + + if (mPublisher != null){ + mPublisherViewContainer.removeView(mPublisher!!.view) + } + mPublisherViewContainer.visibility = View.GONE // localPreviewLayoutIconParam = FrameLayout.LayoutParams(localPreviewIconSmall, localPreviewIconSmall) //// localPreviewLayoutParam = RelativeLayout.LayoutParams(localPreviewWidthSmall, localPreviewHeightSmall) // localPreviewLayoutParam.width = localPreviewWidthSmall @@ -820,7 +833,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onFinish() { mParams.x = -(szWindow.x - videoCallContainer.width) - dialog!!.window!!.attributes = mParams + dialog?.window!!.attributes = mParams } }.start() } @@ -846,7 +859,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session override fun onFinish() { mParams.x = szWindow.x - videoCallContainer.width - dialog!!.window!!.attributes = mParams + dialog?.window!!.attributes = mParams } }.start() } @@ -866,7 +879,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session private class MyGestureListener(val onTabCall: () -> Unit, val miniCircleDoubleTap: () -> Unit) : GestureDetector.SimpleOnGestureListener() { override fun onSingleTapConfirmed(event: MotionEvent): Boolean { - onTabCall() +// onTabCall() return true } diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index f72544a0..1bec02f5 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: startCallRes.openTokenID,//"T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", - kSessionId:startCallRes.openSessionID,//1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg - kApiKey: '46209962',//'47247954' + kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", // startCallRes.openTokenID, + kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg", // startCallRes.openSessionID, + kApiKey: '47247954' ,//'46209962' vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 9da1933a..a161c861 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -255,7 +255,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, 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 36388e87..2c88835d 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -337,8 +337,12 @@ class _PatientProfileScreenState extends State // builder: (BuildContext context) => // EndCallScreen(patient:patient))); + // TODO MOSA remov it and uncomment the below code + AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ + locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); + }); - if(isCallFinished) { + /* if(isCallFinished) { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => EndCallScreen(patient:patient))); } else { @@ -357,10 +361,8 @@ class _PatientProfileScreenState extends State AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); }); - - } - } + }*/ }, From e70eabe68d4b8e89109fea40e7afe56731b17041 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 22 Jun 2021 12:54:25 +0300 Subject: [PATCH 4/5] Fix live care issues and qr code --- lib/client/base_app_client.dart | 2 +- lib/config/localized_values.dart | 1 + .../PatientSearchRequestModel.dart | 8 ++-- lib/core/service/VideoCallService.dart | 6 +-- lib/core/service/home/scan_qr_service.dart | 8 ++-- .../viewModel/PatientSearchViewModel.dart | 6 ++- .../viewModel/authentication_view_model.dart | 2 +- .../insurance_approval_screen_patient.dart | 2 +- .../patient_profile_screen.dart | 39 +++++++++---------- .../assessment/update_assessment_page.dart | 2 +- .../objective/update_objective_page.dart | 2 +- .../soap_update/plan/update_plan_page.dart | 2 +- .../subjective/update_subjective_page.dart | 6 +-- .../prescription_checkout_screen.dart | 2 +- lib/screens/qr_reader/QR_reader_screen.dart | 4 +- 15 files changed, 47 insertions(+), 45 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 65c8341c..3c70c8cf 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -86,7 +86,7 @@ class BaseAppClient { int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) body['PatientOutSA'] = true; - else if(body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3) + else if((body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3)|| body['ProjectID']==2 || body['ProjectID']==3) body['PatientOutSA'] = true; else body['PatientOutSA'] = false; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4d0436aa..eb122d89 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -57,6 +57,7 @@ const Map> localizedValues = { 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicineDashboard': {'en': 'Search\nMedicines', 'ar': 'بحث\nعن الدواء'}, + 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 124f463a..b460fdee 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -16,7 +16,7 @@ class PatientSearchRequestModel { int clinicID=0; PatientSearchRequestModel( - {this.doctorID = 0, + {this.doctorID , this.firstName = "0", this.middleName = "0", this.lastName = "0", @@ -29,7 +29,7 @@ class PatientSearchRequestModel { this.from = "0", this.to = "0", this.clinicID, - this.nursingStationID = 0,this.projectID=0}); + this.nursingStationID = 0,this.projectID}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -51,7 +51,7 @@ class PatientSearchRequestModel { Map toJson() { final Map data = new Map(); - data['DoctorID'] = 0; + data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; data['LastName'] = this.lastName; @@ -63,7 +63,7 @@ class PatientSearchRequestModel { data['SearchType'] = this.searchType; data['MobileNo'] = this.mobileNo; data['IdentificationNo'] = this.identificationNo; - data['NursingStationID'] = this.nursingStationID; + //data['NursingStationID'] = this.nursingStationID; data['ClinicID'] = this.clinicID; data['ProjectID'] =this.projectID; return data; diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 1bec02f5..d85774a6 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", // startCallRes.openTokenID, - kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg", // startCallRes.openSessionID, - kApiKey: '47247954' ,//'46209962' + kToken: startCallRes.openTokenID, + kSessionId:startCallRes.openSessionID, + kApiKey: '46209962' ,//'46209962' vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index bc6c8820..8ad92c89 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -11,11 +11,11 @@ class ScanQrService extends BaseService { hasError = false; await getDoctorProfile(); - if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; - } else { + // if (isMyInpatient) { + // requestModel.doctorID = doctorProfile.doctorID; + // } else { requestModel.doctorID = 0; - } + //} await baseAppClient.post( GET_PATIENT_IN_PATIENT_LIST, diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 12d94498..8612ef9e 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -77,9 +77,11 @@ class PatientSearchViewModel extends BaseViewModel { sortOutPatient({bool isDes = false}){ if(isDes) - filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm)); + filterData= filterData.reversed.toList(); + // filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm)); else - filterData.sort((PatiantInformtion a, PatiantInformtion b)=>AppDateUtils.convertStringToDate(a.appointmentDate).compareTo(AppDateUtils.convertStringToDate(b.appointmentDate))); + filterData= filterData.reversed.toList(); + // filterData.sort((PatiantInformtion a, PatiantInformtion b)=>a.appointmentDateWithDateTimeForm.compareTo(b.appointmentDateWithDateTimeForm)); setState(ViewState.Idle); } diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index a161c861..9da1933a 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -255,7 +255,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 1ab0734b..bedca006 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -39,7 +39,7 @@ class _InsuranceApprovalScreenNewState ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient?.appointmentNo, + appointmentNo: int.parse(patient?.appointmentNo.toString()) , projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => 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 2c88835d..e11c1abf 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -46,6 +46,7 @@ class _PatientProfileScreenState extends State bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; + bool isCallStarted = false; String patientType; String arrivalType; String from; @@ -228,16 +229,12 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () async { - if ((isFromLiveCare && - patient.appointmentNo != null && - patient.appointmentNo != 0) || - patient.patientStatusType == - 43) { + if ((isFromLiveCare && patient.appointmentNo != null ) || patient.patientStatusType == 43) { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( appointmentNo: - patient.appointmentNo, + int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); GifLoaderDialogUtils.showMyDialog( @@ -283,10 +280,7 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () { - if ((isFromLiveCare && - patient.appointmentNo != - null && - patient.appointmentNo != 0) || + if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || patient.patientStatusType == 43) { Navigator.of(context).pushNamed( @@ -294,7 +288,7 @@ class _PatientProfileScreenState extends State arguments: { 'patient': patient }); - } + } }), ], ), @@ -331,18 +325,13 @@ class _PatientProfileScreenState extends State title: isCallFinished? TranslationBase.of(context).endCall: TranslationBase.of(context).initiateCall, - disabled: model.state == ViewState.BusyLocal, + disabled: isCallStarted || model.state == ViewState.BusyLocal, onPressed: () async { // Navigator.push(context, MaterialPageRoute( // builder: (BuildContext context) => // EndCallScreen(patient:patient))); - // TODO MOSA remov it and uncomment the below code - AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ - locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); - }); - - /* if(isCallFinished) { + if(isCallFinished) { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => EndCallScreen(patient:patient))); } else { @@ -354,15 +343,23 @@ class _PatientProfileScreenState extends State Helpers.showErrorToast(model.error); } else { await model.getDoctorProfile(); - patient.appointmentNo = model.startCallRes.appointmentNo; + patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString()); patient.episodeNo = 0; - + setState(() { + isCallStarted = true; + }); GifLoaderDialogUtils.hideDialog(context); AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); }); } - }*/ + } + + // AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ + // locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); + // }); + + }, 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 4f48ff27..fab69c44 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 @@ -55,7 +55,7 @@ class _UpdateAssessmentPageState extends State { episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patientInfo.appointmentNo); + appointmentNo: int.parse(widget.patientInfo.appointmentNo)); await model.getPatientAssessment(getAssessmentReqModel); if (model.patientAssessmentList.isNotEmpty) { if (model.listOfDiagnosisCondition.length == 0) { diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 8fdfffc2..a78db029 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -67,7 +67,7 @@ class _UpdateObjectivePageState extends State { GetPhysicalExamReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); await model.getPatientPhysicalExam(getPhysicalExamReqModel); if (model.patientPhysicalExamList.isNotEmpty) { diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 87ea1e4d..e4731325 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -78,7 +78,7 @@ class _UpdatePlanPageState extends State { onModelReady: (model) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo), patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index b0db0414..8ab08c31 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -63,7 +63,7 @@ class _UpdateSubjectivePageState extends State { GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); @@ -152,7 +152,7 @@ class _UpdateSubjectivePageState extends State { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); @@ -201,7 +201,7 @@ class _UpdateSubjectivePageState extends State { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), episodeId: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo, doctorID: ''); diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 5ebc84aa..cac2f99a 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -186,7 +186,7 @@ class _PrescriptionCheckOutScreenState extends State setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - indicationController.text += reconizedWord + '\n'; + instructionController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 3d50d53a..c6d07bb9 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -82,7 +82,8 @@ class _QrReaderScreenState extends State { int patientID = 0; if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( - patientID: patientID, + patientID: patientID,clinicID: 0, + doctorID: 0, projectID: int.parse(listOfParams[0]) ); @@ -93,6 +94,7 @@ class _QrReaderScreenState extends State { else Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": model.inPatientList[0], + "isInpatient": true, }); } else { DrAppToastMsg.showErrorToast(model.error); From d879f1da77e3d6a7a420c494b883354237ed9cf2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 22 Jun 2021 17:37:37 +0300 Subject: [PATCH 5/5] fix add prescription issue --- lib/screens/prescription/add_prescription_form.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 6a3e5f5b..5eda270d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -592,9 +592,7 @@ class _PrescriptionFormWidgetState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).boxQuantity, isTextFieldHasSuffix: false, - dropDownText: box != null - ? TranslationBase.of(context).boxQuantity + - ": " + + dropDownText: box != null? model.boxQuintity.toString() : null, enabled: false,