diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index 3bb2afa5..f2d0f74e 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_Li import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { @@ -52,70 +53,71 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget { activeTab != 2) Container( width: MediaQuery.of(context).size.width * .3, - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.black, - isExpanded: true, - value: selectedMapId == null - ? model.specialClinicalCareMappingList[0].nursingStationID - : selectedMapId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return model.specialClinicalCareMappingList.map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(2), - margin: EdgeInsets.all(2), - decoration: new BoxDecoration( - color: Colors.red[800], - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: Center( - child: AppText( - model.specialClinicalCareMappingList.length - .toString(), - color: Colors.white, - fontSize: - projectsProvider.isArabic ? 10 : 11, - textAlign: TextAlign.center, - ), - )), - ], - ), - AppText(item.description, - fontSize: 12, - color: Colors.black, - fontWeight: FontWeight.bold, - textAlign: TextAlign.end), - ], - ); - }).toList(); - }, - onChanged: (newValue) async { - onChangeFunc(newValue); - }, - items: model.specialClinicalCareMappingList.map((item) { - return DropdownMenuItem( - child: AppText( - item.description, - textAlign: TextAlign.left, - ), - value: item.nursingStationID, - ); - }).toList(), - )), + child + : DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: selectedMapId??model.specialClinicalCareMappingList[0].nursingStationID, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.specialClinicalCareMappingList.map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.all(2), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: Center( + child: AppText( + model.specialClinicalCareMappingList + .length + .toString(), + color: Colors.white, + fontSize: projectsProvider.isArabic + ? 10 + : 11, + textAlign: TextAlign.center, + ), + )), + ], + ), + AppText(selectedMapId == null?TranslationBase.of(context).all:item.description, + fontSize: 12, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: TextAlign.end), + ], + ); + }).toList(); + }, + onChanged: (newValue) async { + onChangeFunc(newValue); + }, + items: model.specialClinicalCareMappingList.map((item) { + return DropdownMenuItem( + child: AppText( + item.description, + textAlign: TextAlign.left, + ), + value: item.nursingStationID, + ); + }).toList(), + )), ), ]), ), diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index d7bd805a..ef9f8b03 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -70,8 +70,8 @@ class _InPatientScreenState extends State if (widget.specialClinic != null) { await model .getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); - requestModel.nursingStationID = - model.specialClinicalCareMappingList[0].nursingStationID; + // requestModel.nursingStationID = + // model.specialClinicalCareMappingList[0].nursingStationID; } requestModel.clinicID = 0; await model.getInPatientList(requestModel); diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 054817c2..fb31511d 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -166,8 +166,10 @@ class _ProgressNoteState extends State { index] .createdBy) AppText( + TranslationBase.of(context) .notePending, + fontWeight: FontWeight.bold, color: Color(0xFFCC9B14), fontSize: 12, @@ -472,6 +474,7 @@ class _ProgressNoteState extends State { fontWeight: FontWeight.w600, fontSize: 12, + isCopyable:true, ), ), ], @@ -505,6 +508,7 @@ class _ProgressNoteState extends State { .isArabic), fontWeight: FontWeight.w600, fontSize: 14, + isCopyable:true, ), AppText( model @@ -522,6 +526,7 @@ class _ProgressNoteState extends State { DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, + isCopyable:true, ), ], crossAxisAlignment: @@ -543,6 +548,7 @@ class _ProgressNoteState extends State { index] .notes, fontSize: 10, + isCopyable:true, ), ), ]) 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 66fd22fd..41686ead 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 @@ -25,10 +25,12 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class PatientMakeInPatientReferralScreen extends StatefulWidget { @override - _PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState(); + _PatientMakeInPatientReferralScreenState createState() => + _PatientMakeInPatientReferralScreenState(); } -class _PatientMakeInPatientReferralScreenState extends State { +class _PatientMakeInPatientReferralScreenState + extends State { PatiantInformtion patient; List referToList; dynamic _referTo; @@ -66,7 +68,8 @@ class _PatientMakeInPatientReferralScreenState extends State initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -123,8 +127,14 @@ class _PatientMakeInPatientReferralScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + .getClinics(_selectedBranch[ + 'facilityId']) + .then((_) => + GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } } else { _selectedBranch = null; @@ -226,7 +245,9 @@ class _PatientMakeInPatientReferralScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + .getClinics( + _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } }); }, @@ -271,7 +297,9 @@ class _PatientMakeInPatientReferralScreenState extends State GifLoaderDialogUtils.hideDialog(context)); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + patient, + _selectedClinic['ClinicID'], + _selectedBranch['facilityId']) + .then((_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } }); }, @@ -317,41 +353,49 @@ class _PatientMakeInPatientReferralScreenState extends State 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.doctorsList, - attributeName: 'Name', - attributeValueId: 'DoctorID', - usingSearch: true, - hintSearchText: TranslationBase.of(context).doctorSearch, - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : () { - if (_selectedClinic == null) { - DrAppToastMsg.showErrorToast("You need to select a clinic first"); - } else if (model.doctorsList == null || model.doctorsList.length == 0) { - DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); - } + onClick: _selectedClinic != null && + model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'Name', + attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: + TranslationBase.of(context) + .doctorSearch, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : () { + if (_selectedClinic == null) { + DrAppToastMsg.showErrorToast( + "You need to select a clinic first"); + } else if (model.doctorsList == null || + model.doctorsList.length == 0) { + DrAppToastMsg.showErrorToast( + "There is no doctors for this clinic"); + } + }, ), SizedBox( height: 10, @@ -379,8 +423,11 @@ class _PatientMakeInPatientReferralScreenState extends State {onVoiceText()}); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ), @@ -454,15 +504,14 @@ class _PatientMakeInPatientReferralScreenState extends State