View Javadoc
1   /*
2    * Copyright 2012 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.commons.ihe.xds.core.requests;
17  
18  import lombok.EqualsAndHashCode;
19  import lombok.ToString;
20  
21  import javax.xml.bind.annotation.XmlAccessType;
22  import javax.xml.bind.annotation.XmlAccessorType;
23  import javax.xml.bind.annotation.XmlElementRef;
24  import javax.xml.bind.annotation.XmlRootElement;
25  import javax.xml.bind.annotation.XmlType;
26  import java.io.Serializable;
27  import java.util.ArrayList;
28  import java.util.List;
29  
30  /**
31   * Request object for a single Study.
32   * <p>
33   * All members of this class are allowed to be <code>null</code>.
34   * @author Clay Sebourn
35   */
36  @XmlAccessorType(XmlAccessType.FIELD)
37  @XmlType(name = "RetrieveStudy", propOrder = {"studyInstanceUID", "retrieveSerieses"})
38  @XmlRootElement(name = "retrieveStudy")
39  @EqualsAndHashCode(doNotUseGetters = true)
40  @ToString(doNotUseGetters = true)
41  public class RetrieveStudy implements Serializable
42  {
43      private static final long serialVersionUID = 8999352499981099420L;
44  
45      protected String studyInstanceUID;
46      @XmlElementRef
47      protected List<RetrieveSeries> retrieveSerieses;
48  
49      /**
50       * Constructs the Study request.
51       */
52      public RetrieveStudy() {}
53  
54      /**
55       * Constructs the Study request.
56       *
57       * @param studyInstanceUID          the study instance UID.
58       * @param retrieveSerieses          the series requests.
59       */
60      public RetrieveStudy(String studyInstanceUID, List<RetrieveSeries> retrieveSerieses) {
61          this.studyInstanceUID = studyInstanceUID;
62          this.retrieveSerieses = retrieveSerieses;
63      }
64  
65      /**
66       * Gets the value of the studyInstanceUID property.
67       *
68       * @return studyInstanceUID     {@link String }
69       *
70       */
71      public String getStudyInstanceUID() {
72          return studyInstanceUID;
73      }
74  
75      /**
76       * @param studyInstanceUID
77       *          the unique ID of the Study instance.
78       */
79      public void setStudyInstanceUID(String studyInstanceUID) {
80          this.studyInstanceUID = studyInstanceUID;
81      }
82  
83      /**
84       * Gets the value of the retrieveSerieses property.
85       *
86       * <p>
87       * This accessor method returns a reference to the live list,
88       * not a snapshot. Therefore any modification you make to the
89       * returned list will be present inside the JAXB object.
90       * This is why there is not a <CODE>set</CODE> method for the seriesRequest property.
91       * <p>
92       * For example, to add a new item, do as follows:
93       * <pre>
94       *    getRetrieveSerieses().add(newItem);
95       * </pre>
96       * <p>
97       * Objects of the following type(s) are allowed in the list {@link RetrieveSeries }
98       *
99       * @return  the series requests
100      */
101     public List<RetrieveSeries> getRetrieveSerieses() {
102         if (retrieveSerieses == null) {
103             retrieveSerieses = new ArrayList<>();
104         }
105         return this.retrieveSerieses;
106     }
107 
108 }