Package ca.uhn.fhir.jpa.dao.search
Class LastNAggregation
java.lang.Object
ca.uhn.fhir.jpa.dao.search.LastNAggregation
Builds lastN aggregation, and parse the results
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionextractResourceIds
(com.google.gson.JsonObject theAggregationResult) Parses the JSONObject aggregation result from ES to extract observation resource ids E.g aggregation result payloadcom.google.gson.JsonObject
Aggregation template json.
-
Constructor Details
-
LastNAggregation
-
-
Method Details
-
toAggregation
Aggregation template json.https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
-
extractResourceIds
Parses the JSONObject aggregation result from ES to extract observation resource ids E.g aggregation result payload{ "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": "http://mycode.com|code0", "doc_count": 45, "most_recent_effective": { "hits": { "total": { "value": 45, "relation": "eq" }, "max_score": null, "hits": [ { "_index": "resourcetable-000001", "_type": "_doc", "_id": "48", "_score": null, "_source": { "myId": 48 }, "sort": [ 1643673125112 ] } ] } } }, { "key": "http://mycode.com|code1", "doc_count": 30, "most_recent_effective": { "hits": { "total": { "value": 30, "relation": "eq" }, "max_score": null, "hits": [ { "_index": "resourcetable-000001", "_type": "_doc", "_id": "58", "_score": null, "_source": { "myId": 58 }, "sort": [ 1643673125112 ] } ] } } } ] }
-