The feature “Nearby Cases” is used to view locations of other cases, which are present near the given case. The type of cases to be seen and the range/radius can be set, and once you click on search, based on the casetype and range selected, the cases are visible on a map as shown below. When clicked on the location pin, the details of the case are shown.
There are two main steps involved in this functionality.
- Saving the given location by the user into database.
- Populating nearby cases, based on the location persisted in the previous
The address is persisted into the index table as shown below. A location parameter is passed to the persist proximity location step.
Sample example of nearby cases feature
- Persist proximity location: In this step, we will persist the given location into the index table(Index-Location class in the database), using a declare index, “ProximityLocation”. The location parameter, i.e., the address property which has to be stored has to be passed as a parameter to this step. For example, my first step is manage interview, in which my address property is stored in “.interview.LocationDetails.Location” and this is now passed as a parameter to persist this location into the index table.
- Nearby Cases: In this step, the same location parameter is sent likewise in step 1. This step fetches the latitude and longitude values of the given location using a google API. When the end user selects the type of case and the range/radius, a datapage, D_pzFetchProximityCases is run and all the selected cases present in the given range are fetched, they are shown on the map.