diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 0d1e30f9..38c6575d 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -137,7 +137,7 @@ class SOAPViewModel extends BaseViewModel { planCallBack.nextFunction(model); } - Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async { + Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = "", bool allowSetState = false}) async { if (isBusyLocal) { setState(ViewState.Busy); } else { diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index a8049465..97698274 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -25,7 +25,7 @@ class BaseViewModel extends ChangeNotifier { Future getDoctorProfile({bool isGetProfile = false}) async { if (isGetProfile) { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { doctorProfile = DoctorProfileModel.fromJson(profile); if (doctorProfile != null) { diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index d786b98a..34451000 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -30,7 +30,7 @@ class PatientReferralViewModel extends BaseViewModel { List? get branchesList => _referralPatientService.projectsList; - List get clinicsList => _referralPatientService.clinicsList; + List? get clinicsList => _referralPatientService.clinicsList; List get referralFrequencyList => _referralPatientService.frequencyList; diff --git a/lib/screens/patients/patient_search/patient_search_result_screen.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart index 8447964e..61e97597 100644 --- a/lib/screens/patients/patient_search/patient_search_result_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -99,6 +99,7 @@ class _PatientsSearchResultScreenState extends State scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model.filterData.length, + padding: EdgeInsets.zero, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -109,11 +110,6 @@ class _PatientsSearchResultScreenState extends State isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { - print("TODO change the parameter to daynamic"); - print("TODO change the parameter to daynamic"); - print("TODO change the parameter to daynamic"); - print("TODO change the parameter to daynamic"); - print("TODO change the parameter to daynamic"); // TODO change the parameter to daynamic Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": model.filterData[index], 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 418b800b..0aa2c21d 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 @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; @@ -33,19 +33,17 @@ class _ProgressNoteState extends State { AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); late ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); + String? type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); - GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = - GetNursingProgressNoteRequestModel( - admissionNo: int.parse(patient.admissionNo!), - patientTypeID: patient.patientType, - patientID: patient.patientId, - ); + GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel( + admissionNo: int.parse(patient.admissionNo!), + patientTypeID: patient.patientType, + patientID: patient.patientId, + ); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } @@ -55,8 +53,7 @@ class _ProgressNoteState extends State { projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - if (routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), builder: (_, model, w) => AppScaffold( @@ -67,8 +64,7 @@ class _ProgressNoteState extends State { patient, isInpatient: true, ), - body: model.patientNursingProgressNoteList == null || - model.patientNursingProgressNoteList.length == 0 + body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0 ? Center( child: ErrorMessage( error: TranslationBase.of(context).noDataAvailable, @@ -81,8 +77,7 @@ class _ProgressNoteState extends State { Expanded( child: Container( child: ListView.builder( - itemCount: - model.patientNursingProgressNoteList.length, + itemCount: model.patientNursingProgressNoteList.length, itemBuilder: (BuildContext ctxt, int index) { return FractionallySizedBox( widthFactor: 0.95, @@ -92,48 +87,31 @@ class _ProgressNoteState extends State { widget: Column( children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 10, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, + width: MediaQuery.of(context).size.width * 0.60, child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - crossAxisAlignment: - CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of( - context) - .createdBy, + TranslationBase.of(context).createdBy, fontSize: 10, ), Expanded( child: AppText( - model - .patientNursingProgressNoteList[ - index] - .createdByName - .toString() ?? - '', - fontWeight: - FontWeight.w600, + model.patientNursingProgressNoteList[index].createdByName.toString() ?? '', + fontWeight: FontWeight.w600, fontSize: 12, isCopyable: true, ), @@ -146,73 +124,39 @@ class _ProgressNoteState extends State { Column( children: [ AppText( - model - .patientNursingProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientNursingProgressNoteList[ - index] - .createdOn!), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), + model.patientNursingProgressNoteList[index].createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientNursingProgressNoteList[index].createdOn!), + isArabic: projectViewModel.isArabic, isMonthShort: true) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic), fontWeight: FontWeight.w600, fontSize: 14, isCopyable: true, ), AppText( - model - .patientNursingProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientNursingProgressNoteList[ - index] - .createdOn!)) - : AppDateUtils.getHour( - DateTime.now()), + model.patientNursingProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientNursingProgressNoteList[index].createdOn!)) + : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, isCopyable: true, ), ], - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, ) ], ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .patientNursingProgressNoteList[ - index] - .notes!, - fontSize: 10, - isCopyable: true, - ), - ), - ]) + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientNursingProgressNoteList[index].notes!, + fontSize: 10, + isCopyable: true, + ), + ), + ]) ], ), SizedBox( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 09cfe6b8..3121d302 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -167,8 +167,7 @@ class ProfileGridForSearch extends StatelessWidget { isInPatient: item.isInPatient, isDischargedPatient: item.isDischargedPatient, isDisable: item.isDisable, - onTap: () {}, - //item.onTap(), + onTap: item.onTap, isLoading: item.isLoading, ); }).toList(), diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart index 8b24e722..cfc38b6a 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart @@ -279,10 +279,10 @@ class _PatientMakeInPatientReferralScreenState extends State 0 + onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList!.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( - list: model.clinicsList, + list: model.clinicsList!, attributeName: 'ClinicDescription', attributeValueId: 'ClinicID', usingSearch: true, diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart index eb520051..d92a54f1 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart @@ -264,10 +264,10 @@ class _PatientMakeReferralScreenState extends State { enabled: false, isTextFieldHasSuffix: true, validationError: clinicError, - onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 + onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList!.length > 0 ? () { ListSelectDialog dialog = ListSelectDialog( - list: model.clinicsList, + list: model.clinicsList!, attributeName: 'ClinicDescription', attributeValueId: 'ClinicID', usingSearch: true, diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart index bbb2cf11..a793871e 100644 --- a/lib/screens/prescription/new_prescriptions_page.dart +++ b/lib/screens/prescription/new_prescriptions_page.dart @@ -26,7 +26,7 @@ class NewPrescriptionsPage extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; return BaseView( onModelReady: (model) async { - model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo); + model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo ?? 0); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index fa167fff..e240be93 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -56,8 +56,8 @@ class PatientCard extends StatelessWidget { decoration: Utils.getCardBoxDecoration(), child: CardWithBgWidget( padding: 0, - marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 10, - marginSymmetric: isFromSearch ? 10 : 0.0, + marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 0, + marginSymmetric: isFromSearch ? 0 : 0.0, hasBorder: false, bgColor: isFromLiveCare ? Colors.white @@ -292,7 +292,7 @@ class PatientCard extends StatelessWidget { ), Row(crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only(left: 12.0, top: 5), + padding: EdgeInsets.only(left: 12.0, top: 5, bottom: 10), child: Container( width: 60, height: 60,