diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 31f3be0d..2a89b765 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -152,7 +152,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = VERSION_ID; + body['VersionID'] = 6.3; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/core/service/InsuranceCardService.dart b/lib/core/service/InsuranceCardService.dart index 43c0e811..de7ee433 100644 --- a/lib/core/service/InsuranceCardService.dart +++ b/lib/core/service/InsuranceCardService.dart @@ -15,18 +15,18 @@ class InsuranceCardService extends BaseService { List get insuranceApproval => _insuranceApproval; - Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async { + Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo , int projectId}) async { hasError = false; // _cardList.clear(); - if (appointmentNo != null) { - _insuranceApprovalModel.appointmentNo = appointmentNo; - _insuranceApprovalModel.eXuldAPPNO = null; - _insuranceApprovalModel.projectID = null; - } else { + // if (appointmentNo != null) { + // _insuranceApprovalModel.appointmentNo = appointmentNo; + // _insuranceApprovalModel.eXuldAPPNO = null; + // _insuranceApprovalModel.projectID = projectId; + // } else { _insuranceApprovalModel.appointmentNo = null; _insuranceApprovalModel.eXuldAPPNO = 0; _insuranceApprovalModel.projectID = 0; - } + // } await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, patient: patient, diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index b08469ef..a0b51d20 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -14,12 +14,12 @@ class InsuranceViewModel extends BaseViewModel{ List get insuranceApproval => _insuranceCardService.insuranceApproval; - Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async { + Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo, int projectId}) async { error = ""; setState(ViewState.Busy); if (appointmentNo != null) await _insuranceCardService.getInsuranceApproval(patient, - appointmentNo: appointmentNo); + appointmentNo: appointmentNo,projectId: projectId); else await _insuranceCardService.getInsuranceApproval(patient); if (_insuranceCardService.hasError) { diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index 62d46d5e..2f5549fb 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -39,14 +39,15 @@ class DoctorReplyScreen extends StatelessWidget { children: model.listDoctorWorkingHoursTable.map((reply) { return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat(reply: reply))); - }, - child: DoctorReplyWidget(reply: reply)); + onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (BuildContext context) => + // DoctorReplayChat(reply: reply))); + }, + child: DoctorReplyWidget(reply: reply), + ); }).toList(), ) ], diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 1e2bc1f8..25ea1f22 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,8 +1,10 @@ import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; +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/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.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'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; @@ -14,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body. import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class MedicalFileDetails extends StatefulWidget { String age; @@ -69,6 +72,7 @@ class _MedicalFileDetailsState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: pp), builder: @@ -184,7 +188,7 @@ class _MedicalFileDetailsState extends State { TranslationBase.of(context) .episode + ": ", - fontWeight: FontWeight.w700, + //fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -216,7 +220,7 @@ class _MedicalFileDetailsState extends State { TranslationBase.of(context) .visitDate + ": ", - fontWeight: FontWeight.w700, + //fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -230,15 +234,17 @@ class _MedicalFileDetailsState extends State { .length != 0) AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .appointmentDate - .toString(), + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .date, + ), isArabic: projectViewModel.isArabic)}', + color: Colors.black, fontWeight: FontWeight.w700, + fontSize: 14, ), SizedBox(width: 35.0), // AppText( diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index cb0be61c..3f0bfedf 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -42,7 +42,7 @@ class _InsuranceApprovalScreenNewState return BaseView( onModelReady: patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo) + appointmentNo: patient.appointmentNo,projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 98daef73..8903b704 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -37,7 +37,7 @@ class _InsuranceApprovalsDetailsState extends State { return BaseView( onModelReady: patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo) + appointmentNo: patient.appointmentNo,projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( @@ -93,14 +93,12 @@ class _InsuranceApprovalsDetailsState extends State { Row( children: [ Texts( - model.insuranceApproval[indexInsurance] - .approvalDetails.status, + model.insuranceApproval[indexInsurance].approvalDetails!=null? + model.insuranceApproval[indexInsurance].approvalDetails.status ??"":"", color: - model.insuranceApproval[indexInsurance] - .approvalDetails.status == - "Approved" - ? Color(0xff359846) - : Color(0xffD02127), + model.insuranceApproval[indexInsurance].approvalDetails!=null? + "${model.insuranceApproval[indexInsurance].approvalDetails.status}" + == "Approved" ? Color(0xff359846) : Color(0xffD02127): Color(0xffD02127), ), ], ), @@ -210,9 +208,7 @@ class _InsuranceApprovalsDetailsState extends State { Texts('Sample') ], ), - SizedBox( - height: 25.0, - ), + Row( children: [ Texts( @@ -315,8 +311,8 @@ class _InsuranceApprovalsDetailsState extends State { child: Texts(model .insuranceApproval[ indexInsurance] - .approvalDetails - .procedureName), + ?.approvalDetails + ?.procedureName??""), ), Container( height: MediaQuery.of(context) @@ -330,8 +326,8 @@ class _InsuranceApprovalsDetailsState extends State { child: Texts(model .insuranceApproval[ indexInsurance] - .approvalDetails - .status), + ?.approvalDetails + ?.status??""), ), Container( height: MediaQuery.of(context) @@ -345,8 +341,8 @@ class _InsuranceApprovalsDetailsState extends State { child: Texts(model .insuranceApproval[ indexInsurance] - .approvalDetails - .isInvoicedDesc), + ?.approvalDetails + ?.isInvoicedDesc??""), ), ], ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 6b54dec7..308f8536 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -19,7 +19,13 @@ class RadiologyDetailsPage extends StatelessWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType}); + + RadiologyDetailsPage( + {Key key, + this.finalRadiology, + this.patient, + this.patientType, + this.arrivalType}); @override Widget build(BuildContext context) { @@ -30,66 +36,72 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBar: PatientProfileHeaderWhitAppointmentAppBar( - patient: patient, - patientType: patientType??"0", - arrivalType: arrivalType??"0", - orderNo: finalRadiology.orderNo.toString(), - appointmentDate:finalRadiology.orderDate, - doctorName: finalRadiology.doctorName, - profileUrl: finalRadiology.doctorImageURL, - invoiceNO: finalRadiology.invoiceNo.toString(), - ), - isShowAppBar: true, - baseViewModel: model, - body: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 5,), - Texts(TranslationBase.of(context).generalResult), - SizedBox(height: 5,), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - '${finalRadiology.reportData.trim()}', - textAlign: TextAlign.start, - fontSize: 17, - color: Colors.grey, - ), + appBar: PatientProfileHeaderWhitAppointmentAppBar( + patient: patient, + patientType: patientType ?? "0", + arrivalType: arrivalType ?? "0", + appointmentDate: finalRadiology.orderDate, + doctorName: finalRadiology.doctorName, + profileUrl: finalRadiology.doctorImageURL, + invoiceNO: finalRadiology.invoiceNo.toString(), + ), + isShowAppBar: true, + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Texts(TranslationBase.of(context).generalResult), + SizedBox( + height: 5, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + '${finalRadiology.reportData.trim()}', + textAlign: TextAlign.start, + fontSize: 17, + color: Colors.grey, ), - SizedBox(height: 25,), - if(model.radImageURL.isNotEmpty) - Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( + ), + SizedBox( + height: 100, + ), - color: Colors.red, - onTap: () { - launch(model.radImageURL); - }, - title: TranslationBase.of(context).openRad, - ), - ), - ), - ], - ), + ], ), - ], - ), + ), + ], ), + ), + bottomSheet: model.radImageURL.isNotEmpty ?Container( + width: double.maxFinite, + height: 100, + child: Container( + margin: EdgeInsets.only(left: 35,right: 35,top: 12,bottom: 12), + child: Button( + color: Colors.red, + onTap: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), ), + ):null, + ), ); } } diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 27c58e99..5cb14b8a 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -124,7 +124,6 @@ class RadiologyHomePage extends StatelessWidget { invoiceNO: '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', appointmentDate: model.radiologyList[index].orderDate, - orderNo: model.radiologyList[index].orderNo.toString(), ), )), diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index fa665aff..4197b5b6 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -100,13 +100,25 @@ class PrescriptionItemsPage extends StatelessWidget { Row( children: [ Texts(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: Texts(model.prescriptionReportList[index].routeN)), + Expanded(child: Texts(" "+model.prescriptionReportList[index].routeN)), ], ), Row( children: [ Texts(TranslationBase.of(context).frequency,color: Colors.grey,), - Texts(model.prescriptionReportList[index].frequencyN ?? ''), + Texts(" "+model.prescriptionReportList[index].frequencyN ?? ''), + ], + ), + Row( + children: [ + Texts(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + Texts(" "+model.prescriptionReportList[index].doseDailyQuantity ?? ''), + ], + ), + Row( + children: [ + Texts(TranslationBase.of(context).duration,color: Colors.grey,), + Texts(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), SizedBox(height: 12,), @@ -178,13 +190,25 @@ class PrescriptionItemsPage extends StatelessWidget { Row( children: [ Texts(TranslationBase.of(context).route,color: Colors.grey,), - Expanded(child: Texts(model.prescriptionReportEnhList[index].route??'')), + Expanded(child: Texts(" "+model.prescriptionReportEnhList[index].route??'')), ], ), Row( children: [ Texts(TranslationBase.of(context).frequency,color: Colors.grey,), - Texts(model.prescriptionReportEnhList[index].frequency ?? ''), + Texts(" "+model.prescriptionReportEnhList[index].frequency ?? ''), + ], + ), + Row( + children: [ + Texts(TranslationBase.of(context).dailyDoses,color: Colors.grey,), + Texts(" "+model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? ''), + ], + ), + Row( + children: [ + Texts(TranslationBase.of(context).duration,color: Colors.grey,), + Texts(" "+model.prescriptionReportList[index].days.toString() ?? ''), ], ), SizedBox(height: 12,), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 3acc3476..5a284435 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -54,7 +54,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred " " + Helpers.capitalize( patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier *2.5, + fontSize: SizeConfig.textMultiplier *2.2, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, fontFamily: 'Poppins', @@ -79,71 +79,70 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred height: 60, child: Image.asset( gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), ), ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SERVICES_PATIANT2[ - int.parse(patientType)] == - "patientArrivalList" - ? Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - patient.patientStatusType == - 43 - ? AppText( - TranslationBase.of( - context) - .arrivedP, - color: Colors.green, - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of( - context) - .notArrived, - color: - Colors.red[800], - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ), - arrivalType == '1' - ? AppText( - patient.startTime != - null - ? patient - .startTime - : '', - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - : AppText( - DateUtils.convertStringToDateFormat( - patient - .arrivedOn, - 'MM-dd-yyyy HH:mm'), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + patient.arrivedOn!=null? DateUtils.convertStringToDateFormat( + patient.arrivedOn, + 'MM-dd-yyyy HH:mm'):'', fontFamily: 'Poppins', fontWeight: diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 47bf19c4..4f96ac67 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -57,7 +57,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, fontFamily: 'Poppins', diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart index dc60e560..61cb7b52 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -77,7 +77,7 @@ class PatientProfileHeaderWhitAppointment extends StatelessWidget { " " + Helpers.capitalize( patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier *2.5, + fontSize: SizeConfig.textMultiplier *2.2, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, fontFamily: 'Poppins', diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 4106cdbe..d63754df 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -77,7 +77,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget with Pre " " + Helpers.capitalize( patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier *2.5, + fontSize: SizeConfig.textMultiplier *2.2, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, fontFamily: 'Poppins', diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index ddb7b9d6..86016be9 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -16,6 +16,7 @@ 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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -35,10 +36,12 @@ class UpdateAssessmentPage extends StatefulWidget { final PatiantInformtion patientInfo; final Function changeLoadingState; - UpdateAssessmentPage({Key key, - this.changePageViewIndex, - this.mySelectedAssessmentList, - this.patientInfo, this.changeLoadingState}); + UpdateAssessmentPage( + {Key key, + this.changePageViewIndex, + this.mySelectedAssessmentList, + this.patientInfo, + this.changeLoadingState}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -51,7 +54,7 @@ class _UpdateAssessmentPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) async{ + onModelReady: (model) async { widget.mySelectedAssessmentList.clear(); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -60,7 +63,7 @@ class _UpdateAssessmentPageState extends State { doctorID: '', appointmentNo: widget.patientInfo.appointmentNo); await model.getPatientAssessment(getAssessmentReqModel); - if(model.patientAssessmentList.isNotEmpty){ + if (model.patientAssessmentList.isNotEmpty) { if (model.listOfDiagnosisCondition.length == 0) { await model.getMasterLookup(MasterKeysService.DiagnosisCondition); } @@ -83,70 +86,92 @@ class _UpdateAssessmentPageState extends State { masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - if(diagnosisCondition !=null &&diagnosisType !=null && diagnosisCondition!=null) { - MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( - appointmentId: element.appointmentNo, - remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID - ); + if (diagnosisCondition != null && + diagnosisType != null && + diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = + MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); widget.mySelectedAssessmentList.add(temMySelectedAssessment); } - }); } widget.changeLoadingState(false); - }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, + child: Container( + color: Color(0xffF8F8F8), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: + Border.all(color: Colors.grey[200], width: 0.5), ), - HeaderBodyExpandableNotifier( + child: HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - Texts(TranslationBase.of(context).assessment.toUpperCase(), - variant: - isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], + Padding( + padding: EdgeInsets.all(12.0), + child: Row( + children: [ + Texts( + TranslationBase.of(context) + .assessment, + variant: isAssessmentExpand + ? "bodyText" + : '', + bold: + isAssessmentExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: Colors.black, + size: 10, + ) + ], + ), ), InkWell( onTap: () { setState(() { - isAssessmentExpand = !isAssessmentExpand; + isAssessmentExpand = + !isAssessmentExpand; }); }, child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: Column(children: [ @@ -156,24 +181,23 @@ class _UpdateAssessmentPageState extends State { Column( children: [ Container( - margin: - EdgeInsets.only(left: 5, right: 5, top: 15), + margin: EdgeInsets.only( + left: 5, right: 5, top: 15), child: TextFields( - hintText: TranslationBase.of(context).addAssessment, + hintText: TranslationBase.of(context) + .addAssessment, fontSize: 13.5, onTapTextFields: () { - openAssessmentDialog(context,isUpdate: false, - model: model); + openAssessmentDialog(context, + isUpdate: false, model: model); }, readOnly: true, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal - .appPrimaryColor, + suffixIcon: EvaIcons.plusSquare, + suffixIconColor: Colors.black, fontWeight: FontWeight.w600, validator: (value) { if (value == null) - return TranslationBase - .of(context) + return TranslationBase.of(context) .emptyMessage; else return null; @@ -182,182 +206,203 @@ class _UpdateAssessmentPageState extends State { SizedBox( height: 20, ), - Column( - children: widget.mySelectedAssessmentList.map(( - assessment) { + children: widget.mySelectedAssessmentList + .map((assessment) { return Container( margin: EdgeInsets.only( left: 5, right: 5, top: 15), child: Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - crossAxisAlignment: CrossAxisAlignment - .start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Column( - mainAxisAlignment: MainAxisAlignment - .start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( children: [ AppText( - - assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day.toString(), - fontWeight: FontWeight - .bold, - fontSize: 13, - ), - AppText( - Helpers.getMonth(assessment.createdOn !=null?DateTime.parse(assessment.createdOn).month:DateTime.now().month).toUpperCase(), + "ICD : ".toUpperCase(), fontSize: 10, color: Colors.grey, ), + Container( + child: AppText( + assessment.selectedICD + .code + .trim() + .toUpperCase() ?? + "", + fontWeight: + FontWeight.w700, + fontSize: 11, + ), + ), ], - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ + ), Row( mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).ICDName +" : ", - fontWeight: FontWeight - .bold, + TranslationBase.of( + context) + .ICDName + + " : ", fontSize: 13, + color: Colors.grey, ), Container( - width: MediaQuery - .of(context) - .size - .width * 0.29, + width: + MediaQuery.of(context) + .size + .width * + 0.29, child: AppText( - assessment - .selectedICD.description + assessment.selectedICD + .description .toString(), + fontWeight: + FontWeight.w700, fontSize: 10, - color: Colors.grey, ), ), ], ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentNo, - fontWeight: FontWeight - .bold, - fontSize: 13, + TranslationBase.of( + context) + .appointmentNo, + fontSize: 10, + color: Colors.grey, ), AppText( - assessment - .appointmentId + assessment.appointmentId .toString(), - fontSize: 10, - color: Colors.grey, + fontSize: 11, + fontWeight: + FontWeight.w700, ), ], ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).condition + " : ", - fontWeight: FontWeight - .bold, - fontSize: 13, - ), - AppText( - projectViewModel.isArabic?assessment - .selectedDiagnosisCondition - .nameAr : assessment - .selectedDiagnosisCondition - .nameEn, + TranslationBase.of( + context) + .condition + + " : ", fontSize: 10, color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ AppText( - TranslationBase.of(context).dType+' : ', - fontWeight: FontWeight - .bold, - fontSize: 13, - ), - AppText( - projectViewModel.isArabic?assessment - .selectedDiagnosisType - .nameAr:assessment - .selectedDiagnosisType - .nameEn, - fontSize: 10, - color: Colors.grey, + projectViewModel.isArabic + ? assessment + .selectedDiagnosisCondition + .nameAr + : assessment + .selectedDiagnosisCondition + .nameEn, + fontSize: 11, + fontWeight: + FontWeight.w700, ), ], ), - if(assessment.doctorName != null) Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).doc, - fontWeight: FontWeight - .bold, - fontSize: 13, - ), - AppText( - assessment.doctorName??'', + TranslationBase.of( + context) + .dType + + ' : ', fontSize: 10, color: Colors.grey, ), + AppText( + projectViewModel.isArabic + ? assessment + .selectedDiagnosisType + .nameAr + : assessment + .selectedDiagnosisType + .nameEn, + fontSize: 11, + fontWeight: + FontWeight.w700, + ), ], ), + if (assessment.doctorName != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of( + context) + .doc, + fontSize: 10, + color: Colors.grey, + ), + AppText( + assessment.doctorName ?? + '', + fontSize: 11, + fontWeight: + FontWeight.w700, + ), + ], + ), SizedBox( height: 6, ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ SizedBox( height: 6, ), AppText( - assessment.remark != null || - assessment.remark == '' - ? TranslationBase.of(context).remarks + " : " - : '', - fontWeight: FontWeight.bold, - fontSize: 13, - ), + assessment.remark != + null || + assessment + .remark == + '' + ? TranslationBase.of( + context) + .remarks + + " : " + : '', + fontSize: 10, + color: Colors.grey, + ), Container( - width: MediaQuery - .of(context) - .size - .width * 0.38, + width: + MediaQuery.of(context) + .size + .width * + 0.38, child: AppText( assessment.remark ?? "", - fontSize: 10, - color: Colors.grey, + fontSize: 11, + fontWeight: + FontWeight.w700, ), ), ], @@ -365,89 +410,143 @@ class _UpdateAssessmentPageState extends State { ], ), Column( - crossAxisAlignment: CrossAxisAlignment - .start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Row( - children: [ AppText( - "ICD : ".toUpperCase(), - fontWeight: FontWeight - .bold, - fontSize: 13, + assessment.createdOn != + null + ? DateTime.parse( + assessment + .createdOn) + .day + .toString() + : DateTime.now() + .day + .toString(), + fontWeight: + FontWeight.bold, + fontSize: 15, ), - Container( - child: AppText( - assessment.selectedICD - .code.trim() - .toUpperCase() ?? - "", - fontSize: 10, - color: Colors.grey, - ), + AppText(" "), + AppText( + Helpers.getMonth(assessment + .createdOn != + null + ? DateTime.parse( + assessment + .createdOn) + .month + : DateTime.now() + .month) + .toUpperCase(), + fontSize: 13, + color: Colors.grey, ), ], - ) - ], - ), - Column( - children: [ + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.05, + ), InkWell( onTap: () { openAssessmentDialog( - context, isUpdate: true, + context, + isUpdate: true, assessment: assessment, model: model); }, - child: Icon(EvaIcons - .edit2Outline), + child: Icon(EvaIcons.edit2), ) ], ), + // Column( + // children: [ + // // SizedBox( + // // height: 60, + // // ), + // InkWell( + // onTap: () { + // openAssessmentDialog( + // context, + // isUpdate: true, + // assessment: assessment, + // model: model); + // }, + // child: Icon(EvaIcons.edit2), + // ) + // ], + // ), ], ), ); - }).toList(),) + }).toList(), + ) ], ) ]), isExpand: isAssessmentExpand, ), - DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase - .of(context) - .next, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - helpers.showErrorToast( - TranslationBase.of(context).assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, - ), - SizedBox( - height: 30, - ), - ], + ), + DividerWithSpacesAround( + height: 30, + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: 'Previous', + color: Colors.white38, + fontColor: Colors.black, + fontWeight: FontWeight.w700, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + Navigator.pop(context); + }, + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + ), + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase.of(context).next, + fontWeight: FontWeight.w700, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + helpers.showErrorToast( + TranslationBase.of(context) + .assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], + ), + SizedBox( + height: 30, + ), + ], + ), ), ), ), ))); } - openAssessmentDialog(BuildContext context, - { - MySelectedAssessment assessment, bool isUpdate, - SOAPViewModel model - }) { + {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { if (assessment == null) { assessment = MySelectedAssessment( remark: '', appointmentId: widget.patientInfo.appointmentNo); @@ -466,23 +565,26 @@ class _UpdateAssessmentPageState extends State { bool isUpdate) async { setState(() { widget.mySelectedAssessmentList.add(mySelectedAssessment); - }); }); }); } - } class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final List mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) + addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; AddAssessmentDetails( - {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); - + {Key key, + this.mySelectedAssessment, + this.addSelectedAssessment, + this.patientInfo, + this.isUpdate = false, + this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -505,54 +607,47 @@ class _AddAssessmentDetailsState extends State { remarkController.text = widget.mySelectedAssessment.remark ?? ""; appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); - if(widget.isUpdate){ - if(widget.mySelectedAssessment - .selectedDiagnosisCondition != null) - conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameAr - : widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; - if(widget.mySelectedAssessment - .selectedDiagnosisType !=null) - typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment - .selectedDiagnosisType - .nameAr - : widget.mySelectedAssessment - .selectedDiagnosisType - .nameEn; - if(widget.mySelectedAssessment.selectedICD !=null) - icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + if (widget.isUpdate) { + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) + conditionController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr + : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + if (widget.mySelectedAssessment.selectedDiagnosisType != null) + typeController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr + : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; + if (widget.mySelectedAssessment.selectedICD != null) + icdNameController.text = widget.mySelectedAssessment.selectedICD.code; } final screenSize = MediaQuery.of(context).size; InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {IconData icon}) { return InputDecoration( + fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, + filled: true, hintStyle: TextStyle( - fontSize: 10, - color: Theme.of(context).hintColor, - fontWeight: FontWeight.w700), + fontSize: 10, + color: Colors.grey.shade600, + ), ); } + return FractionallySizedBox( heightFactor: 0.75, child: BaseView( @@ -567,393 +662,422 @@ class _AddAssessmentDetailsState extends State { await model.getMasterLookup(MasterKeysService.ICD10); } }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).addAssessmentDetails.toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 13, - ), - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).appointmentNumber, - fontSize: 13.5, - // hintColor: Colors.black, - hasLabelText: appointmentIdController.text != ''?true:false, - showLabelText: true, - fontWeight: FontWeight.w600, - readOnly: true, - controller: appointmentIdController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .addAssessmentDetails + .toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 13, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.42, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + height: 55.0, + hintText: + TranslationBase.of(context).appointmentNumber, + //fontSize: 13.5, + // hintColor: Colors.black, + //hasLabelText: appointmentIdController.text != '' + // ? true + // : false, + //showLabelText: true, + //fontWeight: FontWeight.w600, + //readOnly: true, + isDropDown: false, + enabled: false, + controller: appointmentIdController, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), + ), + SizedBox( + height: 10, + ), + Container( + height: 55.0, + child: InkWell( + onTap: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : null, + child: widget + .mySelectedAssessment.selectedICD == + null + ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .nameOrICD, + widget.mySelectedAssessment + .selectedICD != + null + ? widget.mySelectedAssessment + .selectedICD.nameEn + : null, + true, + icon: Icons.keyboard_arrow_down), + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment + .selectedICD = item; + icdNameController.text = item.code; }), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.080, - child: InkWell( - onTap: model.listOfICD10 != null + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts(suggestion + .description + + " / " + + suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.code + .toLowerCase() + .startsWith( + input.toLowerCase()), + ) + : AppTextFieldCustom( + onClick: model.listOfICD10 != null ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } : null, - child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .nameOrICD, - widget.mySelectedAssessment.selectedICD != - null ? widget.mySelectedAssessment - .selectedICD.nameEn : null, true, - icon: EvaIcons.search), - itemSubmitted: (item) => - setState(() - { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text =item.code; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - suggestion.description + " / " + - suggestion.code.toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.description.toLowerCase() - .startsWith(input.toLowerCase()) - || suggestion.code.toLowerCase().startsWith( - input.toLowerCase()) - , - ) - : TextFields( - onTapTextFields: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = - null; - icdNameController.text = null; - }); - } - : null, - hasLabelText: icdNameController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .nameOrICD, - fontSize: 13.5, - readOnly: true, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: icdNameController, - suffixIcon: EvaIcons.search, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }) + //hasLabelText: + // icdNameController.text != '' + // ? true + // : false, + //showLabelText: true, + hintText: TranslationBase.of(context) + .nameOrICD, - // TextField( - // decoration: textFieldSelectorDecoration( - // widget.mySelectedAssessment.selectedICD != - // null ? widget.mySelectedAssessment - // .selectedICD.code : "Name or ICD", - // widget.mySelectedAssessment.selectedICD != - // null ? projectViewModel.isArabic - // ? widget.mySelectedAssessment - // .selectedICD.nameAr - // : widget.mySelectedAssessment - // .selectedICD.nameEn : null, true, - // icon: EvaIcons.search), - // enabled: false, - // ), - ), - ), - if(isFormSubmitted && - widget.mySelectedAssessment - .selectedICD == null) - CustomValidationError(), - SizedBox( - height: 10, - ), - TextFields( - onTapTextFields: model - .listOfDiagnosisCondition != - null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase - .of(context) - .ok, - okFunction: ( - MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment + //fontSize: 13.5, + //readOnly: true, + //fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: icdNameController, + //suffixIcon: EvaIcons.search, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + + isDropDown: true, + enabled: false, + height: 55.0, + ) + + // TextField( + // decoration: textFieldSelectorDecoration( + // widget.mySelectedAssessment.selectedICD != + // null ? widget.mySelectedAssessment + // .selectedICD.code : "Name or ICD", + // widget.mySelectedAssessment.selectedICD != + // null ? projectViewModel.isArabic + // ? widget.mySelectedAssessment + // .selectedICD.nameAr + // : widget.mySelectedAssessment + // .selectedICD.nameEn : null, true, + // icon: EvaIcons.search), + // enabled: false, + // ), + ), + ), + if (isFormSubmitted && + widget.mySelectedAssessment.selectedICD == null) + CustomValidationError(), + SizedBox( + height: 7, + ), + AppTextFieldCustom( + height: 55.0, + onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment .selectedDiagnosisCondition = - selectedValue; - conditionController.text = - projectViewModel.isArabic - ? widget.mySelectedAssessment + selectedValue; + conditionController + .text = projectViewModel + .isArabic + ? widget + .mySelectedAssessment .selectedDiagnosisCondition .nameAr - : widget.mySelectedAssessment + : widget + .mySelectedAssessment .selectedDiagnosisCondition .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: conditionController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .condition, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: conditionController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - if(isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == null) - CustomValidationError(), - SizedBox( - height: 10, - ), - + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + //hasLabelText: + // conditionController.text != '' ? true : false, + //showLabelText: true, + hintText: TranslationBase.of(context).condition, + //fontSize: 13.5, + //readOnly: true, + //suffixIcon: EvaIcons.arrowDown, + // hintColor: Colors.black, + //fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: conditionController, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context).emptyMessage; + // else + // return null; + // }, - TextFields( - onTapTextFields: model - .listOfDiagnosisType != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase - .of(context) - .ok, - okFunction: ( - MasterKeyModel selectedValue) { - setState(() { - // _selectedDiagnosisType = - // selectedValue; - widget.mySelectedAssessment + isDropDown: true, + enabled: false, + ), + if (isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == + null) + CustomValidationError(), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: 55.0, + onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + // _selectedDiagnosisType = + // selectedValue; + widget.mySelectedAssessment .selectedDiagnosisType = - selectedValue; - typeController.text = + selectedValue; + typeController.text = projectViewModel.isArabic - ? selectedValue - .nameAr - : selectedValue - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hasLabelText: typeController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .dType, - fontSize: 13.5, - readOnly: true, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: typeController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - if(isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == null) - CustomValidationError(), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hintText: TranslationBase - .of(context) - .remarks, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 18, - minLines: 5, - hasLabelText: remarkController.text != - '' ? true : false, - showLabelText: true, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = - remarkController.text; - }, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - AppButton( - title: (widget.isUpdate?TranslationBase.of(context).update:TranslationBase.of(context).add).toUpperCase(), - 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); - } - }, - ), - ])), - ), - ), - ))), + ? selectedValue.nameAr + : selectedValue.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + //hasLabelText: + // typeController.text != '' ? true : false, + //prefixIcon: Icon(Icons.add), + //showLabelText: true, + hintText: TranslationBase.of(context).dType, + //fontSize: 13.5, + //readOnly: true, + // hintColor: Colors.black, + //suffixIcon: EvaIcons.arrowDown, + //fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + enabled: false, + isDropDown: true, + + controller: typeController, + // validator: (value) { + // if (value == null) + // return TranslationBase.of(context).emptyMessage; + // else + // return null; + // }, + ), + if (isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == + null) + CustomValidationError(), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( + hintText: TranslationBase.of(context).remarks, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 18, + minLines: 5, + hasLabelText: + remarkController.text != '' ? true : false, + showLabelText: true, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = + remarkController.text; + }, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + 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); + } + }, + ), + ])), + ), + ), + ))), ); } submitAssessment( - {SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { + {SOAPViewModel model, + MySelectedAssessment mySelectedAssessment, + bool isUpdate = false}) async { if (isUpdate) { - PatchAssessmentReqModel patchAssessmentReqModel = - PatchAssessmentReqModel( + PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: - mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - mySelectedAssessment.selectedDiagnosisType.id, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, icdcode10Id: mySelectedAssessment.selectedICD.code, - prevIcdCode10ID: mySelectedAssessment.icdCode10ID - ); + prevIcdCode10ID: mySelectedAssessment.icdCode10ID); await model.patchAssessment(patchAssessmentReqModel); } else { PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: - mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - mySelectedAssessment.selectedDiagnosisType.id, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, icdcode10Id: mySelectedAssessment.selectedICD.code) ]); await model.postAssessment(postAssessmentRequestModel); } - if (model.state == ViewState.ErrorLocal) { - helpers - .showErrorToast(model.error); + helpers.showErrorToast(model.error); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -963,17 +1087,15 @@ class _AddAssessmentDetailsState extends State { if (!isUpdate) { // widget.mySelectedAssessmentList.add(mySelectedAssessment); - widget.addSelectedAssessment(mySelectedAssessment,isUpdate); + widget.addSelectedAssessment(mySelectedAssessment, isUpdate); } Navigator.of(context).pop(); } - // widget.changePageViewIndex(3); } } - class PatchAssessmentReqModel { int patientMRN; int appointmentNo; @@ -987,14 +1109,14 @@ class PatchAssessmentReqModel { PatchAssessmentReqModel( {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.icdcode10Id, - this.prevIcdCode10ID, - this.conditionId, - this.diagnosisTypeId, - this.complexDiagnosis, - this.remarks}); + this.appointmentNo, + this.episodeID, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); PatchAssessmentReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -1022,5 +1144,3 @@ class PatchAssessmentReqModel { return data; } } - -