diff --git a/doctor_app_key b/doctor_app_key new file mode 100644 index 00000000..ae5bdbbc Binary files /dev/null and b/doctor_app_key differ diff --git a/key.properties b/key.properties new file mode 100644 index 00000000..92d5c684 --- /dev/null +++ b/key.properties @@ -0,0 +1,4 @@ +storePassword=HmGsa123 +keyPassword=HmGsa123 +keyAlias=hmgdoctor +storeFile=doctor_app_key \ No newline at end of file diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ed5a202e..df7874da 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -115,8 +115,8 @@ class BaseAppClient { // print("ProjectID :"); // print(body['ProjectID']); - print("URL : $url"); - print("Body : ${json.encode(body)}"); + debugPrint("URL : $url"); + debugPrint("Body : ${json.encode(body)}"); var asd = json.encode(body); var asd2; if (await Utils.checkConnection()) { diff --git a/lib/config/config.dart b/lib/config/config.dart index 3bc3dda8..7be1e61f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -446,7 +446,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 8.6; +const VERSION_ID = 8.7; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index a060f69f..ace5e866 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -18,19 +18,15 @@ import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => - _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => - _ucafService.patientVitalSignsHistory; + List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; - List get patientAssessmentList => - _ucafService.patientAssessmentList; + List get patientAssessmentList => _ucafService.patientAssessmentList; List get diagnosisTypes => _ucafService.listOfDiagnosisType; - List get diagnosisConditions => - _ucafService.listOfDiagnosisCondition; + List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; PrescriptionModel get prescriptionList => _ucafService.prescriptionList; @@ -75,7 +71,7 @@ class UcafViewModel extends BaseViewModel { // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); - await _ucafService.getPatientChiefComplaint(patient); + // await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { error = _ucafService.error; @@ -91,23 +87,16 @@ class UcafViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || - temperatureCelcius == null || - temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || - respirationBeatPerMinute == null || - respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = - element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || - bloodPressure == null || - bloodPressure == 'null') { + if (bloodPressure == "0/0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } }); @@ -126,8 +115,7 @@ class UcafViewModel extends BaseViewModel { } else { if (patientAssessmentList.isNotEmpty) { if (diagnosisConditions.length == 0) { - await _ucafService - .getMasterLookup(MasterKeysService.DiagnosisCondition); + await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition); } if (diagnosisTypes.length == 0) { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); @@ -169,13 +157,11 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel findMasterDataById( - {@required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -183,8 +169,7 @@ class UcafViewModel extends BaseViewModel { return null; case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index eba91698..005d095d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -7,8 +7,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' - as cpe; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; @@ -36,14 +35,11 @@ class ProcedureViewModel extends BaseViewModel { bool hasError = false; ProcedureService _procedureService = locator(); - List get procedureList => - _procedureService.procedureList; + List get procedureList => _procedureService.procedureList; - List get valadteProcedureList => - _procedureService.valadteProcedureList; + List get valadteProcedureList => _procedureService.valadteProcedureList; - List get categoriesList => - _procedureService.categoriesList; + List get categoriesList => _procedureService.categoriesList; List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); @@ -51,44 +47,31 @@ class ProcedureViewModel extends BaseViewModel { List _finalRadiologyListClinic = List(); List _finalRadiologyListHospital = List(); - List get finalRadiologyList => - filterType == FilterType.Clinic - ? _finalRadiologyListClinic - : _finalRadiologyListHospital; + List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; - List get radiologyList => - _radiologyService.finalRadiologyList; + List get radiologyList => _radiologyService.finalRadiologyList; - List get patientLabOrdersList => - _labsService.patientLabOrdersList; + List get patientLabOrdersList => _labsService.patientLabOrdersList; - List get labOrdersResultsList => - _labsService.labOrdersResultsList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; - List get procedureTemplate => - _procedureService.templateList; + List get procedureTemplate => _procedureService.templateList; List templateList = List(); - List get procedureTemplateDetails => - _procedureService.templateDetailsList; + List get procedureTemplateDetails => _procedureService.templateDetailsList; bool _isRadiologyVIDAPlus = false; bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; - Future getProcedure( - {int mrn, - String patientType, - int appointmentNo, - bool isLocalBusy = false}) async { + Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async { hasError = false; await getDoctorProfile(); if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); - await _procedureService.getProcedure( - mrn: mrn, appointmentNo: appointmentNo); + await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); if (_procedureService.hasError) { error = _procedureService.error; if (patientType == "7") @@ -99,21 +82,14 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory( - {String categoryName, - String categoryID, - patientId, - bool isLocalBusy = false}) async { + Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async { if (categoryName == null) return; hasError = false; if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); - await _procedureService.getProcedureCategory( - categoryName: categoryName, - categoryID: categoryID, - patientId: patientId); + await _procedureService.getProcedureCategory(categoryName: categoryName, categoryID: categoryID, patientId: patientId); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -133,17 +109,13 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureTemplate( - {String categoryID, - bool isLocalBusy = false, - BuildContext context}) async { + Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - await _procedureService.getProcedureTemplate( - categoryID: categoryID, isLocalBusy: false); + await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -154,20 +126,12 @@ class ProcedureViewModel extends BaseViewModel { setTemplateListDependOnId() { procedureTemplate.forEach((element) { - List templateListData = templateList - .where((elementTemplate) => - elementTemplate.templateId == element.templateID) - .toList(); + List templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList(); if (templateListData.length != 0) { - templateList[templateList.indexOf(templateListData[0])] - .procedureTemplate - .add(element); + templateList[templateList.indexOf(templateListData[0])].procedureTemplate.add(element); } else { - var template = ProcedureTempleteDetailsModelList( - templateName: element.templateName, - templateId: element.templateID, - template: element); + var template = ProcedureTempleteDetailsModelList(templateName: element.templateName, templateId: element.templateID, template: element); if (!templateList.contains(template)) templateList.add(template); } }); @@ -189,8 +153,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn, - {bool isLocalBusy = false}) async { + Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn, {bool isLocalBusy = false}) async { hasError = false; if (isLocalBusy) setState(ViewState.BusyLocal); @@ -201,14 +164,12 @@ class ProcedureViewModel extends BaseViewModel { error = _procedureService.error; setState(ViewState.ErrorLocal); } else { - await getProcedure(mrn: mrn, isLocalBusy:isLocalBusy); + await getProcedure(mrn: mrn, isLocalBusy: isLocalBusy); setState(ViewState.Idle); } } - Future validationProcedure( - ProcedureValidationRequestModel procedureValidateRequestModel, - {bool isLocalBusy = false}) async { + Future validationProcedure(ProcedureValidationRequestModel procedureValidateRequestModel, {bool isLocalBusy = false}) async { hasError = false; if (isLocalBusy) { setState(ViewState.BusyLocal); @@ -224,12 +185,12 @@ class ProcedureViewModel extends BaseViewModel { } } - Future updateProcedure( - {UpdateProcedureRequestModel updateProcedureRequestModel, - int mrn, bool isLocalBusy = false}) async { + Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async { hasError = false; - if(isLocalBusy)setState(ViewState.BusyLocal); else - setState(ViewState.Busy); + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); await _procedureService.updateProcedure(updateProcedureRequestModel); if (_procedureService.hasError) { error = _procedureService.error; @@ -239,11 +200,9 @@ class ProcedureViewModel extends BaseViewModel { //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, - {String patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, - isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; @@ -253,39 +212,25 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = - _finalRadiologyListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[ - finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListClinic.add(FinalRadiologyList( - filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = - _finalRadiologyListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = _finalRadiologyListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital - .indexOf(finalRadiologyListHospital[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList( - filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); } }); @@ -295,17 +240,9 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, - lineItem: lineItem, - projectId: projectId, - patient: patient); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); @@ -318,8 +255,7 @@ class ProcedureViewModel extends BaseViewModel { notifyListeners(); } - List get patientLabSpecialResult => - _labsService.patientLabSpecialResult; + List get patientLabSpecialResult => _labsService.patientLabSpecialResult; List get labResultList => _labsService.labResultList; @@ -340,19 +276,9 @@ class ProcedureViewModel extends BaseViewModel { } } - getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult( - invoiceNo: invoiceNo, - orderNo: orderNo, - projectID: projectID, - clinicID: clinicID, - patient: patient); + await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -361,15 +287,9 @@ class ProcedureViewModel extends BaseViewModel { } } - getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, - procedure: procedure, - patient: patient); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -377,9 +297,7 @@ class ProcedureViewModel extends BaseViewModel { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || - element.resultValue.contains('*') || - element.resultValue.isEmpty) isShouldClear = true; + if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true; }); } if (isShouldClear) _labsService.labOrdersResultsList.clear(); @@ -410,8 +328,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); } PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValidationRequestModel procedureValadteRequestModel = - new ProcedureValidationRequestModel(); + ProcedureValidationRequestModel procedureValadteRequestModel = new ProcedureValidationRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; @@ -426,48 +343,34 @@ class ProcedureViewModel extends BaseViewModel { procedureValadteRequestModel.procedure = [element.procedureId]; List controls = List(); controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( - Controls( - code: "ordertype", - controlValue: procedureType == ProcedureType.PROCEDURE - ? element.type ?? "1" - : "0"), + Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"), ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); + controlsProcedure.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls)); }); postProcedureReqModel.procedures = controlsProcedure; - await validationProcedure(procedureValadteRequestModel, - isLocalBusy: isLocalBusy); + await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy); if (state == ViewState.Idle) { if (valadteProcedureList[0].entityList.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN, - isLocalBusy: isLocalBusy); + await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy); if (state == ViewState.ErrorLocal) { Utils.showErrorToast(error); getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy); } else if (state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); - if (Navigator.canPop(AppGlobal.CONTEX)) - Navigator.pop(AppGlobal.CONTEX); - if (Navigator.canPop(AppGlobal.CONTEX)) - Navigator.pop(AppGlobal.CONTEX); + if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX); + if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX); } } else { if (state == ViewState.ErrorLocal) { Utils.showErrorToast(error); getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { - Utils.showErrorToast( - valadteProcedureList[0].entityList[0].warringMessages); + Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); } } } else { @@ -475,34 +378,23 @@ class ProcedureViewModel extends BaseViewModel { } } - bool isEntityListSelected( - cpe.EntityList masterKey, List entityList) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + bool isEntityListSelected(cpe.EntityList masterKey, List entityList) { + Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } return false; } - bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, - List entityList) { - Iterable history = entityList.where( - (element) => - masterKey.templateID == element.templateID && - masterKey.procedureName == element.procedureName); + bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, List entityList) { + Iterable history = entityList.where((element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName); if (history.length > 0) { return true; } return false; } - Future addProcedures( - ProcedureViewModel model, - List items, - PatiantInformtion patient, - TextEditingController remarksController, - {bool isLocalBusy = false}) async { + Future addProcedures(ProcedureViewModel model, List items, PatiantInformtion patient, TextEditingController remarksController, {bool isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { @@ -523,15 +415,10 @@ class ProcedureViewModel extends BaseViewModel { eventCategory: "Procedure Checkout Screen", eventAction: "Add New Procedure", ); - await model.preparePostProcedure( - entityList: entityList, - patient: patient, - remarks: remarksController.text, - isLocalBusy: isLocalBusy); + await model.preparePostProcedure(entityList: entityList, patient: patient, remarks: remarksController.text, isLocalBusy: isLocalBusy); } - Future filterSearchResults(String query, List masterList, - List items) async { + Future filterSearchResults(String query, List masterList, List items) async { List dummySearchList = List(); dummySearchList.addAll(masterList); if (query.isNotEmpty) { @@ -549,13 +436,9 @@ class ProcedureViewModel extends BaseViewModel { } } - void filterProcedureSearchResults( - String query, - List masterList, - List items) { + void filterProcedureSearchResults(String query, List masterList, List items) { List dummySearchList = List(); - if(masterList!= null) - dummySearchList.addAll(masterList); + if (masterList != null) dummySearchList.addAll(masterList); if (query.isNotEmpty) { List dummyListData = List(); dummySearchList.forEach((item) { 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 1d51c4c3..451fd5d8 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 @@ -31,24 +31,17 @@ class UpdateObjectivePage extends StatefulWidget { final int currentIndex; final PatiantInformtion patientInfo; - UpdateObjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + UpdateObjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); } -class _UpdateObjectivePageState extends State - implements ObjectiveCallBack { +class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; List mySelectedExamination = List(); - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -77,8 +70,7 @@ class _UpdateObjectivePageState extends State masterKeys: MasterKeysService.PhysicalExamination, id: element.examId, ); - MySelectedExamination tempEam = - SoapUtils.generateMySelectedExamination( + MySelectedExamination tempEam = SoapUtils.generateMySelectedExamination( examination: examMaster, remark: element.remarks, isNormal: element.isNormal, @@ -113,8 +105,7 @@ class _UpdateObjectivePageState extends State patientInfo: widget.patientInfo, ), ExpandableSOAPWidget( - headerTitle: - TranslationBase.of(context).physicalSystemExamination, + headerTitle: TranslationBase.of(context).physicalSystemExamination, onTap: () { setState(() { isSysExaminationExpand = !isSysExaminationExpand; @@ -123,14 +114,12 @@ class _UpdateObjectivePageState extends State child: Column( children: [ SOAPOpenItems( - label: - "${TranslationBase.of(context).addExamination}", + label: "${TranslationBase.of(context).addExamination}", onTap: () { openExaminationList(context); }, ), - if (mySelectedExamination.isNotEmpty && - mySelectedExamination.first.isLocal) + if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal) Row( children: [ AppText( @@ -143,25 +132,14 @@ class _UpdateObjectivePageState extends State ), Column( children: mySelectedExamination - .sublist( - 0, - model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) + .sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); + removeExamination(examination.selectedExamination); }); }).toList(), ), - if (mySelectedExamination.isNotEmpty && - model.getFirstIndexForOldExamination( - mySelectedExamination) > - -1) + if (mySelectedExamination.isNotEmpty && model.getFirstIndexForOldExamination(mySelectedExamination) > -1) Row( children: [ AppText( @@ -174,16 +152,10 @@ class _UpdateObjectivePageState extends State ), Column( children: mySelectedExamination - .sublist(model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) + .sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); + removeExamination(examination.selectedExamination); }); }).toList(), ) @@ -192,8 +164,7 @@ class _UpdateObjectivePageState extends State isExpanded: isSysExaminationExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 14 : 12), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 14 : 12), ) ], ), @@ -206,33 +177,20 @@ class _UpdateObjectivePageState extends State submitUpdateObjectivePage(SOAPViewModel model) async { if (mySelectedExamination.isNotEmpty) { - if (!model.isAddExamInProgress && - widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { + if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { Navigator.of(context).pop(); } else { widget.changeLoadingState(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel - .listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; - ListHisProgNotePhysicalExaminationVM - listHisProgNotePhysicalExaminationVM = - ListHisProgNotePhysicalExaminationVM( + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + ListHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM = ListHisProgNotePhysicalExaminationVM( patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo == null - ? 0 - : widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo == null - ? 0 - : widget.patientInfo.appointmentNo, + episodeId: widget.patientInfo.episodeNo == null ? 0 : widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo == null ? 0 : widget.patientInfo.appointmentNo, remarks: exam.remark ?? '', createdBy: exam.createdBy ?? doctorProfile.doctorID, createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), @@ -255,15 +213,12 @@ class _UpdateObjectivePageState extends State : "Not Examined", isNew: exam.isNew, ); - if (widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { - listHisProgNotePhysicalExaminationVM.admissionNo = - int.parse(widget.patientInfo.admissionNo); + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { + listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo); } else { listHisProgNotePhysicalExaminationVM.admissionNo = 0; } - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(listHisProgNotePhysicalExaminationVM); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM); }); if (model.patientPhysicalExamList.isEmpty) { @@ -275,14 +230,12 @@ class _UpdateObjectivePageState extends State if (model.state == ViewState.ErrorLocal) { widget.changeLoadingState(false); Utils.showErrorToast(model.error); - if (widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); model.isAddExamInProgress = false; } } else { - if (widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); widget.changeLoadingState(false); model.isAddExamInProgress = false; @@ -298,10 +251,7 @@ class _UpdateObjectivePageState extends State } removeExamination(MasterKeyModel masterKey) { - Iterable history = mySelectedExamination.where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) { setState(() { @@ -322,17 +272,11 @@ class _UpdateObjectivePageState extends State FadePage( page: AddExaminationPage( mySelectedExamination: mySelectedExamination, - addSelectedExamination: - (List mySelectedExaminationLocal) { + addSelectedExamination: (List mySelectedExaminationLocal) { setState(() { { mySelectedExaminationLocal.forEach((element) { - if ((mySelectedExamination.singleWhere( - (it) => - it.selectedExamination.id == - element.selectedExamination.id, - orElse: () => null)) == - null) { + if ((mySelectedExamination.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { mySelectedExamination.insert(0, element); } }); @@ -340,12 +284,7 @@ class _UpdateObjectivePageState extends State /// remove items. List removedList = []; mySelectedExamination.forEach((element) { - if ((mySelectedExaminationLocal.singleWhere( - (it) => - it.selectedExamination.id == - element.selectedExamination.id, - orElse: () => null)) == - null) { + if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { removedList.add(element); } }); diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 29ed59d7..5100c613 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -4,48 +4,19 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_ex import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; class SoapUtils { - static MySelectedHistory generateMySelectedHistory( - {history, isChecked = false, remark, isLocal = true}) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: isChecked, - remark: remark, - isLocal: isLocal); + static MySelectedHistory generateMySelectedHistory({history, isChecked = false, remark, isLocal = true}) { + MySelectedHistory mySelectedHistory = MySelectedHistory(selectedHistory: history, isChecked: isChecked, remark: remark, isLocal: isLocal); return mySelectedHistory; } - static MySelectedAllergy generateMySelectedAllergy( - {allergy, - allergySeverity, - isChecked = false, - remark, - isLocal = true, - int createdBy, - bool isExpanded = false}) { - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: allergy, - selectedAllergySeverity: allergySeverity, - isChecked: isChecked, - remark: remark, - isLocal: isLocal, - createdBy: createdBy, - isExpanded: isExpanded); + static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy, bool isExpanded = false}) { + MySelectedAllergy mySelectedAllergy = + MySelectedAllergy(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded); return mySelectedAllergy; } static MySelectedExamination generateMySelectedExamination( - {examination, - allergySeverity, - isChecked = false, - remark, - isLocal = true, - isNormal, - createdBy, - createdOn, - editedOn, - notExamined, - isNew, - isAbnormal}) { + {examination, allergySeverity, isChecked = false, remark, isLocal = true, isNormal, createdBy, createdOn, editedOn, notExamined, isNew, isAbnormal}) { MySelectedExamination mySelectedExamination = MySelectedExamination( selectedExamination: examination, remark: remark, @@ -61,17 +32,7 @@ class SoapUtils { return mySelectedExamination; } - static MySelectedAssessment generateMySelectedAssessment( - {appointmentNo, - remark, - diagnosisType, - diagnosisCondition, - selectedICD, - doctorID, - doctorName, - createdBy, - createdOn, - icdCode10ID}) { + static MySelectedAssessment generateMySelectedAssessment({appointmentNo, remark, diagnosisType, diagnosisCondition, selectedICD, doctorID, doctorName, createdBy, createdOn, icdCode10ID}) { MySelectedAssessment mySelectedAssessment = MySelectedAssessment( appointmentId: appointmentNo, remark: remark, diff --git a/pubspec.yaml b/pubspec.yaml index 27cb655f..0e4ff414 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.3.5+1 +version: 1.3.97+1 environment: