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