View Javadoc
1   
2   package ca.uhn.fhir.jpa.rp.r4;
3   
4   import java.util.*;
5   
6   import org.apache.commons.lang3.StringUtils;
7   
8   import ca.uhn.fhir.jpa.provider.r4.*;
9   import ca.uhn.fhir.jpa.dao.SearchParameterMap;
10  import ca.uhn.fhir.model.api.Include;
11  import ca.uhn.fhir.model.api.annotation.*;
12  import org.hl7.fhir.r4.model.*;
13  import ca.uhn.fhir.rest.annotation.*;
14  import ca.uhn.fhir.rest.param.*;
15  import ca.uhn.fhir.rest.api.SortSpec;
16  
17  public class MedicinalProductAuthorizationResourceProvider extends 
18  	JpaResourceProviderR4<MedicinalProductAuthorization>
19  	{
20  
21  	@Override
22  	public Class<MedicinalProductAuthorization> getResourceType() {
23  		return MedicinalProductAuthorization.class;
24  	}
25  
26  	@Search(allowUnknownParams=true)
27  	public ca.uhn.fhir.rest.api.server.IBundleProvider search(
28  			javax.servlet.http.HttpServletRequest theServletRequest,
29  			javax.servlet.http.HttpServletResponse theServletResponse,
30  
31  			ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails,
32  			
33  			@Description(shortDefinition="Search the contents of the resource's data using a fulltext search")
34  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT)
35  			StringAndListParam theFtContent, 
36  
37  			@Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search")
38  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT)
39  			StringAndListParam theFtText, 
40  
41  			@Description(shortDefinition="Search for resources which have the given tag")
42  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG)
43  			TokenAndListParam theSearchForTag, 
44  
45  			@Description(shortDefinition="Search for resources which have the given security labels")
46  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY)
47  			TokenAndListParam theSearchForSecurity, 
48    
49  			@Description(shortDefinition="Search for resources which have the given profile")
50  			@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE)
51  			UriAndListParam theSearchForProfile, 
52  
53  			@Description(shortDefinition="Return resources linked to by the given target")
54  			@OptionalParam(name="_has")
55  			HasAndListParam theHas, 
56  
57    
58  			@Description(shortDefinition="The ID of the resource")
59  			@OptionalParam(name="_id")
60  			TokenAndListParam the_id, 
61    
62  			@Description(shortDefinition="The language of the resource")
63  			@OptionalParam(name="_language")
64  			StringAndListParam the_language, 
65  
66  			@RawParam
67  			Map<String, List<String>> theAdditionalRawParams,
68  
69  			@IncludeParam(reverse=true)
70  			Set<Include> theRevIncludes,
71  			@Description(shortDefinition="Only return resources which were last updated as specified by the given range")
72  			@OptionalParam(name="_lastUpdated")
73  			DateRangeParam theLastUpdated, 
74  
75  			@IncludeParam(allow= {
76  				"*"
77  			}) 
78  			Set<Include> theIncludes,
79  			
80  			@Sort 
81  			SortSpec theSort,
82  			
83  			@ca.uhn.fhir.rest.annotation.Count
84  			Integer theCount
85  	) {
86  		startRequest(theServletRequest);
87  		try {
88  			SearchParameterMap paramMap = new SearchParameterMap();
89  			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent);
90  			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText);
91  			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag);
92  			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity);
93  			paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile);
94  			paramMap.add("_has", theHas);
95  			paramMap.add("_id", the_id);
96  			paramMap.add("_language", the_language);
97  			paramMap.setRevIncludes(theRevIncludes);
98  			paramMap.setLastUpdated(theLastUpdated);
99  			paramMap.setIncludes(theIncludes);
100 			paramMap.setSort(theSort);
101 			paramMap.setCount(theCount);
102 
103 			getDao().translateRawParameters(theAdditionalRawParams, paramMap);
104 
105 			ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse);
106 			return retVal;
107 		} finally {
108 			endRequest(theServletRequest);
109 		}
110 	}
111 
112 }