From 36d422c7aa0ead5bd7db6bb9ecb233a32b201db6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 19 Apr 2021 11:22:36 +0300 Subject: [PATCH] PAP-563: fix pickup location from hospital --- .../AmbulanceRequestIndexPages/PickupLocation.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index b0c541f9..cde9e248 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -393,13 +393,14 @@ class _PickupLocationState extends State { setState(() { widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; if (widget.patientER.direction == 0) { - widget.patientER.pickupLocationLattitude = + + widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); - widget.patientER.pickupLocationLongitude = + widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); - widget.patientER.dropoffLocationLattitude = + widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; - widget.patientER.dropoffLocationLongitude = + widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; } else { widget.patientER.pickupLocationLattitude = @@ -416,7 +417,7 @@ class _PickupLocationState extends State { widget.patientER.pickupLocationLattitude; widget.patientER.longitude = widget.patientER.pickupLocationLongitude; - widget.patientER.dropoffLocationName = _selectedHospital.name; + widget.patientER.dropoffLocationName = widget.patientER.direction == 0?_result.formattedAddress:_selectedHospital.name; widget.patientER.createdBy = widget.amRequestViewModel.user.patientID; widget.patientER.isOutPatient = @@ -425,7 +426,7 @@ class _PickupLocationState extends State { widget.amRequestViewModel.user.patientIdentificationNo; widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); - widget.patientER.pickupLocationName = _result.formattedAddress; + widget.patientER.pickupLocationName = widget.patientER.direction == 0?_selectedHospital.name:_result.formattedAddress; widget.patientER.projectID = widget.amRequestViewModel.user.projectID; widget.patientER.requesterFileNo =