View Javadoc
1   package ca.uhn.fhir.jpa.provider;
2   
3   /*
4    * #%L
5    * HAPI FHIR JPA Server
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import ca.uhn.fhir.jpa.dao.IFhirResourceDaoEncounter;
24  import ca.uhn.fhir.jpa.util.JpaConstants;
25  import ca.uhn.fhir.model.api.annotation.Description;
26  import ca.uhn.fhir.model.dstu2.resource.Encounter;
27  import ca.uhn.fhir.model.valueset.BundleTypeEnum;
28  import ca.uhn.fhir.rest.annotation.*;
29  import ca.uhn.fhir.rest.api.Constants;
30  import ca.uhn.fhir.rest.api.SortSpec;
31  import ca.uhn.fhir.rest.api.server.IBundleProvider;
32  import ca.uhn.fhir.rest.param.DateRangeParam;
33  
34  public class BaseJpaResourceProviderEncounterDstu2 extends JpaResourceProviderDstu2<Encounter> {
35  
36  	/**
37  	 * Encounter/123/$everything
38  	 */
39  	@Operation(name = JpaConstants.OPERATION_EVERYTHING, idempotent = true, bundleType=BundleTypeEnum.SEARCHSET)
40  	public IBundleProvider EncounterInstanceEverything(
41  
42  			javax.servlet.http.HttpServletRequest theServletRequest,
43  
44  			@IdParam 
45  			ca.uhn.fhir.model.primitive.IdDt theId,
46  			
47  			@Description(formalDefinition="Results from this method are returned across multiple pages. This parameter controls the size of those pages.") 
48  			@OperationParam(name = Constants.PARAM_COUNT) 
49  			ca.uhn.fhir.model.primitive.UnsignedIntDt theCount,
50  			
51  			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
52  			@OperationParam(name = Constants.PARAM_LASTUPDATED, min=0, max=1) 
53  			DateRangeParam theLastUpdated,
54  			
55  			@Sort
56  			SortSpec theSortSpec
57  			) {
58  
59  		startRequest(theServletRequest);
60  		try {
61  			return ((IFhirResourceDaoEncounter<Encounter>)getDao()).encounterInstanceEverything(theServletRequest, theId, theCount, theLastUpdated, theSortSpec);
62  		} finally {
63  			endRequest(theServletRequest);
64  		}}
65  
66  		/**
67  		 * /Encounter/$everything
68  		 */
69  		@Operation(name = JpaConstants.OPERATION_EVERYTHING, idempotent = true, bundleType=BundleTypeEnum.SEARCHSET)
70  		public IBundleProvider EncounterTypeEverything(
71  
72  				javax.servlet.http.HttpServletRequest theServletRequest,
73  
74  				@Description(formalDefinition="Results from this method are returned across multiple pages. This parameter controls the size of those pages.") 
75  				@OperationParam(name = Constants.PARAM_COUNT) 
76  				ca.uhn.fhir.model.primitive.UnsignedIntDt theCount,
77  				
78  				@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
79  				@OperationParam(name = Constants.PARAM_LASTUPDATED, min=0, max=1) 
80  				DateRangeParam theLastUpdated,
81  				
82  				@Sort
83  				SortSpec theSortSpec
84  				) {
85  
86  			startRequest(theServletRequest);
87  			try {
88  				return ((IFhirResourceDaoEncounter<Encounter>)getDao()).encounterTypeEverything(theServletRequest, theCount, theLastUpdated, theSortSpec);
89  			} finally {
90  				endRequest(theServletRequest);
91  			}
92  
93  	}
94  
95  }