@Search() public List<Patient> searchByNames( @RequiredParam(name=Patient.SP_FAMILY) StringParam theFamilyName, @OptionalParam(name=Patient.SP_GIVEN) StringParam theGivenName ) { String familyName = theFamilyName.getValue(); String givenName = theGivenName != null ? theGivenName.getValue() : null; List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: searchOptionalParam
} else if (nextAnnotation instanceof OptionalParam) { SearchParameter parameter = new SearchParameter(); parameter.setName(((OptionalParam) nextAnnotation).name()); parameter.setRequired(false); parameter.setDeclaredTypes(((OptionalParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((OptionalParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((OptionalParam) nextAnnotation).chainWhitelist(), ((OptionalParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
@Description(shortDefinition="This search finds all patient resources matching a given name combination") @Search() public List<Patient> searchWithDocs( @Description(shortDefinition="This is the patient's last name - Supports partial matches") @RequiredParam(name=Patient.SP_FAMILY) StringParam theFamilyName, @Description(shortDefinition="This is the patient's given names") @OptionalParam(name=Patient.SP_GIVEN) StringParam theGivenName ) { List<Patient> retVal = new ArrayList<Patient>(); // ...populate... return retVal; } //END SNIPPET: searchWithDocs
} else if (nextAnnotation instanceof OptionalParam) { SearchParameter parameter = new SearchParameter(); parameter.setName(((OptionalParam) nextAnnotation).name()); parameter.setRequired(false); parameter.setDeclaredTypes(((OptionalParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((OptionalParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((OptionalParam) nextAnnotation).chainWhitelist(), ((OptionalParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
@Search public List<DiagnosticReport> findDiagnosticReportsWithSubjet( @OptionalParam(name=DiagnosticReport.SP_SUBJECT) ReferenceParam theSubject ) { List<DiagnosticReport> retVal=new ArrayList<DiagnosticReport>(); // If the parameter passed in includes a resource type (e.g. ?subject:Patient=123) // that resource type is available. Here we just check that it is either not provided // or set to "Patient" if (theSubject.hasResourceType()) { String resourceType = theSubject.getResourceType(); if ("Patient".equals(resourceType) == false) { throw new InvalidRequestException("Invalid resource type for parameter 'subject': " + resourceType); } } if (theSubject != null) { // ReferenceParam extends IdType so all of the resource ID methods are available String subjectId = theSubject.getIdPart(); // .. populate retVal with DiagnosticReport resources having // subject with id "subjectId" .. } return retVal; } //END SNIPPET: referenceSimple
} else if (nextAnnotation instanceof OptionalParam) { SearchParameter parameter = new SearchParameter(); parameter.setName(((OptionalParam) nextAnnotation).name()); parameter.setRequired(false); parameter.setDeclaredTypes(((OptionalParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((OptionalParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((OptionalParam) nextAnnotation).chainWhitelist(), ((OptionalParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") TokenAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="identifier") TokenAndListParam theIdentifier, @OptionalParam(name="subject", targetTypes={ } ) ReferenceAndListParam theSubject,
} else if (nextAnnotation instanceof OptionalParam) { SearchParameter parameter = new SearchParameter(); parameter.setName(((OptionalParam) nextAnnotation).name()); parameter.setRequired(false); parameter.setDeclaredTypes(((OptionalParam) nextAnnotation).targetTypes()); parameter.setCompositeTypes(((OptionalParam) nextAnnotation).compositeTypes()); parameter.setChainlists(((OptionalParam) nextAnnotation).chainWhitelist(), ((OptionalParam) nextAnnotation).chainBlacklist()); parameter.setType(theContext, parameterType, innerCollectionType, outerCollectionType); MethodUtil.extractDescription(parameter, annotations);
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") TokenAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="target", targetTypes={ } ) ReferenceAndListParam theTarget, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") TokenAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="code") TokenAndListParam theCode, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") StringAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="identifier") TokenAndListParam theIdentifier, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") TokenAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="subject", targetTypes={ } ) ReferenceAndListParam theSubject, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") StringAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="identifier") TokenAndListParam theIdentifier, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") StringAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="identifier") TokenAndListParam theIdentifier, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") StringAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="contenttype") TokenAndListParam theContenttype, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") TokenAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="subject", targetTypes={ } ) ReferenceAndListParam theSubject, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") StringAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="identifier") TokenAndListParam theIdentifier, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") TokenAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="subject", targetTypes={ } ) ReferenceAndListParam theSubject, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") StringAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="identifier") TokenAndListParam theIdentifier, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")
@OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_CONTENT) StringAndListParam theFtContent, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TEXT) StringAndListParam theFtText, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_TAG) TokenAndListParam theSearchForTag, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_SECURITY) TokenAndListParam theSearchForSecurity, @OptionalParam(name=ca.uhn.fhir.rest.api.Constants.PARAM_PROFILE) UriAndListParam theSearchForProfile, @OptionalParam(name="_has") HasAndListParam theHas, @OptionalParam(name="_id") TokenAndListParam the_id, @OptionalParam(name="_language") StringAndListParam the_language, @OptionalParam(name="subject", targetTypes={ } ) ReferenceAndListParam theSubject, Set<Include> theRevIncludes, @Description(shortDefinition="Only return resources which were last updated as specified by the given range")