diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 40bb0e51..cd113840 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -1,5 +1,3 @@ -import 'dart:convert'; - import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart'; @@ -185,7 +183,6 @@ class LabsService extends BaseService { await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultHistoryList.clear(); response['ListGeneralResultHistory'].forEach((lab) { - print(jsonEncode(lab)); labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 5e197448..0d1e30f9 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -140,8 +140,9 @@ class SOAPViewModel extends BaseViewModel { Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async { if (isBusyLocal) { setState(ViewState.Busy); - } else + } else { setState(ViewState.Busy); + } await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey); if (_SOAPService.hasError) { error = _SOAPService.error; @@ -255,9 +256,7 @@ class SOAPViewModel extends BaseViewModel { return allergiesString; } - Future getPatientPhysicalExam( - PatiantInformtion patientInfo, - ) async { + Future getPatientPhysicalExam(PatiantInformtion patientInfo, {required bool allowSetState}) async { GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(), @@ -271,13 +270,12 @@ class SOAPViewModel extends BaseViewModel { getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!); else getPhysicalExamReqModel.admissionNo = 0; - setState(ViewState.Busy); + if (allowSetState) setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); + if (allowSetState) setState(ViewState.Error); + } else if (allowSetState) setState(ViewState.Idle); } Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async { diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 10cd1679..9aa9f065 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -80,7 +80,7 @@ class _VerificationMethodsScreenState extends State { SizedBox( height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4), ), - authenticationViewModel.user != null && isMoreOption == false + authenticationViewModel.user != null && authenticationViewModel.user!.logInTypeID != null && isMoreOption == false ? Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, @@ -238,7 +238,7 @@ class _VerificationMethodsScreenState extends State { textAlign: TextAlign.start, ), ]), - authenticationViewModel.user != null && isMoreOption == false + authenticationViewModel.user != null && authenticationViewModel.user!.logInTypeID != null && isMoreOption == false ? Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Row(mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( @@ -416,7 +416,7 @@ class _VerificationMethodsScreenState extends State { } sendActivationCode(AuthMethodTypes authMethodType) async { - if (authenticationViewModel.user != null) { + if (authenticationViewModel.user != null && authenticationViewModel.user!.logInTypeID != null) { sendActivationCodeVerificationScreen(authMethodType); } else { sendActivationCodeByOtpNotificationType(authMethodType); diff --git a/lib/screens/patients/profile/lab_result/history/lab_result_history_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/history/lab_result_history_chart_and_detials.dart index ca7c7400..709af295 100644 --- a/lib/screens/patients/profile/lab_result/history/lab_result_history_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/history/lab_result_history_chart_and_detials.dart @@ -26,8 +26,7 @@ class LabResultHistoryChartAndDetails extends StatelessWidget { children: [ Container( margin: EdgeInsets.symmetric(horizontal: 8), - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: LineChartCurvedLabHistory( title: name, labResultHistory: labResultHistory, @@ -36,8 +35,7 @@ class LabResultHistoryChartAndDetails extends StatelessWidget { Container( margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), - decoration: BoxDecoration( - color: Colors.white, borderRadius: BorderRadius.circular(12)), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ 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 629681b1..2ecb873c 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 @@ -60,7 +60,7 @@ class _UpdateObjectivePageState extends State implements Ob model.setObjectiveCallBack(this); mySelectedExamination.clear(); model.isAddExamInProgress = true; - await model.getPatientPhysicalExam(widget.patientInfo); + await model.getPatientPhysicalExam(widget.patientInfo, allowSetState: false); if (model.patientPhysicalExamList.isNotEmpty) { if (model.physicalExaminationList.length == 0) { await model.getMasterLookup(MasterKeysService.PhysicalExamination); 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 b19e79d0..1bb8c2b7 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 @@ -272,6 +272,7 @@ class _UpdateSubjectivePageState extends State implements @override Function nextFunction(model) { - return addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList); + addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList); + return () {}; } } diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart index a793871e..bbb2cf11 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 ?? 0); + model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo); }, builder: (_, model, w) => AppScaffold( baseViewModel: model,