From d0d68741598f2355873d3930d29713dd3ac24b90 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 14 Jul 2021 11:02:51 +0300 Subject: [PATCH 01/29] create mapper for the selected items --- lib/config/localized_values.dart | 1 + lib/models/SOAP/my_selected_allergy.dart | 54 -- lib/models/SOAP/my_selected_assement.dart | 65 -- lib/models/SOAP/my_selected_examination.dart | 61 -- lib/models/SOAP/my_selected_history.dart | 33 - .../selected_items/my_selected_allergy.dart | 23 + .../selected_items/my_selected_assement.dart | 24 + .../my_selected_examination.dart | 27 + .../selected_items/my_selected_history.dart | 11 + .../assessment/add_assessment_details.dart | 2 +- .../assessment/update_assessment_page.dart | 755 +++++++++--------- .../objective/add_examination_page.dart | 2 +- .../objective/add_examination_widget.dart | 2 +- .../objective/examination_item_card.dart | 2 +- .../examinations_list_search_widget.dart | 2 +- .../objective/update_objective_page.dart | 8 +- .../profile/soap_update/soap_utils.dart | 88 ++ .../subjective/allergies/add_allergies.dart | 2 +- .../subjective/allergies/allergies_item.dart | 14 +- ..._key_checkbox_search_allergies_widget.dart | 2 +- .../allergies/update_allergies_widget.dart | 2 +- .../history/add_history_dialog.dart | 9 +- .../history/update_history_widget.dart | 2 +- .../medication/update_medication_widget.dart | 2 +- .../subjective/update_subjective_page.dart | 203 +++-- .../soap_update/update_soap_index.dart | 7 +- lib/util/translations_delegate_base.dart | 1 + 27 files changed, 713 insertions(+), 691 deletions(-) delete mode 100644 lib/models/SOAP/my_selected_allergy.dart delete mode 100644 lib/models/SOAP/my_selected_assement.dart delete mode 100644 lib/models/SOAP/my_selected_examination.dart delete mode 100644 lib/models/SOAP/my_selected_history.dart create mode 100644 lib/models/SOAP/selected_items/my_selected_allergy.dart create mode 100644 lib/models/SOAP/selected_items/my_selected_assement.dart create mode 100644 lib/models/SOAP/selected_items/my_selected_examination.dart create mode 100644 lib/models/SOAP/selected_items/my_selected_history.dart create mode 100644 lib/screens/patients/profile/soap_update/soap_utils.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0a094b9b..ebc43a87 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -704,4 +704,5 @@ const Map> localizedValues = { "edit": {"en": "Edit", "ar": "تعديل"}, "summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"}, "finish": {"en": "Finish", "ar": "انهاء"}, + "severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"}, }; diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart deleted file mode 100644 index 90031230..00000000 --- a/lib/models/SOAP/my_selected_allergy.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedAllergy { - MasterKeyModel selectedAllergySeverity; - MasterKeyModel selectedAllergy; - String remark; - bool isChecked; - bool isExpanded; - bool isLocal; - int createdBy; - bool hasValidationError; - - MySelectedAllergy( - {this.selectedAllergySeverity, - this.selectedAllergy, - this.remark, - this.isChecked, - this.isExpanded = true, - this.isLocal = true, - this.createdBy, - this.hasValidationError = false}); - - MySelectedAllergy.fromJson(Map json) { - selectedAllergySeverity = json['selectedAllergySeverity'] != null - ? new MasterKeyModel.fromJson(json['selectedAllergySeverity']) - : null; - selectedAllergy = json['selectedAllergy'] != null - ? new MasterKeyModel.fromJson(json['selectedAllergy']) - : null; - remark = json['remark']; - isChecked = json['isChecked']; - isExpanded = json['isExpanded']; - isLocal = json['isLocal']; - createdBy = json['createdBy']; - hasValidationError = json['hasValidationError']; - } - - Map toJson() { - final Map data = new Map(); - if (this.selectedAllergySeverity != null) { - data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson(); - } - if (this.selectedAllergy != null) { - data['selectedAllergy'] = this.selectedAllergy.toJson(); - } - data['remark'] = this.remark; - data['isChecked'] = this.isChecked; - data['isExpanded'] = this.isExpanded; - data['createdBy'] = this.createdBy; - data['isLocal'] = this.isLocal; - data['hasValidationError'] = this.hasValidationError; - return data; - } -} diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart deleted file mode 100644 index 4d4afc2d..00000000 --- a/lib/models/SOAP/my_selected_assement.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedAssessment { - MasterKeyModel selectedICD; - MasterKeyModel selectedDiagnosisCondition; - MasterKeyModel selectedDiagnosisType; - String remark; - int appointmentId; - int createdBy; - String createdOn; - int doctorID; - String doctorName; - String icdCode10ID; - - MySelectedAssessment( - {this.selectedICD, - this.selectedDiagnosisCondition, - this.selectedDiagnosisType, - this.remark, this.appointmentId, this.createdBy, - this.createdOn, - this.doctorID, - this.doctorName, - this.icdCode10ID}); - - MySelectedAssessment.fromJson(Map json) { - selectedICD = json['selectedICD'] != null - ? new MasterKeyModel.fromJson(json['selectedICD']) - : null; - selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null - ? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition']) - : null; - selectedDiagnosisType = json['selectedDiagnosisType'] != null - ? new MasterKeyModel.fromJson(json['selectedDiagnosisType']) - : null; - remark = json['remark']; - appointmentId = json['appointmentId']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - doctorID = json['doctorID']; - doctorName = json['doctorName']; - icdCode10ID = json['icdCode10ID']; - } - - Map toJson() { - final Map data = new Map(); - - if (this.selectedICD != null) { - data['selectedICD'] = this.selectedICD.toJson(); - } - if (this.selectedDiagnosisCondition != null) { - data['selectedICD'] = this.selectedDiagnosisCondition.toJson(); - } - if (this.selectedDiagnosisType != null) { - data['selectedICD'] = this.selectedDiagnosisType.toJson(); - } - data['remark'] = this.remark; - data['appointmentId'] = this.appointmentId; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['doctorID'] = this.doctorID; - data['doctorName'] = this.doctorName; - data['icdCode10ID'] = this.icdCode10ID; - return data; - } -} diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart deleted file mode 100644 index 6a3ecf99..00000000 --- a/lib/models/SOAP/my_selected_examination.dart +++ /dev/null @@ -1,61 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedExamination { - MasterKeyModel selectedExamination; - String remark; - bool isNormal; - bool isAbnormal; - bool notExamined; - bool isNew; - bool isLocal; - int createdBy; - String createdOn; - String editedOn; - - MySelectedExamination({ - this.selectedExamination, - this.remark, - this.isNormal = false, - this.isAbnormal = false, - this.notExamined = true, - this.isNew = true, - this.isLocal = true, - this.createdBy, - this.createdOn, - this.editedOn, - }); - - MySelectedExamination.fromJson(Map json) { - selectedExamination = json['selectedExamination'] != null - ? new MasterKeyModel.fromJson(json['selectedExamination']) - : null; - remark = json['remark']; - isNormal = json['isNormal']; - isAbnormal = json['isAbnormal']; - notExamined = json['notExamined']; - isNew = json['isNew']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - editedOn = json['editedOn']; - isLocal = json['isLocal']; - } - - Map toJson() { - final Map data = new Map(); - - if (this.selectedExamination != null) { - data['selectedExamination'] = this.selectedExamination.toJson(); - } - data['remark'] = this.remark; - data['isNormal'] = this.isNormal; - data['isAbnormal'] = this.isAbnormal; - data['notExamined'] = this.notExamined; - data['isNew'] = this.isNew; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['editedOn'] = this.editedOn; - data['isLocal'] = this.isLocal; - - return data; - } -} diff --git a/lib/models/SOAP/my_selected_history.dart b/lib/models/SOAP/my_selected_history.dart deleted file mode 100644 index 91f66910..00000000 --- a/lib/models/SOAP/my_selected_history.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; - -class MySelectedHistory { - MasterKeyModel selectedHistory; - String remark; - bool isChecked; - bool isLocal; - - MySelectedHistory( - { this.selectedHistory, this.remark, this.isChecked, this.isLocal = true}); - - MySelectedHistory.fromJson(Map json) { - - selectedHistory = json['selectedHistory'] != null - ? new MasterKeyModel.fromJson(json['selectedHistory']) - : null; - remark = json['remark']; - remark = json['isChecked']; - isLocal = json['isLocal']; - } - - Map toJson() { - final Map data = new Map(); - - if (this.selectedHistory != null) { - data['selectedHistory'] = this.selectedHistory.toJson(); - } - data['remark'] = this.remark; - data['isChecked'] = this.remark; - data['isLocal'] = this.isLocal; - return data; - } -} diff --git a/lib/models/SOAP/selected_items/my_selected_allergy.dart b/lib/models/SOAP/selected_items/my_selected_allergy.dart new file mode 100644 index 00000000..512a4f64 --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_allergy.dart @@ -0,0 +1,23 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedAllergy { + MasterKeyModel selectedAllergySeverity; + MasterKeyModel selectedAllergy; + String remark; + bool isChecked; + bool isExpanded; + bool isLocal; + int createdBy; + bool hasValidationError; + + MySelectedAllergy( + {this.selectedAllergySeverity, + this.selectedAllergy, + this.remark, + this.isChecked, + this.isExpanded = true, + this.isLocal = true, + this.createdBy, + this.hasValidationError = false}); + +} diff --git a/lib/models/SOAP/selected_items/my_selected_assement.dart b/lib/models/SOAP/selected_items/my_selected_assement.dart new file mode 100644 index 00000000..01572e6d --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_assement.dart @@ -0,0 +1,24 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedAssessment { + MasterKeyModel selectedICD; + MasterKeyModel selectedDiagnosisCondition; + MasterKeyModel selectedDiagnosisType; + String remark; + int appointmentId; + int createdBy; + String createdOn; + int doctorID; + String doctorName; + String icdCode10ID; + + MySelectedAssessment( + {this.selectedICD, + this.selectedDiagnosisCondition, + this.selectedDiagnosisType, + this.remark, this.appointmentId, this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); +} diff --git a/lib/models/SOAP/selected_items/my_selected_examination.dart b/lib/models/SOAP/selected_items/my_selected_examination.dart new file mode 100644 index 00000000..75f67ae2 --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_examination.dart @@ -0,0 +1,27 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedExamination { + MasterKeyModel selectedExamination; + String remark; + bool isNormal; + bool isAbnormal; + bool notExamined; + bool isNew; + bool isLocal; + int createdBy; + String createdOn; + String editedOn; + + MySelectedExamination({ + this.selectedExamination, + this.remark, + this.isNormal = false, + this.isAbnormal = false, + this.notExamined = true, + this.isNew = true, + this.isLocal = true, + this.createdBy, + this.createdOn, + this.editedOn, + }); +} diff --git a/lib/models/SOAP/selected_items/my_selected_history.dart b/lib/models/SOAP/selected_items/my_selected_history.dart new file mode 100644 index 00000000..3769c418 --- /dev/null +++ b/lib/models/SOAP/selected_items/my_selected_history.dart @@ -0,0 +1,11 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedHistory { + MasterKeyModel selectedHistory; + String remark; + bool isChecked; + bool isLocal; + + MySelectedHistory( + {this.selectedHistory, this.remark, this.isChecked, this.isLocal = true}); +} diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index e14eb6f2..cc8be61f 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -6,8 +6,8 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index f8da93f5..95d3cda5 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -5,9 +5,10 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -28,12 +29,14 @@ class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; final Function changeLoadingState; - final int currentIndex; + final int currentIndex; + UpdateAssessmentPage( {Key key, this.changePageViewIndex, this.patientInfo, - this.changeLoadingState, this.currentIndex}); + this.changeLoadingState, + this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -42,6 +45,7 @@ class UpdateAssessmentPage extends StatefulWidget { class _UpdateAssessmentPageState extends State { bool isAssessmentExpand = false; List mySelectedAssessmentList = List(); + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -54,7 +58,8 @@ class _UpdateAssessmentPageState extends State { episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString())); await model.getPatientAssessment(getAssessmentReqModel); if (model.patientAssessmentList.isNotEmpty) { if (model.listOfDiagnosisCondition.length == 0) { @@ -83,11 +88,11 @@ class _UpdateAssessmentPageState extends State { diagnosisType != null && diagnosisCondition != null) { MySelectedAssessment temMySelectedAssessment = - MySelectedAssessment( - appointmentId: element.appointmentNo, + SoapUtils.generateMySelectedAssessment( + appointmentNo: element.appointmentNo, remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, + diagnosisType: diagnosisType, + diagnosisCondition: diagnosisCondition, selectedICD: selectedICD, doctorID: element.doctorID, doctorName: element.doctorName, @@ -103,207 +108,173 @@ class _UpdateAssessmentPageState extends State { widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - - color: Theme - .of(context) - .scaffoldBackgroundColor, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), - - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).assessment - , - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addAssessment}",onTap: () { - openAssessmentDialog(context, - isUpdate: false, model: model); - },), - - SizedBox( - height: 20, - ), - Column( - children: mySelectedAssessmentList - .map((assessment) { - return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), - ), - new TextSpan( - text: assessment - .selectedICD.code - .trim() - .toUpperCase() ?? - "", - ), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment, + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + SOAPOpenItems( + label: + "${TranslationBase.of(context).addAssessment}", + onTap: () { + openAssessmentDialog(context, + isUpdate: false, model: model); + }, + ), + SizedBox( + height: 20, + ), + Column( + children: + mySelectedAssessmentList.map((assessment) { + return Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + RichText( text: new TextSpan( style: new TextStyle( - fontSize: 16, + fontSize: 12, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), children: [ + new TextSpan( + text: + "ICD : ".toUpperCase(), + ), new TextSpan( text: assessment - .selectedICD.description - .toString(), + .selectedICD.code + .trim() + .toUpperCase() ?? + "", ), ], ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( + text: new TextSpan( style: new TextStyle( - color: Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment - .appointmentId.toString() - - ?? - "", - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), - ), + fontSize: 16, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: assessment + .selectedICD + .description + .toString(), + ), + ], ), - ], + ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - color: Color(0xFF575757), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .appointmentNo, + style: new TextStyle( + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), + new TextSpan( + text: assessment + .appointmentId + .toString() ?? + "", + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), - ), - ], + ], + ), ), - ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .dType + - ' : ', - style: new TextStyle( - color: Color(0xFF575757), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .condition + + " : ", + style: new TextStyle( + color: Color(0xFF575757), + ), ), - ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, - style: new TextStyle( - fontSize: 14, - color: Color(0xFF2B353E), + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + style: new TextStyle( + fontSize: 14, + color: Color(0xFF2B353E), + ), ), - ), - ], + ], + ), ), - ), - if (assessment.doctorName != null) RichText( text: new TextSpan( style: new TextStyle( @@ -316,16 +287,21 @@ class _UpdateAssessmentPageState extends State { new TextSpan( text: TranslationBase.of( context) - .doc + + .dType + ' : ', style: new TextStyle( color: Color(0xFF575757), ), ), new TextSpan( - text: - assessment.doctorName ?? - '', + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, style: new TextStyle( fontSize: 14, color: Color(0xFF2B353E), @@ -334,204 +310,236 @@ class _UpdateAssessmentPageState extends State { ], ), ), - SizedBox( - height: 6, - ), - - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - (assessment.remark != null && - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600 - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.38, - child: AppText( - assessment.remark ?? "", - fontSize: 11, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, + if (assessment.doctorName != null) + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .doc + + ' : ', + style: new TextStyle( + color: + Color(0xFF575757), + ), + ), + new TextSpan( + text: assessment + .doctorName ?? + '', + style: new TextStyle( + fontSize: 14, + color: + Color(0xFF2B353E), + ), + ), + ], ), ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( - children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, - ), AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight - .w600, - fontSize: 14, + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + (assessment.remark != + null && + assessment.remark != + '') + ? TranslationBase.of( + context) + .remarks + + " : " + : '', + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: + FontWeight.w600), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.38, + child: AppText( + assessment.remark ?? "", + fontSize: 11, + color: Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), - ], + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Row( + children: [ + Column( + children: [ + AppText( + assessment.createdOn != + null + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime + .now()), + fontWeight: + FontWeight.w600, + fontSize: 14, + ), + AppText( + assessment.createdOn != + null + ? AppDateUtils.getHour( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils + .getHour(DateTime + .now()), + fontWeight: + FontWeight.w600, + fontSize: 14, + ), + ], + ), + ], + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, ), - ], - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, - ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon( - DoctorApp.edit, size: 18,), - ) - ], - ), - ], - ), - ); - }).toList(), - ) - ], - ) - ]), - isExpanded: isAssessmentExpand, - ), - SizedBox( - height: 130, - ), - ], + ) + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ) + ]), + isExpanded: isAssessmentExpand, + ), + SizedBox( + height: 130, + ), + ], + ), ), ), ), ), - ), - bottomSheet:Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0), - ), - height: 80, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - if (mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase - .of(context) - .assessmentErrorMsg); - } else { - widget.changeLoadingState(true); - widget.changePageViewIndex(3); - - } - }, - ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(1); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + if (mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast( + TranslationBase.of(context) + .assessmentErrorMsg); + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(3); + } + }, + ), + ), + ], ), - ], + ), ), ), - ),), - SizedBox( - height: 5, - ), - ], - ),) - - ), + SizedBox( + height: 5, + ), + ], + ), + )), ); } openAssessmentDialog(BuildContext context, {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { if (assessment == null) { - assessment = MySelectedAssessment( - remark: '', appointmentId: widget.patientInfo.appointmentNo); + assessment = SoapUtils.generateMySelectedAssessment( + remark: '', appointmentNo: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -546,11 +554,10 @@ class _UpdateAssessmentPageState extends State { addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { - if(!isUpdate) - mySelectedAssessmentList.add(mySelectedAssessment); + if (!isUpdate) + mySelectedAssessmentList.add(mySelectedAssessment); }); }); }); } } - diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 87af6ec2..37f67ffc 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index f0dc25cf..ce2bced1 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 84a4c740..58dc7180 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; 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'; diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index c67102ee..ed7554e1 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; 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 dbd3b080..ca2464b1 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 @@ -4,11 +4,12 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -80,8 +81,9 @@ class _UpdateObjectivePageState extends State { masterKeys: MasterKeysService.PhysicalExamination, id: element.examId, ); - MySelectedExamination tempEam = MySelectedExamination( - selectedExamination: examMaster, + MySelectedExamination tempEam = + SoapUtils.generateMySelectedExamination( + examination: examMaster, remark: element.remarks, isNormal: element.isNormal, createdBy: element.createdBy, diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart new file mode 100644 index 00000000..34bf4236 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -0,0 +1,88 @@ +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; + +class SoapUtils { + static MySelectedHistory generateMySelectedHistory( + {history, isChecked, remark, isLocal}) { + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: isChecked, + remark: remark, + isLocal: isLocal); + return mySelectedHistory; + } + + static MySelectedAllergy generateMySelectedAllergy( + {allergy, + allergySeverity, + isChecked, + remark, + isLocal, + int createdBy, + bool isExpanded}) { + 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, + remark, + isLocal, + isNormal, + createdBy, + createdOn, + editedOn, + notExamined, + isNew, + isAbnormal}) { + MySelectedExamination mySelectedExamination = MySelectedExamination( + selectedExamination: examination, + remark: remark, + isNormal: isNormal, + createdBy: createdBy, + createdOn: createdOn, + editedOn: editedOn, + notExamined: notExamined, + isNew: isNew, + isLocal: isLocal, + isAbnormal: isAbnormal, + ); + return mySelectedExamination; + } + + static MySelectedAssessment generateMySelectedAssessment( + {appointmentNo, + remark, + diagnosisType, + diagnosisCondition, + selectedICD, + doctorID, + doctorName, + createdBy, + createdOn, + icdCode10ID}) { + MySelectedAssessment mySelectedAssessment = MySelectedAssessment( + appointmentId: appointmentNo, + remark: remark, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: doctorID, + doctorName: doctorName, + createdBy: createdBy, + createdOn: createdOn, + icdCode10ID: icdCode10ID); + return mySelectedAssessment; + } +} diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 4cf20318..9f002d65 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 55e36342..08753bec 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; @@ -12,6 +12,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../soap_utils.dart'; + class AddAllergiesItem extends StatefulWidget { final SOAPViewModel model; final Function(MasterKeyModel) removeAllergy; @@ -139,14 +141,14 @@ class _AddAllergiesItemState extends State { } : null, isTextFieldHasSuffix: true, - hintText: TranslationBase.of(context).selectSeverity, + hintText: TranslationBase.of(context).selectSeverity + "*", enabled: false, maxLines: 2, minLines: 2, validationError: mySelectedAllergy != null && mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.hasValidationError - ? TranslationBase.of(context).emptyMessage + ? TranslationBase.of(context).severityValidationError : null, controller: severityController, ), @@ -184,9 +186,9 @@ class _AddAllergiesItemState extends State { widget.removeAllergy(widget.item); } else { MySelectedAllergy mySelectedAllergy = - new MySelectedAllergy( - selectedAllergy: widget.item, - selectedAllergySeverity: _selectedAllergySeverity, + SoapUtils.generateMySelectedAllergy( + allergy: widget.item, + allergySeverity: _selectedAllergySeverity, remark: null, isChecked: true, isExpanded: true); diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 8644c9a9..8da1799b 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 4be953a7..32c54f52 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index bd2f8502..566eeda4 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -2,8 +2,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -215,10 +216,10 @@ class _AddHistoryDialogState extends State { if (myhistory.isEmpty) { setState(() { - MySelectedHistory mySelectedHistory = MySelectedHistory( - remark: history.remarks ?? "", - selectedHistory: history, + MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(remark: history.remarks ?? "", + history: history, isChecked: true); + widget.myHistoryList.add(mySelectedHistory); }); } else { diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index 3b431a69..cede4e15 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; 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'; diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart index 7372e7ee..c6427511 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/update_medication_widget.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; 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 7a48a786..5942a7cf 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 @@ -6,14 +6,15 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -55,8 +56,8 @@ class _UpdateSubjectivePageState extends State { String medicationControllerError = ''; String illnessControllerError = ''; final formKey = GlobalKey(); - List myAllergiesList=List(); - List myHistoryList=List(); + List myAllergiesList = List(); + List myHistoryList = List(); getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); @@ -84,51 +85,67 @@ class _UpdateSubjectivePageState extends State { } model.patientHistoryList.forEach((element) { - if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { + if (element.historyType == + MasterKeysService.HistoryFamily.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); - + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { + if (element.historyType == + MasterKeysService.HistoryMedical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); - + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { + if (element.historyType == + MasterKeysService.HistorySports.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); - + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { + if (element.historyType == + MasterKeysService.HistorySurgical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); - + SoapUtils.generateMySelectedHistory( + history: history, + isChecked: element.isChecked, + remark: element.remarks, + isLocal: false); myHistoryList.add(mySelectedHistory); } } @@ -145,16 +162,23 @@ class _UpdateSubjectivePageState extends State { editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity); + if (model.allergiesList.isEmpty) + await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) + await model.getMasterLookup(MasterKeysService.AllergySeverity); model.patientAllergiesList.forEach((element) { MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); + id: 0, + typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), + nameAr: '', + nameEn: ''); } else { selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, @@ -162,14 +186,17 @@ class _UpdateSubjectivePageState extends State { ); } - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: selectedAllergy, - isChecked: element.isChecked, - createdBy: element.createdBy, - remark: element.remarks, - isLocal : false, - selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = + SoapUtils.generateMySelectedAllergy( + allergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element.createdBy, + remark: element.remarks, + isLocal: false, + allergySeverity: selectedAllergySeverity); + + if (selectedAllergy != null && selectedAllergySeverity != null) + myAllergiesList.add(mySelectedAllergy); }); } } @@ -181,20 +208,25 @@ class _UpdateSubjectivePageState extends State { myAllergiesList.clear(); myHistoryList.clear(); - GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( - patientMRN: widget.patientInfo.patientMRN, - appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, - doctorID: ''); + GetChiefComplaintReqModel getChiefComplaintReqModel = + GetChiefComplaintReqModel( + patientMRN: widget.patientInfo.patientMRN, + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + episodeId: widget.patientInfo.episodeNo, + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); + complaintsController.text = Helpers.parseHtmlString( + model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty - ? model.patientChiefComplaintList[0].currentMedication + '\n \n' - : model.patientChiefComplaintList[0].currentMedication; + medicationController.text = + !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication + + '\n \n' + : model.patientChiefComplaintList[0].currentMedication; } await getHistory(model); @@ -214,7 +246,9 @@ class _UpdateSubjectivePageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { @@ -245,7 +279,9 @@ class _UpdateSubjectivePageState extends State { }); }, child: Column( - children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], + children: [ + UpdateHistoryWidget(myHistoryList: myHistoryList) + ], ), isExpanded: isHistoryExpand, ), @@ -306,7 +342,9 @@ class _UpdateSubjectivePageState extends State { // loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( - model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); + model: model, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList); }, ), ), @@ -323,9 +361,10 @@ class _UpdateSubjectivePageState extends State { } addSubjectiveInfo( - {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { - if(FocusScope.of(context).hasFocus) - FocusScope.of(context).unfocus(); + {SOAPViewModel model, + List myAllergiesList, + List myHistoryList}) async { + if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState.save(); formKey.currentState.validate(); @@ -360,7 +399,8 @@ class _UpdateSubjectivePageState extends State { if (complaintsController.text.isEmpty) { complaintsControllerError = TranslationBase.of(context).emptyMessage; } else if (complaintsController.text.length < 25) { - complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; + complaintsControllerError = + TranslationBase.of(context).chiefComplaintLength; } if (illnessController.text.isEmpty) { @@ -373,33 +413,38 @@ class _UpdateSubjectivePageState extends State { }); widget.changeLoadingState(false); - Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); + Helpers.showErrorToast( + TranslationBase.of(context).chiefComplaintErrorMsg); } } - postAllergy({List myAllergiesList, SOAPViewModel model}) async { - PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); + postAllergy( + {List myAllergiesList, SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = + new PostAllergyRequestModel(); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == + null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - isChecked: allergy.isChecked, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -423,10 +468,13 @@ class _UpdateSubjectivePageState extends State { } } - postHistories({List myHistoryList, SOAPViewModel model}) async { - PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); + postHistories( + {List myHistoryList, SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = + new PostHistoriesRequestModel(doctorID: ''); myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; + if (postHistoriesRequestModel.listMedicalHistoryVM == null) + postHistoriesRequestModel.listMedicalHistoryVM = []; postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, @@ -452,17 +500,18 @@ class _UpdateSubjectivePageState extends State { postChiefComplaint({SOAPViewModel model}) async { formKey.currentState.save(); if (formKey.currentState.validate()) { - PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: medicationController.text, - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - doctorID: '', - numberOfWeeks: 0); + PostChiefComplaintRequestModel postChiefComplaintRequestModel = + new PostChiefComplaintRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + chiefComplaint: complaintsController.text, + currentMedication: medicationController.text, + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index e9d6d16d..d2fefb31 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -1,9 +1,8 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e30a006a..d36512ae 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1366,6 +1366,7 @@ class TranslationBase { String get addPrescription => localizedValues['addPrescription'][locale.languageCode]; String get edit => localizedValues['edit'][locale.languageCode]; String get summeryReply => localizedValues['summeryReply'][locale.languageCode]; + String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From d301c2a3f40a1b4fcf25abbbd66374840462b1e0 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 14 Jul 2021 12:17:01 +0300 Subject: [PATCH 02/29] add new and old part form examination --- lib/core/viewModel/SOAP_view_model.dart | 12 ++ .../objective/add_examination_page.dart | 8 +- .../objective/add_examination_widget.dart | 2 +- .../objective/examination_item_card.dart | 61 +++++++--- .../examinations_list_search_widget.dart | 6 +- .../objective/update_objective_page.dart | 112 ++++++++---------- 6 files changed, 119 insertions(+), 82 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 8b789cbc..eaa91131 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -26,6 +26,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:flutter/material.dart'; import '../../locator.dart'; @@ -466,4 +467,15 @@ class SOAPViewModel extends BaseViewModel { break; } } + + int getFirstIndexForOldExamination(List mySelectedExamination){ + Iterable examList = mySelectedExamination.where( + (element) => !element.isLocal); + + if (examList.length > 0) { + return mySelectedExamination.indexOf(examList.first); + } else + return -1; + + } } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 37f67ffc..935ac247 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -71,14 +71,14 @@ class _AddExaminationPageState extends State { masterList: model.physicalExaminationList, isServiceSelected: (master) => isServiceSelected(master), - removeExamination: (history) { + removeExamination: (exam) { setState(() { - widget.removeExamination(history); + widget.removeExamination(exam); }); }, - addHistory: (selectedExamination) { + addExamination: (selectedExamination) { widget.mySelectedExamination - .add(selectedExamination); + .insert(0,selectedExamination); // setState(() {}); }, ), diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index ce2bced1..2bb9b943 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -36,7 +36,7 @@ class AddExaminationWidget extends StatefulWidget { } class _AddExaminationWidgetState extends State { - int status = 3; + int status = 1; TextEditingController remarksController = TextEditingController(); MySelectedExamination examination = MySelectedExamination(); diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 58dc7180..085089bd 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examin 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:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class ExaminationItemCard extends StatelessWidget { @@ -42,21 +44,52 @@ class ExaminationItemCard extends StatelessWidget { )), ], ), - AppText( - !examination.isNormal - ? examination.isAbnormal - ? TranslationBase.of(context).abnormal - : TranslationBase.of(context).notExamined - : TranslationBase.of(context).normal, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - color: !examination.isNormal - ? examination.isAbnormal - ? Colors.red.shade800 - : Colors.grey.shade800 - : Colors.green.shade800, - fontSize: SizeConfig.textMultiplier * 1.8, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + !examination.isNormal + ? examination.isAbnormal + ? TranslationBase.of(context).abnormal + : TranslationBase.of(context).notExamined + : TranslationBase.of(context).normal, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + color: !examination.isNormal + ? examination.isAbnormal + ? Colors.red.shade800 + : Colors.grey.shade800 + : Colors.green.shade800, + fontSize: SizeConfig.textMultiplier * 1.8, + ), + if(!examination.notExamined) + InkWell( + child: Row( + children: [Container( + child: AppText( + examination.isLocal ?TranslationBase + .of(context) + .remove :TranslationBase + .of(context) + .notExamined, + fontSize: 15, + variant: "bodyText", + color: HexColor("#B8382C"),), + ), + Icon( + FontAwesomeIcons.times, + color: HexColor("#B8382C"), + size: 20, + ), + ], + ), + onTap: removeExamination, + ), + ], ), + + + SizedBox( height: 4, ), diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index ed7554e1..497bafa8 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -9,14 +9,14 @@ import 'add_examination_widget.dart'; class ExaminationsListSearchWidget extends StatefulWidget { final Function(MasterKeyModel) removeExamination; - final Function(MySelectedExamination) addHistory; + final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; final List mySelectedExamination; ExaminationsListSearchWidget( {this.removeExamination, - this.addHistory, + this.addExamination, this.isServiceSelected, this.masterList, this.mySelectedExamination}); @@ -62,7 +62,7 @@ class _ExaminationsListSearchWidgetState ...items.mapIndexed((index, item) { return AddExaminationWidget( item: item, - addExamination: widget.addHistory, + addExamination: widget.addExamination, removeExamination: widget.removeExamination, mySelectedExamination: widget.mySelectedExamination, isServiceSelected: widget.isServiceSelected, 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 ca2464b1..eb9a6002 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 @@ -97,7 +97,6 @@ class _UpdateObjectivePageState extends State { mySelectedExamination.add(tempEam); }); } - widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( @@ -130,8 +129,50 @@ class _UpdateObjectivePageState extends State { openExaminationList(context); }, ), + if (mySelectedExamination.isNotEmpty && + mySelectedExamination.first.isLocal) + Row( + children: [ + AppText( + "New", + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Colors.blue, + ), + ], + ), Column( - children: mySelectedExamination.map((examination) { + children: mySelectedExamination + .sublist( + 0, + model.getFirstIndexForOldExamination( + mySelectedExamination)) + .map((examination) { + return ExaminationItemCard(examination, () { + removeExamination( + examination.selectedExamination); + }); + }).toList(), + ), + + if (mySelectedExamination.isNotEmpty && + model.getFirstIndexForOldExamination( + mySelectedExamination)>-1) + Row( + children: [ + AppText( + "old", + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Colors.green, + ), + ], + ), + Column( + children: mySelectedExamination + .sublist(model.getFirstIndexForOldExamination( + mySelectedExamination)) + .map((examination) { return ExaminationItemCard(examination, () { removeExamination( examination.selectedExamination); @@ -276,10 +317,17 @@ class _UpdateObjectivePageState extends State { masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); - if (history.length > 0) + if (history.length > 0) { setState(() { - mySelectedExamination.remove(history.first); + if (history.first.isLocal) { + mySelectedExamination.remove(history.first); + } else { + history.first.notExamined = true; + history.first.isNormal = false; + history.first.isAbnormal = false; + } }); + } } openExaminationList(BuildContext context) { @@ -298,59 +346,3 @@ class _UpdateObjectivePageState extends State { ); } } - -class AddExaminationDailog extends StatefulWidget { - final List mySelectedExamination; - final Function addSelectedExamination; - final Function(MasterKeyModel) removeExamination; - - const AddExaminationDailog( - {Key key, - this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}) - : super(key: key); - - @override - _AddExaminationDailogState createState() => _AddExaminationDailogState(); -} - -class _AddExaminationDailogState extends State { - @override - Widget build(BuildContext context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: BaseView( - onModelReady: (model) async { - if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).physicalSystemExamination, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - ]), - ))), - )), - ); - } -} From 7e578823491aea719e89e25fdcf4e7e1fbcf5719 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 14 Jul 2021 17:56:03 +0300 Subject: [PATCH 03/29] fix design issues on first step form create episode --- .../assessment/add_assessment_details.dart | 86 ++++------ .../objective/examination_item_card.dart | 48 ++---- .../shared_soap_widgets/SOAP_open_items.dart | 14 +- .../shared_soap_widgets/SOAP_step_header.dart | 11 +- .../bottom_sheet_dialog_button.dart | 49 ++++++ .../expandable_SOAP_widget.dart | 6 +- .../shared_soap_widgets/remove_button.dart | 38 +++++ .../profile/soap_update/soap_utils.dart | 6 +- .../subjective/allergies/add_allergies.dart | 47 +----- .../subjective/allergies/allergies_item.dart | 32 ++-- ..._key_checkbox_search_allergies_widget.dart | 6 +- .../allergies/update_allergies_widget.dart | 158 +++++++++--------- .../history/add_history_dialog.dart | 54 ++---- .../history/update_history_widget.dart | 83 ++++----- .../subjective/medication/add_medication.dart | 71 +++----- lib/widgets/shared/app_texts_widget.dart | 5 +- .../master_key_checkbox_search_widget.dart | 28 ++-- 17 files changed, 338 insertions(+), 404 deletions(-) create mode 100644 lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart create mode 100644 lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index cc8be61f..4549ae3d 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_asseme import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -372,63 +373,34 @@ class _AddAssessmentDetailsState extends State { ), ), ), - bottomSheet: model.state == ViewState.Busy?Container(height: 0,):Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - color: Colors.green, - title: (widget.isUpdate - ? 'Update Assessment Details' - : 'Add Assessment Details'), - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - setState(() { - isFormSubmitted = true; - }); - widget.mySelectedAssessment.remark = - remarkController.text; - widget.mySelectedAssessment.appointmentId = - int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment - .selectedDiagnosisCondition != - null && - widget.mySelectedAssessment - .selectedDiagnosisType != - null && - widget.mySelectedAssessment.selectedICD != null) { - await submitAssessment( - isUpdate: widget.isUpdate, - model: model, - mySelectedAssessment: - widget.mySelectedAssessment); - } - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), + bottomSheet: model.state == ViewState.Busy?Container(height: 0,): + + BottomSheetDialogButton( + label: TranslationBase.of(context) + .addMedication + .toUpperCase(), + onTap: () async { + setState(() { + isFormSubmitted = true; + }); + widget.mySelectedAssessment.remark = + remarkController.text; + widget.mySelectedAssessment.appointmentId = + int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment + .selectedDiagnosisCondition != + null && + widget.mySelectedAssessment + .selectedDiagnosisType != + null && + widget.mySelectedAssessment.selectedICD != null) { + await submitAssessment( + isUpdate: widget.isUpdate, + model: model, + mySelectedAssessment: + widget.mySelectedAssessment); + } + }, ), ), ), diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index 085089bd..c52f1d4a 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; 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'; @@ -62,45 +63,26 @@ class ExaminationItemCard extends StatelessWidget { : Colors.green.shade800, fontSize: SizeConfig.textMultiplier * 1.8, ), - if(!examination.notExamined) - InkWell( - child: Row( - children: [Container( - child: AppText( - examination.isLocal ?TranslationBase - .of(context) - .remove :TranslationBase - .of(context) - .notExamined, - fontSize: 15, - variant: "bodyText", - color: HexColor("#B8382C"),), - ), - Icon( - FontAwesomeIcons.times, - color: HexColor("#B8382C"), - size: 20, - ), - ], + if (!examination.notExamined) + RemoveButton( + label: examination.isLocal + ? TranslationBase.of(context).remove + : TranslationBase.of(context).notExamined, + onTap: removeExamination, ), - onTap: removeExamination, - ), ], ), - - - SizedBox( height: 4, ), - if(examination.remark.isNotEmpty) - AppText( - examination.remark, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontSize: SizeConfig.textMultiplier * 1.8, - ), + if (examination.remark.isNotEmpty) + AppText( + examination.remark, + fontWeight: FontWeight.normal, + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontSize: SizeConfig.textMultiplier * 1.8, + ), ], ), ); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index 31a501ce..d0819b76 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -36,19 +36,23 @@ class SOAPOpenItems extends StatelessWidget { AppText( "$label", fontSize:15, - color: Colors.black, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + letterSpacing:-0.44 , ), AppText( "${TranslationBase.of(context).searchHere}", - fontSize:13, - color: Colors.grey.shade700, + fontSize:14, + fontWeight: FontWeight.w500, + color: Color(0xFF575757), + letterSpacing:-0.56 , ), ], )), Icon( Icons.add_box_rounded, - size: 25, + size: 28, + color: Color(0xFF2E303A), ) ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 85614b6d..f345666f 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -21,12 +21,17 @@ class SOAPStepHeader extends StatelessWidget { SizedBox(height: 15,), AppText( TranslationBase.of(context).createNew, - fontSize: 14, - fontWeight: FontWeight.w500, + fontSize: 12, + fontWeight: FontWeight.w700, + letterSpacing:-0.72, + color: Color(0xFF2E303A), + ), AppText(TranslationBase.of(context).episode, - fontSize: 26, + fontSize: 24, fontWeight: FontWeight.bold, + letterSpacing:-1.44, + color: Color(0xFF2E303A), ), Container( color: Theme.of(context).scaffoldBackgroundColor, diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart new file mode 100644 index 00000000..d6cab800 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -0,0 +1,49 @@ +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class BottomSheetDialogButton extends StatelessWidget { + final Function onTap; + final String label; + + const BottomSheetDialogButton({Key key, this.onTap, this.label}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#EFEFEF'), width: 1), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: label, + padding: 10, + color: Color(0xFF359846), + onPressed: onTap, + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ); + } +} diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index d4666428..2dcce4ae 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -41,8 +41,10 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ AppText(headerTitle, variant: isExpanded ? "bodyText" : '', - fontSize: 15, - color: Colors.black), + fontSize: 16, + letterSpacing:-0.64, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A),), if(isRequired) Icon( FontAwesomeIcons.asterisk, diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart new file mode 100644 index 00000000..bff3d4a8 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart @@ -0,0 +1,38 @@ + +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:hexcolor/hexcolor.dart'; + +class RemoveButton extends StatelessWidget { + final Function onTap; + final String label; + + const RemoveButton({Key key, this.onTap, this.label}) : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + child: Row( + children: [ + Container( + child: AppText( + label??TranslationBase.of(context).remove, + fontSize: 12, + fontWeight: FontWeight.w700, + color: HexColor("#D02127"), + letterSpacing:-0.48, + ), + ), + Icon( + FontAwesomeIcons.times, + color: HexColor("#D02127"), + size: 16, + ), + ], + ), + onTap: onTap, + ); + } +} diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 34bf4236..455b5439 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_histor class SoapUtils { static MySelectedHistory generateMySelectedHistory( - {history, isChecked, remark, isLocal}) { + {history, isChecked, remark, isLocal = true}) { MySelectedHistory mySelectedHistory = MySelectedHistory( selectedHistory: history, isChecked: isChecked, @@ -19,7 +19,7 @@ class SoapUtils { allergySeverity, isChecked, remark, - isLocal, + isLocal = true, int createdBy, bool isExpanded}) { MySelectedAllergy mySelectedAllergy = MySelectedAllergy( @@ -38,7 +38,7 @@ class SoapUtils { allergySeverity, isChecked, remark, - isLocal, + isLocal = true, isNormal, createdBy, createdOn, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 9f002d65..44eae2b8 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -120,7 +121,6 @@ class _AddAllergiesState extends State { addAllergyLocally(mySelectedAllergy); }, addSelectedAllergy: () { - setState(() { widget .addAllergiesFun(myAllergiesListLocal); @@ -146,43 +146,13 @@ class _AddAllergiesState extends State { ? Container( height: 0, ) - : Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context).addAllergies, - padding: 10, - color: Color(0xFF359846), - onPressed: () { - setState(() { - widget.addAllergiesFun(myAllergiesListLocal); - }); - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), + : BottomSheetDialogButton( + label: TranslationBase.of(context).addAllergies, + onTap: () { + setState(() { + widget.addAllergiesFun(myAllergiesListLocal); + }); + }, ), ), ), @@ -244,3 +214,4 @@ class _AddAllergiesState extends State { } } } + diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 08753bec..00606f68 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -74,22 +74,19 @@ class _AddAllergiesItemState extends State { }), InkWell( onTap:onTapItem, - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 10, vertical: 0), - child: Container( - child: AppText( - projectViewModel.isArabic - ? widget.item.nameAr != "" - ? widget.item.nameAr - : widget.item.nameEn - : widget.item.nameEn, - color: Color(0xFF575757), - fontSize: 16, - fontWeight: FontWeight.w600, - ), - width: MediaQuery.of(context).size.width * 0.55, + child: Container( + child: AppText( + projectViewModel.isArabic + ? widget.item.nameAr != "" + ? widget.item.nameAr + : widget.item.nameEn + : widget.item.nameEn, + color: Color(0xFF575757), + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.56, ), + width: MediaQuery.of(context).size.width * 0.55, ), ), ], @@ -106,8 +103,11 @@ class _AddAllergiesItemState extends State { child: Icon((mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false) + ? EvaIcons.arrowIosUpwardOutline - : EvaIcons.arrowIosDownwardOutline)) + : EvaIcons.arrowIosDownwardOutline, + color: Color(0xFF575757) , + ),) ], ), bodyWidget: Center( diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 8da1799b..3f6f694f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -43,7 +43,7 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { List items = List(); - + TextEditingController filteredSearchController = TextEditingController(); @override void initState() { @@ -67,13 +67,11 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Column( children: [ AppTextFieldCustom( - // height: - // MediaQuery.of(context).size.height * 0.070, hintText: TranslationBase.of(context).selectAllergy, isTextFieldHasSuffix: true, hasBorder: false, - // controller: filteredSearchController, + controller: filteredSearchController, onChanged: (value) { filterSearchResults(value); }, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 32c54f52..1984e3f9 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,12 +1,11 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../shared_soap_widgets/SOAP_open_items.dart'; @@ -14,7 +13,7 @@ import 'add_allergies.dart'; // ignore: must_be_immutable class UpdateAllergiesWidget extends StatefulWidget { - List myAllergiesList; + List myAllergiesList; UpdateAllergiesWidget({Key key, this.myAllergiesList}); @@ -27,28 +26,28 @@ class _UpdateAllergiesWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); changeAllState() { - setState(() { - - }); + setState(() {}); } return Column( children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addAllergies}",onTap: () { - openAllergiesList(context, changeAllState, removeAllergy); - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addAllergies}", + onTap: () { + openAllergiesList(context, changeAllState, removeAllergy); + }, + ), SizedBox( height: 20, ), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myAllergiesList.map((selectedAllergy) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -61,53 +60,41 @@ class _UpdateAllergiesWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn - .toUpperCase(), - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: Color(0xFF2B353E)), + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Color(0xFF2B353E), + fontSize: 12, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + // fontHeight:0.18 , + ), AppText( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergySeverity - .nameAr - : selectedAllergy.selectedAllergySeverity - .nameEn - .toUpperCase(), - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - color: Color(0xFFCC9B14)), + projectViewModel.isArabic + ? selectedAllergy + .selectedAllergySeverity.nameAr + : selectedAllergy + .selectedAllergySeverity.nameEn + .toUpperCase(), + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + color: Color(0xFFCC9B14), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + ), ], ), - width: MediaQuery - .of(context) - .size - .width * 0.5, + width: MediaQuery.of(context).size.width * 0.5, ), - if (selectedAllergy.isChecked) - InkWell( - child: Row( - children: [Container( - child: AppText( - TranslationBase - .of(context) - .remove, - fontSize: 15, - variant: "bodyText", - color: HexColor("#B8382C"),), - ), - Icon( - FontAwesomeIcons.times, - color: HexColor("#B8382C"), - size: 20, - ), - ], - ), + RemoveButton( onTap: () => removeAllergy(selectedAllergy), ) ], @@ -120,8 +107,10 @@ class _UpdateAllergiesWidgetState extends State { width: MediaQuery.of(context).size.width * 0.55, child: AppText( selectedAllergy.remark ?? '', + color: Color(0xFF575757), fontSize: 10, - color: Colors.grey, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, ), ), ], @@ -143,15 +132,17 @@ class _UpdateAllergiesWidgetState extends State { removeAllergy(MySelectedAllergy mySelectedAllergy) { List allergy = - // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergySeverity.id == - element.selectedAllergySeverity.id && - mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id - ).toList(); + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergySeverity.id == + element.selectedAllergySeverity.id && + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) + .toList(); if (allergy.length > 0) { - if(allergy.first.isLocal) { + if (allergy.first.isLocal) { setState(() { widget.myAllergiesList.remove(allergy.first); }); @@ -162,7 +153,8 @@ class _UpdateAllergiesWidgetState extends State { } } - openAllergiesList(BuildContext context, Function changeParentState, removeAllergy) { + openAllergiesList( + BuildContext context, Function changeParentState, removeAllergy) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, @@ -170,7 +162,7 @@ class _UpdateAllergiesWidgetState extends State { context: context, builder: (context) { return AddAllergies( - myAllergiesList: widget.myAllergiesList, + myAllergiesList: widget.myAllergiesList, addAllergiesFun: (List mySelectedAllergy) { bool isAllDataFilled = true; mySelectedAllergy.forEach((element) { @@ -181,19 +173,28 @@ class _UpdateAllergiesWidgetState extends State { }); if (isAllDataFilled) { mySelectedAllergy.forEach((element) { - if ((widget.myAllergiesList.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id, - orElse: () => null)) == null) { + if ((widget.myAllergiesList.singleWhere( + (it) => + it.selectedAllergy.id == + element.selectedAllergy.id, + orElse: () => null)) == + null) { widget.myAllergiesList.add(element); } }); /// remove items. - List removedList= []; + List removedList = []; widget.myAllergiesList.forEach((element) { - if ((mySelectedAllergy.singleWhere((it) => it.selectedAllergy.id == element.selectedAllergy.id, - orElse: () => null)) == null) { + if ((mySelectedAllergy.singleWhere( + (it) => + it.selectedAllergy.id == + element.selectedAllergy.id, + orElse: () => null)) == + null) { removedList.add(element); - }}); + } + }); removedList.forEach((element) { removeAllergy(element); @@ -201,18 +202,11 @@ class _UpdateAllergiesWidgetState extends State { changeParentState(); Navigator.of(context).pop(); } else { - Helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); + Helpers.showErrorToast( + TranslationBase.of(context).requiredMsg); } }); }); } - } - - - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 566eeda4..c089bd24 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -59,8 +60,8 @@ class _AddHistoryDialogState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addHistory), + appBar: + BottomSheetTitle(title: TranslationBase.of(context).addHistory), body: Center( child: Container( child: Column( @@ -166,42 +167,11 @@ class _AddHistoryDialogState extends State { ? Container( height: 0, ) - : Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context) - .addSelectedHistories, - padding: 10, - color: Color(0xFF359846), - onPressed: () { - widget.addSelectedHistories(); - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), + : BottomSheetDialogButton( + label: TranslationBase.of(context).addSelectedHistories, + onTap: () { + widget.addSelectedHistories(); + }, ), ), )); @@ -216,9 +186,11 @@ class _AddHistoryDialogState extends State { if (myhistory.isEmpty) { setState(() { - MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(remark: history.remarks ?? "", - history: history, - isChecked: true); + MySelectedHistory mySelectedHistory = + SoapUtils.generateMySelectedHistory( + remark: history.remarks ?? "", + history: history, + isChecked: true); widget.myHistoryList.add(mySelectedHistory); }); diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index cede4e15..2f17d332 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; 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'; @@ -40,17 +41,17 @@ class _UpdateHistoryWidgetState extends State ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ - - SOAPOpenItems(label: "${TranslationBase.of(context).addHistory}",onTap: () { - openHistoryList(context); - - },), + SOAPOpenItems( + label: "${TranslationBase.of(context).addHistory}", + onTap: () { + openHistoryList(context); + }, + ), SizedBox( height: 20, ), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myHistoryList.map((myHistory) { return Column( @@ -60,42 +61,21 @@ class _UpdateHistoryWidgetState extends State children: [ Container( child: AppText( - projectViewModel.isArabic - ? myHistory.selectedHistory.nameAr - : myHistory.selectedHistory.nameEn, - fontSize: 15, - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, - color: Colors.black), - width: MediaQuery - .of(context) - .size - .width * 0.5, + projectViewModel.isArabic + ? myHistory.selectedHistory.nameAr + : myHistory.selectedHistory.nameEn, + textDecoration: myHistory.isChecked + ? null + : TextDecoration.lineThrough, + color: Color(0xFF2B353E), + fontSize: 12, + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + ), + width: MediaQuery.of(context).size.width * 0.5, ), if (myHistory.isChecked) - InkWell( - child: Row( - children: [ - Container( - child: AppText( - TranslationBase - .of(context) - .remove, - fontSize: 15, - variant: "bodyText", - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, - color: HexColor("#B8382C"),), - ), - Icon( - FontAwesomeIcons.times, - color: HexColor("#B8382C"), - size: 17, - ), - ], - ), + RemoveButton( onTap: () => removeHistory(myHistory.selectedHistory), ) ], @@ -114,17 +94,15 @@ class _UpdateHistoryWidgetState extends State removeHistory(MasterKeyModel historyKey) { List history = - // ignore: missing_return - widget.myHistoryList.where((element) => - historyKey.id == - element.selectedHistory.id && - historyKey.typeId == - element.selectedHistory.typeId - ).toList(); - + // ignore: missing_return + widget.myHistoryList + .where((element) => + historyKey.id == element.selectedHistory.id && + historyKey.typeId == element.selectedHistory.typeId) + .toList(); if (history.length > 0) { - if(history.first.isLocal) { + if (history.first.isLocal) { setState(() { widget.myHistoryList.remove(history.first); }); @@ -133,9 +111,7 @@ class _UpdateHistoryWidgetState extends State history[0].isChecked = false; }); } - } - } openHistoryList(BuildContext context) { @@ -162,6 +138,3 @@ class _UpdateHistoryWidgetState extends State }); } } - - - diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 11e4fa72..c80251f8 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -386,55 +387,27 @@ class _AddMedicationState extends State { ]), ), ), - bottomSheet:model.state == ViewState.Busy?Container(height: 0,): Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0.30), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context) - .addMedication - .toUpperCase(), - color: Color(0xFF359846), - onPressed: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; - Navigator.of(context).pop(); - } - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - ), + bottomSheet:model.state == ViewState.Busy?Container(height: 0,): + BottomSheetDialogButton( + label: TranslationBase.of(context) + .addMedication + .toUpperCase(), + onTap: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget + .medicationController.text + + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, + ) ), ), ); diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 48661a32..4bf89d4e 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -18,6 +18,7 @@ class AppText extends StatefulWidget { final double marginRight; final double marginBottom; final double marginLeft; + final double letterSpacing; final TextAlign textAlign; final bool bold; final bool regular; @@ -55,7 +56,7 @@ class AppText extends StatefulWidget { this.allowExpand = true, this.visibility = true, this.textOverflow, - this.textDecoration, + this.textDecoration, this.letterSpacing, }); @override @@ -132,7 +133,7 @@ class _AppTextState extends State { widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: - widget.variant == "overline" ? 1.5 : null, + widget.letterSpacing??(widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 3a0a1525..780f82ca 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -40,6 +40,8 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { class _MasterKeyCheckboxSearchWidgetState extends State { List items = List(); + TextEditingController filteredSearchController = TextEditingController(); + @override void initState() { @@ -77,7 +79,7 @@ class _MasterKeyCheckboxSearchWidgetState hintText: TranslationBase.of(context).searchHistory, isTextFieldHasSuffix: true, hasBorder: false, - // controller: filteredSearchController, + controller: filteredSearchController, onChanged: (value) { filterSearchResults(value); }, @@ -123,19 +125,17 @@ class _MasterKeyCheckboxSearchWidgetState }); }), Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: AppText( - projectViewModel.isArabic - ? historyInfo.nameAr != "" - ? historyInfo.nameAr - : historyInfo.nameEn - : historyInfo.nameEn, - color: Color(0xFF575757), - fontSize: 16, - fontWeight: FontWeight.w600, - ), + child: AppText( + projectViewModel.isArabic + ? historyInfo.nameAr != "" + ? historyInfo.nameAr + : historyInfo.nameEn + : historyInfo.nameEn, + + color: Color(0xFF575757), + fontSize: 14, + fontWeight: FontWeight.w600, + letterSpacing: -0.56, ), ), ], From 3b1a493d7632b4855638bd9c886f689d28a29e9b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 15 Jul 2021 12:53:16 +0300 Subject: [PATCH 04/29] fix design issues on create episode and prevent exam from keep it state --- .../assessment/add_assessment_details.dart | 6 +- .../assessment/update_assessment_page.dart | 69 +++++++++--------- .../objective/add_examination_page.dart | 64 +++++++---------- .../objective/examination_item_card.dart | 9 +-- .../objective/update_objective_page.dart | 71 ++++++++++++++----- .../shared_soap_widgets/remark_text.dart | 24 +++++++ .../shared_soap_widgets/steps_widget.dart | 2 +- .../subjective/allergies/add_allergies.dart | 26 ------- .../allergies/update_allergies_widget.dart | 13 +--- 9 files changed, 148 insertions(+), 136 deletions(-) create mode 100644 lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 4549ae3d..691cc5b6 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -376,9 +376,9 @@ class _AddAssessmentDetailsState extends State { bottomSheet: model.state == ViewState.Busy?Container(height: 0,): BottomSheetDialogButton( - label: TranslationBase.of(context) - .addMedication - .toUpperCase(), + label: (widget.isUpdate + ? 'Update Assessment Details' + : 'Add Assessment Details'), onTap: () async { setState(() { isFormSubmitted = true; diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 95d3cda5..8caf61fe 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -152,7 +153,7 @@ class _UpdateAssessmentPageState extends State { mySelectedAssessmentList.map((assessment) { return Container( margin: EdgeInsets.only( - left: 5, right: 5, top: 15), + left: 5, right: 5, top: 15, bottom: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -166,11 +167,11 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, + fontSize: 10, color: Color(0xFF2E303A), fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontWeight: FontWeight.w600, + letterSpacing: -0.4), children: [ new TextSpan( text: @@ -194,11 +195,12 @@ class _UpdateAssessmentPageState extends State { child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 16, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontSize: 16, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + ), children: [ new TextSpan( text: assessment @@ -213,17 +215,19 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontSize: 12, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), children: [ new TextSpan( text: TranslationBase.of( context) .appointmentNo, style: new TextStyle( + fontSize: 10, + letterSpacing: -0.4, color: Color(0xFF575757), ), ), @@ -234,6 +238,7 @@ class _UpdateAssessmentPageState extends State { "", style: new TextStyle( fontSize: 14, + letterSpacing: -0.48, color: Color(0xFF2B353E), ), ), @@ -255,6 +260,7 @@ class _UpdateAssessmentPageState extends State { .condition + " : ", style: new TextStyle( + letterSpacing: -0.4, color: Color(0xFF575757), ), ), @@ -268,7 +274,8 @@ class _UpdateAssessmentPageState extends State { .selectedDiagnosisCondition .nameEn, style: new TextStyle( - fontSize: 14, + fontSize: 12, + letterSpacing: -0.48, color: Color(0xFF2B353E), ), ), @@ -278,7 +285,7 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, + fontSize: 10, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: @@ -290,6 +297,7 @@ class _UpdateAssessmentPageState extends State { .dType + ' : ', style: new TextStyle( + letterSpacing: -0.4, color: Color(0xFF575757), ), ), @@ -303,7 +311,8 @@ class _UpdateAssessmentPageState extends State { .selectedDiagnosisType .nameEn, style: new TextStyle( - fontSize: 14, + fontSize: 12, + letterSpacing: -0.48, color: Color(0xFF2B353E), ), ), @@ -323,9 +332,10 @@ class _UpdateAssessmentPageState extends State { new TextSpan( text: TranslationBase.of( context) - .doc + + .doctor + ' : ', style: new TextStyle( + fontSize: 10,letterSpacing: -0.4, color: Color(0xFF575757), ), @@ -335,7 +345,7 @@ class _UpdateAssessmentPageState extends State { .doctorName ?? '', style: new TextStyle( - fontSize: 14, + fontSize: 12,letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -370,17 +380,9 @@ class _UpdateAssessmentPageState extends State { fontFamily: 'Poppins', fontWeight: FontWeight.w600), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.38, - child: AppText( - assessment.remark ?? "", - fontSize: 11, - color: Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), + RemarkText( + remark: + assessment.remark ?? "", ), ], ), @@ -393,6 +395,8 @@ class _UpdateAssessmentPageState extends State { Row( children: [ Column( + crossAxisAlignment: + CrossAxisAlignment.end, children: [ AppText( assessment.createdOn != @@ -408,7 +412,7 @@ class _UpdateAssessmentPageState extends State { .now()), fontWeight: FontWeight.w600, - fontSize: 14, + fontSize: 12, ), AppText( assessment.createdOn != @@ -422,7 +426,8 @@ class _UpdateAssessmentPageState extends State { .now()), fontWeight: FontWeight.w600, - fontSize: 14, + color: Color(0xFF575757), + fontSize: 12, ), ], ), diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 935ac247..07343bb7 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -1,9 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -16,7 +18,7 @@ import 'examinations_list_search_widget.dart'; class AddExaminationPage extends StatefulWidget { final List mySelectedExamination; - final Function addSelectedExamination; + final Function (List)addSelectedExamination; final Function(MasterKeyModel) removeExamination; AddExaminationPage( @@ -29,6 +31,14 @@ class AddExaminationPage extends StatefulWidget { } class _AddExaminationPageState extends State { + List mySelectedExaminationLocal; + + @override + initState() { + super.initState(); + mySelectedExaminationLocal = [...widget.mySelectedExamination]; + } + @override Widget build(BuildContext context) { return BaseView( @@ -77,8 +87,9 @@ class _AddExaminationPageState extends State { }); }, addExamination: (selectedExamination) { - widget.mySelectedExamination - .insert(0,selectedExamination); + + mySelectedExaminationLocal + .insert(0, selectedExamination); // setState(() {}); }, ), @@ -91,48 +102,21 @@ class _AddExaminationPageState extends State { ), ], ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: model.state == ViewState.Busy + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: "${TranslationBase.of(context).addExamination}", + onTap: () { + widget.addSelectedExamination(mySelectedExaminationLocal); + }, ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: - "${TranslationBase.of(context).addExamination}", - padding: 10, - color: Color(0xFF359846), - onPressed: () { - widget.addSelectedExamination(); - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - ), )); } isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = widget.mySelectedExamination.where( + Iterable exam = mySelectedExaminationLocal.where( (element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); diff --git a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart index c52f1d4a..384aff90 100644 --- a/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart +++ b/lib/screens/patients/profile/soap_update/objective/examination_item_card.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -76,13 +77,7 @@ class ExaminationItemCard extends StatelessWidget { height: 4, ), if (examination.remark.isNotEmpty) - AppText( - examination.remark, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - color: Color(0xFF575757), - fontSize: SizeConfig.textMultiplier * 1.8, - ), + RemarkText(remark: examination.remark), ], ), ); 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 eb9a6002..317fa4af 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 @@ -137,7 +137,7 @@ class _UpdateObjectivePageState extends State { "New", fontWeight: FontWeight.w600, fontFamily: 'Poppins', - color: Colors.blue, + color: Color(0xFFCC9B14), ), ], ), @@ -146,7 +146,11 @@ class _UpdateObjectivePageState extends State { .sublist( 0, model.getFirstIndexForOldExamination( - mySelectedExamination)) + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { removeExamination( @@ -154,24 +158,28 @@ class _UpdateObjectivePageState extends State { }); }).toList(), ), - if (mySelectedExamination.isNotEmpty && model.getFirstIndexForOldExamination( - mySelectedExamination)>-1) - Row( - children: [ - AppText( - "old", - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - color: Colors.green, - ), - ], - ), + mySelectedExamination) > + -1) + Row( + children: [ + AppText( + "Verified", + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Colors.green, + ), + ], + ), Column( children: mySelectedExamination .sublist(model.getFirstIndexForOldExamination( - mySelectedExamination)) + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { removeExamination( @@ -336,9 +344,38 @@ class _UpdateObjectivePageState extends State { FadePage( page: AddExaminationPage( mySelectedExamination: mySelectedExamination, - addSelectedExamination: () { + addSelectedExamination: (List mySelectedExaminationLocal ) { setState(() { - Navigator.of(context).pop(); + { + mySelectedExaminationLocal.forEach((element) { + if ((mySelectedExamination.singleWhere( + (it) => + it.selectedExamination.id == + element.selectedExamination.id, + orElse: () => null)) == + null) { + mySelectedExamination.add(element); + } + }); + + /// remove items. + List removedList = []; + mySelectedExamination.forEach((element) { + if ((mySelectedExaminationLocal.singleWhere( + (it) => + it.selectedExamination.id == + element.selectedExamination.id, + orElse: () => null)) == + null) { + removedList.add(element); + } + }); + + removedList.forEach((element) { + removeExamination(element.selectedExamination); + }); + Navigator.of(context).pop(); + } }); }, removeExamination: (masterKey) => removeExamination(masterKey)), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart new file mode 100644 index 00000000..91ef6954 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart @@ -0,0 +1,24 @@ + +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class RemarkText extends StatelessWidget { + final String remark; + const RemarkText({ + Key key, this.remark, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width * 0.55, + child: AppText( + remark ?? '', + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index e79c24a7..31524295 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -248,7 +248,7 @@ class StepsWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, textAlign: TextAlign.end, - marginLeft: 25, + marginLeft: 30, ), StatusLabel( selectedStepId: index, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 44eae2b8..7f1abb64 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -45,32 +45,6 @@ class _AddAllergiesState extends State { GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( - contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 10, - color: Theme.of(context).hintColor, - fontWeight: FontWeight.w700), - ); - } - @override Widget build(BuildContext context) { return FractionallySizedBox( diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 1984e3f9..48136cb4 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -103,16 +104,7 @@ class _UpdateAllergiesWidgetState extends State { padding: const EdgeInsets.symmetric(vertical: 8), child: Row( children: [ - Container( - width: MediaQuery.of(context).size.width * 0.55, - child: AppText( - selectedAllergy.remark ?? '', - color: Color(0xFF575757), - fontSize: 10, - fontWeight: FontWeight.w700, - letterSpacing: -0.4, - ), - ), + RemarkText(remark: selectedAllergy.remark,), ], ), ), @@ -210,3 +202,4 @@ class _UpdateAllergiesWidgetState extends State { } } + From 8a69becab313ac60770ebf2f487b7a00d79b603c Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 15 Jul 2021 17:20:03 +0300 Subject: [PATCH 05/29] fix header issues && exam issues --- lib/config/size_config.dart | 27 ++++++++++ .../objective/add_examination_page.dart | 4 +- .../objective/add_examination_widget.dart | 4 +- .../examinations_list_search_widget.dart | 2 +- .../shared_soap_widgets/steps_widget.dart | 52 ++++++++++--------- 5 files changed, 59 insertions(+), 30 deletions(-) diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6b996b3f..6ba584c6 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -59,5 +59,32 @@ class SizeConfig { print('widthMultiplier $widthMultiplier'); print('isPortrait $isPortrait'); print('isMobilePortrait $isMobilePortrait'); + + + } + + static getTextMultiplierBasedOnWidth({double width}) { + // TODO handel LandScape case + if (width != null) { + return width / 100; + } + return widthMultiplier; + } + + static getWidthMultiplier({double width}) { + // TODO handel LandScape case + if (width != null) { + return width / 100; + } + return widthMultiplier; + } + + static getHeightMultiplier({double height}) { + // TODO handel LandScape case + if (height != null) { + return height / 100; + } + return heightMultiplier; } + } diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index 07343bb7..f1966130 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -81,9 +81,9 @@ class _AddExaminationPageState extends State { masterList: model.physicalExaminationList, isServiceSelected: (master) => isServiceSelected(master), - removeExamination: (exam) { + removeExamination: (selectedExamination) { setState(() { - widget.removeExamination(exam); + mySelectedExaminationLocal.remove(selectedExamination); }); }, addExamination: (selectedExamination) { diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 2bb9b943..82d26dc9 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -14,7 +14,7 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class AddExaminationWidget extends StatefulWidget { MasterKeyModel item; - final Function(MasterKeyModel) removeExamination; + final Function(MySelectedExamination) removeExamination; final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; bool isExpand; @@ -83,7 +83,7 @@ class _AddExaminationWidgetState extends State { setState(() { if (widget.isServiceSelected(widget.item)) { if (examination.isLocal) - widget.removeExamination(widget.item); + widget.removeExamination(examination); widget.expandClick(); } else { examination.isNormal = status == 1; diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index 497bafa8..bab2d647 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'add_examination_widget.dart'; class ExaminationsListSearchWidget extends StatefulWidget { - final Function(MasterKeyModel) removeExamination; + final Function(MySelectedExamination) removeExamination; final Function(MySelectedExamination) addExamination; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index 31524295..c998bceb 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -76,11 +77,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - "Subjective", - fontWeight: FontWeight.bold, - fontSize: 12, - ), + StepWidget(stepLabel: "Subjective",), StatusLabel( selectedStepId: index, stepId: 0, @@ -132,11 +129,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - "Objective", - fontWeight: FontWeight.bold, - fontSize: 12, - ), + StepWidget(stepLabel: "Objective",), StatusLabel( selectedStepId: index, stepId: 1, @@ -152,7 +145,7 @@ class StepsWidget extends StatelessWidget { left: MediaQuery .of(context) .size - .width * 0.50, + .width * 0.47, child: InkWell( onTap: () { if (index >= 3) changeCurrentTab(2); @@ -190,11 +183,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - "Assessment", - fontWeight: FontWeight.bold, - fontSize: 12, - ), + StepWidget(stepLabel: "Assessment",), StatusLabel( selectedStepId: index, stepId: 2, @@ -243,13 +232,7 @@ class StepsWidget extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - AppText( - "Plan", - fontWeight: FontWeight.bold, - fontSize: 12, - textAlign: TextAlign.end, - marginLeft: 30, - ), + StepWidget(stepLabel: "Plan",marginLeft: 30,), StatusLabel( selectedStepId: index, stepId: 3, @@ -506,6 +489,25 @@ class StepsWidget extends StatelessWidget { } } +class StepWidget extends StatelessWidget { + final String stepLabel; + final double marginLeft; + + const StepWidget({ + Key key, this.stepLabel, this.marginLeft = 0, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return AppText( + stepLabel, + fontWeight: FontWeight.bold, + marginLeft: marginLeft, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12, + ); + } +} + class StatusLabel extends StatelessWidget { const StatusLabel({ Key key, @@ -519,7 +521,7 @@ class StatusLabel extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 65, + width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5, padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), decoration: BoxDecoration( color: stepId == selectedStepId @@ -541,7 +543,7 @@ class StatusLabel extends StatelessWidget { : "Locked", fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < selectedStepId From 88b04a8f5d870c8b73bafc1feb8f91e22aaec13b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 25 Jul 2021 11:49:58 +0300 Subject: [PATCH 06/29] fix stepper labels and translate it. --- lib/config/localized_values.dart | 4 + .../shared_soap_widgets/SOAP_step_header.dart | 2 +- .../steper/Step_details_widget.dart | 22 ++++ .../steper/status_Label.dart | 52 +++++++++ .../{ => steper}/steps_widget.dart | 105 +++--------------- lib/util/translations_delegate_base.dart | 3 + 6 files changed, 95 insertions(+), 93 deletions(-) create mode 100644 lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart create mode 100644 lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart rename lib/screens/patients/profile/soap_update/shared_soap_widgets/{ => steper}/steps_widget.dart (85%) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ebc43a87..8766832a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -705,4 +705,8 @@ const Map> localizedValues = { "summeryReply": {"en": "Summary Reply", "ar": "موجز الرد"}, "finish": {"en": "Finish", "ar": "انهاء"}, "severityValidationError": {"en": "Please add allergy severity", "ar": "الرجاء إضافة شدة الحساسية"}, + "inProgress": {"en": "inProgress", "ar": "تحت المعالجه"}, + "Completed": {"en": "Completed", "ar": "مكتمل"}, + "Locked": {"en": "Locked", "ar": "مقفل"}, + }; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index f345666f..5052d48f 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; 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'; diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart new file mode 100644 index 00000000..fb1bdcc9 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/Step_details_widget.dart @@ -0,0 +1,22 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class StepDetailsWidget extends StatelessWidget { + final String stepLabel; + final double marginLeft; + + const StepDetailsWidget({ + Key key, this.stepLabel, this.marginLeft = 0, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return AppText( + stepLabel, + fontWeight: FontWeight.bold, + marginLeft: marginLeft, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12, + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart new file mode 100644 index 00000000..a6c5c22b --- /dev/null +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart @@ -0,0 +1,52 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +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:hexcolor/hexcolor.dart'; + +class StatusLabel extends StatelessWidget { + const StatusLabel({ + Key key, + this.stepId, + this.selectedStepId, + }) : super(key: key); + + final int stepId; + final int selectedStepId; + + @override + Widget build(BuildContext context) { + return Container( + width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5, + padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), + decoration: BoxDecoration( + color: stepId == selectedStepId + ? Color(0xFFF1E9D3) + : stepId < selectedStepId + ? Color(0xFFD8E8DB) + : Color(0xFFCCCCCC), + borderRadius: BorderRadius.all( + Radius.circular(5.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0.30), + ), + child: Center( + child: AppText( + stepId == selectedStepId + ? TranslationBase.of(context).inProgress + : stepId < selectedStepId + ? TranslationBase.of(context).completed + : TranslationBase.of(context).locked, + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + color: stepId == selectedStepId + ? Color(0xFFCC9B14) + : stepId < selectedStepId + ? Color(0xFF359846) + : Color(0xFF969696), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart similarity index 85% rename from lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart rename to lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index c998bceb..304a6765 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -7,6 +8,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; +import 'Step_details_widget.dart'; + class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; @@ -77,7 +80,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - StepWidget(stepLabel: "Subjective",), + StepDetailsWidget(stepLabel: "Subjective",), StatusLabel( selectedStepId: index, stepId: 0, @@ -129,7 +132,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - StepWidget(stepLabel: "Objective",), + StepDetailsWidget(stepLabel: "Objective",), StatusLabel( selectedStepId: index, stepId: 1, @@ -183,7 +186,7 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - StepWidget(stepLabel: "Assessment",), + StepDetailsWidget(stepLabel: "Assessment",), StatusLabel( selectedStepId: index, stepId: 2, @@ -232,7 +235,7 @@ class StepsWidget extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - StepWidget(stepLabel: "Plan",marginLeft: 30,), + StepDetailsWidget(stepLabel: "Plan",marginLeft: 30,), StatusLabel( selectedStepId: index, stepId: 3, @@ -303,11 +306,7 @@ class StepsWidget extends StatelessWidget { SizedBox(height: 3), Column( children: [ - AppText( - "شخصي", - fontWeight: FontWeight.bold, - fontSize: 16, - ), + StepDetailsWidget(stepLabel: "شخصي",), StatusLabel( selectedStepId: index, stepId: 0, @@ -323,7 +322,7 @@ class StepsWidget extends StatelessWidget { right: MediaQuery .of(context) .size - .width * 0.28, + .width * 0.25, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -356,11 +355,7 @@ class StepsWidget extends StatelessWidget { SizedBox(height: 5), Column( children: [ - AppText( - "هدف", - fontWeight: FontWeight.bold, - fontSize: 14, - ), + StepDetailsWidget(stepLabel: "هدف",), StatusLabel( selectedStepId: index, stepId: 1, @@ -376,7 +371,7 @@ class StepsWidget extends StatelessWidget { right: MediaQuery .of(context) .size - .width * 0.52, + .width * 0.50, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( @@ -413,11 +408,7 @@ class StepsWidget extends StatelessWidget { padding: const EdgeInsets.only(right: 2), child: Column( children: [ - AppText( - "تقدير", - fontWeight: FontWeight.bold, - fontSize: 14, - ), + StepDetailsWidget(stepLabel: "تقدير",), StatusLabel( selectedStepId: index, stepId: 2, @@ -468,11 +459,7 @@ class StepsWidget extends StatelessWidget { margin: EdgeInsets.only(right: index == 3 ? 15 : 0), child: Column( children: [ - AppText( - "خطة", - fontWeight: FontWeight.bold, - fontSize: 14, - ), + StepDetailsWidget(stepLabel: "خطة",), StatusLabel( selectedStepId: index, stepId: 3, @@ -488,69 +475,3 @@ class StepsWidget extends StatelessWidget { ); } } - -class StepWidget extends StatelessWidget { - final String stepLabel; - final double marginLeft; - - const StepWidget({ - Key key, this.stepLabel, this.marginLeft = 0, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppText( - stepLabel, - fontWeight: FontWeight.bold, - marginLeft: marginLeft, - fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 3.5 //12, - ); - } -} - -class StatusLabel extends StatelessWidget { - const StatusLabel({ - Key key, - this.stepId, - this.selectedStepId, - }) : super(key: key); - - final int stepId; - final int selectedStepId; - - @override - Widget build(BuildContext context) { - return Container( - width: SizeConfig.getTextMultiplierBasedOnWidth() * 18.5, - padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), - decoration: BoxDecoration( - color: stepId == selectedStepId - ? Color(0xFFF1E9D3) - : stepId < selectedStepId - ? Color(0xFFD8E8DB) - : Color(0xFFCCCCCC), - borderRadius: BorderRadius.all( - Radius.circular(5.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0.30), - ), - child: Center( - child: AppText( - stepId == selectedStepId - ? "inProgress" - : stepId < selectedStepId - ? "Completed" - : "Locked", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, - color: stepId == selectedStepId - ? Color(0xFFCC9B14) - : stepId < selectedStepId - ? Color(0xFF359846) - : Color(0xFF969696), - ), - ), - ); - } -} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index d36512ae..2e8d10c9 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1233,6 +1233,9 @@ class TranslationBase { localizedValues['typeHereToReply'][locale.languageCode]; String get searchHere => localizedValues['searchHere'][locale.languageCode]; String get remove => localizedValues['remove'][locale.languageCode]; + String get inProgress => localizedValues['inProgress'][locale.languageCode]; + String get completed => localizedValues['Completed'][locale.languageCode]; + String get locked => localizedValues['Locked'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode]; String get fieldRequired => From 14a0911aec42047d05e32e3367d9d045c30453a1 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 26 Jul 2021 17:48:56 +0300 Subject: [PATCH 07/29] fix first step from Soap --- lib/config/localized_values.dart | 2 +- lib/config/size_config.dart | 22 +- .../viewModel/authentication_view_model.dart | 2 +- .../auth/verification_methods_screen.dart | 592 +++++++-------- .../shared_soap_widgets/SOAP_open_items.dart | 5 +- .../shared_soap_widgets/SOAP_step_header.dart | 8 +- .../bottom_sheet_dialog_button.dart | 5 +- .../bottom_sheet_title.dart | 82 ++- .../expandable_SOAP_widget.dart | 7 +- .../steper/status_Label.dart | 2 +- .../steper/steps_widget.dart | 50 +- .../subjective/allergies/allergies_item.dart | 57 +- ..._key_checkbox_search_allergies_widget.dart | 3 +- .../subjective/history/priority_bar.dart | 4 +- .../subjective/medication/add_medication.dart | 672 +++++++++--------- .../subjective/update_subjective_page.dart | 16 +- lib/util/helpers.dart | 3 + .../shared/buttons/app_buttons_widget.dart | 3 + .../master_key_checkbox_search_widget.dart | 7 +- .../text_fields/app-textfield-custom.dart | 2 +- 20 files changed, 810 insertions(+), 734 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8766832a..6500c10e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -282,7 +282,7 @@ const Map> localizedValues = { 'indication': {'en': 'Indication', 'ar': 'دواعي الاستخدام'}, 'duration': {'en': 'Duration', 'ar': 'المدة الزمنية'}, 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, - 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, + 'addMedication': {'en': 'Add Medication', 'ar': 'اضف الدواء'}, 'route': {'en': 'Route', 'ar': 'المسار'}, 'reschedule-leave': {'en': 'Reschedule and leaves', 'ar': 'إعادة الجدولة والأوراق'}, 'no-reschedule-leave': {'en': 'No Reschedule and leaves', 'ar': 'لا إعادة جدولة ويغادر'}, diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 6ba584c6..abb3ddd6 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -17,15 +17,31 @@ class SizeConfig { static bool isPortrait = true; static bool isMobilePortrait = false; static bool isMobile = false; - + static bool isHeightShort = false; + static bool isHeightVeryShort = false; + static bool isHeightMiddle = false; + static bool isHeightLarge = false; + static bool isWidthLarge = false; void init(BoxConstraints constraints, Orientation orientation) { realScreenHeight = constraints.maxHeight; realScreenWidth = constraints.maxWidth; - - if (constraints.maxWidth <= MAX_SMALL_SCREEN) { isMobile = true; } + if (constraints.maxHeight < 600) { + isHeightVeryShort = true; + } else if (constraints.maxHeight < 800) { + isHeightShort = true; + } else if (constraints.maxHeight < 1000) { + isHeightMiddle = true; + } else { + isHeightLarge = true; + } + + if (constraints.maxWidth > 600) { + isWidthLarge = true; + } + if (orientation == Orientation.portrait) { isPortrait = true; if (realScreenWidth < 450) { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index cae415da..6e075bc2 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -254,7 +254,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { - print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // DrAppToastMsg.showSuccesToast("_VerificationCode_ : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index c4587014..67d06852 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -71,321 +71,323 @@ class _VerificationMethodsScreenState extends State { margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), height: SizeConfig.realScreenHeight * .95, width: SizeConfig.realScreenWidth, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SizedBox( - height: 80, - ), - if(authenticationViewModel.isFromLogin) - InkWell( - onTap: (){ - authenticationViewModel.setUnverified(false,isFromLogin: false); - authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); - }, - child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - - ), - Container( - - child: Column( - children: [ - SizedBox( - height: 20, - ), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - AppText( - TranslationBase.of(context).welcomeBack, - fontSize:12, - fontWeight: FontWeight.w700, - color: Color(0xFF2B353E), - ), - AppText( - Helpers.capitalize(authenticationViewModel.user.doctorName), - fontSize: 24, - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context).accountInfo , - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - ), - SizedBox( - height: 20, - ), - Container( - padding: EdgeInsets.all(15), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0.1), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - - Text( - TranslationBase.of(context) - .lastLoginAt, - overflow: - TextOverflow.ellipsis, - style: TextStyle( - fontFamily: 'Poppins', - fontSize: 16, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700,), - - ), - Row( - children: [ - AppText( - TranslationBase - .of(context) - .verifyWith, - fontSize: 14, - color: Color(0xFF575757), - fontWeight: FontWeight.w600, - ), - AppText( - authenticationViewModel.getType( - authenticationViewModel.user - .logInTypeID, - context), - fontSize: 14, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ) - ], - crossAxisAlignment: CrossAxisAlignment.start,), - Column(children: [ - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 13, - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - ), - AppText( - authenticationViewModel.user.editedOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate( - authenticationViewModel.user - .editedOn)) - : authenticationViewModel.user.createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils.convertStringToDate(authenticationViewModel.user - .createdOn)) - : '--', - textAlign: - TextAlign.right, - fontSize: 14, - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SizedBox( + height: 80, + ), + if(authenticationViewModel.isFromLogin) + InkWell( + onTap: (){ + authenticationViewModel.setUnverified(false,isFromLogin: false); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); + }, + child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) - ) - ], - ), - ), - SizedBox( - height: 20, - ), - Row( - children: [ - AppText( - "Please Verify", - fontSize: 16, - color: Color(0xFF2B353E), - - fontWeight: FontWeight.w700, - ), - ], - ) - ], - ) - : Column( + ), + Container( + + child: Column( + children: [ + SizedBox( + height: 20, + ), + authenticationViewModel.user != null && isMoreOption == false + ? Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ - this.onlySMSBox == false - ? Container( - margin: EdgeInsets.only(bottom: 20, top: 30), - child: AppText( - TranslationBase.of(context) - .verifyLoginWith, - fontSize: 18, - color: Color(0xFF2E303A), + + AppText( + TranslationBase.of(context).welcomeBack, + fontSize:12, + fontWeight: FontWeight.w700, + color: Color(0xFF2B353E), + ), + AppText( + Helpers.capitalize(authenticationViewModel.user.doctorName), + fontSize: 24, + color: Color(0xFF2B353E), fontWeight: FontWeight.bold, - textAlign: TextAlign.left, ), - ) - : AppText( - TranslationBase.of(context) - .verifyFingerprint2, - fontSize: - SizeConfig.textMultiplier * 2.5, - textAlign: TextAlign.start, + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).accountInfo , + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 20, + ), + Container( + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.1), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + + Text( + TranslationBase.of(context) + .lastLoginAt, + overflow: + TextOverflow.ellipsis, + style: TextStyle( + fontFamily: 'Poppins', + fontSize: 16, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700,), + + ), + Row( + children: [ + AppText( + TranslationBase + .of(context) + .verifyWith, + fontSize: 14, + color: Color(0xFF575757), + fontWeight: FontWeight.w600, + ), + AppText( + authenticationViewModel.getType( + authenticationViewModel.user + .logInTypeID, + context), + fontSize: 14, + color: Color(0xFF2B353E), + + fontWeight: FontWeight.w700, + ), + ], + ) + ], + crossAxisAlignment: CrossAxisAlignment.start,), + Column(children: [ + AppText( + authenticationViewModel.user.editedOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + authenticationViewModel.user + .editedOn)) + : authenticationViewModel.user.createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate(authenticationViewModel.user + .createdOn)) + : '--', + textAlign: + TextAlign.right, + fontSize: 13, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + ), + AppText( + authenticationViewModel.user.editedOn != + null + ? AppDateUtils.getHour( + AppDateUtils.convertStringToDate( + authenticationViewModel.user + .editedOn)) + : authenticationViewModel.user.createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils.convertStringToDate(authenticationViewModel.user + .createdOn)) + : '--', + textAlign: + TextAlign.right, + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + + ) + ], + ), + ), + SizedBox( + height: 20, ), - ]), - authenticationViewModel.user != null && isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ Row( + children: [ + AppText( + "Please Verify", + fontSize: 16, + color: Color(0xFF2B353E), + + fontWeight: FontWeight.w700, + ), + ], + ) + ], + ) + : Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + this.onlySMSBox == false + ? Container( + margin: EdgeInsets.only(bottom: 20, top: 30), + child: AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: 18, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + textAlign: TextAlign.left, + ), + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: + SizeConfig.textMultiplier * 2.5, + textAlign: TextAlign.start, + ), + ]), + authenticationViewModel.user != null && isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => + { + // TODO check this logic it seem it will create bug to us + authenticateUser( + AuthMethodTypes + .Fingerprint, true) + }, + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: SelectedAuthMethodTypesService + .getMethodsTypeService( + authenticationViewModel.user + .logInTypeID), + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )), + ), + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.MoreOptions, + onShowMore: () { + setState(() { + isMoreOption = true; + }); + }, + )) + ]), + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: InkWell( - onTap: () => - { - // TODO check this logic it seem it will create bug to us - authenticateUser( - AuthMethodTypes - .Fingerprint, true) - }, - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: SelectedAuthMethodTypesService - .getMethodsTypeService( - authenticationViewModel.user - .logInTypeID), - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - ), + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.Fingerprint, + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), + )), Expanded( child: VerificationMethodsList( authenticationViewModel:authenticationViewModel, authMethodType: - AuthMethodTypes.MoreOptions, - onShowMore: () { - setState(() { - isMoreOption = true; - }); - }, + AuthMethodTypes.FaceID, + authenticateUser: + (AuthMethodTypes + authMethodType, + isActive) => + authenticateUser( + authMethodType, + isActive), )) - ]), - ]) - : Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.Fingerprint, - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.FaceID, - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: AuthMethodTypes - .SMS, - authenticateUser: - ( - AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel:authenticationViewModel, - authMethodType: - AuthMethodTypes.WhatsApp, - authenticateUser: - ( - AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )) - ], - ), - ]), + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: AuthMethodTypes + .SMS, + authenticateUser: + ( + AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )), + Expanded( + child: VerificationMethodsList( + authenticationViewModel:authenticationViewModel, + authMethodType: + AuthMethodTypes.WhatsApp, + authenticateUser: + ( + AuthMethodTypes authMethodType, + isActive) => + authenticateUser( + authMethodType, isActive), + )) + ], + ), + ]), - // ) - ], + // ) + ], + ), ), - ), - ], + ], + ), ), ), ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart index d0819b76..6449913c 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; 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'; @@ -35,14 +36,14 @@ class SOAPOpenItems extends StatelessWidget { children: [ AppText( "$label", - fontSize:15, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*4.5, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), letterSpacing:-0.44 , ), AppText( "${TranslationBase.of(context).searchHere}", - fontSize:14, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth()*3.5, fontWeight: FontWeight.w500, color: Color(0xFF575757), letterSpacing:-0.56 , diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 5052d48f..7d255c37 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -21,14 +22,14 @@ class SOAPStepHeader extends StatelessWidget { SizedBox(height: 15,), AppText( TranslationBase.of(context).createNew, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, fontWeight: FontWeight.w700, letterSpacing:-0.72, color: Color(0xFF2E303A), ), AppText(TranslationBase.of(context).episode, - fontSize: 24, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 8, fontWeight: FontWeight.bold, letterSpacing:-1.44, color: Color(0xFF2E303A), @@ -41,7 +42,8 @@ class SOAPStepHeader extends StatelessWidget { ), ), SizedBox( - height: 30, + height:SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 1 : 2), ), ], ); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index d6cab800..30937ab4 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -19,7 +20,7 @@ class BottomSheetDialogButton extends StatelessWidget { ), border: Border.all(color: HexColor('#EFEFEF'), width: 1), ), - height: MediaQuery.of(context).size.height * 0.1, + height: SizeConfig.heightMultiplier * 12, width: double.infinity, child: Column( children: [ @@ -31,6 +32,8 @@ class BottomSheetDialogButton extends StatelessWidget { widthFactor: .80, child: Center( child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), title: label, padding: 10, color: Color(0xFF359846), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index d8110844..98a457e0 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -1,58 +1,62 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:flutter/material.dart'; class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { - const BottomSheetTitle({ + BottomSheetTitle({ Key key, this.title, }) : super(key: key); final String title; + double headerHeight = SizeConfig.getTextMultiplierBasedOnWidth()*35; @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), + // padding: EdgeInsets.only( + // left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( color: Colors.white, ), - height: 115, - child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), - margin: EdgeInsets.only(top: 60), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize:20, - color: Colors.black), - children: [ - new TextSpan( + height: headerHeight, + child: Center( + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: headerHeight *0.5), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( - text: title, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 22)), - ], + text: title, + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)), + ], + ), ), - ), - InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Icon(DoctorApp.close_1, - size:20, - color: Color(0xFF2B353E))) - ], - ), - ], + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(DoctorApp.close_1, + size:SizeConfig.getTextMultiplierBasedOnWidth()*5, + color: Color(0xFF2B353E))) + ], + ), + ], + ), ), ), ); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 2dcce4ae..25518110 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -19,7 +20,7 @@ class ExpandableSOAPWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.symmetric(vertical: 20, horizontal: 10), + padding: EdgeInsets.symmetric(vertical: SizeConfig.isHeightVeryShort ?10:20, horizontal: 10), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -41,14 +42,14 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ AppText(headerTitle, variant: isExpanded ? "bodyText" : '', - fontSize: 16, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*5, letterSpacing:-0.64, fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), if(isRequired) Icon( FontAwesomeIcons.asterisk, - size: 12, + size: SizeConfig.getTextMultiplierBasedOnWidth()*2.5, ) ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart index a6c5c22b..10562d53 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart @@ -39,7 +39,7 @@ class StatusLabel extends StatelessWidget { : TranslationBase.of(context).locked, fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, color: stepId == selectedStepId ? Color(0xFFCC9B14) : stepId < selectedStepId diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index 304a6765..cba8daf2 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -20,6 +20,8 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + double containerHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); + double circleTop = (SizeConfig.isHeightVeryShort ?12:SizeConfig.isHeightShort?10:10); return !projectViewModel.isArabic ? Stack( children: [ @@ -45,7 +47,7 @@ class StepsWidget extends StatelessWidget { ), ),), Positioned( - top: 10, + top: circleTop, left: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -53,8 +55,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -92,7 +94,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, left: MediaQuery .of(context) .size @@ -103,8 +105,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width: containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -144,7 +146,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, left: MediaQuery .of(context) .size @@ -157,8 +159,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -198,7 +200,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, right: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -206,8 +208,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -272,7 +274,7 @@ class StepsWidget extends StatelessWidget { ), ),), Positioned( - top: 10, + top: circleTop, right: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -280,8 +282,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -318,7 +320,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, right: MediaQuery .of(context) .size @@ -329,8 +331,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -367,7 +369,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, right: MediaQuery .of(context) .size @@ -378,8 +380,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -421,7 +423,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 10, + top: circleTop, left: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -429,8 +431,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width: 38, - height: 38, + width:containerHeight, + height: containerHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 00606f68..579d8153 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -1,7 +1,9 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; @@ -73,7 +75,7 @@ class _AddAllergiesItemState extends State { onTapItem(); }), InkWell( - onTap:onTapItem, + onTap: onTapItem, child: Container( child: AppText( projectViewModel.isArabic @@ -82,8 +84,7 @@ class _AddAllergiesItemState extends State { : widget.item.nameEn : widget.item.nameEn, color: Color(0xFF575757), - fontSize: 14, - fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.8, letterSpacing: -0.56, ), width: MediaQuery.of(context).size.width * 0.55, @@ -92,22 +93,22 @@ class _AddAllergiesItemState extends State { ], ), InkWell( - onTap: () { - if (mySelectedAllergy != null) { - setState(() { - mySelectedAllergy.isExpanded = - mySelectedAllergy.isExpanded ? false : true; - }); - } - }, - child: Icon((mySelectedAllergy != null - ? mySelectedAllergy.isExpanded - : false) - + onTap: () { + if (mySelectedAllergy != null) { + setState(() { + mySelectedAllergy.isExpanded = + mySelectedAllergy.isExpanded ? false : true; + }); + } + }, + child: Icon( + (mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false) ? EvaIcons.arrowIosUpwardOutline : EvaIcons.arrowIosDownwardOutline, - color: Color(0xFF575757) , - ),) + color: Color(0xFF575757), + size: 20, + ), + ) ], ), bodyWidget: Center( @@ -143,8 +144,9 @@ class _AddAllergiesItemState extends State { isTextFieldHasSuffix: true, hintText: TranslationBase.of(context).selectSeverity + "*", enabled: false, - maxLines: 2, - minLines: 2, + maxLines: 1, + minLines: 1, + height: Helpers.getTextFieldHeight(), validationError: mySelectedAllergy != null && mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.hasValidationError @@ -161,11 +163,10 @@ class _AddAllergiesItemState extends State { maxLines: 25, minLines: 3, hasBorder: true, - onChanged: (value){ + onChanged: (value) { mySelectedAllergy.remark = value; }, inputType: TextInputType.multiline, - ), SizedBox( height: 10, @@ -180,18 +181,18 @@ class _AddAllergiesItemState extends State { ); } - onTapItem(){ + onTapItem() { setState(() { if (widget.isServiceSelected(widget.item)) { widget.removeAllergy(widget.item); } else { MySelectedAllergy mySelectedAllergy = - SoapUtils.generateMySelectedAllergy( - allergy: widget.item, - allergySeverity: _selectedAllergySeverity, - remark: null, - isChecked: true, - isExpanded: true); + SoapUtils.generateMySelectedAllergy( + allergy: widget.item, + allergySeverity: _selectedAllergySeverity, + remark: null, + isChecked: true, + isExpanded: true); widget.addAllergy(mySelectedAllergy); } }); diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 3f6f694f..8819f04a 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -58,7 +59,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState children: [ Expanded( child: Container( - height: MediaQuery.of(context).size.height * 0.70, + height: Helpers.getTextFieldHeight(), child: Center( child: Container( decoration: BoxDecoration( diff --git a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart index ac6ec2c5..305b0c65 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/priority_bar.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -67,8 +68,7 @@ class _PriorityBarState extends State { : item, textAlign: TextAlign.center, style: TextStyle( - fontSize: 14, - + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.5, color: Colors.black, fontWeight: FontWeight.bold, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index c80251f8..8bc8e712 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -1,5 +1,6 @@ // ignore: must_be_immutable import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; @@ -8,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -53,7 +55,6 @@ class _AddMedicationState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final screenSize = MediaQuery.of(context).size; return FractionallySizedBox( child: BaseView( onModelReady: (model) async { @@ -75,340 +76,367 @@ class _AddMedicationState extends State { await model.getMedicationList(); }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addMedication, - ), - body: Center( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( + baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addMedication, + ), + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Expanded( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 16, - ), - SizedBox( - height: 16, - ), - Container( - // height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null + child: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?2:SizeConfig.isHeightShort?2:2), + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + _selectedMedication == null, + child: AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + TranslationBase.of( + context) + .searchMedicineNameHere, + null, + true, + suffixIcon: + Icons.search), + itemSubmitted: (item) => + setState(() => + _selectedMedication = + item), + key: key, + suggestions: + model.allMedicationList, + itemBuilder: (context, + suggestion) => + new Padding( + child: AppText(suggestion + .description + + '/' + + suggestion + .genericName), + padding: + EdgeInsets.all( + 8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, + input) => + suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith(input + .toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith(input + .toLowerCase()), + ), + ) + : AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: _selectedMedication != + null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : TranslationBase.of( + context) + .searchMedicineNameHere, + minLines: 1, + maxLines: 1, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: model.medicationDoseTimeList != + null ? () { - setState(() { - _selectedMedication = null; - }); + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationDoseTimeList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: + _selectedMedicationDose, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = + selectedValue; + + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); } : null, - child: _selectedMedication == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - _selectedMedication == null, - child: AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .searchMedicineNameHere, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState( - () => _selectedMedication = - item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: AppText(suggestion - .description + - '/' + - suggestion - .genericName), - padding: - EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input - .toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith( - input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - hintText: _selectedMedication != - null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of(context) - .searchMedicineNameHere, - minLines: 2, - maxLines: 2, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), - enabled: false, - ), + hintText: + TranslationBase.of(context).doseTime, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && + _selectedMedicationDose == null + ? TranslationBase.of(context) + .emptyMessage + : null, ), - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - onClick: model.medicationDoseTimeList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationDoseTimeList, - okText: - TranslationBase.of(context).ok, - selectedValue: _selectedMedicationDose, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationStrengthList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: + _selectedMedicationStrength, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - doseController - .text = projectViewModel - .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).doseTime, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && - _selectedMedicationDose == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationStrengthList, - okText: - TranslationBase.of(context).ok, - selectedValue: _selectedMedicationStrength, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).strength, + maxLines: 1, + minLines: 1, + controller: strengthController, + validationError: isFormSubmitted && + _selectedMedicationStrength == + null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + selectedValue: + _selectedMedicationRoute, + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - strengthController - .text = projectViewModel - .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).strength, - maxLines: 2, - minLines: 2, - controller: strengthController, - validationError: isFormSubmitted && - _selectedMedicationStrength == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationRouteList, - selectedValue: _selectedMedicationRoute, - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).route, + maxLines: 1, + minLines: 1, + controller: routeController, + validationError: isFormSubmitted && + _selectedMedicationRoute == null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.medicationFrequencyList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationFrequencyList, + okText: + TranslationBase.of(context) + .ok, + selectedValue: + _selectedMedicationFrequency, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; - routeController - .text = projectViewModel - .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 2, - minLines: 2, - controller: routeController, - validationError: isFormSubmitted && - _selectedMedicationRoute == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - onClick: model.medicationFrequencyList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationFrequencyList, - okText: - TranslationBase.of(context).ok, - selectedValue: _selectedMedicationFrequency, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase.of(context).frequency, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && + _selectedMedicationFrequency == + null + ? TranslationBase.of(context) + .emptyMessage + : null, + ), + SizedBox( + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + ), - frequencyController - .text = projectViewModel - .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).frequency, - enabled: false, - maxLines: 2, - minLines: 2, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && - _selectedMedicationFrequency == null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 30, - ), - ], + ], + ), )), ), - ), - ]), + ]), + ), ), - ), - bottomSheet:model.state == ViewState.Busy?Container(height: 0,): - BottomSheetDialogButton( - label: TranslationBase.of(context) - .addMedication - .toUpperCase(), - onTap: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; - Navigator.of(context).pop(); - } - }, - ) - ), + bottomSheet: model.state == ViewState.Busy + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: + TranslationBase.of(context).addMedication, + onTap: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget + .medicationController.text + + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, + )), ), ); } 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 5942a7cf..3e8c2d44 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 @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -268,7 +269,8 @@ class _UpdateSubjectivePageState extends State { isExpanded: isChiefExpand, ), SizedBox( - height: 30, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 4 : 2), ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).histories, @@ -286,7 +288,8 @@ class _UpdateSubjectivePageState extends State { isExpanded: isHistoryExpand, ), SizedBox( - height: 30, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 4 : 2), ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).allergiesSoap, @@ -309,7 +312,8 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height: MediaQuery.of(context).size.height * 0.16, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -324,7 +328,8 @@ class _UpdateSubjectivePageState extends State { ), border: Border.all(color: HexColor('#707070'), width: 0), ), - height: 80, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), width: double.infinity, child: Column( children: [ @@ -338,7 +343,10 @@ class _UpdateSubjectivePageState extends State { child: AppButton( title: TranslationBase.of(context).next, fontWeight: FontWeight.w600, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), color: Colors.red[700], + padding: 10, // loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 7232f0c9..f8f0fbd3 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -277,4 +277,7 @@ class Helpers { String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); return "$twoDigitMinutes:$twoDigitSeconds"; } + static double getTextFieldHeight(){ + return SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?10:SizeConfig.isHeightShort?8:6); + } } diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index ed3e6e98..acbd27fe 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -22,6 +22,7 @@ class AppButton extends StatefulWidget { final double radius; final double vPadding; final double hPadding; + final double height; AppButton({ @required this.onPressed, @@ -40,6 +41,7 @@ class AppButton extends StatefulWidget { this.radius = 8.0, this.hasBorder = false, this.borderColor, + this.height, }); _AppButtonState createState() => _AppButtonState(); @@ -50,6 +52,7 @@ class _AppButtonState extends State { Widget build(BuildContext context) { return Container( // height: MediaQuery.of(context).size.height * 0.075, + height: widget.height, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 780f82ca..8e383ab9 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -1,6 +1,8 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/cupertino.dart'; @@ -75,7 +77,7 @@ class _MasterKeyCheckboxSearchWidgetState child: ListView( children: [ AppTextFieldCustom( - height: MediaQuery.of(context).size.height * 0.070, + height: Helpers.getTextFieldHeight(),//MediaQuery.of(context).size.height * 0.070, hintText: TranslationBase.of(context).searchHistory, isTextFieldHasSuffix: true, hasBorder: false, @@ -133,8 +135,7 @@ class _MasterKeyCheckboxSearchWidgetState : historyInfo.nameEn, color: Color(0xFF575757), - fontSize: 14, - fontWeight: FontWeight.w600, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.8, letterSpacing: -0.56, ), ), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 05f139a2..bbd010cd 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -158,7 +158,7 @@ class _AppTextFieldCustomState extends State { ? widget.inputFormatters : [], onChanged: (value) { - // setState(() {}); + setState(() {}); if (widget.onChanged != null) { widget.onChanged(value); } From 7227679081b8ecc6cf8df87b02777a8ebb67781c Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 27 Jul 2021 15:08:58 +0300 Subject: [PATCH 08/29] fix design --- .../assessment/add_assessment_details.dart | 19 +++-- .../assessment/update_assessment_page.dart | 34 +++++---- .../objective/add_examination_widget.dart | 75 +++++++++++-------- .../examinations_list_search_widget.dart | 4 +- .../objective/update_objective_page.dart | 13 +++- .../soap_update/plan/update_plan_page.dart | 23 ++++-- .../expandable_SOAP_widget.dart | 2 +- .../shared_soap_widgets/remove_button.dart | 5 +- .../steper/steps_widget.dart | 2 - .../allergies/update_allergies_widget.dart | 5 +- .../history/update_history_widget.dart | 3 +- .../subjective/medication/add_medication.dart | 2 +- .../subjective/update_subjective_page.dart | 3 +- 13 files changed, 118 insertions(+), 72 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 691cc5b6..2ac051b1 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -1,5 +1,6 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -153,6 +154,8 @@ class _AddAssessmentDetailsState extends State { margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: AppTextFieldCustom( // height: 55.0, + height: Helpers.getTextFieldHeight(), + hintText: TranslationBase.of(context).appointmentNumber, isTextFieldHasSuffix: false, @@ -224,7 +227,8 @@ class _AddAssessmentDetailsState extends State { ), ) : AppTextFieldCustom( - onClick: model.listOfICD10 != null + height: Helpers.getTextFieldHeight(), + onClick: model.listOfICD10 != null ? () { setState(() { widget.mySelectedAssessment @@ -235,7 +239,7 @@ class _AddAssessmentDetailsState extends State { : null, hintText: TranslationBase.of(context) .nameOrICD, - maxLines: 2, + maxLines: 1, minLines: 1, controller: icdNameController, enabled: true, @@ -251,6 +255,8 @@ class _AddAssessmentDetailsState extends State { height: 7, ), AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.listOfDiagnosisCondition != null ? () { MasterKeyDailog dialog = MasterKeyDailog( @@ -288,7 +294,7 @@ class _AddAssessmentDetailsState extends State { } : null, hintText: TranslationBase.of(context).condition, - maxLines: 2, + maxLines: 1, minLines: 1, controller: conditionController, isTextFieldHasSuffix: true, @@ -305,6 +311,8 @@ class _AddAssessmentDetailsState extends State { height: 10, ), AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( @@ -334,7 +342,7 @@ class _AddAssessmentDetailsState extends State { } : null, hintText: TranslationBase.of(context).dType, - maxLines: 2, + maxLines: 1, minLines: 1, enabled: false, isTextFieldHasSuffix: true, @@ -365,7 +373,8 @@ class _AddAssessmentDetailsState extends State { ), ), SizedBox( - height: 10, + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), + ), ])), ), diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 8caf61fe..99c27478 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -167,7 +168,7 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -182,7 +183,8 @@ class _UpdateAssessmentPageState extends State { .selectedICD.code .trim() .toUpperCase() ?? - "", + "" + ), ], ), @@ -195,7 +197,7 @@ class _UpdateAssessmentPageState extends State { child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 16, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *5, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -215,7 +217,7 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -226,7 +228,7 @@ class _UpdateAssessmentPageState extends State { context) .appointmentNo, style: new TextStyle( - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, letterSpacing: -0.4, color: Color(0xFF575757), ), @@ -237,7 +239,7 @@ class _UpdateAssessmentPageState extends State { .toString() ?? "", style: new TextStyle( - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -248,7 +250,7 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: @@ -274,7 +276,7 @@ class _UpdateAssessmentPageState extends State { .selectedDiagnosisCondition .nameEn, style: new TextStyle( - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -285,7 +287,7 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: @@ -311,7 +313,7 @@ class _UpdateAssessmentPageState extends State { .selectedDiagnosisType .nameEn, style: new TextStyle( - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -323,7 +325,7 @@ class _UpdateAssessmentPageState extends State { RichText( text: new TextSpan( style: new TextStyle( - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: @@ -335,7 +337,7 @@ class _UpdateAssessmentPageState extends State { .doctor + ' : ', style: new TextStyle( - fontSize: 10,letterSpacing: -0.4, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,letterSpacing: -0.4, color: Color(0xFF575757), ), @@ -345,7 +347,7 @@ class _UpdateAssessmentPageState extends State { .doctorName ?? '', style: new TextStyle( - fontSize: 12,letterSpacing: -0.48, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -375,7 +377,7 @@ class _UpdateAssessmentPageState extends State { .remarks + " : " : '', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: @@ -412,7 +414,7 @@ class _UpdateAssessmentPageState extends State { .now()), fontWeight: FontWeight.w600, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, ), AppText( assessment.createdOn != @@ -427,7 +429,7 @@ class _UpdateAssessmentPageState extends State { fontWeight: FontWeight.w600, color: Color(0xFF575757), - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, ), ], ), diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 82d26dc9..ae6342c4 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -65,38 +65,32 @@ class _AddExaminationWidgetState extends State { headerWidget: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - child: CheckboxListTile( - title: AppText( - projectViewModel.isArabic - ? widget.item.nameAr != null && widget.item.nameAr != "" - ? widget.item.nameAr - : widget.item.nameEn - : widget.item.nameEn, - fontWeight: FontWeight.normal, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 2.0, - ), - value: widget.isServiceSelected(widget.item), - activeColor: HexColor("#D02127"), - onChanged: (newValue) { - setState(() { - if (widget.isServiceSelected(widget.item)) { - if (examination.isLocal) - widget.removeExamination(examination); - widget.expandClick(); - } else { - examination.isNormal = status == 1; - examination.isAbnormal = status == 2; - examination.notExamined = status == 3; - examination.remark = remarksController.text; - widget.addExamination(examination); - widget.expandClick(); - } - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), + InkWell( + onTap: (){ + onExamTap(); + }, + child: Row( + children: [ + Checkbox( + value:widget.isServiceSelected(widget.item), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + onExamTap(); + }), + Container( + child: AppText( + projectViewModel.isArabic + ? widget.item.nameAr != null && widget.item.nameAr != "" + ? widget.item.nameAr + : widget.item.nameEn + : widget.item.nameEn, + + color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.8, + letterSpacing: -0.56, + ), + ), + ], ), ), Container( @@ -271,6 +265,23 @@ class _AddExaminationWidgetState extends State { ); } + onExamTap(){ + setState(() { + if (widget.isServiceSelected(widget.item)) { + if (examination.isLocal) + widget.removeExamination(examination); + widget.expandClick(); + } else { + examination.isNormal = status == 1; + examination.isAbnormal = status == 2; + examination.notExamined = status == 3; + examination.remark = remarksController.text; + widget.addExamination(examination); + widget.expandClick(); + } + }); + } + MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { Iterable exam = widget.mySelectedExamination.where( (element) => diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index bab2d647..c041b545 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -42,10 +43,11 @@ class _ExaminationsListSearchWidgetState return Column( children: [ AppTextFieldCustom( - height: MediaQuery.of(context).size.height * 0.080, + height: Helpers.getTextFieldHeight(), hintText: TranslationBase.of(context).searchExamination, isTextFieldHasSuffix: true, hasBorder: false, + controller: filteredSearchController, onChanged: (value) { filterSearchResults(value); 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 317fa4af..0ecda333 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 @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -192,7 +193,8 @@ class _UpdateObjectivePageState extends State { isExpanded: isSysExaminationExpand, ), SizedBox( - height: MediaQuery.of(context).size.height * 0.12, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 14 : 12), ) ], ), @@ -207,7 +209,8 @@ class _UpdateObjectivePageState extends State { ), border: Border.all(color: HexColor('#707070'), width: 0), ), - height: 80, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), width: double.infinity, child: Column( children: [ @@ -224,6 +227,9 @@ class _UpdateObjectivePageState extends State { child: AppButton( title: TranslationBase.of(context).previous, color: Colors.grey[300], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, fontColor: Colors.black, fontWeight: FontWeight.w600, onPressed: () { @@ -239,6 +245,9 @@ class _UpdateObjectivePageState extends State { title: TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, disabled: model.state == ViewState.BusyLocal, onPressed: () async { await submitUpdateObjectivePage(model); diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 4622bc94..ce86f33d 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -209,7 +210,9 @@ class _UpdatePlanPageState extends State { children: [ AppText( 'Appointment No: ', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + letterSpacing: -0.4, + color: Color(0xFF575757), ), AppText( patientProgressNote @@ -220,7 +223,9 @@ class _UpdatePlanPageState extends State { .toString() : '', fontWeight: FontWeight.w600, - fontSize: 14, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, ), ], ), @@ -236,7 +241,7 @@ class _UpdatePlanPageState extends State { .getDayMonthYearDateFormatted( DateTime.now()), fontWeight: FontWeight.w600, - fontSize: 14, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, ) ], ), @@ -268,7 +273,8 @@ class _UpdatePlanPageState extends State { : AppDateUtils.getHour( DateTime.now()), fontWeight: FontWeight.w600, - fontSize: 14, + color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, ) ], ), @@ -319,7 +325,8 @@ class _UpdatePlanPageState extends State { ), border: Border.all(color: HexColor('#707070'), width: 0), ), - height: 80, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), width: double.infinity, child: Column( children: [ @@ -334,6 +341,9 @@ class _UpdatePlanPageState extends State { children: [ Expanded( child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, title: TranslationBase.of(context).previous, color: Colors.grey[300], fontColor: Colors.black, @@ -349,6 +359,9 @@ class _UpdatePlanPageState extends State { ), Expanded( child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, title: isAddProgress ? TranslationBase.of(context).next : TranslationBase.of(context).finish, diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 25518110..732df855 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -42,7 +42,7 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ AppText(headerTitle, variant: isExpanded ? "bodyText" : '', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: 5), letterSpacing:-0.64, fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart index bff3d4a8..1e5231c9 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/remove_button.dart @@ -1,4 +1,5 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; 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'; @@ -19,7 +20,7 @@ class RemoveButton extends StatelessWidget { Container( child: AppText( label??TranslationBase.of(context).remove, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontWeight: FontWeight.w700, color: HexColor("#D02127"), letterSpacing:-0.48, @@ -28,7 +29,7 @@ class RemoveButton extends StatelessWidget { Icon( FontAwesomeIcons.times, color: HexColor("#D02127"), - size: 16, + size: SizeConfig.getTextMultiplierBasedOnWidth() *4, ), ], ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index cba8daf2..e1f740bc 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -1,11 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import 'Step_details_widget.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart index 48136cb4..c8a519c3 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/update_allergies_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/remark_text.dart'; @@ -70,7 +71,7 @@ class _UpdateAllergiesWidgetState extends State { : TextDecoration.lineThrough, bold: true, color: Color(0xFF2B353E), - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontWeight: FontWeight.w700, letterSpacing: -0.48, // fontHeight:0.18 , @@ -86,7 +87,7 @@ class _UpdateAllergiesWidgetState extends State { ? null : TextDecoration.lineThrough, color: Color(0xFFCC9B14), - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w700, letterSpacing: -0.48, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart index 2f17d332..33e7fcd1 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_history.dart'; @@ -68,7 +69,7 @@ class _UpdateHistoryWidgetState extends State ? null : TextDecoration.lineThrough, color: Color(0xFF2B353E), - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontWeight: FontWeight.w700, letterSpacing: -0.48, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 8bc8e712..6b0a592d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -351,7 +351,7 @@ class _AddMedicationState extends State { height: 5, ), AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), + height: Helpers.getTextFieldHeight(), onClick: model.medicationFrequencyList != null ? () { 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 3e8c2d44..b1441ce4 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 @@ -345,9 +345,8 @@ class _UpdateSubjectivePageState extends State { fontWeight: FontWeight.w600, height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 8 : 6), - color: Colors.red[700], padding: 10, - // loading: model.state == ViewState.BusyLocal, + color: Colors.red[700], onPressed: () async { addSubjectiveInfo( model: model, From 6b65de77e90d496cb861f069c9fc8371f0faaddd Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 27 Jul 2021 17:57:48 +0300 Subject: [PATCH 09/29] fix design issues on diff pages inside soap --- .../assessment/update_assessment_page.dart | 9 +- .../objective/add_examination_page.dart | 2 +- .../subjective/allergies/add_allergies.dart | 2 +- .../history/add_history_dialog.dart | 2 +- .../subjective/medication/add_medication.dart | 2 +- .../soap_update/update_soap_index.dart | 111 ++++++++---------- .../profile/patient-profile-app-bar.dart | 72 ++++++------ .../shared/dialogs/master_key_dailog.dart | 49 ++++---- 8 files changed, 127 insertions(+), 122 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 99c27478..a3c688a4 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -482,7 +482,8 @@ class _UpdateAssessmentPageState extends State { ), border: Border.all(color: HexColor('#707070'), width: 0), ), - height: 80, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), width: double.infinity, child: Column( children: [ @@ -500,6 +501,9 @@ class _UpdateAssessmentPageState extends State { title: TranslationBase.of(context).previous, color: Colors.grey[300], fontColor: Colors.black, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, fontWeight: FontWeight.w600, disabled: model.state == ViewState.BusyLocal, onPressed: () async { @@ -515,6 +519,9 @@ class _UpdateAssessmentPageState extends State { title: TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, disabled: model.state == ViewState.BusyLocal, onPressed: () async { if (mySelectedAssessmentList.isEmpty) { diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index f1966130..5ce4250a 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -102,7 +102,7 @@ class _AddExaminationPageState extends State { ), ], ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index 7f1abb64..8c68a61e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -116,7 +116,7 @@ class _AddAllergiesState extends State { ]), ), ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index c089bd24..f663d92e 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -163,7 +163,7 @@ class _AddHistoryDialogState extends State { ], )), ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 6b0a592d..d5addf88 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -414,7 +414,7 @@ class _AddMedicationState extends State { ]), ), ), - bottomSheet: model.state == ViewState.Busy + bottomSheet: model.state != ViewState.Idle ? Container( height: 0, ) diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index d2fefb31..792a3f20 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -62,68 +62,61 @@ class _UpdateSoapIndexState extends State PatiantInformtion patient = routeArgs['patient']; return AppScaffold( isLoading: _isLoading, - isShowAppBar: false, + isShowAppBar: true, + appBar: PatientProfileAppBar(patient), body: SingleChildScrollView( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - boxShadow: [], - color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientProfileAppBar(patient), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ - Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.73, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState) - ], - ), - ) - ], - ), + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.73, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState) + ], + ), + ) + ], ), - ], - ), + ), + ], ), ), ); diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 2a0fa072..0b94ec23 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -75,21 +75,17 @@ class PatientProfileAppBar extends StatelessWidget ), decoration: BoxDecoration( color: Colors.white, + border: Border( bottom: BorderSide(color:Color(0xFFEFEFEF))) + ), - // height: height == 0 - // ? isInpatient - // ? 215 - // : isAppointmentHeader - // ? 325 - // : 200 - // : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + + margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort?30: 50), child: Column( children: [ Container( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -138,10 +134,10 @@ class PatientProfileAppBar extends StatelessWidget ), Row(children: [ Padding( - padding: EdgeInsets.only(left: 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0), child: Container( - width: 60, - height: 60, + width: SizeConfig.getTextMultiplierBasedOnWidth()*20, + height: SizeConfig.getTextMultiplierBasedOnWidth()*20, child: Image.asset( gender == 1 ? 'assets/images/male_avatar.png' @@ -170,14 +166,14 @@ class PatientProfileAppBar extends StatelessWidget color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ) : AppText( TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ), patient.startTime != null ? AppText( @@ -185,7 +181,7 @@ class PatientProfileAppBar extends StatelessWidget ? patient.startTime : '', fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A)) : SizedBox() ], @@ -207,7 +203,7 @@ class PatientProfileAppBar extends StatelessWidget .fileNumber, style: TextStyle( - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF575757), fontWeight: FontWeight.w600, @@ -218,7 +214,7 @@ class PatientProfileAppBar extends StatelessWidget style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 12, color: Color(0xFF2E303A),)), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),)), ], ), ), @@ -227,7 +223,7 @@ class PatientProfileAppBar extends StatelessWidget AppText( patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ), patient.nationalityFlagURL != null ? ClipRRect( @@ -260,7 +256,7 @@ class PatientProfileAppBar extends StatelessWidget text: TranslationBase .of(context) .age + " : ", - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), + style: TextStyle(fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), new TextSpan( text: "${AppDateUtils.getAgeByBirthday( @@ -271,7 +267,7 @@ class PatientProfileAppBar extends StatelessWidget isServerFormat: !isFromLiveCare)}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),)), ], ), @@ -285,7 +281,7 @@ class PatientProfileAppBar extends StatelessWidget AppText( TranslationBase.of(context).appointmentDate + " : ", - fontSize: 10, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, color: Color(0xFF575757), fontWeight: FontWeight.w600, fontFamily: 'Poppins', @@ -300,7 +296,7 @@ class PatientProfileAppBar extends StatelessWidget patient.appointmentDate)) , fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A), ), SizedBox( @@ -319,7 +315,7 @@ class PatientProfileAppBar extends StatelessWidget children: [ new TextSpan( text: "Result Date: ", - style: TextStyle( fontSize: 10, + style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, color: Color(0xFF575757), fontWeight: FontWeight.w600, fontFamily: 'Poppins',)), @@ -341,7 +337,7 @@ class PatientProfileAppBar extends StatelessWidget child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757), fontFamily: 'Poppins', ), children: [ @@ -363,7 +359,7 @@ class PatientProfileAppBar extends StatelessWidget .toString())))}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),)), ]))), if (patient.admissionDate != null) @@ -371,7 +367,7 @@ class PatientProfileAppBar extends StatelessWidget children: [ AppText( "${TranslationBase.of(context).numOfDays}: ", - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757) + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757) ), if(isDischargedPatient && patient.dischargeDate != null) @@ -384,7 +380,7 @@ class PatientProfileAppBar extends StatelessWidget patient.admissionDate)) .inDays + 1}", fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A), ) else @@ -396,7 +392,7 @@ class PatientProfileAppBar extends StatelessWidget patient.admissionDate)) .inDays + 1}", fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, color: Color(0xFF2E303A),), ], ), @@ -457,7 +453,7 @@ class PatientProfileAppBar extends StatelessWidget .dr}$doctorName', color: Color(0xFF2E303A), fontWeight: FontWeight.w700, - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ), if (orderNo != null && !isPrescriptions) @@ -465,7 +461,7 @@ class PatientProfileAppBar extends StatelessWidget children: [ AppText('Order No: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(orderNo ?? '', fontSize: 12) ], @@ -475,7 +471,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Invoice: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(invoiceNO ?? "", fontSize: 12) ], @@ -484,7 +480,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Branch: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(branch ?? '', fontSize: 12) ], @@ -494,7 +490,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Clinic: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(clinic ?? '', fontSize: 12) ], @@ -504,7 +500,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Episode: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(episode ?? '', fontSize: 12) ], @@ -514,7 +510,7 @@ class PatientProfileAppBar extends StatelessWidget Row( children: [ AppText('Visit Date: ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757),), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), AppText(visitDate ?? '', fontSize: 12) ], @@ -527,7 +523,7 @@ class PatientProfileAppBar extends StatelessWidget !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', - fontSize: 10, fontWeight: FontWeight.w600,color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757), ), AppText( '${AppDateUtils @@ -535,7 +531,7 @@ class PatientProfileAppBar extends StatelessWidget appointmentDate, isArabic: projectViewModel .isArabic)}', - fontSize: 12, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, ) ], ) @@ -556,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : 170 + ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?150:SizeConfig.isHeightShort?180: 170 : height); } diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 55046c3c..7beb3ca6 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -1,9 +1,12 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../app_texts_widget.dart'; + // ignore: must_be_immutable class MasterKeyDailog extends StatefulWidget { final List list; @@ -33,18 +36,18 @@ class _MasterKeyDailogState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return showAlertDialog(context, projectViewModel); + return showAlertDialog(context, projectViewModel); } showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: Text(TranslationBase.of(context).cancel), + child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( - child: Text(this.widget.okText), + child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,), onPressed: () { this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); @@ -69,23 +72,29 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: Text( - '${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), - groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), - value: widget.isICD ? widget.selectedValue.code.toString() : item - .id.toString(), - activeColor: Colors.blue.shade700, - selected: widget.isICD ? item.code.toString() == - widget.selectedValue.code.toString() : item.id.toString() == - widget.selectedValue.id.toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) + title: AppText( + '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + + (widget.isICD ? '/${item.code}' : ''), + + ), + groupValue: widget.isICD + ? widget.selectedValue.code.toString() + : widget.selectedValue.id.toString(), + value: widget.isICD + ? widget.selectedValue.code.toString() + : item.id.toString(), + activeColor: Colors.blue.shade700, + selected: widget.isICD + ? item.code.toString() == + widget.selectedValue.code.toString() + : item.id.toString() == + widget.selectedValue.id.toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) .toList() ], ), From 0780cafcca6c243dfc59b27db481898b8b17ca9e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 28 Jul 2021 14:14:17 +0300 Subject: [PATCH 10/29] fixes issues in small devices --- .../assessment/update_assessment_page.dart | 19 +-- .../objective/update_objective_page.dart | 118 +++++++++--------- .../soap_update/plan/update_plan_page.dart | 4 + .../shared_soap_widgets/SOAP_step_header.dart | 6 +- .../bottom_sheet_dialog_button.dart | 12 +- .../bottom_sheet_title.dart | 4 +- .../expandable_SOAP_widget.dart | 2 +- .../steper/steps_widget.dart | 38 +++--- .../profile/patient-profile-app-bar.dart | 2 +- 9 files changed, 110 insertions(+), 95 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index a3c688a4..c4ee046e 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -524,14 +524,17 @@ class _UpdateAssessmentPageState extends State { padding: 10, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - if (mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase.of(context) - .assessmentErrorMsg); - } else { - widget.changeLoadingState(true); - widget.changePageViewIndex(3); - } + + // TODO Elham* + widget.changePageViewIndex(3); + // if (mySelectedAssessmentList.isEmpty) { + // Helpers.showErrorToast( + // TranslationBase.of(context) + // .assessmentErrorMsg); + // } else { + // widget.changeLoadingState(true); + // widget.changePageViewIndex(3); + // } }, ), ), 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 0ecda333..32932d7d 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 @@ -104,11 +104,14 @@ class _UpdateObjectivePageState extends State { isShowAppBar: false, backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( + physics: ScrollPhysics(), child: Center( child: FractionallySizedBox( widthFactor: 0.9, child: Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ SOAPStepHeader( currentIndex: widget.currentIndex, @@ -269,63 +272,66 @@ class _UpdateObjectivePageState extends State { } submitUpdateObjectivePage(SOAPViewModel model) async { - if (mySelectedExamination.isNotEmpty) { - widget.changeLoadingState(true); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); - mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; - - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); - }); - - if (model.patientPhysicalExamList.isEmpty) { - await model.postPhysicalExam(postPhysicalExamRequestModel); - } else { - await model.patchPhysicalExam(postPhysicalExamRequestModel); - } + // TODO Elham* + widget.changePageViewIndex(2); - if (model.state == ViewState.ErrorLocal) { - widget.changeLoadingState(false); - Helpers.showErrorToast(model.error); - } else { - widget.changeLoadingState(true); - widget.changePageViewIndex(2); - } - } else { - Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); - } + // if (mySelectedExamination.isNotEmpty) { + // widget.changeLoadingState(true); + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // + // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + // PostPhysicalExamRequestModel postPhysicalExamRequestModel = + // new PostPhysicalExamRequestModel(); + // mySelectedExamination.forEach((exam) { + // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + // null) + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = + // []; + // + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM + // .add(ListHisProgNotePhysicalExaminationVM( + // patientMRN: widget.patientInfo.patientMRN, + // episodeId: widget.patientInfo.episodeNo, + // appointmentNo: widget.patientInfo.appointmentNo, + // remarks: exam.remark ?? '', + // createdBy: exam.createdBy ?? doctorProfile.doctorID, + // createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), + // editedBy: doctorProfile.doctorID, + // editedOn: DateTime.now().toIso8601String(), + // examId: exam.selectedExamination.id, + // examType: exam.selectedExamination.typeId, + // isAbnormal: exam.isAbnormal, + // isNormal: exam.isNormal, + // notExamined: exam.notExamined, + // examinationType: exam.isNormal + // ? 1 + // : exam.isAbnormal + // ? 2 + // : 3, + // examinationTypeName: exam.isNormal + // ? "Normal" + // : exam.isAbnormal + // ? 'AbNormal' + // : "Not Examined", + // isNew: exam.isNew)); + // }); + // + // if (model.patientPhysicalExamList.isEmpty) { + // await model.postPhysicalExam(postPhysicalExamRequestModel); + // } else { + // await model.patchPhysicalExam(postPhysicalExamRequestModel); + // } + // + // if (model.state == ViewState.ErrorLocal) { + // widget.changeLoadingState(false); + // Helpers.showErrorToast(model.error); + // } else { + // widget.changeLoadingState(true); + // widget.changePageViewIndex(2); + // } + // } else { + // Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); + // } } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index ce86f33d..a39b7472 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -312,6 +312,10 @@ class _UpdatePlanPageState extends State { ), isExpanded: isProgressExpanded, ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), + ), ], ), ), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index 7d255c37..deddc4a1 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -19,17 +19,17 @@ class SOAPStepHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 15,), + SizedBox(height: SizeConfig.isHeightVeryShort?30: 15,), AppText( TranslationBase.of(context).createNew, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 3: 4), fontWeight: FontWeight.w700, letterSpacing:-0.72, color: Color(0xFF2E303A), ), AppText(TranslationBase.of(context).episode, - fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * 8, + fontSize:SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge? 6: 8), fontWeight: FontWeight.bold, letterSpacing:-1.44, color: Color(0xFF2E303A), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart index 30937ab4..835dd225 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart @@ -7,8 +7,9 @@ class BottomSheetDialogButton extends StatelessWidget { final Function onTap; final String label; - const BottomSheetDialogButton({Key key, this.onTap, this.label}) - : super(key: key); + double headerHeight = SizeConfig.heightMultiplier * 12; + + BottomSheetDialogButton({Key key, this.onTap, this.label}) : super(key: key); @override Widget build(BuildContext context) { @@ -20,14 +21,13 @@ class BottomSheetDialogButton extends StatelessWidget { ), border: Border.all(color: HexColor('#EFEFEF'), width: 1), ), - height: SizeConfig.heightMultiplier * 12, + height: headerHeight, width: double.infinity, child: Column( children: [ - SizedBox( - height: 10, - ), Container( + margin: EdgeInsets.only( + top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2)), child: FractionallySizedBox( widthFactor: .80, child: Center( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart index 98a457e0..d6c19372 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart @@ -8,7 +8,7 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { }) : super(key: key); final String title; - double headerHeight = SizeConfig.getTextMultiplierBasedOnWidth()*35; + double headerHeight = SizeConfig.heightMultiplier*15; @override Widget build(BuildContext context) { return Container( @@ -63,5 +63,5 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget { } @override - Size get preferredSize => Size(double.maxFinite,115); + Size get preferredSize => Size(double.maxFinite,headerHeight); } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart index 732df855..c1b2d443 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/expandable_SOAP_widget.dart @@ -42,7 +42,7 @@ class ExpandableSOAPWidget extends StatelessWidget { children: [ AppText(headerTitle, variant: isExpanded ? "bodyText" : '', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: 5), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isHeightVeryShort?4.8: SizeConfig.isWidthLarge?4: 5), letterSpacing:-0.64, fontWeight: FontWeight.w700, color: Color(0xFF2E303A),), diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index e1f740bc..88ca392b 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -18,13 +18,15 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - double containerHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); + double circleHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); double circleTop = (SizeConfig.isHeightVeryShort ?12:SizeConfig.isHeightShort?10:10); + double containerHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?16:15); + return !projectViewModel.isArabic ? Stack( children: [ Container( - height: height == 0 ? 100 : height, + height: height == 0 ? containerHeight : height, width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, ), @@ -53,8 +55,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -103,8 +105,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: containerHeight, - height: containerHeight, + width: circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -157,8 +159,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -206,8 +208,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -280,8 +282,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -329,8 +331,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -378,8 +380,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -429,8 +431,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width:containerHeight, - height: containerHeight, + width:circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 0b94ec23..1486edc5 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -552,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?150:SizeConfig.isHeightShort?180: 170 + ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?137:SizeConfig.isHeightShort?180: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge?25:20) : height); } From b341bd5f4792ac4dbc174d01f4c02dd6f4b4a886 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 1 Aug 2021 09:29:37 +0300 Subject: [PATCH 11/29] fixes issues in small devices --- .../soap_update/objective/add_examination_widget.dart | 2 +- lib/screens/patients/profile/soap_update/soap_utils.dart | 8 ++++---- .../soap_update/subjective/allergies/allergies_item.dart | 2 +- .../soap_update/subjective/update_subjective_page.dart | 1 + lib/widgets/shared/dialogs/master_key_dailog.dart | 4 ++-- lib/widgets/shared/master_key_checkbox_search_widget.dart | 2 +- lib/widgets/shared/text_fields/app-textfield-custom.dart | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index ae6342c4..c9202e52 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -86,7 +86,7 @@ class _AddExaminationWidgetState extends State { : widget.item.nameEn, color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.8, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isWidthLarge?3:3.8), letterSpacing: -0.56, ), ), diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 455b5439..6c5d4f02 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_histor class SoapUtils { static MySelectedHistory generateMySelectedHistory( - {history, isChecked, remark, isLocal = true}) { + {history, isChecked = false, remark, isLocal = true}) { MySelectedHistory mySelectedHistory = MySelectedHistory( selectedHistory: history, isChecked: isChecked, @@ -17,11 +17,11 @@ class SoapUtils { static MySelectedAllergy generateMySelectedAllergy( {allergy, allergySeverity, - isChecked, + isChecked = false, remark, isLocal = true, int createdBy, - bool isExpanded}) { + bool isExpanded = false}) { MySelectedAllergy mySelectedAllergy = MySelectedAllergy( selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, @@ -36,7 +36,7 @@ class SoapUtils { static MySelectedExamination generateMySelectedExamination( {examination, allergySeverity, - isChecked, + isChecked = false, remark, isLocal = true, isNormal, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart index 579d8153..130e730d 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart @@ -84,7 +84,7 @@ class _AddAllergiesItemState extends State { : widget.item.nameEn : widget.item.nameEn, color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.8, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3:3.8), letterSpacing: -0.56, ), width: MediaQuery.of(context).size.width * 0.55, 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 b1441ce4..73adb0a3 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 @@ -371,6 +371,7 @@ class _UpdateSubjectivePageState extends State { {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { + if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState.save(); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 7beb3ca6..7c12b54a 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -42,12 +42,12 @@ class _MasterKeyDailogState extends State { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( - child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,), + child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), onPressed: () { Navigator.of(context).pop(); }); Widget continueButton = FlatButton( - child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 5,), + child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), onPressed: () { this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 8e383ab9..c61913a4 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -135,7 +135,7 @@ class _MasterKeyCheckboxSearchWidgetState : historyInfo.nameEn, color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*3.8, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*(SizeConfig.isWidthLarge?3:3.8), letterSpacing: -0.56, ), ), diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index bbd010cd..91b50400 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -122,7 +122,7 @@ class _AppTextFieldCustomState extends State { widget.hintText, color: Color(0xFF2E303A), fontSize: widget.isPrscription == false - ? SizeConfig.textMultiplier * 1.3 + ? SizeConfig.getHeightMultiplier() * (SizeConfig.isWidthLarge?1.1: 1.3) : 0, fontWeight: FontWeight.w700, ), From e58ce34aa4219f765362a4282a386f65462769a7 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 1 Aug 2021 14:26:59 +0300 Subject: [PATCH 12/29] move bottom sheet to index page --- lib/core/viewModel/SOAP_view_model.dart | 44 + lib/locator.dart | 2 +- .../assessment/add_assessment_details.dart | 26 + .../assessment/assessmentCallBack.dart | 3 + .../assessment/update_assessment_page.dart | 29 +- .../objective/objectiveCallBack.dart | 3 + .../objective/update_objective_page.dart | 75 +- .../soap_update/plan/planCallBack.dart | 3 + .../soap_update/plan/update_plan_page.dart | 108 +-- .../subjective/medication/add_medication.dart | 793 ++++++++++-------- .../subjective/subjectiveCallBack.dart | 3 + .../subjective/update_subjective_page.dart | 154 ++-- .../soap_update/update_soap_index.dart | 301 +++++-- .../profile/patient-profile-app-bar.dart | 2 +- 14 files changed, 865 insertions(+), 681 deletions(-) create mode 100644 lib/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart create mode 100644 lib/screens/patients/profile/soap_update/objective/objectiveCallBack.dart create mode 100644 lib/screens/patients/profile/soap_update/plan/planCallBack.dart create mode 100644 lib/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index eaa91131..e9c59d90 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -27,6 +27,10 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objectiveCallBack.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/planCallBack.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart'; import 'package:flutter/material.dart'; import '../../locator.dart'; @@ -86,6 +90,9 @@ class SOAPViewModel extends BaseViewModel { _SOAPService.patientAssessmentList; int get episodeID => _SOAPService.episodeID; + bool isAddProgress = true; + String progressNoteText =""; + get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; get medicationRouteList => _SOAPService.medicationRouteListWithModel; @@ -93,6 +100,43 @@ class SOAPViewModel extends BaseViewModel { List get allMedicationList => _prescriptionService.allMedicationList; + SubjectiveCallBack subjectiveCallBack; + setSubjectiveCallBack(SubjectiveCallBack callBack) + { + this.subjectiveCallBack = callBack; + } + nextOnSubjectPage(model){ + subjectiveCallBack.nextFunction(model); + } + + ObjectiveCallBack objectiveCallBack; + setObjectiveCallBack(ObjectiveCallBack callBack) + { + this.objectiveCallBack = callBack; + } + nextOnObjectivePage(model){ + objectiveCallBack.nextFunction(model); + } + + + AssessmentCallBack assessmentCallBack; + setAssessmentCallBack(AssessmentCallBack callBack) + { + this.assessmentCallBack = callBack; + } + nextOnAssessmentPage(model){ + assessmentCallBack.nextFunction(model); + } + + PlanCallBack planCallBack; + setPlanCallBack(PlanCallBack callBack) + { + this.planCallBack = callBack; + } + nextOnPlanPage(model){ + planCallBack.nextFunction(model); + } + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); diff --git a/lib/locator.dart b/lib/locator.dart index aa259758..3ee2650c 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -109,7 +109,7 @@ void setupLocator() { locator.registerFactory(() => PatientViewModel()); locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => SickLeaveViewModel()); - locator.registerFactory(() => SOAPViewModel()); + locator.registerLazySingleton(() => SOAPViewModel()); locator.registerFactory(() => PatientReferralViewModel()); locator.registerFactory(() => PrescriptionViewModel()); locator.registerFactory(() => ProcedureViewModel()); diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 2ac051b1..ed2a2d74 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -251,6 +251,32 @@ class _AddAssessmentDetailsState extends State { )), )), ), + + if(widget.mySelectedAssessment + .selectedICD != null) + Column( + children: [ + SizedBox( + height: 3, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.7, + child: AppText( + widget.mySelectedAssessment + .selectedICD.description + + (' (${widget.mySelectedAssessment + .selectedICD.code} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + ], + ), SizedBox( height: 7, ), diff --git a/lib/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart b/lib/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart new file mode 100644 index 00000000..331b2d15 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart @@ -0,0 +1,3 @@ +abstract class AssessmentCallBack{ + nextFunction(model); +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index c4ee046e..4941b0ed 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -25,6 +25,7 @@ import '../shared_soap_widgets/SOAP_open_items.dart'; import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import 'add_assessment_details.dart'; +import 'assessmentCallBack.dart'; // ignore: must_be_immutable class UpdateAssessmentPage extends StatefulWidget { @@ -44,7 +45,7 @@ class UpdateAssessmentPage extends StatefulWidget { _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); } -class _UpdateAssessmentPageState extends State { +class _UpdateAssessmentPageState extends State implements AssessmentCallBack{ bool isAssessmentExpand = false; List mySelectedAssessmentList = List(); @@ -54,6 +55,7 @@ class _UpdateAssessmentPageState extends State { return BaseView( onModelReady: (model) async { + model.setAssessmentCallBack(this); mySelectedAssessmentList.clear(); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -525,16 +527,7 @@ class _UpdateAssessmentPageState extends State { disabled: model.state == ViewState.BusyLocal, onPressed: () async { - // TODO Elham* - widget.changePageViewIndex(3); - // if (mySelectedAssessmentList.isEmpty) { - // Helpers.showErrorToast( - // TranslationBase.of(context) - // .assessmentErrorMsg); - // } else { - // widget.changeLoadingState(true); - // widget.changePageViewIndex(3); - // } + }, ), ), @@ -577,4 +570,18 @@ class _UpdateAssessmentPageState extends State { }); }); } + + @override + nextFunction(model) { + // TODO Elham* + widget.changePageViewIndex(3); + // if (mySelectedAssessmentList.isEmpty) { + // Helpers.showErrorToast( + // TranslationBase.of(context) + // .assessmentErrorMsg); + // } else { + // widget.changeLoadingState(true); + // widget.changePageViewIndex(3); + // } + } } diff --git a/lib/screens/patients/profile/soap_update/objective/objectiveCallBack.dart b/lib/screens/patients/profile/soap_update/objective/objectiveCallBack.dart new file mode 100644 index 00000000..466f344e --- /dev/null +++ b/lib/screens/patients/profile/soap_update/objective/objectiveCallBack.dart @@ -0,0 +1,3 @@ +abstract class ObjectiveCallBack{ + nextFunction(model); +} \ No newline at end of file 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 32932d7d..db0484da 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 @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model. import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objectiveCallBack.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -43,7 +44,7 @@ class UpdateObjectivePage extends StatefulWidget { _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); } -class _UpdateObjectivePageState extends State { +class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; List mySelectedExamination = List(); @@ -64,6 +65,7 @@ class _UpdateObjectivePageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { + model.setObjectiveCallBack(this); mySelectedExamination.clear(); GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( @@ -71,7 +73,6 @@ class _UpdateObjectivePageState extends State { episodeID: widget.patientInfo.episodeNo.toString(), appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); - await model.getPatientPhysicalExam(getPhysicalExamReqModel); if (model.patientPhysicalExamList.isNotEmpty) { if (model.physicalExaminationList.length == 0) { @@ -204,70 +205,7 @@ class _UpdateObjectivePageState extends State { ), ), ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 10), - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ), - ), - SizedBox( - width: 5, - ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, - ), - ), - ], - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - )), + ), ); } @@ -397,4 +335,9 @@ class _UpdateObjectivePageState extends State { ), ); } + + @override + nextFunction(model) async { + await submitUpdateObjectivePage(model); + } } diff --git a/lib/screens/patients/profile/soap_update/plan/planCallBack.dart b/lib/screens/patients/profile/soap_update/plan/planCallBack.dart new file mode 100644 index 00000000..14fef483 --- /dev/null +++ b/lib/screens/patients/profile/soap_update/plan/planCallBack.dart @@ -0,0 +1,3 @@ +abstract class PlanCallBack{ + nextFunction(model); +} \ No newline at end of file diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index a39b7472..b40b0a29 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; @@ -9,6 +10,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model. import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/planCallBack.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -40,7 +42,7 @@ class UpdatePlanPage extends StatefulWidget { _UpdatePlanPageState createState() => _UpdatePlanPageState(); } -class _UpdatePlanPageState extends State { +class _UpdatePlanPageState extends State implements PlanCallBack { bool isAddProgress = true; bool isProgressExpanded = true; GetPatientProgressNoteResModel patientProgressNote = @@ -73,7 +75,7 @@ class _UpdatePlanPageState extends State { } - getPatientProgressNote(model, {bool isAddProgress = false}) async { + getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( appointmentNo: @@ -83,11 +85,12 @@ class _UpdatePlanPageState extends State { editedBy: '', doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); - + ///TODO set progressNote in model; if (model.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( model.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; + patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = @@ -100,6 +103,7 @@ class _UpdatePlanPageState extends State { model.patientProgressNoteList[0].appointmentNo; setState(() { isAddProgress = isAddProgress; + model.isAddProgress = isAddProgress; }); } } @@ -108,6 +112,7 @@ class _UpdatePlanPageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { + model.setPlanCallBack(this); GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( appointmentNo: @@ -135,6 +140,7 @@ class _UpdatePlanPageState extends State { setState(() { isAddProgress = false; + model.isAddProgress = false; }); } widget.changeLoadingState(false); @@ -320,84 +326,7 @@ class _UpdatePlanPageState extends State { ), ), ), - ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 10), - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(2); - }, - ), - ), - SizedBox( - width: 5, - ), - Expanded( - child: AppButton( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, - title: isAddProgress - ? TranslationBase.of(context).next - : TranslationBase.of(context).finish, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: progressNoteController.text.isEmpty, - onPressed: () async { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - Helpers.showErrorToast( - TranslationBase.of(context) - .progressNoteErrorMsg); - } - }, - ), - ), - ], - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - )), + ),) ); } @@ -452,6 +381,7 @@ class _UpdatePlanPageState extends State { setState(() { isAddProgress = false; + model.isAddProgress = false; }); } } @@ -460,4 +390,20 @@ class _UpdatePlanPageState extends State { Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } + + @override + nextFunction(model) { + print("dfdfdf"); + if (progressNoteController.text.isNotEmpty) { + if (isAddProgress) { + submitPlan(model); + } else { + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast( + TranslationBase.of(context) + .progressNoteErrorMsg); + } + } } diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index d5addf88..67c1df55 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -49,7 +49,7 @@ class _AddMedicationState extends State { GetMedicationResponseModel _selectedMedication; GlobalKey key = - new GlobalKey>(); + new GlobalKey>(); bool isFormSubmitted = false; @override @@ -57,387 +57,440 @@ class _AddMedicationState extends State { ProjectViewModel projectViewModel = Provider.of(context); return FractionallySizedBox( child: BaseView( - onModelReady: (model) async { - if (model.medicationStrengthList.length == 0) { - await model.getMasterLookup( - MasterKeysService.MedicationStrength, - ); - } - if (model.medicationFrequencyList.length == 0) { - await model.getMasterLookup(MasterKeysService.MedicationFrequency); - } - if (model.medicationDoseTimeList.length == 0) { - await model.getMasterLookup(MasterKeysService.MedicationDoseTime); - } - if (model.medicationRouteList.length == 0) { - await model.getMasterLookup(MasterKeysService.MedicationRoute); - } - if (model.allMedicationList.length == 0) - await model.getMedicationList(); - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addMedication, - ), - body: Center( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( + onModelReady: (model) async { + if (model.medicationStrengthList.length == 0) { + await model.getMasterLookup( + MasterKeysService.MedicationStrength, + ); + } + if (model.medicationFrequencyList.length == 0) { + await model.getMasterLookup( + MasterKeysService.MedicationFrequency); + } + if (model.medicationDoseTimeList.length == 0) { + await model.getMasterLookup(MasterKeysService.MedicationDoseTime); + } + if (model.medicationRouteList.length == 0) { + await model.getMasterLookup(MasterKeysService.MedicationRoute); + } + if (model.allMedicationList.length == 0) + await model.getMedicationList(); + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase + .of(context) + .addMedication, + ), + body: Center( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( height: 10, ), Expanded( child: FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Column( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( children: [ - SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?2:SizeConfig.isHeightShort?2:2), - ), - Container( - // height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - _selectedMedication == null, - child: AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .searchMedicineNameHere, - null, - true, - suffixIcon: - Icons.search), - itemSubmitted: (item) => - setState(() => - _selectedMedication = - item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: AppText(suggestion - .description + - '/' + - suggestion - .genericName), - padding: - EdgeInsets.all( - 8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, - input) => - suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input - .toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith(input - .toLowerCase()), - ), - ) - : AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - hintText: _selectedMedication != - null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of( - context) - .searchMedicineNameHere, - minLines: 1, - maxLines: 1, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - enabled: false, - onClick: model.medicationDoseTimeList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model - .medicationDoseTimeList, - okText: - TranslationBase.of(context) - .ok, - selectedValue: - _selectedMedicationDose, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; + SizedBox( + height: SizeConfig.heightMultiplier * ( + SizeConfig.isHeightVeryShort ?2:SizeConfig.isHeightShort? + 2:2), + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && + _selectedMedication == null, + child: AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( + TranslationBase + .of( + context) + .searchMedicineNameHere, + null, + true, + suffixIcon: + Icons.search), + itemSubmitted: (item) => + setState(() => + _selectedMedication = + item), + key: key, + suggestions: + model.allMedicationList, + itemBuilder: (context, + suggestion) => + new Padding( + child: AppText(suggestion + .description + + '/' + + suggestion + .genericName), + padding: + EdgeInsets.all( + 8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, + input) => + suggestion.genericName.toLowerCase() + .startsWith(input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith(input + .toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith(input + .toLowerCase()), + ), + ) + : AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + hintText: _selectedMedication != + null + ? _selectedMedication + .description + + (' (${_selectedMedication.genericName} )') + : TranslationBase + .of( + context) + .searchMedicineNameHere, + minLines: 1, + maxLines: 1, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + enabled: false, + ), + ), + ), - doseController - .text = projectViewModel - .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).doseTime, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && - _selectedMedicationDose == null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model - .medicationStrengthList, - okText: - TranslationBase.of(context) - .ok, - selectedValue: - _selectedMedicationStrength, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; + if(_selectedMedication != null) + Column( + children: [ + SizedBox( + height: 3, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.7, + child: AppText( + _selectedMedication.description + + (' (${_selectedMedication.genericName} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + ], + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + onClick: model.medicationDoseTimeList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationDoseTimeList, + okText: + TranslationBase + .of(context) + .ok, + selectedValue: + _selectedMedicationDose, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = + selectedValue; - strengthController - .text = projectViewModel - .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).strength, - maxLines: 1, - minLines: 1, - controller: strengthController, - validationError: isFormSubmitted && - _selectedMedicationStrength == - null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationRouteList, - selectedValue: - _selectedMedicationRoute, - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + doseController + .text = projectViewModel + .isArabic + ? _selectedMedicationDose + .nameAr + : _selectedMedicationDose + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase + .of(context) + .doseTime, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && + _selectedMedicationDose == null + ? TranslationBase + .of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationStrengthList, + okText: + TranslationBase + .of(context) + .ok, + selectedValue: + _selectedMedicationStrength, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = + selectedValue; - routeController - .text = projectViewModel - .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).route, - maxLines: 1, - minLines: 1, - controller: routeController, - validationError: isFormSubmitted && - _selectedMedicationRoute == null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Helpers.getTextFieldHeight(), - onClick: model.medicationFrequencyList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model - .medicationFrequencyList, - okText: - TranslationBase.of(context) - .ok, - selectedValue: - _selectedMedicationFrequency, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + strengthController + .text = projectViewModel + .isArabic + ? _selectedMedicationStrength + .nameAr + : _selectedMedicationStrength + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase + .of(context) + .strength, + maxLines: 1, + minLines: 1, + controller: strengthController, + validationError: isFormSubmitted && + _selectedMedicationStrength == + null + ? TranslationBase + .of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model.medicationRouteList, + selectedValue: + _selectedMedicationRoute, + okText: + TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; - frequencyController - .text = projectViewModel - .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).frequency, - enabled: false, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && - _selectedMedicationFrequency == - null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ?20:SizeConfig.isHeightShort?15:10), - ), + routeController + .text = projectViewModel + .isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase + .of(context) + .route, + maxLines: 1, + minLines: 1, + controller: routeController, + validationError: isFormSubmitted && + _selectedMedicationRoute == null + ? TranslationBase + .of(context) + .emptyMessage + : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Helpers.getTextFieldHeight(), + onClick: model.medicationFrequencyList != + null + ? () { + MasterKeyDailog dialog = + MasterKeyDailog( + list: model + .medicationFrequencyList, + okText: + TranslationBase + .of(context) + .ok, + selectedValue: + _selectedMedicationFrequency, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = + selectedValue; - ], - ), - )), + frequencyController + .text = projectViewModel + .isArabic + ? _selectedMedicationFrequency + .nameAr + : _selectedMedicationFrequency + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: + TranslationBase + .of(context) + .frequency, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && + _selectedMedicationFrequency == + null + ? TranslationBase + .of(context) + .emptyMessage + : null, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : SizeConfig + .isHeightShort ? 15 : 10), + ), + + ], ), - ]), + )), ), - ), - bottomSheet: model.state != ViewState.Idle - ? Container( - height: 0, - ) - : BottomSheetDialogButton( - label: - TranslationBase.of(context).addMedication, - onTap: () { - setState(() { - isFormSubmitted = true; - }); - if (_selectedMedication != null && - _selectedMedicationDose != null && - _selectedMedicationStrength != null && - _selectedMedicationRoute != null && - _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + - '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; - Navigator.of(context).pop(); - } - }, - )), - ), + ]), + ), + ), + bottomSheet: model.state != ViewState.Idle + ? Container( + height: 0, + ) + : BottomSheetDialogButton( + label: + TranslationBase.of(context).addMedication, + onTap: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedMedication != null && + _selectedMedicationDose != null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = widget + .medicationController.text + + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; + Navigator.of(context).pop(); + } + }, + ) + ) + , + ) + , ); } } diff --git a/lib/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart b/lib/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart new file mode 100644 index 00000000..e8d0e11f --- /dev/null +++ b/lib/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart @@ -0,0 +1,3 @@ +abstract class SubjectiveCallBack{ + Function nextFunction(model); +} \ No newline at end of file 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 73adb0a3..db3ab7c8 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 @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -46,7 +47,8 @@ class UpdateSubjectivePage extends StatefulWidget { _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); } -class _UpdateSubjectivePageState extends State { +class _UpdateSubjectivePageState extends State + implements SubjectiveCallBack { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; @@ -208,7 +210,7 @@ class _UpdateSubjectivePageState extends State { onModelReady: (model) async { myAllergiesList.clear(); myHistoryList.clear(); - + model.setSubjectiveCallBack(this); GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -270,7 +272,7 @@ class _UpdateSubjectivePageState extends State { ), SizedBox( height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 4 : 2), + (SizeConfig.isHeightVeryShort ? 4 : 2), ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).histories, @@ -312,57 +314,14 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), ), ), ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 10), - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, - color: Colors.red[700], - onPressed: () async { - addSubjectiveInfo( - model: model, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList); - }, - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - ), ), ); } @@ -371,7 +330,6 @@ class _UpdateSubjectivePageState extends State { {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { - if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState.save(); @@ -380,50 +338,54 @@ class _UpdateSubjectivePageState extends State { complaintsControllerError = ''; medicationControllerError = ''; illnessControllerError = ''; - if (complaintsController.text.isNotEmpty && - illnessController.text.isNotEmpty && - complaintsController.text.length > 25) { - await postChiefComplaint(model: model); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } - if (myHistoryList.length != 0) { - await postHistories(model: model, myHistoryList: myHistoryList); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } - } - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); - } - } - widget.changeLoadingState(true); - - widget.changePageViewIndex(1); - } else { - setState(() { - if (complaintsController.text.isEmpty) { - complaintsControllerError = TranslationBase.of(context).emptyMessage; - } else if (complaintsController.text.length < 25) { - complaintsControllerError = - TranslationBase.of(context).chiefComplaintLength; - } - - if (illnessController.text.isEmpty) { - illnessControllerError = TranslationBase.of(context).emptyMessage; - } - if (medicationController.text.isEmpty) { - medicationControllerError = TranslationBase.of(context).emptyMessage; - } - }); - - widget.changeLoadingState(false); - Helpers.showErrorToast( - TranslationBase.of(context).chiefComplaintErrorMsg); - } + ///TODO Elham* + /// + widget.changePageViewIndex(1); + // if (complaintsController.text.isNotEmpty && + // illnessController.text.isNotEmpty && + // complaintsController.text.length > 25) { + // await postChiefComplaint(model: model); + // if (model.state == ViewState.ErrorLocal) { + // Helpers.showErrorToast(model.error); + // } + // if (myHistoryList.length != 0) { + // await postHistories(model: model, myHistoryList: myHistoryList); + // if (model.state == ViewState.ErrorLocal) { + // Helpers.showErrorToast(model.error); + // } + // } + // if (myAllergiesList.length != 0) { + // await postAllergy(myAllergiesList: myAllergiesList, model: model); + // if (model.state == ViewState.ErrorLocal) { + // Helpers.showErrorToast(model.error); + // } + // } + // widget.changeLoadingState(true); + // + // widget.changePageViewIndex(1); + // } else { + // setState(() { + // if (complaintsController.text.isEmpty) { + // complaintsControllerError = TranslationBase.of(context).emptyMessage; + // } else if (complaintsController.text.length < 25) { + // complaintsControllerError = + // TranslationBase.of(context).chiefComplaintLength; + // } + // + // if (illnessController.text.isEmpty) { + // illnessControllerError = TranslationBase.of(context).emptyMessage; + // } + // + // if (medicationController.text.isEmpty) { + // medicationControllerError = TranslationBase.of(context).emptyMessage; + // } + // }); + // + // widget.changeLoadingState(false); + // Helpers.showErrorToast( + // TranslationBase.of(context).chiefComplaintErrorMsg); + // } } postAllergy( @@ -528,4 +490,12 @@ class _UpdateSubjectivePageState extends State { } } } + + @override + Function nextFunction(model) { + addSubjectiveInfo( + model: model, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList); + } } diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index 792a3f20..7265e90e 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -1,3 +1,6 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_allergy.dart'; @@ -6,10 +9,13 @@ import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_histor import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/update_subjective_page.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'assessment/update_assessment_page.dart'; import 'objective/update_objective_page.dart'; @@ -31,10 +37,8 @@ class _UpdateSoapIndexState extends State List myAllergiesList = List(); List myHistoryList = List(); - - changePageViewIndex(pageIndex,{isChangeState = true}) { - if (pageIndex != _currentIndex && isChangeState) - changeLoadingState(true); + changePageViewIndex(pageIndex, {isChangeState = true}) { + if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true); _controller.jumpToPage(pageIndex); setState(() { _currentIndex = pageIndex; @@ -60,65 +64,244 @@ class _UpdateSoapIndexState extends State Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - return AppScaffold( - isLoading: _isLoading, - isShowAppBar: true, - appBar: PatientProfileAppBar(patient), - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - boxShadow: [], - color: Theme.of(context).scaffoldBackgroundColor), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - Container( - color: Theme.of(context).scaffoldBackgroundColor, - height: MediaQuery.of(context).size.height * 0.73, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState) - ], - ), - ) - ], + return BaseView( + builder: (_,model,w)=>AppScaffold( + isLoading: _isLoading, + isShowAppBar: true, + appBar: PatientProfileAppBar(patient), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: Theme.of(context).scaffoldBackgroundColor, + height: MediaQuery.of(context).size.height * 0.73, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState) + ], + ), + ) + ], + ), ), + ], + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), ), - ], + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 12 : 10), + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: getBottomSheet(model) + ), + ), + SizedBox( + height: 5, + ), + ], + ), ), + ), ); } + + Widget getBottomSheet(SOAPViewModel model) { + switch (_currentIndex) { + case 0: + { + return Center( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + color: Colors.red[700], + onPressed: () async { + model.nextOnSubjectPage(model); + }, + ), + ); + } + break; + case 1: + { + return Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + changePageViewIndex(0); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await model.nextOnObjectivePage(model); + }, + ), + ), + ], + ), + ); + } + break; + case 2: + { + return Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + changePageViewIndex(1); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + model.nextOnAssessmentPage(model); + }, + ), + ), + ], + ), + ); + } + break; + case 3: + { + return Center( + child: Row( + children: [ + Expanded( + child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + changePageViewIndex(2); + }, + ), + ), + SizedBox( + width: 5, + ), + Expanded( + child: AppButton( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 8 : 6), + padding: 10, + title: model.isAddProgress + ? TranslationBase.of(context).next + : TranslationBase.of(context).finish, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.progressNoteText.isEmpty, + onPressed: () async { + model.nextOnPlanPage(model); + }, + ), + ), + ], + ), + ); + } + break; + } + } } diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 1486edc5..9916ae3e 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -552,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? (isFromLabResult?200:170) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?137:SizeConfig.isHeightShort?180: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge?25:20) + ? isInpatient ? (isFromLabResult?200:190) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?137:SizeConfig.isHeightShort?190: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge?25:20) : height); } From 36786a3079b0cec1b0d2a3c8c8d51680eb906680 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 1 Aug 2021 15:02:17 +0300 Subject: [PATCH 13/29] chinging chief complaint in the soap --- lib/config/config.dart | 251 +++++-------- .../GetChiefComplaintReqModel.dart | 10 +- lib/models/SOAP/GetPhysicalExamReqModel.dart | 1 + .../post_chief_complaint_request_model.dart | 9 +- .../objective/update_objective_page.dart | 330 ++++++++---------- .../subjective/update_subjective_page.dart | 270 ++++++-------- pubspec.lock | 8 +- 7 files changed, 360 insertions(+), 519 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index ec8efe26..959816f5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -8,280 +8,199 @@ const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -const PATIENT_PROGRESS_NOTE_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_INSURANCE_APPROVALS_URL = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_ORDERS_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_REFER_TO_DOCTOR_URL = - "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = - "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = - "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = - 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = - "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = - "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_ORDERS_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = - 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = - 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = - 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; -const GET_LIVECARE_PENDINGLIST = - 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVECARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = - 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = - 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = - 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = - 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = - 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = - 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = - 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = - 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = - 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = - 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = - 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = - 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; + +const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_ARRIVAL_LIST = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; -const GET_PATIENT_IN_PATIENT_LIST = - 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = - 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; -const GET_MASTER_LOOKUP_LIST = - 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = - '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = - 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const GET_LIST_CATEGORISE = - 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; +const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_CATEGORISE_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = - 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = - 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = - 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = - 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = - 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = - 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = - 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = - 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = - 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; -const GET_PRESCRIPTION_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_INSURANCE_IN_PATIENT = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; var selectedPatientType = 1; @@ -337,7 +256,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 = 6.0; +const VERSION_ID = 6.2; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 80188dfe..8e253151 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -4,9 +4,10 @@ class GetChiefComplaintReqModel { int episodeId; int episodeID; dynamic doctorID; + int admissionNo; GetChiefComplaintReqModel( - {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); + {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -14,8 +15,8 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; - -} + admissionNo = json['AdmissionNo']; + } Map toJson() { final Map data = new Map(); @@ -24,6 +25,9 @@ class GetChiefComplaintReqModel { data['EpisodeId'] = this.episodeId; data['EpisodeID'] = this.episodeID; data['DoctorID'] = this.doctorID; + if (this.admissionNo != null) { + data['AdmissionNo'] = this.admissionNo; + } return data; } diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 5145c419..d1645feb 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -36,6 +36,7 @@ class GetPhysicalExamReqModel { data['To'] = this.to; data['DoctorID'] = this.doctorID; data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index f1e9c2b4..5f5fe721 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -2,6 +2,7 @@ class PostChiefComplaintRequestModel { int appointmentNo; int episodeID; int patientMRN; + int admissionNo; String chiefComplaint; String hopi; String currentMedication; @@ -11,7 +12,6 @@ class PostChiefComplaintRequestModel { dynamic doctorID; dynamic editedBy; - PostChiefComplaintRequestModel( {this.appointmentNo, this.episodeID, @@ -23,7 +23,8 @@ class PostChiefComplaintRequestModel { this.isLactation, this.doctorID, this.editedBy, - this.numberOfWeeks}); + this.numberOfWeeks, + this.admissionNo}); PostChiefComplaintRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; @@ -37,6 +38,7 @@ class PostChiefComplaintRequestModel { numberOfWeeks = json['numberOfWeeks']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; + admissionNo = json['AdmissionNo']; } Map toJson() { @@ -52,6 +54,9 @@ class PostChiefComplaintRequestModel { data['numberOfWeeks'] = this.numberOfWeeks; data['DoctorID'] = this.doctorID; data['EditedBy'] = this.editedBy; + if (this.admissionNo != null) { + data['AdmissionNo'] = this.admissionNo; + } return data; } 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 8fdfffc2..5d60a5b0 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 @@ -36,7 +36,8 @@ class UpdateObjectivePage extends StatefulWidget { this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, - this.changeLoadingState, this.currentIndex}); + this.changeLoadingState, + this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -45,8 +46,7 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State { bool isSysExaminationExpand = false; - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -61,98 +61,89 @@ class _UpdateObjectivePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - widget.mySelectedExamination.clear(); - GetPhysicalExamReqModel getPhysicalExamReqModel = - GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); + onModelReady: (model) async { + widget.mySelectedExamination.clear(); + GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo); - await model.getPatientPhysicalExam(getPhysicalExamReqModel); - if (model.patientPhysicalExamList.isNotEmpty) { - if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); - } - model.patientPhysicalExamList.forEach((element) { - MasterKeyModel examMaster = model.getOneMasterKey( - masterKeys: MasterKeysService.PhysicalExamination, - id: element.examId, - ); - MySelectedExamination tempEam = MySelectedExamination( - selectedExamination: examMaster, - remark: element.remarks, - isNormal: element.isNormal, - createdBy: element.createdBy, - notExamined: element.notExamined, - isNew: element.isNew, - isAbnormal: element.isAbnormal); - widget.mySelectedExamination.add(tempEam); - }); + await model.getPatientPhysicalExam(getPhysicalExamReqModel); + if (model.patientPhysicalExamList.isNotEmpty) { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup(MasterKeysService.PhysicalExamination); } + model.patientPhysicalExamList.forEach((element) { + MasterKeyModel examMaster = model.getOneMasterKey( + masterKeys: MasterKeysService.PhysicalExamination, + id: element.examId, + ); + MySelectedExamination tempEam = MySelectedExamination( + selectedExamination: examMaster, + remark: element.remarks, + isNormal: element.isNormal, + createdBy: element.createdBy, + notExamined: element.notExamined, + isNew: element.isNew, + isAbnormal: element.isAbnormal); + widget.mySelectedExamination.add(tempEam); + }); + } - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), - ExpandableSOAPWidget( - headerTitle: - TranslationBase.of(context).physicalSystemExamination, - onTap: () { - setState(() { - isSysExaminationExpand = !isSysExaminationExpand; - }); - }, - child: Column( - children: [ - SOAPOpenItems(label: "${TranslationBase.of(context).addExamination}",onTap: () { - openExaminationList(context); - },), - Column( - children: - widget.mySelectedExamination.map((examination) { - return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); - }); - }).toList(), - ) - ], - + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).physicalSystemExamination, + onTap: () { + setState(() { + isSysExaminationExpand = !isSysExaminationExpand; + }); + }, + child: Column( + children: [ + SOAPOpenItems( + label: "${TranslationBase.of(context).addExamination}", + onTap: () { + openExaminationList(context); + }, + ), + Column( + children: widget.mySelectedExamination.map((examination) { + return ExaminationItemCard(examination, () { + removeExamination(examination.selectedExamination); + }); + }).toList(), + ) + ], + ), + isExpanded: isSysExaminationExpand, ), - isExpanded: isSysExaminationExpand, - ), - SizedBox(height: MediaQuery - .of(context) - .size - .height * 0.12,) - ], + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ) + ], + ), ), ), ), - ), - bottomSheet: - Container( + bottomSheet: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(0.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0), + border: Border.all(color: HexColor('#707070'), width: 0), ), height: 80, width: double.infinity, @@ -161,50 +152,48 @@ class _UpdateObjectivePageState extends State { SizedBox( height: 10, ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ) - , - ), - SizedBox(width: 5,), - Expanded( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + widget.changePageViewIndex(0); + }, + ), + ), + SizedBox( + width: 5, ), - ), - ], + Expanded( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + ), + ], + ), ), ), - ),), + ), SizedBox( height: 5, ), ], - ),) - - - ), + ), + )), ); } @@ -213,40 +202,36 @@ class _UpdateObjectivePageState extends State { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: exam.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + notExamined: exam.notExamined, + examinationType: exam.isNormal + ? 1 + : exam.isAbnormal + ? 2 + : 3, + examinationTypeName: exam.isNormal + ? "Normal" + : exam.isAbnormal + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew)); }); if (model.patientPhysicalExamList.isEmpty) { @@ -268,10 +253,8 @@ class _UpdateObjectivePageState extends State { } removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.mySelectedExamination - .where((element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable history = widget.mySelectedExamination.where((element) => + masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) setState(() { @@ -316,11 +299,7 @@ class AddExaminationDailog extends StatefulWidget { final Function addSelectedExamination; final Function(MasterKeyModel) removeExamination; - const AddExaminationDailog( - {Key key, - this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}) + const AddExaminationDailog({Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) : super(key: key); @override @@ -335,8 +314,7 @@ class _AddExaminationDailogState extends State { child: BaseView( onModelReady: (model) async { if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); + await model.getMasterLookup(MasterKeysService.PhysicalExamination); } }, builder: (_, model, w) => AppScaffold( @@ -346,21 +324,19 @@ class _AddExaminationDailogState extends State { child: Container( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).physicalSystemExamination, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).physicalSystemExamination, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + ]), ))), )), ); 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 b0db0414..28b8a7f6 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 @@ -33,14 +33,16 @@ class UpdateSubjectivePage extends StatefulWidget { final List myAllergiesList; final List myHistoryList; final PatiantInformtion patientInfo; - final int currentIndex; + final int currentIndex; UpdateSubjectivePage( {Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList, - this.patientInfo, this.changeLoadingState, this.currentIndex}); + this.patientInfo, + this.changeLoadingState, + this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -67,7 +69,7 @@ class _UpdateSubjectivePageState extends State { doctorID: '', editedBy: ''); - await model.getPatientHistories(getHistoryReqModel,isFirst: true); + await model.getPatientHistories(getHistoryReqModel, isFirst: true); if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { @@ -84,62 +86,50 @@ class _UpdateSubjectivePageState extends State { } model.patientHistoryList.forEach((element) { - if (element.historyType == - MasterKeysService.HistoryFamily.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistoryMedical.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySports.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySurgical.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: element.isChecked, - remark: element.remarks); + MySelectedHistory mySelectedHistory = + MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks); widget.myHistoryList.add(mySelectedHistory); } @@ -157,23 +147,18 @@ class _UpdateSubjectivePageState extends State { editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); + if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity); model.patientAllergiesList.forEach((element) { MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, - typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); + id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { - selectedAllergySeverity = model.getOneMasterKey( + selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, id: element.severity, ); @@ -185,8 +170,7 @@ class _UpdateSubjectivePageState extends State { createdBy: element.createdBy, remark: element.remarks, selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) - widget.myAllergiesList.add(mySelectedAllergy); + if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); }); } } @@ -198,33 +182,31 @@ class _UpdateSubjectivePageState extends State { widget.myAllergiesList.clear(); widget.myHistoryList.clear(); - GetChiefComplaintReqModel getChiefComplaintReqModel = - GetChiefComplaintReqModel( - patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo, - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, - doctorID: ''); + GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( + admissionNo: int.parse(widget.patientInfo.admissionNo), + patientMRN: widget.patientInfo.patientMRN, + appointmentNo: widget.patientInfo.appointmentNo, + episodeId: widget.patientInfo.episodeNo, + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Helpers.parseHtmlString( - model.patientChiefComplaintList[0].chiefComplaint); + complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; + medicationController.text = !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication + '\n \n' + : model.patientChiefComplaintList[0].currentMedication; } await getHistory(model); await getAllergies(model); widget.changeLoadingState(false); - }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - backgroundColor: Theme - .of(context) - .scaffoldBackgroundColor, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -234,12 +216,9 @@ class _UpdateSubjectivePageState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - - SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex:widget.changePageViewIndex), + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context) - .chiefComplaints - , + headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { setState(() { isChiefExpand = !isChiefExpand; @@ -259,12 +238,8 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 30, ), - - ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .histories, + headerTitle: TranslationBase.of(context).histories, isRequired: false, onTap: () { setState(() { @@ -272,22 +247,15 @@ class _UpdateSubjectivePageState extends State { }); }, child: Column( - children: [ - UpdateHistoryWidget(myHistoryList: widget.myHistoryList) - ], + children: [UpdateHistoryWidget(myHistoryList: widget.myHistoryList)], ), isExpanded: isHistoryExpand, ), SizedBox( height: 30, ), - - ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .allergiesSoap - , + headerTitle: TranslationBase.of(context).allergiesSoap, isRequired: false, onTap: () { setState(() { @@ -296,8 +264,9 @@ class _UpdateSubjectivePageState extends State { }, child: Column( children: [ - UpdateAllergiesWidget(myAllergiesList: widget - .myAllergiesList,), + UpdateAllergiesWidget( + myAllergiesList: widget.myAllergiesList, + ), SizedBox( height: 30, ), @@ -306,7 +275,7 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height:MediaQuery.of(context).size.height * 0.16, + height: MediaQuery.of(context).size.height * 0.16, ), ], ), @@ -319,9 +288,7 @@ class _UpdateSubjectivePageState extends State { borderRadius: BorderRadius.all( Radius.circular(0.0), ), - border: Border.all( - color: HexColor('#707070'), - width: 0), + border: Border.all(color: HexColor('#707070'), width: 0), ), height: 80, width: double.infinity, @@ -330,38 +297,35 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - Container(child: - FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color:Colors.red[700], - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - addSubjectiveInfo( - model: model, - myAllergiesList: widget.myAllergiesList, - myHistoryList: widget.myHistoryList); - }, + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + addSubjectiveInfo( + model: model, myAllergiesList: widget.myAllergiesList, myHistoryList: widget.myHistoryList); + }, + ), ), ), - ),), + ), SizedBox( height: 5, ), ], - ),), + ), + ), ), ); } - addSubjectiveInfo({SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { + addSubjectiveInfo( + {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { formKey.currentState.save(); formKey.currentState.validate(); @@ -391,66 +355,49 @@ class _UpdateSubjectivePageState extends State { widget.changeLoadingState(true); widget.changePageViewIndex(1); - } else { setState(() { if (complaintsController.text.isEmpty) { - complaintsControllerError = TranslationBase - .of(context) - .emptyMessage; + complaintsControllerError = TranslationBase.of(context).emptyMessage; } else if (complaintsController.text.length < 25) { - complaintsControllerError = TranslationBase - .of(context) - .chiefComplaintLength; + complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; } if (illnessController.text.isEmpty) { - illnessControllerError = TranslationBase - .of(context) - .emptyMessage; + illnessControllerError = TranslationBase.of(context).emptyMessage; } if (medicationController.text.isEmpty) { - medicationControllerError = TranslationBase - .of(context) - .emptyMessage; + medicationControllerError = TranslationBase.of(context).emptyMessage; } }); - Helpers.showErrorToast(TranslationBase - .of(context) - .chiefComplaintErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); } - - } - postAllergy( - {List myAllergiesList, SOAPViewModel model}) async { - PostAllergyRequestModel postAllergyRequestModel = - new PostAllergyRequestModel(); + postAllergy({List myAllergiesList, SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); widget.myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == - null) + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( - ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: allergy.createdBy??doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - isChecked: allergy.isChecked, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -464,20 +411,17 @@ class _UpdateSubjectivePageState extends State { appointmentNo: widget.patientInfo.appointmentNo, doctorID: '', editedBy: ''); - await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); + await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy: true); if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } } - postHistories( - {List myHistoryList, SOAPViewModel model}) async { - PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(doctorID: ''); + postHistories({List myHistoryList, SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); widget.myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) - postHistoriesRequestModel.listMedicalHistoryVM = []; + if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, @@ -489,14 +433,12 @@ class _UpdateSubjectivePageState extends State { )); }); - if (model.patientHistoryList.isEmpty) { await model.postHistories(postHistoriesRequestModel); } else { await model.patchHistories(postHistoriesRequestModel); } - if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } @@ -504,20 +446,19 @@ class _UpdateSubjectivePageState extends State { postChiefComplaint({SOAPViewModel model}) async { formKey.currentState.save(); - if(formKey.currentState.validate()){ - PostChiefComplaintRequestModel postChiefComplaintRequestModel = - new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: medicationController.text, - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - doctorID: '', - - numberOfWeeks: 0); + if (formKey.currentState.validate()) { + PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( + admissionNo: int.parse(widget.patientInfo.admissionNo), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + chiefComplaint: complaintsController.text, + currentMedication: medicationController.text, + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); @@ -527,8 +468,3 @@ class _UpdateSubjectivePageState extends State { } } } - - - - - diff --git a/pubspec.lock b/pubspec.lock index ee31002d..1a572a0a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -573,7 +573,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -615,7 +615,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -907,7 +907,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1098,5 +1098,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From a502308a8a712f25ff7b0f52449b0b8b45379b88 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 1 Aug 2021 16:18:36 +0300 Subject: [PATCH 14/29] finish update on soap --- lib/core/viewModel/SOAP_view_model.dart | 18 +- .../viewModel/authentication_view_model.dart | 3 +- lib/models/SOAP/GetPhysicalExamReqModel.dart | 3 + .../post_physical_exam_request_model.dart | 186 +++++------ .../assessment/update_assessment_page.dart | 68 +---- .../objective/update_objective_page.dart | 289 +++++++++--------- .../soap_update/plan/update_plan_page.dart | 75 ++--- .../soap_update/update_soap_index.dart | 39 ++- 8 files changed, 329 insertions(+), 352 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index e9c59d90..0c6004e2 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -27,6 +27,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objectiveCallBack.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/planCallBack.dart'; @@ -356,8 +357,21 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientPhysicalExam( - GetPhysicalExamReqModel getPhysicalExamReqModel) async { + Future getPatientPhysicalExam(PatiantInformtion patientInfo, + ) async { + + GetPhysicalExamReqModel getPhysicalExamReqModel = + GetPhysicalExamReqModel( + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo.toString(), + appointmentNo: int.parse( + patientInfo.appointmentNo.toString(), + ), + ); + if(patientInfo.admissionNo !=null &&patientInfo.admissionNo.isNotEmpty) + getPhysicalExamReqModel.admissionNo =int.parse(patientInfo.admissionNo); + else + getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 6e075bc2..d6cd0790 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -299,8 +299,7 @@ class AuthenticationViewModel extends BaseViewModel { clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, - tokenID: '', - languageID: 2);//TODO change the lan + languageID: 2);///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); if (_authService.hasError) { error = _authService.error; diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index 5145c419..241bac57 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -1,6 +1,7 @@ class GetPhysicalExamReqModel { int patientMRN; int appointmentNo; + int admissionNo; String episodeID; String from; String to; @@ -10,6 +11,7 @@ class GetPhysicalExamReqModel { GetPhysicalExamReqModel({ this.patientMRN, this.appointmentNo, + this.admissionNo, this.episodeID, this.from, this.to, @@ -31,6 +33,7 @@ class GetPhysicalExamReqModel { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; data['EpisodeID'] = this.episodeID; data['From'] = this.from; data['To'] = this.to; diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 52836232..41fb4507 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,12 +1,13 @@ - class PostPhysicalExamRequestModel { - List listHisProgNotePhysicalExaminationVM; + List + listHisProgNotePhysicalExaminationVM; PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { if (json['listHisProgNotePhysicalExaminationVM'] != null) { - listHisProgNotePhysicalExaminationVM = new List(); + listHisProgNotePhysicalExaminationVM = + new List(); json['listHisProgNotePhysicalExaminationVM'].forEach((v) { listHisProgNotePhysicalExaminationVM .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); @@ -17,98 +18,105 @@ class PostPhysicalExamRequestModel { Map toJson() { final Map data = new Map(); if (this.listHisProgNotePhysicalExaminationVM != null) { - data['listHisProgNotePhysicalExaminationVM'] = - this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList(); + data['listHisProgNotePhysicalExaminationVM'] = this + .listHisProgNotePhysicalExaminationVM + .map((v) => v.toJson()) + .toList(); } return data; } } - class ListHisProgNotePhysicalExaminationVM { - int episodeId; - int appointmentNo; - int examType; - int examId; - int patientMRN; - bool isNormal; - bool isAbnormal; - bool notExamined; - String examName; - String examinationTypeName; - int examinationType; - String remarks; - bool isNew; - int createdBy; - String createdOn; - String createdByName; - int editedBy; - String editedOn; - String editedByName; +class ListHisProgNotePhysicalExaminationVM { + int episodeId; + int appointmentNo; + int admissionNo; + int examType; + int examId; + int patientMRN; + bool isNormal; + bool isAbnormal; + bool notExamined; + String examName; + String examinationTypeName; + int examinationType; + String remarks; + bool isNew; + int createdBy; + String createdOn; + String createdByName; + int editedBy; + String editedOn; + String editedByName; - ListHisProgNotePhysicalExaminationVM( - {this.episodeId, - this.appointmentNo, - this.examType, - this.examId, - this.patientMRN, - this.isNormal, - this.isAbnormal, - this.notExamined, - this.examName, - this.examinationTypeName, - this.examinationType, - this.remarks, - this.isNew, - this.createdBy, - this.createdOn, - this.createdByName, - this.editedBy, - this.editedOn, - this.editedByName}); + ListHisProgNotePhysicalExaminationVM( + {this.episodeId, + this.appointmentNo, + this.admissionNo, + this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.notExamined, + this.examName, + this.examinationTypeName, + this.examinationType, + this.remarks, + this.isNew, + this.createdBy, + this.createdOn, + this.createdByName, + this.editedBy, + this.editedOn, + this.editedByName}); - ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { - episodeId = json['episodeId']; - appointmentNo = json['appointmentNo']; - examType = json['examType']; - examId = json['examId']; - patientMRN = json['patientMRN']; - isNormal = json['isNormal']; - isAbnormal = json['isAbnormal']; - notExamined = json['notExamined']; - examName = json['examName']; - examinationTypeName = json['examinationTypeName']; - examinationType = json['examinationType']; - remarks = json['remarks']; - isNew = json['isNew']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - createdByName = json['createdByName']; - editedBy = json['editedBy']; - editedOn = json['editedOn']; - editedByName = json['editedByName']; - } + ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + admissionNo = json['AdmissionNo']; - Map toJson() { - final Map data = new Map(); - data['episodeId'] = this.episodeId; - data['appointmentNo'] = this.appointmentNo; - data['examType'] = this.examType; - data['examId'] = this.examId; - data['patientMRN'] = this.patientMRN; - data['isNormal'] = this.isNormal; - data['isAbnormal'] = this.isAbnormal; - data['notExamined'] = this.notExamined; - data['examName'] = this.examName; - data['examinationTypeName'] = this.examinationTypeName; - data['examinationType'] = this.examinationType; - data['remarks'] = this.remarks; - data['isNew'] = this.isNew; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['createdByName'] = this.createdByName; - data['editedBy'] = this.editedBy; - data['editedOn'] = this.editedOn; - data['editedByName'] = this.editedByName; - return data; - } + examType = json['examType']; + examId = json['examId']; + patientMRN = json['patientMRN']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + notExamined = json['notExamined']; + examName = json['examName']; + examinationTypeName = json['examinationTypeName']; + examinationType = json['examinationType']; + remarks = json['remarks']; + isNew = json['isNew']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + createdByName = json['createdByName']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + editedByName = json['editedByName']; } + + Map toJson() { + final Map data = new Map(); + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['examType'] = this.examType; + data['examId'] = this.examId; + data['patientMRN'] = this.patientMRN; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + data['notExamined'] = this.notExamined; + data['examName'] = this.examName; + data['examinationTypeName'] = this.examinationTypeName; + data['examinationType'] = this.examinationType; + data['remarks'] = this.remarks; + data['isNew'] = this.isNew; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['createdByName'] = this.createdByName; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['editedByName'] = this.editedByName; + return data; + } +} diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 4941b0ed..6f476c65 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -475,73 +475,7 @@ class _UpdateAssessmentPageState extends State implements ), ), ), - ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), - ), - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 12 : 10), - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, - fontWeight: FontWeight.w600, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ), - ), - SizedBox( - width: 5, - ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 8 : 6), - padding: 10, - disabled: model.state == ViewState.BusyLocal, - onPressed: () async { - - - }, - ), - ), - ], - ), - ), - ), - ), - SizedBox( - height: 5, - ), - ], - ), - )), + ),), ); } 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 db0484da..7109f21b 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 @@ -44,7 +44,8 @@ class UpdateObjectivePage extends StatefulWidget { _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); } -class _UpdateObjectivePageState extends State implements ObjectiveCallBack { +class _UpdateObjectivePageState extends State + implements ObjectiveCallBack { bool isSysExaminationExpand = false; List mySelectedExamination = List(); @@ -67,13 +68,8 @@ class _UpdateObjectivePageState extends State implements Ob onModelReady: (model) async { model.setObjectiveCallBack(this); mySelectedExamination.clear(); - GetPhysicalExamReqModel getPhysicalExamReqModel = - GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString())); - await model.getPatientPhysicalExam(getPhysicalExamReqModel); + + await model.getPatientPhysicalExam(widget.patientInfo); if (model.patientPhysicalExamList.isNotEmpty) { if (model.physicalExaminationList.length == 0) { await model.getMasterLookup(MasterKeysService.PhysicalExamination); @@ -102,109 +98,108 @@ class _UpdateObjectivePageState extends State implements Ob widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), - ExpandableSOAPWidget( - headerTitle: - TranslationBase.of(context).physicalSystemExamination, - onTap: () { - setState(() { - isSysExaminationExpand = !isSysExaminationExpand; - }); - }, - child: Column( - children: [ - SOAPOpenItems( - label: - "${TranslationBase.of(context).addExamination}", - onTap: () { - openExaminationList(context); - }, + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex), + ExpandableSOAPWidget( + headerTitle: + TranslationBase.of(context).physicalSystemExamination, + onTap: () { + setState(() { + isSysExaminationExpand = !isSysExaminationExpand; + }); + }, + child: Column( + children: [ + SOAPOpenItems( + label: + "${TranslationBase.of(context).addExamination}", + onTap: () { + openExaminationList(context); + }, + ), + if (mySelectedExamination.isNotEmpty && + mySelectedExamination.first.isLocal) + Row( + children: [ + AppText( + "New", + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Color(0xFFCC9B14), + ), + ], ), - if (mySelectedExamination.isNotEmpty && - mySelectedExamination.first.isLocal) - Row( - children: [ - AppText( - "New", - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - color: Color(0xFFCC9B14), - ), - ], - ), - Column( - children: mySelectedExamination - .sublist( - 0, - model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) - .map((examination) { - return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); - }); - }).toList(), + Column( + children: mySelectedExamination + .sublist( + 0, + model.getFirstIndexForOldExamination( + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) + .map((examination) { + return ExaminationItemCard(examination, () { + removeExamination( + examination.selectedExamination); + }); + }).toList(), + ), + if (mySelectedExamination.isNotEmpty && + model.getFirstIndexForOldExamination( + mySelectedExamination) > + -1) + Row( + children: [ + AppText( + "Verified", + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + color: Colors.green, + ), + ], ), - if (mySelectedExamination.isNotEmpty && - model.getFirstIndexForOldExamination( - mySelectedExamination) > - -1) - Row( - children: [ - AppText( - "Verified", - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - color: Colors.green, - ), - ], - ), - Column( - children: mySelectedExamination - .sublist(model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) - .map((examination) { - return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); - }); - }).toList(), - ) - ], - ), - isExpanded: isSysExaminationExpand, + Column( + children: mySelectedExamination + .sublist(model.getFirstIndexForOldExamination( + mySelectedExamination) == + -1 + ? 0 + : model.getFirstIndexForOldExamination( + mySelectedExamination)) + .map((examination) { + return ExaminationItemCard(examination, () { + removeExamination( + examination.selectedExamination); + }); + }).toList(), + ) + ], ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 14 : 12), - ) - ], - ), + isExpanded: isSysExaminationExpand, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 14 : 12), + ) + ], ), ), ), + ), ), ); } @@ -213,6 +208,7 @@ class _UpdateObjectivePageState extends State implements Ob // TODO Elham* widget.changePageViewIndex(2); + /// TODO Elham* move this logic to view model // if (mySelectedExamination.isNotEmpty) { // widget.changeLoadingState(true); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -225,33 +221,41 @@ class _UpdateObjectivePageState extends State implements Ob // null) // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = // []; - // + // ListHisProgNotePhysicalExaminationVM + // listHisProgNotePhysicalExaminationVM = + // ListHisProgNotePhysicalExaminationVM( + // patientMRN: widget.patientInfo.patientMRN, + // episodeId: widget.patientInfo.episodeNo, + // appointmentNo: widget.patientInfo.appointmentNo, + // remarks: exam.remark ?? '', + // createdBy: exam.createdBy ?? doctorProfile.doctorID, + // createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), + // editedBy: doctorProfile.doctorID, + // editedOn: DateTime.now().toIso8601String(), + // examId: exam.selectedExamination.id, + // examType: exam.selectedExamination.typeId, + // isAbnormal: exam.isAbnormal, + // isNormal: exam.isNormal, + // notExamined: exam.notExamined, + // examinationType: exam.isNormal + // ? 1 + // : exam.isAbnormal + // ? 2 + // : 3, + // examinationTypeName: exam.isNormal + // ? "Normal" + // : exam.isAbnormal + // ? 'AbNormal' + // : "Not Examined", + // isNew: exam.isNew, + // ); + // if (widget.patientInfo.admissionNo != null && + // widget.patientInfo.admissionNo.isNotEmpty) { + // listHisProgNotePhysicalExaminationVM.admissionNo = + // int.parse(widget.patientInfo.admissionNo); + // } // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - // .add(ListHisProgNotePhysicalExaminationVM( - // patientMRN: widget.patientInfo.patientMRN, - // episodeId: widget.patientInfo.episodeNo, - // appointmentNo: widget.patientInfo.appointmentNo, - // remarks: exam.remark ?? '', - // createdBy: exam.createdBy ?? doctorProfile.doctorID, - // createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), - // editedBy: doctorProfile.doctorID, - // editedOn: DateTime.now().toIso8601String(), - // examId: exam.selectedExamination.id, - // examType: exam.selectedExamination.typeId, - // isAbnormal: exam.isAbnormal, - // isNormal: exam.isNormal, - // notExamined: exam.notExamined, - // examinationType: exam.isNormal - // ? 1 - // : exam.isAbnormal - // ? 2 - // : 3, - // examinationTypeName: exam.isNormal - // ? "Normal" - // : exam.isAbnormal - // ? 'AbNormal' - // : "Not Examined", - // isNew: exam.isNew)); + // .add(listHisProgNotePhysicalExaminationVM); // }); // // if (model.patientPhysicalExamList.isEmpty) { @@ -297,15 +301,16 @@ class _UpdateObjectivePageState extends State implements Ob FadePage( page: AddExaminationPage( mySelectedExamination: mySelectedExamination, - addSelectedExamination: (List mySelectedExaminationLocal ) { + addSelectedExamination: + (List mySelectedExaminationLocal) { setState(() { - { - mySelectedExaminationLocal.forEach((element) { + { + mySelectedExaminationLocal.forEach((element) { if ((mySelectedExamination.singleWhere( (it) => - it.selectedExamination.id == - element.selectedExamination.id, - orElse: () => null)) == + it.selectedExamination.id == + element.selectedExamination.id, + orElse: () => null)) == null) { mySelectedExamination.add(element); } @@ -313,12 +318,12 @@ class _UpdateObjectivePageState extends State implements Ob /// remove items. List removedList = []; - mySelectedExamination.forEach((element) { + mySelectedExamination.forEach((element) { if ((mySelectedExaminationLocal.singleWhere( (it) => - it.selectedExamination.id == - element.selectedExamination.id, - orElse: () => null)) == + it.selectedExamination.id == + element.selectedExamination.id, + orElse: () => null)) == null) { removedList.add(element); } @@ -337,7 +342,7 @@ class _UpdateObjectivePageState extends State implements Ob } @override - nextFunction(model) async { + nextFunction(model) async { await submitUpdateObjectivePage(model); } } diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index b40b0a29..c17b593f 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -28,6 +28,8 @@ class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; final Function changeLoadingState; + final Function changeStateFun; + final SOAPViewModel sOAPViewModel; final int currentIndex; @@ -36,7 +38,7 @@ class UpdatePlanPage extends StatefulWidget { this.changePageViewIndex, this.patientInfo, this.changeLoadingState, - this.currentIndex}); + this.currentIndex, this.sOAPViewModel, this.changeStateFun}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -84,26 +86,27 @@ class _UpdatePlanPageState extends State implements PlanCallBack episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); - await model.getPatientProgressNote(getGetProgressNoteReqModel); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); ///TODO set progressNote in model; - if (model.patientProgressNoteList.isNotEmpty) { + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( - model.patientProgressNoteList[0].planNote); + widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; patientProgressNote.createdByName = - model.patientProgressNoteList[0].createdByName; + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = - model.patientProgressNoteList[0].createdOn; + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; patientProgressNote.editedOn = - model.patientProgressNoteList[0].editedOn; + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; patientProgressNote.editedByName = - model.patientProgressNoteList[0].editedByName; + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; patientProgressNote.appointmentNo = - model.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; setState(() { isAddProgress = isAddProgress; - model.isAddProgress = isAddProgress; + widget.sOAPViewModel.isAddProgress = isAddProgress; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; }); } } @@ -112,7 +115,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - model.setPlanCallBack(this); + widget.sOAPViewModel.setPlanCallBack(this); GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( appointmentNo: @@ -121,26 +124,27 @@ class _UpdatePlanPageState extends State implements PlanCallBack episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); - await model.getPatientProgressNote(getGetProgressNoteReqModel); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); - if (model.patientProgressNoteList.isNotEmpty) { + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( - model.patientProgressNoteList[0].planNote); + widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; patientProgressNote.createdByName = - model.patientProgressNoteList[0].createdByName; + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = - model.patientProgressNoteList[0].createdOn; + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; patientProgressNote.editedOn = - model.patientProgressNoteList[0].editedOn; + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; patientProgressNote.editedByName = - model.patientProgressNoteList[0].editedByName; + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; patientProgressNote.appointmentNo = - model.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; setState(() { isAddProgress = false; - model.isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; }); } widget.changeLoadingState(false); @@ -188,6 +192,8 @@ class _UpdatePlanPageState extends State implements PlanCallBack onChanged: (value) { setState(() { patientProgressNote.planNote = value; + model.progressNoteText = value; + widget.changeStateFun(); }); }, ), @@ -301,6 +307,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack onTap: () { setState(() { isAddProgress = true; + widget.sOAPViewModel.isAddProgress = true; }); }, child: Icon( @@ -342,17 +349,17 @@ class _UpdatePlanPageState extends State implements PlanCallBack doctorID: '', editedBy: ''); - if (model.patientProgressNoteList.isEmpty) { - await model.postProgressNote(postProgressNoteRequestModel); + if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { + await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; - await model.patchProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); } - if (model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(model.error); + if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.sOAPViewModel.error); } else { GetGetProgressNoteReqModel getGetProgressNoteReqModel = @@ -363,25 +370,25 @@ class _UpdatePlanPageState extends State implements PlanCallBack episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); - await model.getPatientProgressNote(getGetProgressNoteReqModel); - if (model.patientProgressNoteList.isNotEmpty) { + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( - model.patientProgressNoteList[0].planNote); + widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; patientProgressNote.createdByName = - model.patientProgressNoteList[0].createdByName; + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = - model.patientProgressNoteList[0].createdOn; + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; patientProgressNote.editedOn = - model.patientProgressNoteList[0].editedOn; + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; patientProgressNote.editedByName = - model.patientProgressNoteList[0].editedByName; + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; patientProgressNote.appointmentNo = - model.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; setState(() { isAddProgress = false; - model.isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; }); } } diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index 7265e90e..77c395e5 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -60,6 +60,11 @@ class _UpdateSoapIndexState extends State }); } + void changeStateFun(){ + setState(() { + + }); + } @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -94,25 +99,27 @@ class _UpdateSoapIndexState extends State }, scrollDirection: Axis.horizontal, children: [ - UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), - UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - currentIndex: _currentIndex, - patientInfo: patient, - changeLoadingState: changeLoadingState), + // UpdateSubjectivePage( + // changePageViewIndex: changePageViewIndex, + // currentIndex: _currentIndex, + // patientInfo: patient, + // changeLoadingState: changeLoadingState), + // UpdateObjectivePage( + // changePageViewIndex: changePageViewIndex, + // currentIndex: _currentIndex, + // patientInfo: patient, + // changeLoadingState: changeLoadingState), + // UpdateAssessmentPage( + // changePageViewIndex: changePageViewIndex, + // currentIndex: _currentIndex, + // patientInfo: patient, + // changeLoadingState: changeLoadingState), UpdatePlanPage( changePageViewIndex: changePageViewIndex, currentIndex: _currentIndex, patientInfo: patient, + sOAPViewModel: model, + changeStateFun: changeStateFun, changeLoadingState: changeLoadingState) ], ), @@ -123,7 +130,7 @@ class _UpdateSoapIndexState extends State ], ), ), - bottomSheet: Container( + bottomSheet:_isLoading?Container(height: 0,): Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( From ae30e23d4d4480cf2151cbd6c8e93414f3cd2dc0 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 1 Aug 2021 16:59:49 +0300 Subject: [PATCH 15/29] rename call back files --- lib/core/viewModel/SOAP_view_model.dart | 8 ++--- ...allBack.dart => assessment_call_back.dart} | 0 .../assessment/update_assessment_page.dart | 2 +- ...CallBack.dart => objective_call_back.dart} | 0 .../objective/update_objective_page.dart | 2 +- ...{planCallBack.dart => plan_call_back.dart} | 0 .../soap_update/plan/update_plan_page.dart | 2 +- ...allBack.dart => subjective_call_back.dart} | 0 .../subjective/update_subjective_page.dart | 2 +- .../soap_update/update_soap_index.dart | 30 +++++++++---------- 10 files changed, 23 insertions(+), 23 deletions(-) rename lib/screens/patients/profile/soap_update/assessment/{assessmentCallBack.dart => assessment_call_back.dart} (100%) rename lib/screens/patients/profile/soap_update/objective/{objectiveCallBack.dart => objective_call_back.dart} (100%) rename lib/screens/patients/profile/soap_update/plan/{planCallBack.dart => plan_call_back.dart} (100%) rename lib/screens/patients/profile/soap_update/subjective/{subjectiveCallBack.dart => subjective_call_back.dart} (100%) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 0c6004e2..a3320145 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -28,10 +28,10 @@ import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model. import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objectiveCallBack.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/planCallBack.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:flutter/material.dart'; import '../../locator.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart b/lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart similarity index 100% rename from lib/screens/patients/profile/soap_update/assessment/assessmentCallBack.dart rename to lib/screens/patients/profile/soap_update/assessment/assessment_call_back.dart diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 6f476c65..c059c2b0 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -25,7 +25,7 @@ import '../shared_soap_widgets/SOAP_open_items.dart'; import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import 'add_assessment_details.dart'; -import 'assessmentCallBack.dart'; +import 'assessment_call_back.dart'; // ignore: must_be_immutable class UpdateAssessmentPage extends StatefulWidget { diff --git a/lib/screens/patients/profile/soap_update/objective/objectiveCallBack.dart b/lib/screens/patients/profile/soap_update/objective/objective_call_back.dart similarity index 100% rename from lib/screens/patients/profile/soap_update/objective/objectiveCallBack.dart rename to lib/screens/patients/profile/soap_update/objective/objective_call_back.dart 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 7109f21b..396d492d 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 @@ -10,7 +10,6 @@ import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model. import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objectiveCallBack.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -26,6 +25,7 @@ import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; import 'add_examination_page.dart'; import 'examination_item_card.dart'; +import 'objective_call_back.dart'; class UpdateObjectivePage extends StatefulWidget { final Function changePageViewIndex; diff --git a/lib/screens/patients/profile/soap_update/plan/planCallBack.dart b/lib/screens/patients/profile/soap_update/plan/plan_call_back.dart similarity index 100% rename from lib/screens/patients/profile/soap_update/plan/planCallBack.dart rename to lib/screens/patients/profile/soap_update/plan/plan_call_back.dart diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index c17b593f..c627b151 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model. import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/planCallBack.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart b/lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart similarity index 100% rename from lib/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart rename to lib/screens/patients/profile/soap_update/subjective/subjective_call_back.dart 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 db3ab7c8..137d9faf 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 @@ -16,7 +16,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjectiveCallBack.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index 77c395e5..d4cc5ca9 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -99,21 +99,21 @@ class _UpdateSoapIndexState extends State }, scrollDirection: Axis.horizontal, children: [ - // UpdateSubjectivePage( - // changePageViewIndex: changePageViewIndex, - // currentIndex: _currentIndex, - // patientInfo: patient, - // changeLoadingState: changeLoadingState), - // UpdateObjectivePage( - // changePageViewIndex: changePageViewIndex, - // currentIndex: _currentIndex, - // patientInfo: patient, - // changeLoadingState: changeLoadingState), - // UpdateAssessmentPage( - // changePageViewIndex: changePageViewIndex, - // currentIndex: _currentIndex, - // patientInfo: patient, - // changeLoadingState: changeLoadingState), + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + currentIndex: _currentIndex, + patientInfo: patient, + changeLoadingState: changeLoadingState), UpdatePlanPage( changePageViewIndex: changePageViewIndex, currentIndex: _currentIndex, From 8c3fc3a6f7dfc68dfdeb1fc434bdb3d61c734f0d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 8 Aug 2021 09:56:19 +0300 Subject: [PATCH 16/29] chief complaint in in patient --- lib/config/config.dart | 1 - .../objective/update_objective_page.dart | 135 +++++++----------- .../subjective/update_subjective_page.dart | 74 ++++------ 3 files changed, 80 insertions(+), 130 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index bf398791..26c0445b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -280,7 +280,6 @@ var SERVICES_PATIANT_HEADER_AR = [ "المريض الواصل" ]; - const PRIMARY_COLOR = 0xff515B5D; const TRANSACTION_NO = 0; 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 dbd3b080..94f41595 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,11 +31,7 @@ class UpdateObjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + {Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -45,8 +41,7 @@ class _UpdateObjectivePageState extends State { 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, @@ -63,12 +58,10 @@ class _UpdateObjectivePageState extends State { return BaseView( onModelReady: (model) async { mySelectedExamination.clear(); - GetPhysicalExamReqModel getPhysicalExamReqModel = - GetPhysicalExamReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString())); + GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); await model.getPatientPhysicalExam(getPhysicalExamReqModel); if (model.patientPhysicalExamList.isNotEmpty) { @@ -108,12 +101,9 @@ class _UpdateObjectivePageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( - headerTitle: - TranslationBase.of(context).physicalSystemExamination, + headerTitle: TranslationBase.of(context).physicalSystemExamination, onTap: () { setState(() { isSysExaminationExpand = !isSysExaminationExpand; @@ -122,8 +112,7 @@ class _UpdateObjectivePageState extends State { child: Column( children: [ SOAPOpenItems( - label: - "${TranslationBase.of(context).addExamination}", + label: "${TranslationBase.of(context).addExamination}", onTap: () { openExaminationList(context); }, @@ -131,8 +120,7 @@ class _UpdateObjectivePageState extends State { Column( children: mySelectedExamination.map((examination) { return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); + removeExamination(examination.selectedExamination); }); }).toList(), ) @@ -214,40 +202,36 @@ class _UpdateObjectivePageState extends State { 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 = - []; + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew)); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: exam.createdBy ?? doctorProfile.doctorID, + createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + notExamined: exam.notExamined, + examinationType: exam.isNormal + ? 1 + : exam.isAbnormal + ? 2 + : 3, + examinationTypeName: exam.isNormal + ? "Normal" + : exam.isAbnormal + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew)); }); if (model.patientPhysicalExamList.isEmpty) { @@ -269,10 +253,8 @@ 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(() { @@ -302,11 +284,7 @@ class AddExaminationDailog extends StatefulWidget { final Function addSelectedExamination; final Function(MasterKeyModel) removeExamination; - const AddExaminationDailog( - {Key key, - this.mySelectedExamination, - this.addSelectedExamination, - this.removeExamination}) + const AddExaminationDailog({Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) : super(key: key); @override @@ -321,8 +299,7 @@ class _AddExaminationDailogState extends State { child: BaseView( onModelReady: (model) async { if (model.physicalExaminationList.length == 0) { - await model - .getMasterLookup(MasterKeysService.PhysicalExamination); + await model.getMasterLookup(MasterKeysService.PhysicalExamination); } }, builder: (_, model, w) => AppScaffold( @@ -332,21 +309,19 @@ class _AddExaminationDailogState extends State { child: Container( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).physicalSystemExamination, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).physicalSystemExamination, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + ]), ))), )), ); 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 b4d7e96e..09fcaa59 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 @@ -34,11 +34,7 @@ class UpdateSubjectivePage extends StatefulWidget { final int currentIndex; UpdateSubjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + {Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -55,8 +51,8 @@ class _UpdateSubjectivePageState extends State { String medicationControllerError = ''; String illnessControllerError = ''; final formKey = GlobalKey(); - List myAllergiesList=List(); - List myHistoryList=List(); + List myAllergiesList = List(); + List myHistoryList = List(); getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); @@ -67,7 +63,7 @@ class _UpdateSubjectivePageState extends State { doctorID: '', editedBy: ''); - await model.getPatientHistories(getHistoryReqModel,isFirst: true); + await model.getPatientHistories(getHistoryReqModel, isFirst: true); if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { @@ -84,15 +80,14 @@ class _UpdateSubjectivePageState extends State { } model.patientHistoryList.forEach((element) { - if (element.historyType == - MasterKeysService.HistoryFamily.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } @@ -103,8 +98,8 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } @@ -115,8 +110,8 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } @@ -127,8 +122,8 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - MySelectedHistory(selectedHistory: history, isChecked: element.isChecked, remark: element.remarks,isLocal: false); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } @@ -157,7 +152,7 @@ class _UpdateSubjectivePageState extends State { selectedAllergySeverity = MasterKeyModel( id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { - selectedAllergySeverity = model.getOneMasterKey( + selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, id: element.severity, ); @@ -168,7 +163,7 @@ class _UpdateSubjectivePageState extends State { isChecked: element.isChecked, createdBy: element.createdBy, remark: element.remarks, - isLocal : false, + isLocal: false, selectedAllergySeverity: selectedAllergySeverity); if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); @@ -218,9 +213,7 @@ class _UpdateSubjectivePageState extends State { children: [ SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context) - .chiefComplaints - , + headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { setState(() { isChiefExpand = !isChiefExpand; @@ -241,9 +234,7 @@ class _UpdateSubjectivePageState extends State { height: 30, ), ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .histories, + headerTitle: TranslationBase.of(context).histories, isRequired: false, onTap: () { setState(() { @@ -259,10 +250,7 @@ class _UpdateSubjectivePageState extends State { height: 30, ), ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) - .allergiesSoap - , + headerTitle: TranslationBase.of(context).allergiesSoap, isRequired: false, onTap: () { setState(() { @@ -282,7 +270,7 @@ class _UpdateSubjectivePageState extends State { isExpanded: isAllergiesExpand, ), SizedBox( - height:MediaQuery.of(context).size.height * 0.16, + height: MediaQuery.of(context).size.height * 0.16, ), ], ), @@ -314,8 +302,7 @@ class _UpdateSubjectivePageState extends State { color: Colors.red[700], //loading: model.state == ViewState.BusyLocal, onPressed: () async { - addSubjectiveInfo( - model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); + addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); }, ), ), @@ -333,8 +320,7 @@ class _UpdateSubjectivePageState extends State { addSubjectiveInfo( {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { - if(FocusScope.of(context).hasFocus) - FocusScope.of(context).unfocus(); + if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState.save(); formKey.currentState.validate(); @@ -367,25 +353,17 @@ class _UpdateSubjectivePageState extends State { } else { setState(() { if (complaintsController.text.isEmpty) { - complaintsControllerError = TranslationBase - .of(context) - .emptyMessage; + complaintsControllerError = TranslationBase.of(context).emptyMessage; } else if (complaintsController.text.length < 25) { - complaintsControllerError = TranslationBase - .of(context) - .chiefComplaintLength; + complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; } if (illnessController.text.isEmpty) { - illnessControllerError = TranslationBase - .of(context) - .emptyMessage; + illnessControllerError = TranslationBase.of(context).emptyMessage; } if (medicationController.text.isEmpty) { - medicationControllerError = TranslationBase - .of(context) - .emptyMessage; + medicationControllerError = TranslationBase.of(context).emptyMessage; } }); @@ -455,14 +433,12 @@ class _UpdateSubjectivePageState extends State { )); }); - if (model.patientHistoryList.isEmpty) { await model.postHistories(postHistoriesRequestModel); } else { await model.patchHistories(postHistoriesRequestModel); } - if (model.state == ViewState.ErrorLocal) { Helpers.showErrorToast(model.error); } From 7830c41d024a40b45a4b248af308df995b8c6a5e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 8 Aug 2021 10:01:07 +0300 Subject: [PATCH 17/29] show update button in case of in patient --- .../profile/profile_screen/patient_profile_screen.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index a8b4e65b..bcf2a371 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -198,7 +198,7 @@ class _PatientProfileScreenState extends State with Single ), ], ), - if (isFromLiveCare + if (isInpatient?true:isFromLiveCare ? patient.episodeNo != null : patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( @@ -253,7 +253,7 @@ class _PatientProfileScreenState extends State with Single AppButton( title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: isFromLiveCare + color: isFromLiveCare || isInpatient ? Colors.red.shade700 : patient.patientStatusType == 43 ? Colors.red.shade700 @@ -277,7 +277,7 @@ class _PatientProfileScreenState extends State with Single if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || - patient.patientStatusType == 43) { + patient.patientStatusType == 43 ||isInpatient ) { Navigator.of(context) .pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); } From 6db5191e07226ef4a013f3f732cea746e0eb3dc3 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 8 Aug 2021 11:09:11 +0300 Subject: [PATCH 18/29] return the function code back --- lib/core/viewModel/SOAP_view_model.dart | 4 +- .../assessment/update_assessment_page.dart | 18 ++- .../objective/update_objective_page.dart | 132 +++++++++--------- .../soap_update/plan/update_plan_page.dart | 1 - .../subjective/update_subjective_page.dart | 90 ++++++------ 5 files changed, 117 insertions(+), 128 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index a3320145..a74e4a42 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -363,8 +363,8 @@ class SOAPViewModel extends BaseViewModel { GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( patientMRN: patientInfo.patientMRN, - episodeID: patientInfo.episodeNo.toString(), - appointmentNo: int.parse( + episodeID: patientInfo.episodeNo == null?"0":patientInfo.episodeNo.toString(), + appointmentNo: patientInfo.appointmentNo == null ?0:int.parse( patientInfo.appointmentNo.toString(), ), ); diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index c059c2b0..dfcbba50 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -507,15 +507,13 @@ class _UpdateAssessmentPageState extends State implements @override nextFunction(model) { - // TODO Elham* - widget.changePageViewIndex(3); - // if (mySelectedAssessmentList.isEmpty) { - // Helpers.showErrorToast( - // TranslationBase.of(context) - // .assessmentErrorMsg); - // } else { - // widget.changeLoadingState(true); - // widget.changePageViewIndex(3); - // } + if (mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast( + TranslationBase.of(context) + .assessmentErrorMsg); + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(3); + } } } 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 396d492d..cb245b7d 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 @@ -205,75 +205,71 @@ class _UpdateObjectivePageState extends State } submitUpdateObjectivePage(SOAPViewModel model) async { - // TODO Elham* - widget.changePageViewIndex(2); + if (mySelectedExamination.isNotEmpty) { + widget.changeLoadingState(true); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - /// TODO Elham* move this logic to view model - // if (mySelectedExamination.isNotEmpty) { - // widget.changeLoadingState(true); - // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - // - // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - // PostPhysicalExamRequestModel postPhysicalExamRequestModel = - // new PostPhysicalExamRequestModel(); - // mySelectedExamination.forEach((exam) { - // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - // null) - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - // []; - // ListHisProgNotePhysicalExaminationVM - // listHisProgNotePhysicalExaminationVM = - // ListHisProgNotePhysicalExaminationVM( - // patientMRN: widget.patientInfo.patientMRN, - // episodeId: widget.patientInfo.episodeNo, - // appointmentNo: widget.patientInfo.appointmentNo, - // remarks: exam.remark ?? '', - // createdBy: exam.createdBy ?? doctorProfile.doctorID, - // createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), - // editedBy: doctorProfile.doctorID, - // editedOn: DateTime.now().toIso8601String(), - // examId: exam.selectedExamination.id, - // examType: exam.selectedExamination.typeId, - // isAbnormal: exam.isAbnormal, - // isNormal: exam.isNormal, - // notExamined: exam.notExamined, - // examinationType: exam.isNormal - // ? 1 - // : exam.isAbnormal - // ? 2 - // : 3, - // examinationTypeName: exam.isNormal - // ? "Normal" - // : exam.isAbnormal - // ? 'AbNormal' - // : "Not Examined", - // isNew: exam.isNew, - // ); - // if (widget.patientInfo.admissionNo != null && - // widget.patientInfo.admissionNo.isNotEmpty) { - // listHisProgNotePhysicalExaminationVM.admissionNo = - // int.parse(widget.patientInfo.admissionNo); - // } - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - // .add(listHisProgNotePhysicalExaminationVM); - // }); - // - // if (model.patientPhysicalExamList.isEmpty) { - // await model.postPhysicalExam(postPhysicalExamRequestModel); - // } else { - // await model.patchPhysicalExam(postPhysicalExamRequestModel); - // } - // - // if (model.state == ViewState.ErrorLocal) { - // widget.changeLoadingState(false); - // Helpers.showErrorToast(model.error); - // } else { - // widget.changeLoadingState(true); - // widget.changePageViewIndex(2); - // } - // } else { - // Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); - // } + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = + new PostPhysicalExamRequestModel(); + mySelectedExamination.forEach((exam) { + 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, + remarks: exam.remark ?? '', + createdBy: exam.createdBy ?? doctorProfile.doctorID, + createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + notExamined: exam.notExamined, + examinationType: exam.isNormal + ? 1 + : exam.isAbnormal + ? 2 + : 3, + examinationTypeName: exam.isNormal + ? "Normal" + : exam.isAbnormal + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew, + ); + if (widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + listHisProgNotePhysicalExaminationVM.admissionNo = + int.parse(widget.patientInfo.admissionNo); + } + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM + .add(listHisProgNotePhysicalExaminationVM); + }); + + if (model.patientPhysicalExamList.isEmpty) { + await model.postPhysicalExam(postPhysicalExamRequestModel); + } else { + await model.patchPhysicalExam(postPhysicalExamRequestModel); + } + + if (model.state == ViewState.ErrorLocal) { + widget.changeLoadingState(false); + Helpers.showErrorToast(model.error); + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); + } + } else { + Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); + } } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index c627b151..16d53804 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -400,7 +400,6 @@ class _UpdatePlanPageState extends State implements PlanCallBack @override nextFunction(model) { - print("dfdfdf"); if (progressNoteController.text.isNotEmpty) { if (isAddProgress) { submitPlan(model); 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 269f20a5..5971fb6f 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 @@ -334,54 +334,50 @@ class _UpdateSubjectivePageState extends State complaintsControllerError = ''; medicationControllerError = ''; illnessControllerError = ''; + if (complaintsController.text.isNotEmpty && + illnessController.text.isNotEmpty && + complaintsController.text.length > 25) { + await postChiefComplaint(model: model); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } + if (myHistoryList.length != 0) { + await postHistories(model: model, myHistoryList: myHistoryList); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } + } + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } + } + widget.changeLoadingState(true); + + widget.changePageViewIndex(1); + } else { + setState(() { + if (complaintsController.text.isEmpty) { + complaintsControllerError = TranslationBase.of(context).emptyMessage; + } else if (complaintsController.text.length < 25) { + complaintsControllerError = + TranslationBase.of(context).chiefComplaintLength; + } + + if (illnessController.text.isEmpty) { + illnessControllerError = TranslationBase.of(context).emptyMessage; + } - ///TODO Elham* - /// - widget.changePageViewIndex(1); - // if (complaintsController.text.isNotEmpty && - // illnessController.text.isNotEmpty && - // complaintsController.text.length > 25) { - // await postChiefComplaint(model: model); - // if (model.state == ViewState.ErrorLocal) { - // Helpers.showErrorToast(model.error); - // } - // if (myHistoryList.length != 0) { - // await postHistories(model: model, myHistoryList: myHistoryList); - // if (model.state == ViewState.ErrorLocal) { - // Helpers.showErrorToast(model.error); - // } - // } - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // Helpers.showErrorToast(model.error); - // } - // } - // widget.changeLoadingState(true); - // - // widget.changePageViewIndex(1); - // } else { - // setState(() { - // if (complaintsController.text.isEmpty) { - // complaintsControllerError = TranslationBase.of(context).emptyMessage; - // } else if (complaintsController.text.length < 25) { - // complaintsControllerError = - // TranslationBase.of(context).chiefComplaintLength; - // } - // - // if (illnessController.text.isEmpty) { - // illnessControllerError = TranslationBase.of(context).emptyMessage; - // } - // - // if (medicationController.text.isEmpty) { - // medicationControllerError = TranslationBase.of(context).emptyMessage; - // } - // }); - // - // widget.changeLoadingState(false); - // Helpers.showErrorToast( - // TranslationBase.of(context).chiefComplaintErrorMsg); - // } + if (medicationController.text.isEmpty) { + medicationControllerError = TranslationBase.of(context).emptyMessage; + } + }); + + widget.changeLoadingState(false); + Helpers.showErrorToast( + TranslationBase.of(context).chiefComplaintErrorMsg); + } } postAllergy( From 41190bc501ecfd7e9004d91199298e876d4db199 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 8 Aug 2021 11:45:34 +0300 Subject: [PATCH 19/29] move error to model --- lib/core/viewModel/SOAP_view_model.dart | 3 ++ .../subjective/update_subjective_page.dart | 46 +++++++++++-------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index a74e4a42..29caec43 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -93,6 +93,9 @@ class SOAPViewModel extends BaseViewModel { bool isAddProgress = true; String progressNoteText =""; + String complaintsControllerError = ''; + String medicationControllerError = ''; + String illnessControllerError = ''; get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; 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 5971fb6f..25269b2e 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 @@ -55,9 +55,7 @@ class _UpdateSubjectivePageState extends State TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); TextEditingController medicationController = TextEditingController(); - String complaintsControllerError = ''; - String medicationControllerError = ''; - String illnessControllerError = ''; + final formKey = GlobalKey(); List myAllergiesList = List(); List myHistoryList = List(); @@ -95,7 +93,8 @@ class _UpdateSubjectivePageState extends State id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( + MySelectedHistory mySelectedHistory = + SoapUtils.generateMySelectedHistory( history: history, isChecked: element.isChecked, remark: element.remarks, @@ -110,7 +109,8 @@ class _UpdateSubjectivePageState extends State id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( + MySelectedHistory mySelectedHistory = + SoapUtils.generateMySelectedHistory( history: history, isChecked: element.isChecked, remark: element.remarks, @@ -125,7 +125,8 @@ class _UpdateSubjectivePageState extends State id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( + MySelectedHistory mySelectedHistory = + SoapUtils.generateMySelectedHistory( history: history, isChecked: element.isChecked, remark: element.remarks, @@ -140,7 +141,8 @@ class _UpdateSubjectivePageState extends State id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( + MySelectedHistory mySelectedHistory = + SoapUtils.generateMySelectedHistory( history: history, isChecked: element.isChecked, remark: element.remarks, @@ -209,7 +211,10 @@ class _UpdateSubjectivePageState extends State model.setSubjectiveCallBack(this); GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( - admissionNo: int.parse(widget.patientInfo.admissionNo),patientMRN: widget.patientInfo.patientMRN, + admissionNo: widget.patientInfo.admissionNo == null + ? 0 + : int.parse(widget.patientInfo.admissionNo), + patientMRN: widget.patientInfo.patientMRN, appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), episodeId: widget.patientInfo.episodeNo, @@ -260,9 +265,9 @@ class _UpdateSubjectivePageState extends State complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController, - complaintsControllerError: complaintsControllerError, - illnessControllerError: illnessControllerError, - medicationControllerError: medicationControllerError, + complaintsControllerError: model.complaintsControllerError, + illnessControllerError: model.illnessControllerError, + medicationControllerError: model.medicationControllerError, ), isExpanded: isChiefExpand, ), @@ -331,9 +336,9 @@ class _UpdateSubjectivePageState extends State formKey.currentState.save(); formKey.currentState.validate(); - complaintsControllerError = ''; - medicationControllerError = ''; - illnessControllerError = ''; + model.complaintsControllerError = ''; + model.medicationControllerError = ''; + model.illnessControllerError = ''; if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length > 25) { @@ -359,18 +364,18 @@ class _UpdateSubjectivePageState extends State } else { setState(() { if (complaintsController.text.isEmpty) { - complaintsControllerError = TranslationBase.of(context).emptyMessage; + model.complaintsControllerError = TranslationBase.of(context).emptyMessage; } else if (complaintsController.text.length < 25) { - complaintsControllerError = + model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; } if (illnessController.text.isEmpty) { - illnessControllerError = TranslationBase.of(context).emptyMessage; + model.illnessControllerError = TranslationBase.of(context).emptyMessage; } if (medicationController.text.isEmpty) { - medicationControllerError = TranslationBase.of(context).emptyMessage; + model.medicationControllerError = TranslationBase.of(context).emptyMessage; } }); @@ -464,7 +469,10 @@ class _UpdateSubjectivePageState extends State if (formKey.currentState.validate()) { PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( - admissionNo: int.parse(widget.patientInfo.admissionNo),patientMRN: widget.patientInfo.patientMRN, + admissionNo: widget.patientInfo.admissionNo == null + ? 0 + : int.parse(widget.patientInfo.admissionNo), + patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, chiefComplaint: complaintsController.text, From 300ad103d3b90b3dc2b0855df82df859ff9a846b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 8 Aug 2021 11:56:47 +0300 Subject: [PATCH 20/29] move error to model --- .../soap_update/subjective/update_subjective_page.dart | 4 ++++ 1 file changed, 4 insertions(+) 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 25269b2e..850ab5a9 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 @@ -62,6 +62,10 @@ class _UpdateSubjectivePageState extends State getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); + + model.complaintsControllerError = ''; + model.medicationControllerError = ''; + model.illnessControllerError = ''; GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), From a1aa1d56899d903741ad0f439f547faeeaf2e2d3 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 9 Aug 2021 12:04:21 +0300 Subject: [PATCH 21/29] small on in patient cases --- .../soap_update/subjective/update_subjective_page.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 850ab5a9..134805c6 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 @@ -219,7 +219,7 @@ class _UpdateSubjectivePageState extends State ? 0 : int.parse(widget.patientInfo.admissionNo), patientMRN: widget.patientInfo.patientMRN, - appointmentNo: + appointmentNo:widget.patientInfo.appointmentNo == null?0: int.parse(widget.patientInfo.appointmentNo.toString()), episodeId: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo, @@ -236,9 +236,11 @@ class _UpdateSubjectivePageState extends State '\n \n' : model.patientChiefComplaintList[0].currentMedication; } + if(widget.patientInfo.appointmentNo != null) { + await getHistory(model); + await getAllergies(model); + } - await getHistory(model); - await getAllergies(model); widget.changeLoadingState(false); }, From 562fd1b515f652d85b3e0ece5d678a48b589cef5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 11 Aug 2021 08:46:23 +0300 Subject: [PATCH 22/29] chef complint for in patient --- lib/config/config.dart | 4 +- .../GetChiefComplaintReqModel.dart | 16 +- .../post_chief_complaint_request_model.dart | 15 +- lib/models/patient/patiant_info_model.dart | 217 +++++------ .../subjective/update_subjective_page.dart | 355 ++++++++---------- 5 files changed, 280 insertions(+), 327 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 26c0445b..4e96c39c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 8e253151..45e0dae6 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -21,10 +21,18 @@ class GetChiefComplaintReqModel { Map toJson() { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; - data['AppointmentNo'] = this.appointmentNo; - data['EpisodeId'] = this.episodeId; - data['EpisodeID'] = this.episodeID; - data['DoctorID'] = this.doctorID; + if (this.appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + if (this.episodeId != null) { + data['EpisodeId'] = this.episodeId; + } + if (episodeID != null) { + data['EpisodeID'] = this.episodeID; + } + if (doctorID != null) { + data['DoctorID'] = this.doctorID; + } if (this.admissionNo != null) { data['AdmissionNo'] = this.admissionNo; } diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index 5f5fe721..682342df 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -43,8 +43,13 @@ class PostChiefComplaintRequestModel { Map toJson() { final Map data = new Map(); - data['AppointmentNo'] = this.appointmentNo; - data['EpisodeID'] = this.episodeID; + if (appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + + if (episodeID != null) { + data['EpisodeID'] = this.episodeID; + } data['PatientMRN'] = this.patientMRN; data['chiefComplaint'] = this.chiefComplaint; data['Hopi'] = this.hopi; @@ -53,8 +58,10 @@ class PostChiefComplaintRequestModel { data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; data['DoctorID'] = this.doctorID; - data['EditedBy'] = this.editedBy; - if (this.admissionNo != null) { + if (editedBy != null) { + data['EditedBy'] = this.editedBy; + } + if (admissionNo != null) { data['AdmissionNo'] = this.admissionNo; } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 83a70b01..df966f03 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -79,95 +79,93 @@ class PatiantInformtion { int vcId; String voipToken; - PatiantInformtion({this.patientDetails, - this.projectId, - this.clinicId, - this.doctorId, - this.patientId, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.nationalityId, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.createdOn, - this.roomId, - this.bedId, - this.nursingStationId, - this.description, - this.clinicDescription, - this.clinicDescriptionN, - this.nationalityName, - this.nationalityNameN, - this.age, - this.genderDescription, - this.nursingStationName, - this.appointmentDate, - this.startTime, - this.appointmentNo, - this.arrivalTime, - this.arrivalTimeD, - this.callStatus, - this.callStatusDisc, - this.callTypeID, - this.clientRequestID, - this.clinicName, - this.consoltationEnd, - this.consultationNotes, - this.appointmentType, - this.appointmentTypeId, - this.arrivedOn, - this.clinicGroupId, - this.companyName, - this.dischargeStatus, - this.doctorDetails, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.genderInt, - this.isSigned, - this.medicationOrders, - this.nationality, - this.patientMRN, - this.visitType, - this.fullName, - this.fullNameN, - this.nationalityFlagURL, - this.patientStatusType, - this.patientStatus, - this.visitTypeId, - this.startTimes, - this.dischargeDate, - this.status, - this.vcId, - this.voipToken, - this.admissionDateWithDateTimeForm, + PatiantInformtion( + {this.patientDetails, + this.projectId, + this.clinicId, + this.doctorId, + this.patientId, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.nationalityId, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.createdOn, + this.roomId, + this.bedId, + this.nursingStationId, + this.description, + this.clinicDescription, + this.clinicDescriptionN, + this.nationalityName, + this.nationalityNameN, + this.age, + this.genderDescription, + this.nursingStationName, + this.appointmentDate, + this.startTime, + this.appointmentNo, + this.arrivalTime, + this.arrivalTimeD, + this.callStatus, + this.callStatusDisc, + this.callTypeID, + this.clientRequestID, + this.clinicName, + this.consoltationEnd, + this.consultationNotes, + this.appointmentType, + this.appointmentTypeId, + this.arrivedOn, + this.clinicGroupId, + this.companyName, + this.dischargeStatus, + this.doctorDetails, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.genderInt, + this.isSigned, + this.medicationOrders, + this.nationality, + this.patientMRN, + this.visitType, + this.fullName, + this.fullNameN, + this.nationalityFlagURL, + this.patientStatusType, + this.patientStatus, + this.visitTypeId, + this.startTimes, + this.dischargeDate, + this.status, + this.vcId, + this.voipToken, + this.admissionDateWithDateTimeForm, this.appointmentDateWithDateTimeForm}); - PatiantInformtion.fromJson(Map json) { { - patientDetails = json['patientDetails'] != null - ? new PatiantInformtion.fromJson(json['patientDetails']) - : null; + patientDetails = json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null; projectId = json["ProjectID"] ?? json["projectID"]; clinicId = json["ClinicID"] ?? json["clinicID"]; doctorId = json["DoctorID"] ?? json["doctorID"]; patientId = json["PatientID"] != null ? json["PatientID"] is String - ? int.parse(json["PatientID"]) - : json["PatientID"] + ? int.parse(json["PatientID"]) + : json["PatientID"] : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN']; doctorName = json["DoctorName"] ?? json["doctorName"]; doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"]; @@ -179,18 +177,16 @@ class PatiantInformtion { lastNameN = json["LastNameN"] ?? json["lastNameN"]; gender = json["Gender"] != null ? json["Gender"] is String - ? int.parse(json["Gender"]) - : json["Gender"] + ? int.parse(json["Gender"]) + : json["Gender"] : json["gender"]; fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"]; - fullNameN = - json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; + fullNameN = json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"]; dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth']; nationalityId = json["NationalityID"] ?? json["nationalityID"]; mobileNumber = json["MobileNumber"] ?? json["mobileNumber"]; emailAddress = json["EmailAddress"] ?? json["emailAddress"]; - patientIdentificationNo = - json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; + patientIdentificationNo = json["PatientIdentificationNo"] ?? json["patientIdentificationNo"]; //TODO make 7 dynamic when the backend retrun it in patient arrival patientType = json["PatientType"] ?? json["patientType"] ?? 1; admissionNo = json["AdmissionNo"] ?? json["admissionNo"]; @@ -200,16 +196,10 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = - json["ClinicDescription"] ?? json["clinicDescription"]; - clinicDescriptionN = - json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; - nationalityName = json["NationalityName"] ?? - json["nationalityName"] ?? - json['NationalityName']; - nationalityNameN = json["NationalityNameN"] ?? - json["nationalityNameN"] ?? - json['NationalityNameN']; + clinicDescription = json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; + nationalityName = json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName']; + nationalityNameN = json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN']; age = json["Age"] ?? json["age"]; genderDescription = json["GenderDescription"]; nursingStationName = json["NursingStationName"]; @@ -217,8 +207,7 @@ class PatiantInformtion { startTime = json["startTime"] ?? json['StartTime']; appointmentNo = json['appointmentNo'] ?? json['AppointmentNo']; appointmentType = json['appointmentType']; - appointmentTypeId = - json['appointmentTypeId'] ?? json['appointmentTypeid']; + appointmentTypeId = json['appointmentTypeId'] ?? json['appointmentTypeid']; arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn']; clinicGroupId = json['clinicGroupId']; companyName = json['companyName']; @@ -234,16 +223,15 @@ class PatiantInformtion { json['PatientMRN'] ?? (json["PatientID"] != null ? int?.parse(json["PatientID"].toString()) - : json["patientID"] != null ? int?.parse( - json["patientID"].toString()) : json["patientId"] != null ? int - ?.parse(json["patientId"].toString()) : ''); + : json["patientID"] != null + ? int?.parse(json["patientID"].toString()) + : json["patientId"] != null + ? int?.parse(json["patientId"].toString()) + : ''); visitType = json['visitType'] ?? json['visitType'] ?? json['visitType']; - nationalityFlagURL = - json['NationalityFlagURL'] ?? json['NationalityFlagURL']; - patientStatusType = - json['patientStatusType'] ?? json['PatientStatusType']; - visitTypeId = - json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; + nationalityFlagURL = json['NationalityFlagURL'] ?? json['NationalityFlagURL']; + patientStatusType = json['patientStatusType'] ?? json['PatientStatusType']; + visitTypeId = json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid']; startTimes = json['StartTime'] ?? json['StartTime']; dischargeDate = json['DischargeDate']; status = json['Status']; @@ -262,16 +250,15 @@ class PatiantInformtion { voipToken = json['VoipToken']; admissionDateWithDateTimeForm = json["AdmissionDate"] != null ? AppDateUtils.convertStringToDate(json["AdmissionDate"]) - : json["admissionDate"] != null ? AppDateUtils.convertStringToDate( - json["admissionDate"]) : null; + : json["admissionDate"] != null + ? AppDateUtils.convertStringToDate(json["admissionDate"]) + : null; appointmentDateWithDateTimeForm = - json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate( - json["AppointmentDate"]) : null; + json["AppointmentDate"] != null ? AppDateUtils.convertStringToDate(json["AppointmentDate"]) : null; } } - Map toJson() { final Map data = new Map(); @@ -315,9 +302,9 @@ class PatiantInformtion { data["Gender"] = this.gender; data["gender"] = this.gender; - data['Age'] = this.age; - data['AppointmentDate'] = this.appointmentDate.isNotEmpty?this.appointmentDate:null; + data['AppointmentDate'] = this.appointmentDate.isNotEmpty ? this.appointmentDate : null; + data['AppointmentNo'] = this.appointmentNo; data['ArrivalTime'] = this.arrivalTime; data['ArrivalTimeD'] = this.arrivalTimeD; @@ -343,4 +330,4 @@ class PatiantInformtion { data['DateOfBirth'] = this.dateofBirth; return data; } -} \ No newline at end of file +} 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 269f20a5..1a1dd2f8 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 @@ -37,18 +37,13 @@ class UpdateSubjectivePage extends StatefulWidget { final int currentIndex; UpdateSubjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + {Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); } -class _UpdateSubjectivePageState extends State - implements SubjectiveCallBack { +class _UpdateSubjectivePageState extends State implements SubjectiveCallBack { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; @@ -88,63 +83,47 @@ class _UpdateSubjectivePageState extends State } model.patientHistoryList.forEach((element) { - if (element.historyType == - MasterKeysService.HistoryFamily.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistoryMedical.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySports.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySurgical.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); if (history != null) { MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } @@ -161,23 +140,16 @@ class _UpdateSubjectivePageState extends State editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); + if (model.allergiesList.isEmpty) await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) await model.getMasterLookup(MasterKeysService.AllergySeverity); model.patientAllergiesList.forEach((element) { MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); + masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { selectedAllergySeverity = MasterKeyModel( - id: 0, - typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), - nameAr: '', - nameEn: ''); + id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, @@ -185,17 +157,15 @@ class _UpdateSubjectivePageState extends State ); } - MySelectedAllergy mySelectedAllergy = - SoapUtils.generateMySelectedAllergy( - allergy: selectedAllergy, - isChecked: element.isChecked, - createdBy: element.createdBy, - remark: element.remarks, - isLocal: false, - allergySeverity: selectedAllergySeverity); - - if (selectedAllergy != null && selectedAllergySeverity != null) - myAllergiesList.add(mySelectedAllergy); + MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy( + allergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element.createdBy, + remark: element.remarks, + isLocal: false, + allergySeverity: selectedAllergySeverity); + + if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); } } @@ -207,29 +177,29 @@ class _UpdateSubjectivePageState extends State myAllergiesList.clear(); myHistoryList.clear(); model.setSubjectiveCallBack(this); - GetChiefComplaintReqModel getChiefComplaintReqModel = - GetChiefComplaintReqModel( - admissionNo: int.parse(widget.patientInfo.admissionNo),patientMRN: widget.patientInfo.patientMRN, - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo, - doctorID: ''); + GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( + admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null, + patientMRN: widget.patientInfo.patientMRN, + appointmentNo: widget.patientInfo.appointmentNo != null + ? int.parse(widget.patientInfo.appointmentNo.toString()) + : null, + episodeId: widget.patientInfo.episodeNo, + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Helpers.parseHtmlString( - model.patientChiefComplaintList[0].chiefComplaint); + complaintsController.text = Helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = - !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty - ? model.patientChiefComplaintList[0].currentMedication + - '\n \n' - : model.patientChiefComplaintList[0].currentMedication; + medicationController.text = !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication + '\n \n' + : model.patientChiefComplaintList[0].currentMedication; } + if (widget.patientInfo.admissionNo == null) { + await getHistory(model); - await getHistory(model); - await getAllergies(model); + await getAllergies(model); + } widget.changeLoadingState(false); }, @@ -245,9 +215,7 @@ class _UpdateSubjectivePageState extends State mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), + SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { @@ -267,51 +235,48 @@ class _UpdateSubjectivePageState extends State isExpanded: isChiefExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).histories, - isRequired: false, - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Column( - children: [ - UpdateHistoryWidget(myHistoryList: myHistoryList) - ], + if (widget.patientInfo.admissionNo == null) + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).histories, + isRequired: false, + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Column( + children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], + ), + isExpanded: isHistoryExpand, ), - isExpanded: isHistoryExpand, - ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).allergiesSoap, - isRequired: false, - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Column( - children: [ - UpdateAllergiesWidget( - myAllergiesList: myAllergiesList, - ), - SizedBox( - height: 30, - ), - ], + if (widget.patientInfo.admissionNo == null) + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).allergiesSoap, + isRequired: false, + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Column( + children: [ + UpdateAllergiesWidget( + myAllergiesList: myAllergiesList, + ), + SizedBox( + height: 30, + ), + ], + ), + isExpanded: isAllergiesExpand, ), - isExpanded: isAllergiesExpand, - ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -323,9 +288,7 @@ class _UpdateSubjectivePageState extends State } addSubjectiveInfo( - {SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { + {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState.save(); @@ -338,79 +301,73 @@ class _UpdateSubjectivePageState extends State ///TODO Elham* /// widget.changePageViewIndex(1); - // if (complaintsController.text.isNotEmpty && - // illnessController.text.isNotEmpty && - // complaintsController.text.length > 25) { - // await postChiefComplaint(model: model); - // if (model.state == ViewState.ErrorLocal) { - // Helpers.showErrorToast(model.error); - // } - // if (myHistoryList.length != 0) { - // await postHistories(model: model, myHistoryList: myHistoryList); - // if (model.state == ViewState.ErrorLocal) { - // Helpers.showErrorToast(model.error); - // } - // } - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // Helpers.showErrorToast(model.error); - // } - // } - // widget.changeLoadingState(true); - // - // widget.changePageViewIndex(1); - // } else { - // setState(() { - // if (complaintsController.text.isEmpty) { - // complaintsControllerError = TranslationBase.of(context).emptyMessage; - // } else if (complaintsController.text.length < 25) { - // complaintsControllerError = - // TranslationBase.of(context).chiefComplaintLength; - // } - // - // if (illnessController.text.isEmpty) { - // illnessControllerError = TranslationBase.of(context).emptyMessage; - // } - // - // if (medicationController.text.isEmpty) { - // medicationControllerError = TranslationBase.of(context).emptyMessage; - // } - // }); - // - // widget.changeLoadingState(false); - // Helpers.showErrorToast( - // TranslationBase.of(context).chiefComplaintErrorMsg); - // } + if (complaintsController.text.isNotEmpty && + illnessController.text.isNotEmpty && + complaintsController.text.length > 25) { + await postChiefComplaint(model: model); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } + if (myHistoryList.length != 0 && widget.patientInfo.admissionNo == null) { + await postHistories(model: model, myHistoryList: myHistoryList); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } + } + if (myAllergiesList.length != 0 && widget.patientInfo.admissionNo == null) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(model.error); + } + } + widget.changeLoadingState(true); + + widget.changePageViewIndex(1); + } else { + setState(() { + if (complaintsController.text.isEmpty) { + complaintsControllerError = TranslationBase.of(context).emptyMessage; + } else if (complaintsController.text.length < 25) { + complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; + } + + if (illnessController.text.isEmpty) { + illnessControllerError = TranslationBase.of(context).emptyMessage; + } + + if (medicationController.text.isEmpty) { + medicationControllerError = TranslationBase.of(context).emptyMessage; + } + }); + + widget.changeLoadingState(false); + Helpers.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); + } } - postAllergy( - {List myAllergiesList, SOAPViewModel model}) async { - PostAllergyRequestModel postAllergyRequestModel = - new PostAllergyRequestModel(); + postAllergy({List myAllergiesList, SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == - null) + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( - ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - isChecked: allergy.isChecked, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -434,13 +391,10 @@ class _UpdateSubjectivePageState extends State } } - postHistories( - {List myHistoryList, SOAPViewModel model}) async { - PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(doctorID: ''); + postHistories({List myHistoryList, SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) - postHistoriesRequestModel.listMedicalHistoryVM = []; + if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, @@ -466,18 +420,18 @@ class _UpdateSubjectivePageState extends State postChiefComplaint({SOAPViewModel model}) async { formKey.currentState.save(); if (formKey.currentState.validate()) { - PostChiefComplaintRequestModel postChiefComplaintRequestModel = - new PostChiefComplaintRequestModel( - admissionNo: int.parse(widget.patientInfo.admissionNo),patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: medicationController.text, - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - doctorID: '', - numberOfWeeks: 0); + PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( + admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + chiefComplaint: complaintsController.text, + currentMedication: medicationController.text, + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); @@ -489,9 +443,6 @@ class _UpdateSubjectivePageState extends State @override Function nextFunction(model) { - addSubjectiveInfo( - model: model, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList); + addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); } } From 13be1c6a00e915f64867fb27ee99606dba2a33ef Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 11 Aug 2021 10:06:53 +0300 Subject: [PATCH 23/29] fix issue in the model --- lib/models/SOAP/post_physical_exam_request_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 41fb4507..f056f168 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -99,7 +99,7 @@ class ListHisProgNotePhysicalExaminationVM { final Map data = new Map(); data['episodeId'] = this.episodeId; data['appointmentNo'] = this.appointmentNo; - data['AdmissionNo'] = this.admissionNo; + data['admissionNo'] = this.admissionNo; data['examType'] = this.examType; data['examId'] = this.examId; data['patientMRN'] = this.patientMRN; From 80b976dff39124995b1ed44c78f9a0dad4712ffa Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 15 Aug 2021 10:32:06 +0300 Subject: [PATCH 24/29] first step from change steper --- .../assessment/update_assessment_page.dart | 646 +++++++++--------- .../objective/update_objective_page.dart | 4 +- .../soap_update/plan/update_plan_page.dart | 470 +++++++------ .../shared_soap_widgets/SOAP_step_header.dart | 5 +- .../steper/steps_widget.dart | 4 +- .../subjective/update_subjective_page.dart | 29 +- 6 files changed, 603 insertions(+), 555 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index dfcbba50..439cb61a 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -45,7 +45,8 @@ class UpdateAssessmentPage extends StatefulWidget { _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); } -class _UpdateAssessmentPageState extends State implements AssessmentCallBack{ +class _UpdateAssessmentPageState extends State + implements AssessmentCallBack { bool isAssessmentExpand = false; List mySelectedAssessmentList = List(); @@ -112,184 +113,237 @@ class _UpdateAssessmentPageState extends State implements widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - color: Theme.of(context).scaffoldBackgroundColor, - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).assessment, - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - SOAPOpenItems( - label: - "${TranslationBase.of(context).addAssessment}", - onTap: () { - openAssessmentDialog(context, - isUpdate: false, model: model); - }, - ), - SizedBox( - height: 20, - ), - Column( - children: - mySelectedAssessmentList.map((assessment) { - return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15, bottom: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.4), - children: [ - new TextSpan( - text: - "ICD : ".toUpperCase(), - ), - new TextSpan( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).assessment, + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + SOAPOpenItems( + label: + "${TranslationBase.of(context).addAssessment}", + onTap: () { + openAssessmentDialog(context, + isUpdate: false, model: model); + }, + ), + SizedBox( + height: 20, + ), + Column( + children: + mySelectedAssessmentList.map((assessment) { + return Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15, bottom: 15), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), + ), + new TextSpan( text: assessment .selectedICD.code .trim() .toUpperCase() ?? - "" - - ), - ], - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *5, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - letterSpacing: -0.64, - ), - children: [ - new TextSpan( - text: assessment - .selectedICD - .description - .toString(), - ), - ], - ), - ), + ""), + ], ), - RichText( + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.50, + child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 5, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, + letterSpacing: -0.64, ), children: [ - new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - letterSpacing: -0.4, - color: Color(0xFF575757), - ), - ), new TextSpan( text: assessment - .appointmentId - .toString() ?? - "", - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), + .selectedICD.description + .toString(), ), ], ), ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", - style: new TextStyle( - letterSpacing: -0.4, - color: Color(0xFF575757), - ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.5, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .appointmentNo, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), ), - new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - ), + ), + new TextSpan( + text: assessment.appointmentId + .toString() ?? + "", + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), ), - ], - ), + ), + ], + ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .condition + + " : ", + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], ), + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .dType + + ' : ', + style: new TextStyle( + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + ), + new TextSpan( + text: projectViewModel + .isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, + style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + ), + ), + ], + ), + ), + if (assessment.doctorName != null) RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: @@ -298,24 +352,24 @@ class _UpdateAssessmentPageState extends State implements new TextSpan( text: TranslationBase.of( context) - .dType + + .doctor + ' : ', style: new TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, + text: + assessment.doctorName ?? + '', style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -323,159 +377,123 @@ class _UpdateAssessmentPageState extends State implements ], ), ), - if (assessment.doctorName != null) - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - children: [ - new TextSpan( - text: TranslationBase.of( + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + (assessment.remark != null && + assessment.remark != + '') + ? TranslationBase.of( context) - .doctor + - ' : ', - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,letterSpacing: -0.4, - color: - Color(0xFF575757), - ), - ), - new TextSpan( - text: assessment - .doctorName ?? - '', - style: new TextStyle( - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6,letterSpacing: -0.48, - color: - Color(0xFF2B353E), - ), - ), - ], - ), + .remarks + + " : " + : '', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600), + RemarkText( + remark: assessment.remark ?? "", ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - (assessment.remark != - null && - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), - RemarkText( - remark: - assessment.remark ?? "", - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Row( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - AppText( - assessment.createdOn != - null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime - .now()), - fontWeight: - FontWeight.w600, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ), - AppText( - assessment.createdOn != - null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils - .getHour(DateTime - .now()), - fontWeight: - FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ), - ], - ), - ], - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, - ), - InkWell( - onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); - }, - child: Icon( - DoctorApp.edit, - size: 18, + ], + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Row( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + AppText( + assessment.createdOn != null + ? AppDateUtils.getHour( + DateTime.parse( + assessment + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], ), - ) - ], - ), - ], - ), - ); - }).toList(), - ) - ], - ) - ]), - isExpanded: isAssessmentExpand, - ), - SizedBox( - height: 130, - ), - ], - ), + ], + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), + InkWell( + onTap: () { + openAssessmentDialog(context, + isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon( + DoctorApp.edit, + size: 18, + ), + ) + ], + ), + ], + ), + ); + }).toList(), + ) + ], + ) + ]), + isExpanded: isAssessmentExpand, + ), + SizedBox( + height: 130, + ), + ], ), ), ), - ),), + ), + ), + ), ); } @@ -508,9 +526,7 @@ class _UpdateAssessmentPageState extends State implements @override nextFunction(model) { if (mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase.of(context) - .assessmentErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); } else { widget.changeLoadingState(true); widget.changePageViewIndex(3); 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 cb245b7d..c93a6c57 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 @@ -111,7 +111,9 @@ class _UpdateObjectivePageState extends State children: [ SOAPStepHeader( currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).physicalSystemExamination, diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 16d53804..d32634b2 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -29,7 +29,7 @@ class UpdatePlanPage extends StatefulWidget { final PatiantInformtion patientInfo; final Function changeLoadingState; final Function changeStateFun; - final SOAPViewModel sOAPViewModel; + final SOAPViewModel sOAPViewModel; final int currentIndex; @@ -38,13 +38,16 @@ class UpdatePlanPage extends StatefulWidget { this.changePageViewIndex, this.patientInfo, this.changeLoadingState, - this.currentIndex, this.sOAPViewModel, this.changeStateFun}); + this.currentIndex, + this.sOAPViewModel, + this.changeStateFun}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); } -class _UpdatePlanPageState extends State implements PlanCallBack { +class _UpdatePlanPageState extends State + implements PlanCallBack { bool isAddProgress = true; bool isProgressExpanded = true; GetPatientProgressNoteResModel patientProgressNote = @@ -76,17 +79,19 @@ class _UpdatePlanPageState extends State implements PlanCallBack } } - - getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async { + getPatientProgressNote(SOAPViewModel model, + {bool isAddProgress = false}) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); + ///TODO set progressNote in model; if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( @@ -103,238 +108,251 @@ class _UpdatePlanPageState extends State implements PlanCallBack widget.sOAPViewModel.patientProgressNoteList[0].editedByName; patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; - setState(() { - isAddProgress = isAddProgress; - widget.sOAPViewModel.isAddProgress = isAddProgress; - widget.sOAPViewModel.progressNoteText = progressNoteController.text; - }); + setState(() { + isAddProgress = isAddProgress; + widget.sOAPViewModel.isAddProgress = isAddProgress; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; + }); } } @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - widget.sOAPViewModel.setPlanCallBack(this); - GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + onModelReady: (model) async { + widget.sOAPViewModel.setPlanCallBack(this); + GetGetProgressNoteReqModel getGetProgressNoteReqModel = + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); - if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Helpers.parseHtmlString( - widget.sOAPViewModel.patientProgressNoteList[0].planNote); - patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = - widget.sOAPViewModel.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = - widget.sOAPViewModel.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = - widget.sOAPViewModel.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = - widget.sOAPViewModel.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = - widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; - widget.sOAPViewModel.progressNoteText = progressNoteController.text; + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Helpers.parseHtmlString( + widget.sOAPViewModel.patientProgressNoteList[0].planNote); + patientProgressNote.planNote = progressNoteController.text; + patientProgressNote.createdByName = + widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = + widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = + widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = + widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = + widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; - setState(() { - isAddProgress = false; - widget.sOAPViewModel.isAddProgress = false; - }); - } - widget.changeLoadingState(false); - }, - builder: (_, model, w) => AppScaffold( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.90, - child: Column( - children: [ - SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), - SizedBox( - height: 10, - ), - ExpandableSOAPWidget( - headerTitle: TranslationBase.of(context).progressNote, - onTap: () { - setState(() { - isProgressExpanded = !isProgressExpanded; - }); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + setState(() { + isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; + }); + } + widget.changeLoadingState(false); + }, + builder: (_, model, w) => AppScaffold( + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.90, + child: Column( + children: [ + SOAPStepHeader( + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), + SizedBox( + height: 10, + ), + ExpandableSOAPWidget( + headerTitle: TranslationBase.of(context).progressNote, + onTap: () { + setState(() { + isProgressExpanded = !isProgressExpanded; + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - if (isAddProgress) - Container( - margin: EdgeInsets.only( - left: 10, right: 10, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .progressNote, - controller: progressNoteController, - minLines: 2, - maxLines: 4, - inputType: TextInputType.multiline, - onChanged: (value) { - setState(() { - patientProgressNote.planNote = value; - model.progressNoteText = value; - widget.changeStateFun(); - }); - }, - ), - ), - SizedBox( - height: 9, - ), - if (patientProgressNote.planNote != null && - !isAddProgress) - Container( - margin: EdgeInsets.only( - left: 5, - right: 5, + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (isAddProgress) + Container( + margin: EdgeInsets.only( + left: 10, right: 10, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .progressNote, + controller: progressNoteController, + minLines: 2, + maxLines: 4, + inputType: TextInputType.multiline, + onChanged: (value) { + setState(() { + patientProgressNote.planNote = + value; + model.progressNoteText = value; + widget.changeStateFun(); + }); + }, + ), + ), + SizedBox( + height: 9, ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + if (patientProgressNote.planNote != null && + !isAddProgress) + Container( + margin: EdgeInsets.only( + left: 5, + right: 5, + ), + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText( - 'Appointment No: ', - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, - letterSpacing: -0.4, - color: Color(0xFF575757), + Row( + children: [ + AppText( + 'Appointment No: ', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + letterSpacing: -0.4, + color: Color(0xFF575757), + ), + AppText( + patientProgressNote + .appointmentNo != + null + ? patientProgressNote + .appointmentNo + .toString() + : '', + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xFF2B353E), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ), + ], ), AppText( - patientProgressNote - .appointmentNo != + patientProgressNote.createdOn != null - ? patientProgressNote - .appointmentNo - .toString() - : '', + ? AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.parse( + patientProgressNote + .createdOn)) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), fontWeight: FontWeight.w600, - letterSpacing: -0.48, - color: Color(0xFF2B353E), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ) ], ), - AppText( - patientProgressNote.createdOn != - null - ? AppDateUtils - .getDayMonthYearDateFormatted( + Row( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // Row( + // children: [ + // AppText( + // 'Condition: ', + // fontSize: 12, + // ), + // AppText( + // patientProgressNote.mName ?? + // '', + // fontWeight: FontWeight.w600), + // ], + // ), + AppText( + patientProgressNote.createdOn != + null + ? AppDateUtils.getHour( DateTime.parse( patientProgressNote .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( + : AppDateUtils.getHour( DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ) - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - // Row( - // children: [ - // AppText( - // 'Condition: ', - // fontSize: 12, - // ), - // AppText( - // patientProgressNote.mName ?? - // '', - // fontWeight: FontWeight.w600), - // ], - // ), - AppText( - patientProgressNote.createdOn != - null - ? AppDateUtils.getHour( - DateTime.parse( - patientProgressNote - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.6, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - progressNoteController.text, - fontSize: 10, - ), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.6, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + progressNoteController.text, + fontSize: 10, + ), + ), + InkWell( + onTap: () { + setState(() { + isAddProgress = true; + widget.sOAPViewModel + .isAddProgress = true; + }); + }, + child: Icon( + DoctorApp.edit, + size: 18, + )) + ], ), - InkWell( - onTap: () { - setState(() { - isAddProgress = true; - widget.sOAPViewModel.isAddProgress = true; - }); - }, - child: Icon( - DoctorApp.edit, - size: 18, - )) ], ), - ], - ), - ) + ) + ], + ), ], ), - ], - ), - isExpanded: isProgressExpanded, - ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 20 : 10), + isExpanded: isProgressExpanded, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort ? 20 : 10), + ), + ], ), - ], + ), ), ), - ), - ),) - ); + )); } submitPlan(SOAPViewModel model) async { @@ -350,27 +368,29 @@ class _UpdatePlanPageState extends State implements PlanCallBack editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { - await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel + .postProgressNote(postProgressNoteRequestModel); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; - await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel + .patchProgressNote(postProgressNoteRequestModel); } if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast(widget.sOAPViewModel.error); } else { - GetGetProgressNoteReqModel getGetProgressNoteReqModel = - GetGetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + GetGetProgressNoteReqModel( + appointmentNo: + int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel + .getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { progressNoteController.text = Helpers.parseHtmlString( widget.sOAPViewModel.patientProgressNoteList[0].planNote); @@ -407,9 +427,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack Navigator.of(context).pop(); } } else { - Helpers.showErrorToast( - TranslationBase.of(context) - .progressNoteErrorMsg); + Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } } diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index deddc4a1..51afcd1f 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -7,11 +8,12 @@ import 'package:flutter/material.dart'; class SOAPStepHeader extends StatelessWidget { const SOAPStepHeader({ Key key, - this.currentIndex, this.changePageViewIndex, + this.currentIndex, this.changePageViewIndex, this.patientInfo, }) : super(key: key); final int currentIndex; final Function changePageViewIndex; + final PatiantInformtion patientInfo; @override Widget build(BuildContext context) { @@ -39,6 +41,7 @@ class SOAPStepHeader extends StatelessWidget { child: StepsWidget( index: currentIndex, changeCurrentTab: changePageViewIndex, + patientInfo: patientInfo, ), ), SizedBox( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index 88ca392b..f18f61da 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/steper/status_Label.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -12,8 +13,9 @@ class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; final double height; + final PatiantInformtion patientInfo; - StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0}); + StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0, this.patientInfo}); @override Widget build(BuildContext context) { 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 134805c6..fb126a69 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 @@ -219,8 +219,9 @@ class _UpdateSubjectivePageState extends State ? 0 : int.parse(widget.patientInfo.admissionNo), patientMRN: widget.patientInfo.patientMRN, - appointmentNo:widget.patientInfo.appointmentNo == null?0: - int.parse(widget.patientInfo.appointmentNo.toString()), + appointmentNo: widget.patientInfo.appointmentNo == null + ? 0 + : int.parse(widget.patientInfo.appointmentNo.toString()), episodeId: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo, doctorID: ''); @@ -236,12 +237,11 @@ class _UpdateSubjectivePageState extends State '\n \n' : model.patientChiefComplaintList[0].currentMedication; } - if(widget.patientInfo.appointmentNo != null) { + if (widget.patientInfo.appointmentNo != null) { await getHistory(model); await getAllergies(model); } - widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( @@ -257,8 +257,10 @@ class _UpdateSubjectivePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ SOAPStepHeader( - currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex), + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, + ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).chiefComplaints, onTap: () { @@ -271,9 +273,11 @@ class _UpdateSubjectivePageState extends State complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController, - complaintsControllerError: model.complaintsControllerError, + complaintsControllerError: + model.complaintsControllerError, illnessControllerError: model.illnessControllerError, - medicationControllerError: model.medicationControllerError, + medicationControllerError: + model.medicationControllerError, ), isExpanded: isChiefExpand, ), @@ -370,18 +374,21 @@ class _UpdateSubjectivePageState extends State } else { setState(() { if (complaintsController.text.isEmpty) { - model.complaintsControllerError = TranslationBase.of(context).emptyMessage; + model.complaintsControllerError = + TranslationBase.of(context).emptyMessage; } else if (complaintsController.text.length < 25) { model.complaintsControllerError = TranslationBase.of(context).chiefComplaintLength; } if (illnessController.text.isEmpty) { - model.illnessControllerError = TranslationBase.of(context).emptyMessage; + model.illnessControllerError = + TranslationBase.of(context).emptyMessage; } if (medicationController.text.isEmpty) { - model.medicationControllerError = TranslationBase.of(context).emptyMessage; + model.medicationControllerError = + TranslationBase.of(context).emptyMessage; } }); From 26a1758af9fb47f9763af3b7e74f526b682d4271 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 15 Aug 2021 11:10:50 +0300 Subject: [PATCH 25/29] Soap for in Patient chef complint --- lib/config/config.dart | 4 ++-- lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart | 4 ++-- lib/models/SOAP/post_chief_complaint_request_model.dart | 2 +- .../soap_update/subjective/update_subjective_page.dart | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 4e96c39c..26c0445b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 45e0dae6..6be95372 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -15,7 +15,7 @@ class GetChiefComplaintReqModel { episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; doctorID = json['DoctorID']; - admissionNo = json['AdmissionNo']; + admissionNo = json['admissionNo']; } Map toJson() { @@ -34,7 +34,7 @@ class GetChiefComplaintReqModel { data['DoctorID'] = this.doctorID; } if (this.admissionNo != null) { - data['AdmissionNo'] = this.admissionNo; + data['admissionNo'] = this.admissionNo; } return data; diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index 682342df..eb3bea7f 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -62,7 +62,7 @@ class PostChiefComplaintRequestModel { data['EditedBy'] = this.editedBy; } if (admissionNo != null) { - data['AdmissionNo'] = this.admissionNo; + data['admissionNo'] = this.admissionNo; } return data; 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 1a1dd2f8..7234d822 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 @@ -423,8 +423,8 @@ class _UpdateSubjectivePageState extends State implements PostChiefComplaintRequestModel postChiefComplaintRequestModel = new PostChiefComplaintRequestModel( admissionNo: widget.patientInfo.admissionNo != null ? int.parse(widget.patientInfo.admissionNo) : null, patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + episodeID: widget.patientInfo.episodeNo ?? 0, + appointmentNo: widget.patientInfo.appointmentNo ?? 0, chiefComplaint: complaintsController.text, currentMedication: medicationController.text, hopi: illnessController.text, From 74a6ebebdc1625912464d2ed26619b3f8850699c Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 15 Aug 2021 12:16:34 +0300 Subject: [PATCH 26/29] remove unnecessary step for inpatient --- .../objective/update_objective_page.dart | 12 +- .../steper/steps_widget.dart | 512 +++++++++--------- .../soap_update/update_soap_index.dart | 7 +- 3 files changed, 284 insertions(+), 247 deletions(-) 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 c93a6c57..b780e952 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 @@ -266,8 +266,14 @@ class _UpdateObjectivePageState extends State widget.changeLoadingState(false); Helpers.showErrorToast(model.error); } else { - widget.changeLoadingState(true); - widget.changePageViewIndex(2); + if(widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + Navigator.of(context).pop(); + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); + } + } } else { Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); @@ -310,7 +316,7 @@ class _UpdateObjectivePageState extends State element.selectedExamination.id, orElse: () => null)) == null) { - mySelectedExamination.add(element); + mySelectedExamination.insert(0,element); } }); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index f18f61da..6320fc41 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -15,14 +15,28 @@ class StepsWidget extends StatelessWidget { final double height; final PatiantInformtion patientInfo; - StepsWidget({Key key, this.index, this.changeCurrentTab, this.height = 0.0, this.patientInfo}); + StepsWidget( + {Key key, + this.index, + this.changeCurrentTab, + this.height = 0.0, + this.patientInfo}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - double circleHeight = (SizeConfig.isHeightVeryShort ?30:SizeConfig.isHeightShort?38:38); - double circleTop = (SizeConfig.isHeightVeryShort ?12:SizeConfig.isHeightShort?10:10); - double containerHeight = SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort?16:15); + double circleHeight = (SizeConfig.isHeightVeryShort + ? 30 + : SizeConfig.isHeightShort + ? 38 + : 38); + double circleTop = (SizeConfig.isHeightVeryShort + ? 12 + : SizeConfig.isHeightShort + ? 10 + : 10); + double containerHeight = + SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 16 : 15); return !projectViewModel.isArabic ? Stack( @@ -33,21 +47,22 @@ class StepsWidget extends StatelessWidget { color: Colors.transparent, ), Positioned( - top: 30 - , + top: 30, child: Center( child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.9, + width: MediaQuery.of(context).size.width * + (patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty + ? 0.9 + : 0.85), child: Divider( color: Colors.grey, height: 0.75, thickness: 0.75, ), ), - ),), + ), + ), Positioned( top: circleTop, left: 0, @@ -57,8 +72,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width:circleHeight, - height: circleHeight, + width: circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -84,7 +99,9 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - StepDetailsWidget(stepLabel: "Subjective",), + StepDetailsWidget( + stepLabel: "Subjective", + ), StatusLabel( selectedStepId: index, stepId: 0, @@ -97,10 +114,10 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: circleTop, - left: MediaQuery - .of(context) - .size - .width * 0.25, + left: patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty + ? MediaQuery.of(context).size.width * 0.25 + : MediaQuery.of(context).size.width * 0.71, child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( @@ -108,7 +125,7 @@ class StepsWidget extends StatelessWidget { children: [ Container( width: circleHeight, - height: circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -136,7 +153,9 @@ class StepsWidget extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - StepDetailsWidget(stepLabel: "Objective",), + StepDetailsWidget( + stepLabel: "Objective", + ), StatusLabel( selectedStepId: index, stepId: 1, @@ -147,109 +166,115 @@ class StepsWidget extends StatelessWidget { ), ), ), - Positioned( - top: circleTop, - left: MediaQuery - .of(context) - .size - .width * 0.47, - child: InkWell( - onTap: () { - if (index >= 3) changeCurrentTab(2); - }, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width:circleHeight, - height: circleHeight, - decoration: BoxDecoration( - border: index == 2 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 2 - ? Color(0xFFCC9B14) - : index > 2 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - StepDetailsWidget(stepLabel: "Assessment",), - StatusLabel( - selectedStepId: index, - stepId: 2, + if (patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + left: MediaQuery.of(context).size.width * 0.47, + child: InkWell( + onTap: () { + if (index >= 3) changeCurrentTab(2); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 2 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 2 + ? Color(0xFFCC9B14) + : index > 2 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), - ], - ), - ], + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox( + height: 5, + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + StepDetailsWidget( + stepLabel: "Assessment", + ), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), + ], + ), + ], + ), ), ), - ), - Positioned( - top: circleTop, - right: 0, - child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - width:circleHeight, - height: circleHeight, - decoration: BoxDecoration( - border: index == 3 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 3 - ? Color(0xFFCC9B14) - : index > 3 - ? Color(0xFF359846) - : Color(0xFFCCCCCC), - ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - StepDetailsWidget(stepLabel: "Plan",marginLeft: 30,), - StatusLabel( - selectedStepId: index, - stepId: 3, + if (patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + right: 0, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(4) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 3 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 3 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 3 + ? Color(0xFFCC9B14) + : index > 3 + ? Color(0xFF359846) + : Color(0xFFCCCCCC), ), - ], - ), - ], + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), + ), + SizedBox( + height: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + StepDetailsWidget( + stepLabel: "Plan", + marginLeft: 30, + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], + ), + ], + ), ), ), - ), ], ) : Stack( @@ -260,21 +285,19 @@ class StepsWidget extends StatelessWidget { color: Colors.transparent, ), Positioned( - top: 30 - , + top: 30, child: Center( child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.9, + width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty?0.9:0.85), child: Divider( color: Colors.grey, height: 0.75, thickness: 0.75, ), ), - ),), + ), + ), Positioned( top: circleTop, right: 0, @@ -284,8 +307,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width:circleHeight, - height: circleHeight, + width: circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -298,19 +321,21 @@ class StepsWidget extends StatelessWidget { ? Color(0xFFCC9B14) : index > 0 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 3), Column( children: [ - StepDetailsWidget(stepLabel: "شخصي",), + StepDetailsWidget( + stepLabel: "شخصي", + ), StatusLabel( selectedStepId: index, stepId: 0, @@ -323,18 +348,16 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: circleTop, - right: MediaQuery - .of(context) - .size - .width * 0.25, + right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty?0.25:0.71), child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:circleHeight, - height: circleHeight, + width: circleHeight, + height: circleHeight, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -347,19 +370,21 @@ class StepsWidget extends StatelessWidget { ? Color(0xFFCC9B14) : index > 1 ? Color(0xFF359846) - : Color(0xFFCCCCCC), + : Color(0xFFCCCCCC), ), child: Center( child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), SizedBox(height: 5), Column( children: [ - StepDetailsWidget(stepLabel: "هدف",), + StepDetailsWidget( + stepLabel: "هدف", + ), StatusLabel( selectedStepId: index, stepId: 1, @@ -370,111 +395,116 @@ class StepsWidget extends StatelessWidget { ), ), ), - Positioned( - top: circleTop, - right: MediaQuery - .of(context) - .size - .width * 0.50, - child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(2) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width:circleHeight, - height: circleHeight, - decoration: BoxDecoration( - border: index == 2 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 2 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 2 - ? Color(0xFFCC9B14) - : index > 2 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + if (patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + right: MediaQuery.of(context).size.width * 0.50, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(2) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 2 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 2 + ? Color(0xFFCC9B14) + : index > 2 + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Padding( - padding: const EdgeInsets.only(right: 2), - child: Column( - children: [ - StepDetailsWidget(stepLabel: "تقدير",), - StatusLabel( - selectedStepId: index, - stepId: 2, - ), - ], + SizedBox( + height: 5, ), - ), - ], + Padding( + padding: const EdgeInsets.only(right: 2), + child: Column( + children: [ + StepDetailsWidget( + stepLabel: "تقدير", + ), + StatusLabel( + selectedStepId: index, + stepId: 2, + ), + ], + ), + ), + ], + ), ), ), - ), - Positioned( - top: circleTop, - left: 0, - child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - width:circleHeight, - height: circleHeight, - decoration: BoxDecoration( - border: index == 3 - ? Border.all(color: Color(0xFFCC9B14), width: 2) - : index > 3 - ? null - : Border.all( - color: Color(0xFFCCCCCC), width: 0.75), - shape: BoxShape.circle, - color: index == 3 - ? Color(0xFFCC9B14) - : index > 3 - ? Color(0xFFCC9B14) - : Color(0xFFCCCCCC), + if (patientInfo.admissionNo == null && + patientInfo.admissionNo.isEmpty) + Positioned( + top: circleTop, + left: 0, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(4) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + width: circleHeight, + height: circleHeight, + decoration: BoxDecoration( + border: index == 3 + ? Border.all(color: Color(0xFFCC9B14), width: 2) + : index > 3 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 3 + ? Color(0xFFCC9B14) + : index > 3 + ? Color(0xFFCC9B14) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Icon( + FontAwesomeIcons.check, + size: 20, + color: Colors.white, + )), ), - child: Center( - child: Icon( - FontAwesomeIcons.check, - size: 20, - color: Colors.white, - )), - ), - SizedBox( - height: 5, - ), - Container( - margin: EdgeInsets.only(right: index == 3 ? 15 : 0), - child: Column( - children: [ - StepDetailsWidget(stepLabel: "خطة",), - StatusLabel( - selectedStepId: index, - stepId: 3, - ), - ], + SizedBox( + height: 5, ), - ), - ], + Container( + margin: EdgeInsets.only(right: index == 3 ? 15 : 0), + child: Column( + children: [ + StepDetailsWidget( + stepLabel: "خطة", + ), + StatusLabel( + selectedStepId: index, + stepId: 3, + ), + ], + ), + ), + ], + ), ), ), - ), ], ); } diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index d4cc5ca9..bbe06c31 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -149,7 +149,7 @@ class _UpdateSoapIndexState extends State Container( child: FractionallySizedBox( widthFactor: .80, - child: getBottomSheet(model) + child: getBottomSheet(model, patient) ), ), SizedBox( @@ -163,7 +163,7 @@ class _UpdateSoapIndexState extends State ); } - Widget getBottomSheet(SOAPViewModel model) { + Widget getBottomSheet(SOAPViewModel model, PatiantInformtion patient) { switch (_currentIndex) { case 0: { @@ -206,7 +206,8 @@ class _UpdateSoapIndexState extends State ), Expanded( child: AppButton( - title: TranslationBase.of(context).next, + title: patient.admissionNo != null && + patient.admissionNo.isNotEmpty?TranslationBase.of(context).finish: TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], height: SizeConfig.heightMultiplier * From 4abd005499b1a22b2792e22de55be3f3b8a761ea Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 15 Aug 2021 15:20:22 +0300 Subject: [PATCH 27/29] SOAP For in patient --- lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart | 2 +- lib/models/SOAP/post_chief_complaint_request_model.dart | 2 +- .../profile/soap_update/subjective/update_subjective_page.dart | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 6be95372..f04fd8d4 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -34,7 +34,7 @@ class GetChiefComplaintReqModel { data['DoctorID'] = this.doctorID; } if (this.admissionNo != null) { - data['admissionNo'] = this.admissionNo; + data['AdmissionNo'] = this.admissionNo; } return data; diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index eb3bea7f..682342df 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -62,7 +62,7 @@ class PostChiefComplaintRequestModel { data['EditedBy'] = this.editedBy; } if (admissionNo != null) { - data['admissionNo'] = this.admissionNo; + data['AdmissionNo'] = this.admissionNo; } return data; 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 7234d822..70bf95e4 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 @@ -436,6 +436,7 @@ class _UpdateSubjectivePageState extends State implements postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); } else { + postChiefComplaintRequestModel.editedBy = ''; await model.patchChiefComplaint(postChiefComplaintRequestModel); } } From 79a0e0917f208bd7f5b5b83b3691d90f02a27d68 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 16 Aug 2021 16:17:23 +0300 Subject: [PATCH 28/29] fix issue related to outpatient --- .../objective/update_objective_page.dart | 2 ++ .../steper/steps_widget.dart | 30 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) 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 b780e952..04c36ed9 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 @@ -251,6 +251,8 @@ class _UpdateObjectivePageState extends State widget.patientInfo.admissionNo.isNotEmpty) { listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo); + } else { + listHisProgNotePhysicalExaminationVM.admissionNo = 0; } postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM .add(listHisProgNotePhysicalExaminationVM); diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart index 6320fc41..e1c97d75 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart @@ -51,7 +51,7 @@ class StepsWidget extends StatelessWidget { child: Center( child: Container( width: MediaQuery.of(context).size.width * - (patientInfo.admissionNo == null && + (patientInfo.admissionNo == null || patientInfo.admissionNo.isEmpty ? 0.9 : 0.85), @@ -114,8 +114,8 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: circleTop, - left: patientInfo.admissionNo == null && - patientInfo.admissionNo.isEmpty + left: patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty ? MediaQuery.of(context).size.width * 0.25 : MediaQuery.of(context).size.width * 0.71, child: InkWell( @@ -166,8 +166,8 @@ class StepsWidget extends StatelessWidget { ), ), ), - if (patientInfo.admissionNo == null && - patientInfo.admissionNo.isEmpty) + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, left: MediaQuery.of(context).size.width * 0.47, @@ -221,8 +221,8 @@ class StepsWidget extends StatelessWidget { ), ), ), - if (patientInfo.admissionNo == null && - patientInfo.admissionNo.isEmpty) + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, right: 0, @@ -288,8 +288,8 @@ class StepsWidget extends StatelessWidget { top: 30, child: Center( child: Container( - width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null && - patientInfo.admissionNo.isEmpty?0.9:0.85), + width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty?0.9:0.85), child: Divider( color: Colors.grey, height: 0.75, @@ -348,8 +348,8 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: circleTop, - right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null && - patientInfo.admissionNo.isEmpty?0.25:0.71), + right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty?0.25:0.71), child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( @@ -395,8 +395,8 @@ class StepsWidget extends StatelessWidget { ), ), ), - if (patientInfo.admissionNo == null && - patientInfo.admissionNo.isEmpty) + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, right: MediaQuery.of(context).size.width * 0.50, @@ -450,8 +450,8 @@ class StepsWidget extends StatelessWidget { ), ), ), - if (patientInfo.admissionNo == null && - patientInfo.admissionNo.isEmpty) + if (patientInfo.admissionNo == null || + patientInfo.admissionNo.isEmpty) Positioned( top: circleTop, left: 0, From 947fc7f8f88356139aea72e769de5a46f33a8d24 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 17 Aug 2021 11:30:27 +0300 Subject: [PATCH 29/29] fix issues related to add progress exam --- lib/core/viewModel/SOAP_view_model.dart | 1 + .../objective/update_objective_page.dart | 139 ++++++++++-------- .../soap_update/update_soap_index.dart | 2 +- 3 files changed, 78 insertions(+), 64 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 29caec43..d42098a2 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -92,6 +92,7 @@ class SOAPViewModel extends BaseViewModel { int get episodeID => _SOAPService.episodeID; bool isAddProgress = true; + bool isAddExamInProgress = true; String progressNoteText =""; String complaintsControllerError = ''; String medicationControllerError = ''; 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 04c36ed9..576c52c3 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 @@ -68,7 +68,7 @@ class _UpdateObjectivePageState extends State onModelReady: (model) async { model.setObjectiveCallBack(this); mySelectedExamination.clear(); - + model.isAddExamInProgress = true; await model.getPatientPhysicalExam(widget.patientInfo); if (model.patientPhysicalExamList.isNotEmpty) { if (model.physicalExaminationList.length == 0) { @@ -208,75 +208,88 @@ class _UpdateObjectivePageState extends State submitUpdateObjectivePage(SOAPViewModel model) async { if (mySelectedExamination.isNotEmpty) { - widget.changeLoadingState(true); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + 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(); + mySelectedExamination.forEach((exam) { + 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, + remarks: exam.remark ?? '', + createdBy: exam.createdBy ?? doctorProfile.doctorID, + createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + notExamined: exam.notExamined, + examinationType: exam.isNormal + ? 1 + : exam.isAbnormal + ? 2 + : 3, + examinationTypeName: exam.isNormal + ? "Normal" + : exam.isAbnormal + ? 'AbNormal' + : "Not Examined", + isNew: exam.isNew, + ); + if (widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + listHisProgNotePhysicalExaminationVM.admissionNo = + int.parse(widget.patientInfo.admissionNo); + } else { + listHisProgNotePhysicalExaminationVM.admissionNo = 0; + } + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM + .add(listHisProgNotePhysicalExaminationVM); + }); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); - mySelectedExamination.forEach((exam) { - 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, - remarks: exam.remark ?? '', - createdBy: exam.createdBy ?? doctorProfile.doctorID, - createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - notExamined: exam.notExamined, - examinationType: exam.isNormal - ? 1 - : exam.isAbnormal - ? 2 - : 3, - examinationTypeName: exam.isNormal - ? "Normal" - : exam.isAbnormal - ? 'AbNormal' - : "Not Examined", - isNew: exam.isNew, - ); - if (widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { - listHisProgNotePhysicalExaminationVM.admissionNo = - int.parse(widget.patientInfo.admissionNo); + if (model.patientPhysicalExamList.isEmpty) { + await model.postPhysicalExam(postPhysicalExamRequestModel); } else { - listHisProgNotePhysicalExaminationVM.admissionNo = 0; + await model.patchPhysicalExam(postPhysicalExamRequestModel); } - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(listHisProgNotePhysicalExaminationVM); - }); - - if (model.patientPhysicalExamList.isEmpty) { - await model.postPhysicalExam(postPhysicalExamRequestModel); - } else { - await model.patchPhysicalExam(postPhysicalExamRequestModel); - } - if (model.state == ViewState.ErrorLocal) { - widget.changeLoadingState(false); - Helpers.showErrorToast(model.error); - } else { - if(widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { - Navigator.of(context).pop(); + if (model.state == ViewState.ErrorLocal) { + widget.changeLoadingState(false); + Helpers.showErrorToast(model.error); + if(widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + // Navigator.of(context).pop(); + model.isAddExamInProgress = false; + } } else { - widget.changeLoadingState(true); - widget.changePageViewIndex(2); - } + if(widget.patientInfo.admissionNo != null && + widget.patientInfo.admissionNo.isNotEmpty) { + // Navigator.of(context).pop(); + widget.changeLoadingState(false); + model.isAddExamInProgress = false; + } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); + } + } } + } else { Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); } diff --git a/lib/screens/patients/profile/soap_update/update_soap_index.dart b/lib/screens/patients/profile/soap_update/update_soap_index.dart index bbe06c31..07c8caf7 100644 --- a/lib/screens/patients/profile/soap_update/update_soap_index.dart +++ b/lib/screens/patients/profile/soap_update/update_soap_index.dart @@ -207,7 +207,7 @@ class _UpdateSoapIndexState extends State Expanded( child: AppButton( title: patient.admissionNo != null && - patient.admissionNo.isNotEmpty?TranslationBase.of(context).finish: TranslationBase.of(context).next, + patient.admissionNo.isNotEmpty && !model.isAddExamInProgress?TranslationBase.of(context).finish: TranslationBase.of(context).next, fontWeight: FontWeight.w600, color: Colors.red[700], height: SizeConfig.heightMultiplier *