Skip to content

Commit

Permalink
#363 - Add "results" to GET query/{queryId} response
Browse files Browse the repository at this point in the history
- Add the totalNumberOfPatients from the saved query object back to the response when reading a query
- the demanded queryId from the issue is already present as "id" - so nothing to do here imho
  • Loading branch information
michael-82 committed Sep 23, 2024
1 parent 901436f commit fdbf06c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ private Query convertQueryToApi(de.numcodex.feasibility_gui_backend.query.persis
.content(jsonUtil.readValue(in.getQueryContent().getQueryContent(), StructuredQuery.class))
.label(savedQuery.get().getLabel())
.comment(savedQuery.get().getComment())
.totalNumberOfPatients(savedQuery.get().getResultSize())
.build();
} else {
return Query.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public record Query(
@JsonProperty long id,
@JsonProperty StructuredQuery content,
@JsonProperty String label,
@JsonProperty String comment
@JsonProperty String comment,
@JsonProperty long totalNumberOfPatients
) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ public ResponseEntity<Object> getQuery(@PathVariable("id") Long queryId,
.content(structuredQueryValidation.annotateStructuredQuery(query.content(), skipValidation))
.label(query.label())
.comment(query.comment())
.totalNumberOfPatients(query.totalNumberOfPatients())
.build();
return new ResponseEntity<>(annotatedQuery, HttpStatus.OK);
}
Expand Down

0 comments on commit fdbf06c

Please sign in to comment.