@RestController
public class DetailsController
extends java.lang.Object
| Constructor and Description |
|---|
DetailsController() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Hospital> |
hospitals() |
java.util.List<Record> |
records(java.util.List<java.lang.String> params)
Retrieves the records based on the input parameters.
|
java.util.List<Speciality> |
specialities() |
@GetMapping(value="/records") public java.util.List<Record> records(@RequestParam(value="params") java.util.List<java.lang.String> params)
The structure of one parameter is the following:
The first part is the path to a certain field, which is based on the structure of the Record object (examples below).
The second part can be:
":" when checking for equality "<" when the field retrieved by the path has to be less than the value provided ">" when the field retrieved by the path has to be greater than the value provided
The third part is the value that will be compared against the field that's retrieved by the path.
The parameters should be provided in a certain pattern.
When you want to lookup a record by id:
/records?param=id:abcdefg
When you want to lookup a record where the minimumAge is at least 16:
/records?param=minimumAge>15
When you want to lookup a record where the maximumAge is less than 64:
/records?param=maximumAge<65
When you want to lookup a record by the name of the hospital group:
/records?param=hospital.hospitalGroup.name:hospital group name
Or when you want to lookup a record by the hospital HIPE code:
/records?param=hospital.hipe:1234
Multiple parameters can be provided at the same time to fine tune the query.
/records?param=minimumAge>15¶m=maximumAge<65&classification:child&hospital.hipe:1234
params - a list of parameters to create a query@GetMapping(value="/hospitals") public java.util.List<Hospital> hospitals()
@GetMapping(value="/specialities") public java.util.List<Speciality> specialities()