
001 002package ca.uhn.fhir.jpa.rp.dstu2; 003 004import java.util.*; 005 006import org.apache.commons.lang3.StringUtils; 007 008import ca.uhn.fhir.jpa.provider.*; 009import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; 010import ca.uhn.fhir.model.api.Include; 011import ca.uhn.fhir.model.api.annotation.*; 012import ca.uhn.fhir.model.dstu2.composite.*; 013import ca.uhn.fhir.model.dstu2.resource.*; // 014import ca.uhn.fhir.rest.annotation.*; 015import ca.uhn.fhir.rest.param.*; 016import ca.uhn.fhir.rest.api.SortSpec; 017import ca.uhn.fhir.rest.api.SummaryEnum; 018import ca.uhn.fhir.rest.api.SearchTotalModeEnum; 019import ca.uhn.fhir.rest.api.SearchContainedModeEnum; 020 021public class ValueSetResourceProvider extends 022 BaseJpaResourceProviderValueSetDstu2 023 { 024 025 @Override 026 public Class<ValueSet> getResourceType() { 027 return ValueSet.class; 028 } 029 030 @Search(allowUnknownParams=true) 031 public ca.uhn.fhir.rest.api.server.IBundleProvider search( 032 javax.servlet.http.HttpServletRequest theServletRequest, 033 javax.servlet.http.HttpServletResponse theServletResponse, 034 035 ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, 036 037 @Description(shortDefinition="Search the contents of the resource's data using a filter") 038 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_FILTER) 039 StringAndListParam theFtFilter, 040 041 @Description(shortDefinition="Search the contents of the resource's data using a fulltext search") 042 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) 043 StringAndListParam theFtContent, 044 045 @Description(shortDefinition="Search the contents of the resource's narrative using a fulltext search") 046 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) 047 StringAndListParam theFtText, 048 049 @Description(shortDefinition="Search for resources which have the given tag") 050 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) 051 TokenAndListParam theSearchForTag, 052 053 @Description(shortDefinition="Search for resources which have the given security labels") 054 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) 055 TokenAndListParam theSearchForSecurity, 056 057 @Description(shortDefinition="Search for resources which have the given profile") 058 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) 059 UriAndListParam theSearchForProfile, 060 061 @Description(shortDefinition="Search for resources which have the given source value (Resource.meta.source)") 062 @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE) 063 UriAndListParam theSearchForSource, 064 065 @Description(shortDefinition="Return resources linked to by the given target") 066 @OptionalParam(name="_has") 067 HasAndListParam theHas, 068 069 070 071 @Description(shortDefinition="The ID of the resource") 072 @OptionalParam(name="_id") 073 StringAndListParam the_id, 074 075 076 @Description(shortDefinition="A code defined in the value set") 077 @OptionalParam(name="code") 078 TokenAndListParam theCode, 079 080 081 @Description(shortDefinition="A use context assigned to the value set") 082 @OptionalParam(name="context") 083 TokenAndListParam theContext, 084 085 086 @Description(shortDefinition="The value set publication date") 087 @OptionalParam(name="date") 088 DateRangeParam theDate, 089 090 091 @Description(shortDefinition="Text search in the description of the value set") 092 @OptionalParam(name="description") 093 StringAndListParam theDescription, 094 095 096 @Description(shortDefinition="") 097 @OptionalParam(name="expansion") 098 UriAndListParam theExpansion, 099 100 101 @Description(shortDefinition="The identifier for the value set") 102 @OptionalParam(name="identifier") 103 TokenAndListParam theIdentifier, 104 105 106 @Description(shortDefinition="The name of the value set") 107 @OptionalParam(name="name") 108 StringAndListParam theName, 109 110 111 @Description(shortDefinition="Name of the publisher of the value set") 112 @OptionalParam(name="publisher") 113 StringAndListParam thePublisher, 114 115 116 @Description(shortDefinition="A code system included or excluded in the value set or an imported value set") 117 @OptionalParam(name="reference") 118 UriAndListParam theReference, 119 120 121 @Description(shortDefinition="The status of the value set") 122 @OptionalParam(name="status") 123 TokenAndListParam theStatus, 124 125 126 @Description(shortDefinition="The system for any codes defined by this value set") 127 @OptionalParam(name="system") 128 UriAndListParam theSystem, 129 130 131 @Description(shortDefinition="The logical URL for the value set") 132 @OptionalParam(name="url") 133 UriAndListParam theUrl, 134 135 136 @Description(shortDefinition="The version identifier of the value set") 137 @OptionalParam(name="version") 138 TokenAndListParam theVersion, 139 140 @RawParam 141 Map<String, List<String>> theAdditionalRawParams, 142 143 @Description(shortDefinition="Only return resources which were last updated as specified by the given range") 144 @OptionalParam(name="_lastUpdated") 145 DateRangeParam theLastUpdated, 146 147 @IncludeParam 148 Set<Include> theIncludes, 149 150 @IncludeParam(reverse=true) 151 Set<Include> theRevIncludes, 152 153 @Sort 154 SortSpec theSort, 155 156 @ca.uhn.fhir.rest.annotation.Count 157 Integer theCount, 158 159 @ca.uhn.fhir.rest.annotation.Offset 160 Integer theOffset, 161 162 SummaryEnum theSummaryMode, 163 164 SearchTotalModeEnum theSearchTotalMode, 165 166 SearchContainedModeEnum theSearchContainedMode 167 168 ) { 169 startRequest(theServletRequest); 170 try { 171 SearchParameterMap paramMap = new SearchParameterMap(); 172 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_FILTER, theFtFilter); 173 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT, theFtContent); 174 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TEXT, theFtText); 175 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_TAG, theSearchForTag); 176 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY, theSearchForSecurity); 177 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE, theSearchForProfile); 178 paramMap.add(ca.uhn.fhir.rest.api.Constants.PARAM_SOURCE, theSearchForSource); 179 paramMap.add("_has", theHas); 180 paramMap.add("_id", the_id); 181 paramMap.add("code", theCode); 182 paramMap.add("context", theContext); 183 paramMap.add("date", theDate); 184 paramMap.add("description", theDescription); 185 paramMap.add("expansion", theExpansion); 186 paramMap.add("identifier", theIdentifier); 187 paramMap.add("name", theName); 188 paramMap.add("publisher", thePublisher); 189 paramMap.add("reference", theReference); 190 paramMap.add("status", theStatus); 191 paramMap.add("system", theSystem); 192 paramMap.add("url", theUrl); 193 paramMap.add("version", theVersion); 194 paramMap.setRevIncludes(theRevIncludes); 195 paramMap.setLastUpdated(theLastUpdated); 196 paramMap.setIncludes(theIncludes); 197 paramMap.setSort(theSort); 198 paramMap.setCount(theCount); 199 paramMap.setOffset(theOffset); 200 paramMap.setSummaryMode(theSummaryMode); 201 paramMap.setSearchTotalMode(theSearchTotalMode); 202 paramMap.setSearchContainedMode(theSearchContainedMode); 203 204 getDao().translateRawParameters(theAdditionalRawParams, paramMap); 205 206 ca.uhn.fhir.rest.api.server.IBundleProvider retVal = getDao().search(paramMap, theRequestDetails, theServletResponse); 207 return retVal; 208 } finally { 209 endRequest(theServletRequest); 210 } 211 } 212 213}