View Javadoc
1   /*
2    * Copyright 2009 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.query;
17  
18  import lombok.EqualsAndHashCode;
19  import lombok.Getter;
20  import lombok.Setter;
21  import lombok.ToString;
22  import org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus;
23  import org.openehealth.ipf.commons.ihe.xds.core.metadata.DocumentAvailability;
24  import org.openehealth.ipf.commons.ihe.xds.core.metadata.DocumentEntryType;
25  import org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable;
26  
27  import javax.xml.bind.annotation.*;
28  import java.util.List;
29  
30  /**
31   * Represents a stored query for FindDocuments.
32   * @author Jens Riemschneider
33   */
34  @XmlAccessorType(XmlAccessType.FIELD)
35  @XmlType(name = "FindDocumentsQuery", propOrder = {
36          "patientId", "status", "documentEntryTypes", "documentAvailability", "metadataLevel"})
37  @XmlRootElement(name = "findDocumentsQuery")
38  @EqualsAndHashCode(callSuper = true, doNotUseGetters = true)
39  @ToString(callSuper = true, doNotUseGetters = true)
40  public class FindDocumentsQuery extends DocumentsQuery implements PatientIdBasedStoredQuery, DocumentEntryTypeAwareStoredQuery {
41      private static final long serialVersionUID = -5765363916663583605L;
42  
43      @Getter @Setter private Identifiable patientId;
44      @Getter @Setter private List<AvailabilityStatus> status;
45      @XmlElement(name = "documentEntryType")
46      @Getter @Setter private List<DocumentEntryType> documentEntryTypes;
47      @Getter @Setter private List<DocumentAvailability> documentAvailability;
48      @Getter @Setter private Integer metadataLevel;
49  
50      /**
51       * Constructs the query.
52       */
53      public FindDocumentsQuery() {
54          super(QueryType.FIND_DOCUMENTS);
55      }
56  
57      protected FindDocumentsQuery(QueryType type) {
58          super(type);
59      }
60  
61      @Override
62      public void accept(Visitor visitor) {
63          visitor.visit(this);
64      }
65  }