Ambulance Service

er_location
Mohammad Aljammal 5 years ago
parent bae6fe4ad6
commit f543126152

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

@ -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

@ -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<String, dynamic> 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<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
}
}

@ -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<PatientER_RRT_GetAllTransportationMethodListModel> AmModelList = List();
Map<String, dynamic> body = Map();
List<PatientER_RRT_GetAllTransportationMethodListModel> amModelList = List();
List<PatientAllPresOrders> 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());
}
}

@ -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<AmService>();
HospitalService _hospitalService = locator<HospitalService>();
List<PatientER_RRT_GetAllTransportationMethodListModel>
get amRequestModeList => _amService.amModelList;
AmService _amService = locator<AmService>();
List<PatientAllPresOrders> get patientAllPresOrdersList =>_amService.patientAllPresOrdersList;
List<PatientER_RRT_GetAllTransportationMethodListModel> 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);
}
}
}

@ -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<AmbulanceReq>
}
@override
Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptions(),
return BaseView<AmRequestViewModel>(
// onModelReady: (model) => model.getAmRequestOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: "Ambulance Request",
@ -106,12 +109,8 @@ class _AmbulanceReqState extends State<AmbulanceReq>
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
PrescriptionsPage(
prescriptionsViewModel: model,
),
PrescriptionsHistoryPage(
prescriptionsViewModel: model,
)
AmbulanceRequestIndex(),
Container()
],
),
)

@ -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<AmbulanceRequestIndex> {
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: <Widget>[
SelectTransportationMethod(changeCurrentTab: _changeCurrentTab,),
PickupLocation(changeCurrentTab: _changeCurrentTab,),
BillAmount(changeCurrentTab: _changeCurrentTab,),
Summary(changeCurrentTab: _changeCurrentTab,),
],
),
),
],
),
);
}
}

@ -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<BillAmount> {
@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',
),
)
],
);
}
}

@ -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<PickupLocation> {
@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',
),
)
],
);
}
}

@ -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<SelectTransportationMethod> {
@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',
),
)
],
);
}
}

@ -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<Summary> {
@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),
),
)
],
);
}
}

@ -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] ,
),
),
),
),
),
],
);
}
}

@ -64,6 +64,68 @@ class _HomePageState extends State<HomePage> {
MediaQuery.of(context).size.width * 0.8,
child: Row(
children: <Widget>[
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<HomePage> {
),
),
),
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<HomePage> {
child: Column(
children: <Widget>[
Image.asset(
'assets/images/Dr_Schedule_report.png',
'assets/images/home_health_care_icon.png',
width: 50,
height: 50,
),

Loading…
Cancel
Save