diff --git a/assets/images/covid-car.png b/assets/images/covid-car.png new file mode 100644 index 00000000..01090b74 Binary files /dev/null and b/assets/images/covid-car.png differ diff --git a/assets/images/covid_bg_transparent.png b/assets/images/covid_bg_transparent.png new file mode 100644 index 00000000..cd5f12f1 Binary files /dev/null and b/assets/images/covid_bg_transparent.png differ diff --git a/assets/images/home_health_care_icon.png b/assets/images/home_health_care_icon.png new file mode 100644 index 00000000..d80ec015 Binary files /dev/null and b/assets/images/home_health_care_icon.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 961a386d..394aa2ef 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -55,8 +55,8 @@ const GET_NEAREST_HOSPITAL= 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///Er Nearest -const GET_AMBULANCE_REQUEST= - 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +const GET_AMBULANCE_REQUEST= 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; ///FindUs diff --git a/lib/core/model/er/PatientAllPresOrders.dart b/lib/core/model/er/PatientAllPresOrders.dart new file mode 100644 index 00000000..90ce074a --- /dev/null +++ b/lib/core/model/er/PatientAllPresOrders.dart @@ -0,0 +1,132 @@ +class PatientAllPresOrders { + int iD; + String patientID; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; + String appointmentNo; + String dischargeID; + int lineItemNo; + int status; + String description; + String descriptionN; + String createdOn; + int serviceID; + int createdBy; + String editedOn; + int editedBy; + int channel; + dynamic clientRequestID; + bool returnedToQueue; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; + int realRRTHaveTransactions; + String nearestProjectDescription; + String nearestProjectDescriptionN; + String projectDescription; + String projectDescriptionN; + + PatientAllPresOrders( + {this.iD, + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); + + PatientAllPresOrders.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = json['CreatedOn']; + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index 181ad37b..016cc2df 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -1,25 +1,39 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import '../base_service.dart'; class AmService extends BaseService { - List AmModelList = List(); - Map body = Map(); + List amModelList = List(); + List patientAllPresOrdersList = List(); Future getAllTransportationOrders() async { hasError = false; - await baseAppClient.post(GET_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) { - AmModelList.clear(); + amModelList.clear(); response['AmModelList'].forEach((vital) { - AmModelList.add( + amModelList.add( PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: body); + }, body: Map()); + } + + Future getPatientAllPresOrdersList() async { + hasError = false; + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + onSuccess: (dynamic response, int statusCode) { + patientAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((vital) { + patientAllPresOrdersList.add(PatientAllPresOrders.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); } } diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index db1acbf0..6e08d984 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -1,32 +1,49 @@ - import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; +import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import '../base_view_model.dart'; import '../../../locator.dart'; -class AmRequestViewModel extends BaseViewModel{ +class AmRequestViewModel extends BaseViewModel { + AmService _amService = locator(); + HospitalService _hospitalService = locator(); + List + get amRequestModeList => _amService.amModelList; - AmService _amService = locator(); + List get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; - List get AmRequestModeList=> - _amService.AmModelList; - getAmRequestOrders({int id, int projectID}) async { + Future getAmRequestOrders() async { setState(ViewState.Busy); + await _amService.getAllTransportationOrders(); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + getHospitals(); + } + Future getHospitals() async { + setState(ViewState.Busy); + await _hospitalService.getHospitals(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else + getPatientAllPresOrdersList(); + } - await _amService.getAllTransportationOrders(); - - if ( _amService.hasError) { - error = _amService.error; + Future getPatientAllPresOrdersList()async{ + setState(ViewState.Busy); + await _amService.getPatientAllPresOrdersList(); + if (_hospitalService.hasError) { + error = _hospitalService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - - - -} \ No newline at end of file +} diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 9c4dfa29..8e9f54bc 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; @@ -9,6 +10,8 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'AmbulanceRequestIndex.dart'; + class AmbulanceReq extends StatefulWidget { @override _AmbulanceReqState createState() => _AmbulanceReqState(); @@ -30,8 +33,8 @@ class _AmbulanceReqState extends State } @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getPrescriptions(), + return BaseView( + // onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: "Ambulance Request", @@ -106,12 +109,8 @@ class _AmbulanceReqState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - PrescriptionsPage( - prescriptionsViewModel: model, - ), - PrescriptionsHistoryPage( - prescriptionsViewModel: model, - ) + AmbulanceRequestIndex(), + Container() ], ), ) diff --git a/lib/pages/ErService/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndex.dart new file mode 100644 index 00000000..863d3b57 --- /dev/null +++ b/lib/pages/ErService/AmbulanceRequestIndex.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/pages/ErService/widgets/StepesWideget.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +import 'BillAmount.dart'; +import 'PickupLocation.dart'; +import 'SelectTransportationMethod.dart'; +import 'Summary.dart'; + +class AmbulanceRequestIndex extends StatefulWidget { + @override + _AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState(); +} + +class _AmbulanceRequestIndexState extends State { + + int currentIndex = 0; + PageController pageController; + + _changeCurrentTab(int tab) { + setState(() { + currentIndex = tab; + }); + pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + } + + @override + void initState() { + super.initState(); + pageController = new PageController(); + + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: Column( + children: [ + SizedBox(height: 80,), + Container( + margin: EdgeInsets.only(left: 12,right: 12), + child: StepesWidget(index: currentIndex,changeCurrentTab: _changeCurrentTab,)), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: pageController, + children: [ + SelectTransportationMethod(changeCurrentTab: _changeCurrentTab,), + PickupLocation(changeCurrentTab: _changeCurrentTab,), + BillAmount(changeCurrentTab: _changeCurrentTab,), + Summary(changeCurrentTab: _changeCurrentTab,), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/ErService/BillAmount.dart b/lib/pages/ErService/BillAmount.dart new file mode 100644 index 00000000..86b0d181 --- /dev/null +++ b/lib/pages/ErService/BillAmount.dart @@ -0,0 +1,37 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class BillAmount extends StatefulWidget { + final Function changeCurrentTab; + + BillAmount({Key key, this.changeCurrentTab}); + + @override + _BillAmountState createState() => _BillAmountState(); +} + +class _BillAmountState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('BillAmount 3'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: ()=> widget.changeCurrentTab(3), + label: 'Next', + + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/PickupLocation.dart new file mode 100644 index 00000000..bdb1ea52 --- /dev/null +++ b/lib/pages/ErService/PickupLocation.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PickupLocation extends StatefulWidget { + final Function changeCurrentTab; + + PickupLocation({Key key, this.changeCurrentTab}); + + @override + _PickupLocationState createState() => _PickupLocationState(); +} + +class _PickupLocationState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('PickupLocation 2'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: ()=> widget.changeCurrentTab(2), + label: 'Next', + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/SelectTransportationMethod.dart new file mode 100644 index 00000000..a5fcbb75 --- /dev/null +++ b/lib/pages/ErService/SelectTransportationMethod.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectTransportationMethod extends StatefulWidget { + final Function changeCurrentTab; + + SelectTransportationMethod({Key key, this.changeCurrentTab}); + + @override + _SelectTransportationMethodState createState() => + _SelectTransportationMethodState(); +} + +class _SelectTransportationMethodState + extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('SelectTransportationMethod 1'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: ()=> widget.changeCurrentTab(1), + label: 'Next', + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/Summary.dart b/lib/pages/ErService/Summary.dart new file mode 100644 index 00000000..4f792b68 --- /dev/null +++ b/lib/pages/ErService/Summary.dart @@ -0,0 +1,37 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class Summary extends StatefulWidget { + final Function changeCurrentTab; + + Summary({Key key, this.changeCurrentTab}); + + @override + _SummaryState createState() => _SummaryState(); +} + +class _SummaryState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('Summary 4'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + label: 'Next', + + // onTap: ()=> widget.changeCurrentTab(2), + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/widgets/StepesWideget.dart b/lib/pages/ErService/widgets/StepesWideget.dart new file mode 100644 index 00000000..3f6b57a4 --- /dev/null +++ b/lib/pages/ErService/widgets/StepesWideget.dart @@ -0,0 +1,114 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class StepesWidget extends StatelessWidget { + final int index; + final Function changeCurrentTab; + + StepesWidget({Key key, this.index, this.changeCurrentTab}); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.black, + height: 3, + thickness: 3, + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white:Colors.grey[800] , + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width *0.3, + child: InkWell( + onTap: () => changeCurrentTab(1), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1 ? Colors.white:Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width *0.6, + child: InkWell( + onTap: () => changeCurrentTab(2), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 2 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2 ? Colors.white: Colors.grey[800] , + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(3), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 3 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '4', + color: index == 3 ? Colors.white:Colors.grey[800] , + ), + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 59c0a167..b811ef8f 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -64,6 +64,68 @@ class _HomePageState extends State { MediaQuery.of(context).size.width * 0.8, child: Row( children: [ + Expanded( + child: Container( + height: 110, + // padding: EdgeInsets.all(15), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: + Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/covid_bg_transparent.png'), + fit: BoxFit.cover), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 8,), + Texts('COVID-19 TEST',color: Colors.white,), + SizedBox(height: 15,), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Image.asset( + 'assets/images/covid-car.png',width: 55,height: 55,fit: BoxFit.cover, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts('Drove-Thru',color: Colors.white,fontSize: 14,), + SizedBox(height: 4,), + Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: Hexcolor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5)), + ), + child: Center( + child: Texts('BOOK Now', + color: Colors.white, + fontSize: 12, + ), + ), + ) + ], + ) + ], + ) + ], + ) + ), + ), Expanded( child: InkWell( onTap: () => Navigator.push(context, @@ -83,19 +145,6 @@ class _HomePageState extends State { ), ), ), - Expanded( - child: Container( - height: 110, - padding: EdgeInsets.all(15), - margin: EdgeInsets.all(5), - decoration: BoxDecoration( - color: - Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all( - Radius.circular(5))), - // child: Image.asset('assets/images/livecare_white_logo.png',), - ), - ), ], ), ), @@ -359,7 +408,7 @@ class _HomePageState extends State { child: Column( children: [ Image.asset( - 'assets/images/Dr_Schedule_report.png', + 'assets/images/home_health_care_icon.png', width: 50, height: 50, ),