Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit c187002

Browse files
author
FredrikSchäferVitagroup
committed
SORMAS-Foundation#2638 Extend the ExternalVisitsRessource to provide PersonData
Fixed errors in the documentation structure
1 parent 635e475 commit c187002

1 file changed

Lines changed: 14 additions & 38 deletions

File tree

sormas-rest/src/main/java/de/symeda/sormas/rest/ExternalVisitsResource.java

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ public class ExternalVisitsResource extends EntityDtoResource {
3838
@GET
3939
@Path("/person/{personUuid}")
4040
@Operation(summary = "Get person information", description = "Get some personal data for a specific person")
41-
@Parameter(in = ParameterIn.PATH,
42-
name = "personUuid",
43-
required = true,
44-
description = "The Uuid of the person data is required for.",
45-
schema = @Schema(type = "string",
46-
format = "Uuid",
47-
example = "UO2OCI-BPXSAO-7Q4RHO-RMXCKC4M, where this is a personUuid that exists in your system."))
4841
@ApiResponse(
4942
description = "A selection of personal data, including first and last name, e-mail, phone number(s) and birth date if available"
5043
+ "for that person. Note that Null value fields may not be returned. If you get an unexpected result, it might help to verify"
@@ -72,17 +65,9 @@ public PersonDto getPersonByUuid(@PathParam("personUuid") String personUuid) {
7265

7366
@GET
7467
@Path("/person/{personUuid}/isValid")
75-
@Operation(summary = "Check person validity",
76-
responses = {
77-
@ApiResponse(responseCode = "true", description = "If a person with the given Uuid exists in SORMAS."),
78-
@ApiResponse(responseCode = "false", description = "Otherwise") })
79-
@Parameter(in = ParameterIn.PATH,
80-
name = "personUuid",
81-
required = true,
82-
description = "The Uuid of the person data is required for.",
83-
schema = @Schema(type = "string",
84-
format = "Uuid",
85-
example = "UO2OCI-BPXSAO-7Q4RHO-RMXCKC4M, where this is a personUuid that exists in your system."))
68+
@Operation(summary = "Check person validity", description = "Check if a the Uuid given as parameter exists in SORMAS.",
69+
responses =
70+
@ApiResponse(description = "true a person with the given Uuid exists in SORMAS, false otherwise.", content = @Content(schema = @Schema(example = "true"))))
8671
public Boolean isValidPersonUuid(@PathParam("personUuid") String personUuid) {
8772
return FacadeProvider.getPersonFacade().isValidPersonUuid(personUuid);
8873
}
@@ -91,16 +76,9 @@ public Boolean isValidPersonUuid(@PathParam("personUuid") String personUuid) {
9176
@POST
9277
@Path("/person/{personUuid}/status")
9378
@Operation(summary = "Save symptom journal status",
94-
responses = {
95-
@ApiResponse(responseCode = "true", description = "If the status was set succesfully."),
96-
@ApiResponse(responseCode = "false", description = "Otherwise.") })
97-
@Parameter(in = ParameterIn.PATH,
98-
name = "personUuid",
99-
required = true,
100-
description = "The Uuid of the person data is posted for.",
101-
schema = @Schema(type = "string",
102-
format = "Uuid",
103-
example = "UO2OCI-BPXSAO-7Q4RHO-RMXCKC4M, where this is a personUuid that exists in your system."))
79+
responses =
80+
@ApiResponse(description = "true if the status was set succesfully, false otherwise.",
81+
content = @Content(schema = @Schema(example = "true"))))
10482
@RequestBody(
10583
//@formatter:off
10684
description = "status may be one of the following:<br/>" +
@@ -124,9 +102,9 @@ public boolean postSymptomJournalStatus(@PathParam("personUuid") String personUu
124102
@POST
125103
@Path("/")
126104
@Operation(summary = "Save visits",
127-
responses = {
128-
@ApiResponse(responseCode = "OK", description = "Visit saved successfully."),
129-
@ApiResponse(responseCode = "ERROR", description = "Otherwise.") })
105+
description = "Upload visits with all symptom and disease related data to SORMAS.",
106+
responses = @ApiResponse(description = "OK when visit was successfully saved, ERROR otherwise.",
107+
content = @Content(schema = @Schema(name = "processing", example = "OK"))))
130108
public List<PushResult> postExternalVisits(List<ExternalVisitDto> dtos) {
131109
List<PushResult> result = savePushedDto(dtos, FacadeProvider.getVisitFacade()::saveExternalVisit);
132110
return result;
@@ -136,7 +114,7 @@ public List<PushResult> postExternalVisits(List<ExternalVisitDto> dtos) {
136114
@Path("/version")
137115
@Operation(summary = "Get API version")
138116
@ApiResponse(description = "The minimal version needed for compatibility with the external ReST API of SORMAS.",
139-
content = @Content(schema = @Schema(type = "String", example = "1.37.0")))
117+
content = @Content(schema = @Schema(type = "string", example = "1.37.0")))
140118
public String getVersion() {
141119
return EXTERNAL_VISITS_API_VERSION;
142120
}
@@ -151,13 +129,11 @@ public List<PersonQuarantineEndDto> getLatestQuarantineEndDates(@PathParam("sinc
151129
@Path("/followUpEndDates/{since}")
152130
@Operation(summary = "Get follow up end dates",
153131
description = "Get latest follow up end date assigned to the specified person. "
154-
+ "Note: Only returns values for persons who have their symptom journal status set to ACCEPTED!")
155-
@Parameter(in = ParameterIn.PATH,
156-
description = "Only data changed after this value is returned.",
157-
name = "since",
158-
schema = @Schema(format = "UNIX timestamp [Long)"))
132+
+ "Note: Only returns values for persons who have their symptom journal status set to ACCEPTED! "
133+
+ "Only returns values changed after {since}, which is interpreted as a UNIX timestamp.")
159134
//@formatter:off
160-
@ApiResponse(content = @Content(schema = @Schema(example = "[\n" +
135+
@ApiResponse(description = "List of personUuids and their latest follow up end dates as UNIX timestamps.",
136+
content = @Content(schema = @Schema(example = "[\n" +
161137
" {\n" +
162138
" \"personUuid\": \"Q56VFD-G3TXKT-R2DBIW-FTWIKAMI\",\n" +
163139
" \"latestFollowUpEndDate\": 1599602400000\n" +

0 commit comments

Comments
 (0)