diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 721a0bb8..1d354ac3 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -85,80 +85,103 @@ class _MedicalFilePageState extends State { itemBuilder: (BuildContext ctxt, int index) { return InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicalFileDetails( - age: patient.age is String - ? patient.age ?? "" - : "${patient.age}", - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, - encounterNumber: index, - pp: patient.patientId, - patient: patient, - doctorName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName - : "", - clinicName: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .clinicName - : "", - doctorImage: model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .timeLineEvents[0] - .consulations - .isNotEmpty - ? model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorImage - : "", - episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty - ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() - : "", - vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), - ); + if (model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .length != + 0) + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MedicalFileDetails( + age: patient.age is String + ? patient.age ?? "" + : "${patient.age}", + firstName: patient.firstName, + lastName: patient.lastName, + gender: patient.genderDescription, + encounterNumber: index, + pp: patient.patientId, + patient: patient, + doctorName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName + : "", + clinicName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName + : "", + doctorImage: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .isNotEmpty + ? model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorImage + : "", + episode: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations.isNotEmpty + ? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0].consulations[0].episodeID.toString() + : "", + vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString())), + ); }, child: DoctorCard( - doctorName: model.medicalFileList[0] - .entityList[0].timelines[index].doctorName, - clinic: model.medicalFileList[0].entityList[0] - .timelines[index].clinicName, - branch: model.medicalFileList[0].entityList[0] - .timelines[index].projectName, - profileUrl: model.medicalFileList[0] - .entityList[0].timelines[index].doctorImage, - appointmentDate: - DateUtils.getDateTimeFromServerFormat( - model.medicalFileList[0].entityList[0] - .timelines[index].date, - ), - isPrescriptions: true, - ), + doctorName: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, + clinic: model.medicalFileList[0].entityList[0] + .timelines[index].clinicName, + branch: model.medicalFileList[0].entityList[0] + .timelines[index].projectName, + profileUrl: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorImage, + appointmentDate: + DateUtils.getDateTimeFromServerFormat( + model.medicalFileList[0].entityList[0] + .timelines[index].date, + ), + isPrescriptions: true, + isShowEye: model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .timeLineEvents[0] + .consulations + .length != + 0 + ? true + : false), ); }) : Center( diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index a18aed2f..5cffe283 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -589,24 +589,23 @@ class _PatientsScreenState extends State { SizedBox( height: 10.0, ), - if (int.parse(patientType) == 7) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular( - 10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic( - newValue, context, model); - }, - )), + // if (int.parse(patientType) == 7) + // Container( + // padding: EdgeInsets.all(5), + // decoration: BoxDecoration( + // color: Colors.white, + // border: Border.all( + // color: Colors.grey), + // borderRadius: + // BorderRadius.circular(10)), + // child: ClinicList( + // clinicId: clinicId, + // onClinicChange: (newValue) { + // clinicId = newValue; + // changeClinic( + // newValue, context, model); + // }, + // )), Padding( padding: EdgeInsets.only( top: MediaQuery.of(context) @@ -616,7 +615,7 @@ class _PatientsScreenState extends State { // child: _locationBar(context) child: SERVICES_PATIANT2[ int.parse(patientType)] == - "patientArrivalList" + "List_MyOutPatient" ? _locationBar(context, model) : Container(), ), @@ -657,7 +656,8 @@ class _PatientsScreenState extends State { isInpatient, "arrivalType": arrivalType, - "isInpatient":isInpatient + "isInpatient": + isInpatient }); }, ); @@ -903,13 +903,17 @@ class _PatientsScreenState extends State { GifLoaderDialogUtils.showMyDialog(context); int val2 = int.parse(patientType); GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 7) { - getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: _patientSearchFormValues.From, - to: _patientSearchFormValues.To, - pageIndex: 0, - pageSize: 0, - patientMRN: patient.getPatientID); + if (val2 == 0) { + patient = PatientModel( + From: _patientSearchFormValues.From, + To: _patientSearchFormValues.To, + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + ); } model diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index c4500824..14600646 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; @@ -14,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; import '../../../../config/shared_pref_kay.dart'; import '../../../../models/patient/patiant_info_model.dart'; @@ -38,6 +40,9 @@ class _ProgressNoteState extends State { final _controller = TextEditingController(); var _isInit = true; bool isDischargedPatient = false; + AuthViewModel authProvider; + + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; @@ -60,6 +65,7 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { + authProvider = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; @@ -116,7 +122,7 @@ class _ProgressNoteState extends State { CrossAxisAlignment.start, children: [ if (model.patientProgressNoteList[index].status != 2 && - model.patientProgressNoteList[index].status != 4) + model.patientProgressNoteList[index].status != 4 && authProvider.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) Row( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index c9932e63..e555e613 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -62,6 +62,13 @@ class _UpdateNoteOrderState extends State { @override void initState() { requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + onVoiceText(); + } + } + }); super.initState(); } @@ -236,7 +243,11 @@ class _UpdateNoteOrderState extends State { } } - void errorListener(SpeechRecognitionError error) {} + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + //SpeechToText.closeAlertDialog(context); + print(error); + } void statusListener(String status) { reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; @@ -257,6 +268,8 @@ class _UpdateNoteOrderState extends State { SpeechToText.closeAlertDialog(context); progressNoteController.text = reconizedWord; }); + } else { + print(result.finalResult); } } } diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 7741fa89..e4112cf2 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -34,13 +34,13 @@ class MyScheduleWidget extends StatelessWidget { ), AppText( projectViewModel.isArabic?DateUtils.getWeekDayArabic(workingHoursTable.date.weekday): DateUtils.getWeekDay(workingHoursTable.date.weekday) , - fontSize: 18, + fontSize: 16, fontFamily: 'Poppins', // fontSize: 18 ), AppText( ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', - fontSize: 18, + fontSize: 14, fontWeight: FontWeight.w700, fontFamily: 'Poppins', // fontSize: 18 diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index c86e0211..48782921 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -21,6 +21,7 @@ class DoctorCard extends StatelessWidget { final Function onTap; final bool isPrescriptions; final String clinic; + final bool isShowEye; DoctorCard( {this.doctorName, @@ -31,7 +32,8 @@ class DoctorCard extends StatelessWidget { this.appointmentDate, this.orderNo, this.isPrescriptions = false, - this.clinic}); + this.clinic, + this.isShowEye = true}); @override Widget build(BuildContext context) { @@ -50,7 +52,7 @@ class DoctorCard extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(15.0), child: InkWell( - onTap: onTap, + onTap: (isShowEye) ? onTap : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -169,9 +171,10 @@ class DoctorCard extends StatelessWidget { ]), ), ), - Icon( - EvaIcons.eye, - ) + if (isShowEye) + Icon( + EvaIcons.eye, + ) ], ), ), diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index 41b64249..ac48c3fe 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -75,6 +75,10 @@ class _MyStatefulBuilderState extends State { setState(() { searchText = p['searchText']; }); + } else if (p['searchText'] == 'null') { + setState(() { + searchText = p['searchText']; + }); } }); super.initState();