diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart index a0b51d20..941abcfb 100644 --- a/lib/core/viewModel/InsuranceViewModel.dart +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -23,8 +23,8 @@ class InsuranceViewModel extends BaseViewModel{ else await _insuranceCardService.getInsuranceApproval(patient); if (_insuranceCardService.hasError) { - error = _insuranceCardService.error; - setState(ViewState.ErrorLocal); + error = "No Insurance Approval Found"; + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 548c0a68..82b2f70c 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -244,12 +244,15 @@ class PrescriptionViewModel extends BaseViewModel { } } - getPrescriptions(PatiantInformtion patient) async { + getPrescriptions(PatiantInformtion patient, {String patientType}) async { setState(ViewState.Busy); await _prescriptionsService.getPrescriptions(patient); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; - setState(ViewState.Error); + if(patientType=="7") + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); } else { _filterList(); await _getPrescriptionsOrders(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6632df4d..0d0b41ef 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -55,14 +55,17 @@ class ProcedureViewModel extends BaseViewModel { ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; - Future getProcedure({int mrn}) async { + Future getProcedure({int mrn,String patientType}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _procedureService.getProcedure(mrn: mrn); if (_procedureService.hasError) { error = _procedureService.error; - setState(ViewState.Error); + if(patientType=="7") + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); } else setState(ViewState.Idle); } @@ -136,12 +139,15 @@ class ProcedureViewModel extends BaseViewModel { //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient) async { + void getPatientRadOrders(PatiantInformtion patient,{String patientType}) async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient); if (_radiologyService.hasError) { error = _radiologyService.error; - setState(ViewState.Error); + if(patientType=="7") + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { List finalRadiologyListClinic = @@ -220,12 +226,15 @@ class ProcedureViewModel extends BaseViewModel { return labResultLists; } - void getLabs(PatiantInformtion patient) async { + void getLabs(PatiantInformtion patient,{bool isArrived}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersList(patient); if (_labsService.hasError) { error = _labsService.error; + if(isArrived) setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); } else { _labsService.patientLabOrdersList.forEach((element) { List patientLabOrdersClinic = diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 252958b1..50614d52 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -80,7 +80,7 @@ class _DashboardScreenState extends State { From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), To: DateUtils.convertDateToFormat( - DateTime.now().add(Duration(days: 7, hours: 0)), 'yyyy-MM-dd') + DateTime.now().add(Duration(days: 6, hours: 0)), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 8fcc9f66..6ef7ca9c 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -54,630 +54,89 @@ class _InsuranceApprovalScreenNewState appBarTitle: TranslationBase.of(context).approvals, body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: model.insuranceApproval.length != 0 - ? Column( - children: [ - // Container( - // width: double.infinity, - // height: SizeConfig.screenHeight * 0.09, - // color: Color(0xffEEEEEE), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Texts( - // TranslationBase.of(context).totalApproval, - // color: Color(0xff60688B), - // fontSize: 19.0, - // fontWeight: FontWeight.w600, - // ), - // if (model.insuranceApproval.length > 0) - // Container( - // width: 60, - // height: 40, - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // borderRadius: BorderRadius.circular(19.0)), - // child: Center( - // child: Texts( - // model.insuranceApproval[0].unUsedCount - // .toString(), - // color: Colors.white, - // fontSize: 17.0, - // ), - // )) - // ], - // )), - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - 'Insurance', - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - 'Approvals', - fontSize: 30.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: model.insuranceApproval.length != 0 + ? Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + 'Insurance', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Approvals', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], ), - - ...List.generate( - model.insuranceApproval.length, - (index) => Container( - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - InsuranceApprovalsDetails( - patient: patient, - indexInsurance: index, - )), - ); - }, - child: DoctorCardInsurance( - patientOut: model.insuranceApproval[index] - .patientDescription, - profileUrl: - model.insuranceApproval[index].doctorImage, - clinic: - model.insuranceApproval[index].clinicName, - doctorName: - model.insuranceApproval[index].doctorName, - branch: model - .insuranceApproval[index].approvalNo - .toString(), - isPrescriptions: true, - approvalStatus: model.insuranceApproval[index] - .approvalStatusDescption ?? - '', - branch2: - model.insuranceApproval[index].projectName, - ), + ), + ...List.generate( + model.insuranceApproval.length, + (index) => Container( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InsuranceApprovalsDetails( + patient: patient, + indexInsurance: index, + )), + ); + }, + child: DoctorCardInsurance( + patientOut: model + .insuranceApproval[index].patientDescription, + profileUrl: + model.insuranceApproval[index].doctorImage, + clinic: model.insuranceApproval[index].clinicName, + doctorName: + model.insuranceApproval[index].doctorName, + branch: model.insuranceApproval[index].approvalNo + .toString(), + isPrescriptions: true, + approvalStatus: model.insuranceApproval[index] + .approvalStatusDescption ?? + '', + branch2: + model.insuranceApproval[index].projectName, ), ), - // (index) => Container( - // width: double.maxFinite, - // height: MediaQuery.of(context).size.height * .20, - // margin: EdgeInsets.all(10), - // padding: - // EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(15), - // color: Colors.white, - // ), - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Container( - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Container( - // height: MediaQuery.of(context).size.height * .20, - // width: 5, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(10), - // bottomLeft: Radius.circular(10), - // ), - // color: model.insuranceApproval[index] - // .approvalStatusDescption != - // "Approved" - // ? Colors.red[500] - // : Colors.green, - // ), - // ), - // Expanded( - // child: Container( - // padding: EdgeInsets.only( - // left: projectViewModel.isArabic ? 0 : 15, - // right: projectViewModel.isArabic ? 15 : 0), - // child: InkWell( - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // // mainAxisAlignment: - // // MainAxisAlignment.spaceBetween, - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Texts( - // model.insuranceApproval[index] - // .approvalDetails.status, - // color: model - // .insuranceApproval[ - // index] - // .approvalStatusDescption == - // "Approved" - // ? Colors.green - // : Colors.red[800], - // fontWeight: FontWeight.w600, - // ), - // SizedBox( - // height: 5, - // ), - // AppText(model - // .insuranceApproval[index] - // .doctorName), - // Container( - // child: LargeAvatar( - // url: model - // .insuranceApproval[index] - // .doctorImage, - // ), - // width: 55, - // height: 55, - // ), - // ], - // ), - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // children: [ - // Texts( - // 'Clinic: ', - // color: Colors.grey[500], - // ), - // Texts( - // model - // .insuranceApproval[ - // index] - // .clinicName, - // ), - // ], - // ), - // Row( - // children: [ - // Texts( - // 'Approval No', - // color: Colors.grey[500], - // ), - // Texts( - // model - // .insuranceApproval[ - // index] - // .approvalNo - // .toString(), - // ), - // ], - // ), - // ], - // ), - // SizedBox( - // width: 5, - // ), - // ], - // ), - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Row( - // children: [ - // Texts( - // 'Clinic: ', - // color: Colors.grey[500], - // ), - // Texts( - // model - // .insuranceApproval[ - // index] - // .clinicName, - // ), - // ], - // ), - // Row( - // children: [ - // Texts( - // 'Approval No', - // color: Colors.grey[500], - // ), - // Texts( - // model - // .insuranceApproval[ - // index] - // .approvalNo - // .toString(), - // ), - // ], - // ), - // ], - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.end, - // children: [ - // Icon(Icons.remove_red_eye_outlined) - // ], - // ) - // ], - // ), - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // ), -// RoundedContainer( -// backgroundColor: Colors.white, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// ExpansionTile( -// title: Container( -// //height: 120.0, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// model.insuranceApproval[index] -// .patientDescription == -// "In Patient" -// ? Container( -// decoration: BoxDecoration( -// color: -// Theme.of(context).primaryColor, -// borderRadius: -// BorderRadius.circular(16.0)), -// width: 115.0, -// padding: EdgeInsets.only(left: 11.5), -// child: Center( -// child: Texts( -// TranslationBase.of(context) -// .inPatient, -// color: Colors.white, -// ), -// ), -// ) -// : Container( -// decoration: BoxDecoration( -// color: Color(0xff505A5D), -// borderRadius: -// BorderRadius.circular(16.0)), -// width: 115.0, -// padding: EdgeInsets.only(left: 11.5), -// child: Center( -// child: Texts( -// TranslationBase.of(context) -// .outpatient, -// color: Colors.white, -// ), -// ), -// ), -// Padding( -// padding: EdgeInsets.symmetric(vertical: 10.0), -// child: Texts( -// model.insuranceApproval[index].clinicName, -// fontSize: 20.0, -// color: Color(0xff60686B), -// fontWeight: FontWeight.w600, -// ), -// ), -// Texts( -// model.insuranceApproval[index].doctorName, -// fontSize: 17.0, -// ), -// ], -// ), -// ), -// children: [ -// Padding( -// padding: EdgeInsets.symmetric( -// vertical: 12.0, horizontal: 12.0), -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Row( -// children: [ -// Texts( -// TranslationBase.of(context).approvalNo, -// fontSize: 18.0, -// ), -// Texts( -// model -// .insuranceApproval[index].approvalNo -// .toString(), -// fontSize: 18.0, -// fontWeight: FontWeight.w600, -// ), -// ], -// ), -// Divider( -// color: Colors.black, -// height: 25.0, -// thickness: 1.0, -// ), -// Row( -// children: [ -// Texts( -// TranslationBase.of(context) -// .procedureStatus, -// fontSize: 17.5, -// ), -// SizedBox( -// width: 12, -// ), -// Expanded( -// child: Texts( -// model.insuranceApproval[index] -// .approvalStatusDescption, -// fontWeight: FontWeight.w600, -// fontSize: 17.5, -// ), -// ), -// ], -// ), -// Divider( -// color: Colors.black, -// height: 25.0, -// thickness: 1.0, -// ), -// Row( -// children: [ -// Texts( -// TranslationBase.of(context).unusedCount, -// fontSize: 17.5, -// ), -// Texts( -// model.insuranceApproval[index] -// .unUsedCount -// .toString(), -// fontSize: 17.5, -// fontWeight: FontWeight.w600, -// ), -// ], -// ), -// Divider( -// color: Colors.black, -// height: 25.0, -// thickness: 1.0, -// ), -// // Text( -// // 'Company Name: ' + -// // model.insuranceApproval[index] -// // .companyName == -// // null -// // ? '000' -// // : model -// // .insuranceApproval[index].companyName, -// // style: TextStyle( -// // fontSize: 17.5, -// // fontWeight: FontWeight.w600), -// // ), -// Texts( -// TranslationBase.of(context).companyName, -// fontWeight: FontWeight.w600, -// fontSize: 17.5, -// ), -// -// Divider( -// color: Colors.black, -// height: 25.0, -// thickness: 1.0, -// ), -// Row( -// children: [ -// Texts( -// TranslationBase.of(context).receiptOn, -// fontSize: 17.5, -// fontWeight: FontWeight.w600, -// ), -// Texts( -// DateUtils.getDateTimeFromServerFormat( -// model.insuranceApproval[index] -// .rceiptOn) -// .toString(), -// fontSize: 17.5, -// fontWeight: FontWeight.w600, -// ), -// ], -// ), -// Divider( -// color: Colors.black, -// height: 25.0, -// thickness: 1.0, -// ), -// Row( -// children: [ -// Texts( -// TranslationBase.of(context).expiryDate, -// fontSize: 17.5, -// fontWeight: FontWeight.w600, -// ), -// Texts( -// DateUtils.getDateTimeFromServerFormat( -// model.insuranceApproval[index] -// .expiryDate) -// .toString(), -// fontSize: 17.5, -// fontWeight: FontWeight.w600, -// ), -// ], -// ), -// Divider( -// color: Colors.black, -// height: 55.0, -// thickness: 1.2, -// ), -// IntrinsicHeight( -// child: Row( -// crossAxisAlignment: -// CrossAxisAlignment.center, -// children: [ -// Expanded( -// flex: 1, -// child: Column( -// children: [ -// Text(TranslationBase.of(context) -// .procedureName), -// Padding( -// padding: EdgeInsets.only( -// top: SizeConfig -// .heightMultiplier * -// 3.0), -// child: Text( -// model.insuranceApproval[index] -// .approvalDetails == -// null -// ? '' -// : model -// .insuranceApproval[ -// index] -// .approvalDetails -// .procedureName, -// style: TextStyle( -// fontWeight: -// FontWeight.w600, -// fontSize: 15.5), -// ), -// ), -// ], -// ), -// ), -// VerticalDivider( -// width: 10.0, -// thickness: 1.2, -// color: Colors.black, -// ), -// Expanded( -// flex: 1, -// child: Column( -// children: [ -// Text(TranslationBase.of(context) -// .procedureStatus), -// Padding( -// padding: EdgeInsets.only( -// top: SizeConfig -// .heightMultiplier * -// 3.0), -// child: Text( -// model.insuranceApproval[index] -// .approvalDetails == -// null -// ? '' -// : model -// .insuranceApproval[ -// index] -// .approvalDetails -// .status, -// style: TextStyle( -// fontSize: 17.5, -// fontWeight: -// FontWeight.w600), -// ), -// ), -// ], -// ), -// ), -// VerticalDivider( -// width: 2.3, -// thickness: 1.2, -// color: Colors.black, -// ), -// Expanded( -// flex: 1, -// child: Column( -// children: [ -// Text(TranslationBase.of(context) -// .usageStatus), -// Padding( -// padding: EdgeInsets.only( -// top: SizeConfig -// .heightMultiplier * -// 3.0), -// child: Text( -// model.insuranceApproval[index] -// .approvalDetails == -// null -// ? '' -// : model -// .insuranceApproval[ -// index] -// .approvalDetails -// .isInvoicedDesc, -// style: TextStyle( -// fontWeight: -// FontWeight.w600, -// fontSize: 17.5), -// ), -// ), -// ], -// ), -// ), -// ], -// ), -// ), -// Divider( -// color: Colors.black, -// height: 25.0, -// thickness: 1.0, -// ), -// ], -// ), -// ), -// ], -// ), -// ], -// ), -// ), ), - ], - ) - : Column( - children: [ - Container( - height: 200, - width: double.infinity, - child: Center( - child: Text("No Insurance Approvals Found"))) - ], - )), + ), + ], + ) + : Column( + children: [ + Container( + height: 200, + width: double.infinity, + child: Center( + child: Text("No Insurance Approvals Found"))) + ], + ), + ), ), ), ); } - - convertDateFormat(String Date) { - const start = "/Date("; - const end = "+0300)"; - - final startIndex = Date.indexOf(start); - final endIndex = Date.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(Date.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } } diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index d167ca43..8ae3f3ac 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -32,9 +32,10 @@ class LabsHomePage extends StatelessWidget { arrivalType = routeArgs['arrivalType']; print(arrivalType); return BaseView( - onModelReady: (model) => model.getLabs(patient), + onModelReady: (model) => model.getLabs(patient,isArrived: (patientType != null && patientType == '7' && patient.patientStatusType == 43)), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, + backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( patient, patient.patientType.toString() ?? '0', patientType), @@ -48,6 +49,7 @@ class LabsHomePage extends StatelessWidget { SizedBox( height: 12, ), + if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -67,9 +69,27 @@ class LabsHomePage extends StatelessWidget { ], ), ), - if (patientType != null && - patientType == '7' && - patient.patientStatusType == 43) + if(patient.patientStatusType == 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Lab', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), + ), + if (patientType != null && patientType == '7' && patient.patientStatusType == 43) InkWell( onTap: () { Navigator.push( @@ -156,7 +176,22 @@ class LabsHomePage extends StatelessWidget { ); }).toList(), ), - ) + ), + if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('No Lab Result Found'), + ) + + ], + ), + ) ], ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 6c44cde4..dfbbdff3 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -29,9 +29,10 @@ class RadiologyHomePage extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient), + onModelReady: (model) => model.getPatientRadOrders(patient,patientType: patientType), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( patient, patient.patientType.toString() ?? '0', arrivalType), @@ -44,7 +45,8 @@ class RadiologyHomePage extends StatelessWidget { SizedBox( height: 12, ), - Padding( + if(model.radiologyList.isNotEmpty && patient.patientStatusType != 43) + Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -63,6 +65,26 @@ class RadiologyHomePage extends StatelessWidget { ], ), ), + if(patient.patientStatusType == 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Radiology', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), + ), if (patientType != null && patientType == '7' && patient.patientStatusType == 43) @@ -142,6 +164,21 @@ class RadiologyHomePage extends StatelessWidget { appointmentDate: model.radiologyList[index].orderDate, ), )), + if(model.radiologyList.isEmpty && patient.patientStatusType != 43) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('No Radiology Found'), + ) + + ], + ), + ) ], ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f6207b52..819cc2f1 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -49,7 +49,7 @@ postProcedure( DateTime doseTime, String doseUnit, String icdCode, - PatiantInformtion patient}) async { + PatiantInformtion patient,String patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); List sss = List(); @@ -236,8 +236,15 @@ class _PrescriptionFormWidgetState extends State { children: [ Column( children: [ + SizedBox(height: 15,), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + AppText( + 'New Prescription Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), InkWell( child: Icon( Icons.close, @@ -246,16 +253,7 @@ class _PrescriptionFormWidgetState extends State { onTap: () { Navigator.pop(context); }, - ), - ], - ), - Row( - children: [ - AppText( - 'New Prescription Order', - fontWeight: FontWeight.w700, - fontSize: 20, - ), + ) ], ), ], diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index ba707769..fafd753d 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -28,10 +28,11 @@ class PrescriptionsPage extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPrescriptions(patient), + onModelReady: (model) => model.getPrescriptions(patient,patientType:patientType), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, + backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType ?? '0', arrivalType), body: FractionallySizedBox( @@ -42,7 +43,8 @@ class PrescriptionsPage extends StatelessWidget { SizedBox( height: 12, ), - Padding( + if(model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43) + Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -61,6 +63,26 @@ class PrescriptionsPage extends StatelessWidget { ], ), ), + if(patient.patientStatusType == 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Order', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Prescriptions', + bold: true, + fontSize: 22, + ), + ], + ), + ), if (patientType != null && patientType == '7' && patient.patientStatusType == 43) @@ -138,7 +160,22 @@ class PrescriptionsPage extends StatelessWidget { DateUtils.getDateTimeFromServerFormat( model.prescriptionsList[index].appointmentDate, ), - ))) + ))), + if(model.prescriptionsList.isEmpty && patient.patientStatusType != 43) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('No Lab Result Found'), + ) + + ], + ), + ) ], ), ), diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index e9cdd316..2f3718a3 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -154,21 +154,21 @@ class ProcedureCard extends StatelessWidget { ), ], ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - entityList.remarks.toString() ?? '', - fontSize: 12, - ), - if (entityList.categoryID == 2 || - entityList.categoryID == 4) - InkWell( - child: Icon(DoctorApp.edit), - onTap: onTap, - ) - ], - ) + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts( + // entityList.remarks.toString() ?? '', + // fontSize: 12, + // ), + // if (entityList.categoryID == 2 || + // entityList.categoryID == 4) + // InkWell( + // child: Icon(DoctorApp.edit), + // onTap: onTap, + // ) + // ], + // ) ], ), //onTap: onTap, diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 252dce0b..678a345d 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -155,7 +155,7 @@ class _AddSelectedLabOrderState extends State { (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( - height: MediaQuery.of(context).size.height * 1.0, + height: MediaQuery.of(context).size.height * .90, child: Padding( padding: EdgeInsets.all(12.0), child: Column( @@ -209,85 +209,39 @@ class _AddSelectedLabOrderState extends State { isEntityListSelected: (master) => isEntityListSelected(master), )), - SizedBox( - height: 15.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // Container( - // child: Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderType), - // Radio( - // activeColor: Color(0xFFB9382C), - // value: 1, - // groupValue: selectedType, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text('routine'), - // Radio( - // activeColor: Color(0xFFB9382C), - // groupValue: selectedType, - // value: 0, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text(TranslationBase.of(context).urgent), - // ], - // ), - // ), - // SizedBox( - // height: 15.0, - // ), - // TextFields( - // hintText: TranslationBase.of(context).remarks, - // controller: remarksController, - // minLines: 3, - // maxLines: 5, - // ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: - "Add Lab Order", //TranslationBase.of(context) - fontWeight: FontWeight.w700, - //.addSelectedProcedures, - color: Color(0xff359846), - onPressed: () { - //print(entityList.toString()); - onPressed: - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); - return; - } + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + "Add Lab Order", //TranslationBase.of(context) + fontWeight: FontWeight.w700, + //.addSelectedProcedures, + color: Color(0xff359846), + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, ), - ), - ], - ) + ], + ), + ), ], ), ), diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index aa897569..56776e86 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -162,15 +162,14 @@ class _AddSelectedRadiologyOrderState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( 'New Radiology Order', fontWeight: FontWeight.w700, fontSize: 20, ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.48, - ), + InkWell( child: Icon( Icons.close, @@ -209,82 +208,36 @@ class _AddSelectedRadiologyOrderState extends State { isEntityListSelected: (master) => isEntityListSelected(master), )), - SizedBox( - height: 15.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // Container( - // child: Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderType), - // Radio( - // activeColor: Color(0xFFB9382C), - // value: 1, - // groupValue: selectedType, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text('routine'), - // Radio( - // activeColor: Color(0xFFB9382C), - // groupValue: selectedType, - // value: 0, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text(TranslationBase.of(context).urgent), - // ], - // ), - // ), - // SizedBox( - // height: 15.0, - // ), - // TextFields( - // hintText: TranslationBase.of(context).remarks, - // controller: remarksController, - // minLines: 3, - // maxLines: 5, - // ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'Add Radiology Order', - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () { - //print(entityList.toString()); - onPressed: - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); - return; - } + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'Add Radiology Order', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } - Navigator.pop(context); - postProcedure( - orderType: selectedType.toString(), - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, ), - ), - ], + ], + ), ) ], ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 679739e2..32f02057 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -69,7 +69,7 @@ class _EntityListCheckboxSearchWidgetState NetworkBaseView( baseViewModel: widget.model, child: Container( - height: MediaQuery.of(context).size.height * 0.55, + height: MediaQuery.of(context).size.height * 0.65, child: Center( child: Container( margin: EdgeInsets.only(top: 15), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 646665b7..9608524e 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -25,10 +25,11 @@ class ProcedureScreen extends StatelessWidget { String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; return BaseView( - onModelReady: (model) => model.getProcedure(mrn: patient.patientId), + onModelReady: (model) => model.getProcedure(mrn: patient.patientId,patientType: patientType), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, + backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( patient, arrivalType ?? '0', patientType), @@ -40,7 +41,8 @@ class ProcedureScreen extends StatelessWidget { SizedBox( height: 12, ), - Padding( + if(model.procedureList.length==0 && patient.patientStatusType != 43) + Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -59,6 +61,26 @@ class ProcedureScreen extends StatelessWidget { ], ), ), + if( patient.patientStatusType == 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Order Test or', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + Texts( + 'Procedure', + bold: true, + fontSize: 22, + ), + ], + ), + ), if (patientType != null && patientType == '7' && patient.patientStatusType == 43) InkWell( onTap: () { @@ -141,6 +163,21 @@ class ProcedureScreen extends StatelessWidget { }, ), ), + if (model.procedureList.length!=0 && patient.patientStatusType != 43) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('No Procedure Found'), + ) + + ], + ), + ) ], ), ), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index eb59cdc3..87071e6e 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; @@ -32,6 +33,7 @@ class AddSickLeavScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, + backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( patient, routeArgs['patientType'] ?? "0", @@ -197,33 +199,33 @@ class AddSickLeavScreen extends StatelessWidget { AppText( item.remarks ?? "", ), - (item.status == 1 || - item.status == 2) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), - - // color: Colors.green, //Colors.black, - onPressed: () => { - if (item.status == - 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .sickleaveonhold) - } - else - { - openSickLeave( - context, - true, - extendedData: - item) - } - }, - ) - : SizedBox() + // (item.status == 1 || + // item.status == 2) + // ? IconButton( + // icon: Image.asset( + // 'assets/images/edit.png'), + // + // // color: Colors.green, //Colors.black, + // onPressed: () => { + // if (item.status == + // 1) + // { + // DrAppToastMsg.showErrorToast( + // TranslationBase.of( + // context) + // .sickleaveonhold) + // } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + // }, + // ) + // : SizedBox() ]), ], ), @@ -240,90 +242,22 @@ class AddSickLeavScreen extends StatelessWidget { }).toList(), ) : patient.patientStatusType != 43 - ? Container( - height: 200, - width: SizeConfig.screenWidth, - color: Colors.white, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).noSickLeave, - color: Colors.red, - ) - ]), - ) + ? Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 100,), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('No Sick Leave Found'), + ) + + ], + ), + ) : SizedBox() - // : new Builder(builder: (context) { - // return Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: EdgeInsets.all(10), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // AppText( - // TranslationBase.of(context).patient, - // fontWeight: FontWeight.bold, - // ), - // AppText( - // TranslationBase.of(context).sickLeave, - // fontSize: 24, - // fontWeight: FontWeight.bold, - // ), - // ], - // )), - // Container( - // width: SizeConfig.screenWidth, - // margin: EdgeInsets.only( - // left: 20, right: 20, top: 20, bottom: 20), - // padding: EdgeInsets.all(20), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(10), - // color: HexColor('#EAEAEA')), - // child: Column( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Colors.grey, - // borderRadius: - // BorderRadius.circular(10)), - // padding: EdgeInsets.all(3), - // child: IconButton( - // icon: Icon( - // Icons.add, - // size: 35, - // color: Colors.white, - // ), - // onPressed: () { - // openSickLeave( - // context, - // false, - // ); - // }), - // )), - // Padding( - // child: AppText( - // TranslationBase.of(context) - // .noSickLeaveApplied, - // fontWeight: FontWeight.bold, - // fontFamily: 'Poppins', - // fontSize: 16, - // textAlign: TextAlign.center, - // color: HexColor('#7E7E7E')), - // padding: EdgeInsets.all(10), - // ), - // ], - // )), - // SizedBox( - // height: SizeConfig.screenHeight * .6, - // ) - // ], - // ); - // }), + ])))); } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 12f157c2..0e1a8491 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -150,6 +150,7 @@ class _SickLeaveScreenState extends State { // validator: (value) { // return TextValidator().validateName(value); // }, + textInputType:TextInputType.number, inputFormatter: ONLY_NUMBERS) ]), ), diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index adba46cd..8e5ba34e 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -34,10 +34,14 @@ class NetworkBaseView extends StatelessWidget { case ViewState.Error: return Center( child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height: 100,), - Image.asset('assets/images/no-data.png',height: 250), - Texts(baseViewModel.error??'') + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(baseViewModel.error??''), + ) ], ),