|
1 | 1 | package de.dktk.dd.rpb.uploaderbasicwebservices; |
2 | 2 |
|
| 3 | +import de.dktk.dd.rpb.uploaderbasicwebservices.util.Counter; |
| 4 | +import jakarta.inject.Inject; |
3 | 5 | import jakarta.ws.rs.GET; |
4 | 6 | import jakarta.ws.rs.Path; |
5 | 7 | import jakarta.ws.rs.PathParam; |
|
8 | 10 | import jakarta.ws.rs.core.HttpHeaders; |
9 | 11 | import jakarta.ws.rs.core.MediaType; |
10 | 12 | import jakarta.ws.rs.core.Response; |
| 13 | +import org.json.JSONObject; |
11 | 14 |
|
12 | | -@Path("/v1/pacs") |
| 15 | +import java.util.ArrayList; |
| 16 | +import java.util.HashMap; |
| 17 | +import java.util.List; |
| 18 | +import java.util.Map; |
| 19 | + |
| 20 | +@Path("/api/v1/pacs") |
13 | 21 | public class PacsSubjectResource { |
14 | 22 |
|
| 23 | + //private final Counter counter; |
| 24 | + |
| 25 | + //@Inject |
| 26 | + //public PacsSubjectResource(Counter counter) { |
| 27 | + // this.counter = counter; |
| 28 | + //} |
| 29 | + |
15 | 30 | @GET |
16 | 31 | @Path("/subjects/{subjectid}/studies/{study}/series/{series}") |
17 | 32 | @Produces(MediaType.APPLICATION_JSON) |
18 | 33 | public Response getDicomSeriesData(@Context HttpHeaders headers, |
19 | 34 | @PathParam("subjectid") String dicomPatientId, |
20 | 35 | @PathParam("study") String studyInstanceUid, |
21 | 36 | @PathParam("series") String seriesInstanceUid){ |
22 | | - //return Response.ok().build(); |
23 | | - return jakarta.ws.rs.core.Response.status(200).entity("28").build(); |
| 37 | + |
| 38 | + int count = 34; |
| 39 | + List<String> imageArray = new ArrayList<>(); |
| 40 | + for (int i=0; i<count; i++){ |
| 41 | + imageArray.add("0"); |
| 42 | + } |
| 43 | + |
| 44 | + Map<String,List> seriesImages = new HashMap<>(); |
| 45 | + seriesImages.put("Images",imageArray); |
| 46 | + |
| 47 | + List<Map> seriesData = new ArrayList<>(); |
| 48 | + seriesData.add(seriesImages); |
| 49 | + |
| 50 | + JSONObject jsonObject = new JSONObject(); |
| 51 | + jsonObject.put("Series", seriesData); |
| 52 | + |
| 53 | + return Response.status(200).entity(jsonObject.toString()).build(); |
24 | 54 | } |
25 | 55 |
|
26 | 56 | } |
0 commit comments