@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
public static void extractDescription(SearchParameter theParameter, Annotation[] theAnnotations) { for (Annotation annotation : theAnnotations) { if (annotation instanceof Description) { Description desc = (Description) annotation; if (isNotBlank(desc.formalDefinition())) { theParameter.setDescription(desc.formalDefinition()); } else { theParameter.setDescription(desc.shortDefinition()); } } } }
@Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) private List<ExtensionDt> myUndeclaredExtensions; @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) private List<ExtensionDt> myUndeclaredModifierExtensions;
public static void extractDescription(SearchParameter theParameter, Annotation[] theAnnotations) { for (Annotation annotation : theAnnotations) { if (annotation instanceof Description) { Description desc = (Description) annotation; if (isNotBlank(desc.formalDefinition())) { theParameter.setDescription(desc.formalDefinition()); } else { theParameter.setDescription(desc.shortDefinition()); } } } }
@ResourceDef() public static class MyPatient extends Patient { @Child(name="petName") @Extension(url="http://example.com/dontuse#petname", definedLocally=false, isModifier=false) @Description(shortDefinition="The name of the patient's favourite pet") private StringDt myPetName; public StringDt getPetName() { if(myPetName==null) { myPetName = new StringDt(); } return myPetName; } public void setPetName(StringDt thePetName) { myPetName = thePetName; } public List<DateTimeDt> getImportantDates() { if (myImportantDates==null) { myImportantDates=new ArrayList<DateTimeDt>(); } return myImportantDates; } public void setImportantDates(List<DateTimeDt> theImportantDates) { myImportantDates = theImportantDates; } @Child(name="importantDates", max=Child.MAX_UNLIMITED) @Extension(url="http://example.com/dontuse#importantDates", definedLocally=false, isModifier=true) @Description(shortDefinition="Some dates of note for the patient") private List<DateTimeDt> myImportantDates; }
public SearchMethodBinding(Class<? extends IBaseResource> theReturnResourceType, Class<? extends IBaseResource> theResourceProviderResourceType, Method theMethod, FhirContext theContext, Object theProvider) { super(theReturnResourceType, theMethod, theContext, theProvider); Search search = theMethod.getAnnotation(Search.class); this.myQueryName = StringUtils.defaultIfBlank(search.queryName(), null); this.myCompartmentName = StringUtils.defaultIfBlank(search.compartmentName(), null); this.myIdParamIndex = ParameterUtil.findIdParameterIndex(theMethod, getContext()); this.myAllowUnknownParams = search.allowUnknownParams(); Description desc = theMethod.getAnnotation(Description.class); if (desc != null) { if (isNotBlank(desc.formalDefinition())) { myDescription = StringUtils.defaultIfBlank(desc.formalDefinition(), null); } else { myDescription = StringUtils.defaultIfBlank(desc.shortDefinition(), null); } } /* * Only compartment searching methods may have an ID parameter */ if (isBlank(myCompartmentName) && myIdParamIndex != null) { String msg = theContext.getLocalizer().getMessage(getClass().getName() + ".idWithoutCompartment", theMethod.getName(), theMethod.getDeclaringClass()); throw new ConfigurationException(msg); } if (theResourceProviderResourceType != null) { this.myResourceProviderResourceName = theContext.getResourceDefinition(theResourceProviderResourceType).getName(); } else { this.myResourceProviderResourceName = null; } }
@Description(shortDefinition="Designations to be included", formalDefinition="Designations to be included." ) protected DesignationIncludeComponent include; @Description(shortDefinition="Designations to be excluded", formalDefinition="Designations to be excluded." ) protected DesignationExcludeComponent exclude;
if (isNotBlank(desc.formalDefinition())) { myDescription = StringUtils.defaultIfBlank(desc.formalDefinition(), null); } else { myDescription = StringUtils.defaultIfBlank(desc.shortDefinition(), null);
@Description(shortDefinition="Fulfilment code", formalDefinition="Code indicating when the request should be fulfilled." ) protected CodeableConcept code; @Description(shortDefinition="Formal fulfillment schedule", formalDefinition="Formal fulfillment schedule." ) protected Timing schedule;
BaseRuntimeDeclaredChildDefinition(Field theField, Child theChildAnnotation, Description theDescriptionAnnotation, String theElementName) throws ConfigurationException { super(); Validate.notNull(theField, "No field speficied"); ValidateUtil.isGreaterThanOrEqualTo(theChildAnnotation.min(), 0, "Min must be >= 0"); Validate.isTrue(theChildAnnotation.max() == -1 || theChildAnnotation.max() >= theChildAnnotation.min(), "Max must be >= Min (unless it is -1 / unlimited)"); Validate.notBlank(theElementName, "Element name must not be blank"); myField = theField; myMin = theChildAnnotation.min(); myMax = theChildAnnotation.max(); mySummary = theChildAnnotation.summary(); myModifier = theChildAnnotation.modifier(); myElementName = theElementName; if (theDescriptionAnnotation != null) { myShortDefinition = theDescriptionAnnotation.shortDefinition(); myFormalDefinition = theDescriptionAnnotation.formalDefinition(); } else { myShortDefinition = null; myFormalDefinition = null; } myField.setAccessible(true); if (List.class.equals(myField.getType())) { // TODO: verify that generic type is IElement myAccessor = new FieldListAccessor(); myMutator = new FieldListMutator(); } else { myAccessor = new FieldPlainAccessor(); myMutator = new FieldPlainMutator(); } }
@Description(shortDefinition="Numerator value", formalDefinition="The value of the numerator." ) protected Quantity numerator; @Description(shortDefinition="Denominator value", formalDefinition="The value of the denominator." ) protected Quantity denominator;
myDescription = description.formalDefinition(); if (isBlank(myDescription)) { myDescription = description.shortDefinition();
@Description(shortDefinition="The type of behavior (grouping, precheck, selection, cardinality, etc)", formalDefinition="The type of the behavior to be described, such as grouping, visual, or selection behaviors." ) protected Coding type; @Description(shortDefinition="Specific behavior (e.g. required, at-most-one, single, etc)", formalDefinition="The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset." ) protected Coding value;
myDescription = description.formalDefinition(); if (isBlank(myDescription)) { myDescription = description.shortDefinition();
@Description(shortDefinition="generic | formulary +", formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." ) protected CodeableConcept type; @Description(shortDefinition="Why should (not) substitution be made", formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." ) protected CodeableConcept reason;
@Description(shortDefinition="The setup operation to perform", formalDefinition="An operation would involve a REST request to a server." ) protected SetupActionOperationComponent operation; @Description(shortDefinition="The setup assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." ) protected SetupActionAssertComponent assert_;
@Description(shortDefinition="Code specifies when request should be done. The code may simply be a priority code", formalDefinition="Code specifies when request should be done. The code may simply be a priority code." ) protected CodeableConcept code; @Description(shortDefinition="A formal schedule", formalDefinition="A formal schedule." ) protected Timing schedule;
@Description(shortDefinition="The operation to perform", formalDefinition="The operation performed." ) protected SetupActionOperationComponent operation; @Description(shortDefinition="The assertion to perform", formalDefinition="The results of the assertion performed on the previous operations." ) protected SetupActionAssertComponent assert_;
@Description(shortDefinition="The operation performed", formalDefinition="An operation would involve a REST request to a server." ) protected SetupActionOperationComponent operation; @Description(shortDefinition="The assertion performed", formalDefinition="The results of the assertion performed on the previous operations." ) protected SetupActionAssertComponent assert_;
/** * /Patient/$everything */ @Operation(name = JpaConstants.OPERATION_EVERYTHING, idempotent = true, bundleType = BundleTypeEnum.SEARCHSET) public IBundleProvider patientTypeEverything( javax.servlet.http.HttpServletRequest theServletRequest, @Description(formalDefinition = "Results from this method are returned across multiple pages. This parameter controls the size of those pages.") @OperationParam(name = Constants.PARAM_COUNT) UnsignedIntType theCount, @Description(shortDefinition = "Only return resources which were last updated as specified by the given range") @OperationParam(name = Constants.PARAM_LASTUPDATED, min = 0, max = 1) DateRangeParam theLastUpdated, @Description(shortDefinition = "Filter the resources to return only resources matching the given _content filter (note that this filter is applied only to results which link to the given patient, not to the patient itself or to supporting resources linked to by the matched resources)") @OperationParam(name = Constants.PARAM_CONTENT, min = 0, max = OperationParam.MAX_UNLIMITED) List<StringType> theContent, @Description(shortDefinition = "Filter the resources to return only resources matching the given _text filter (note that this filter is applied only to results which link to the given patient, not to the patient itself or to supporting resources linked to by the matched resources)") @OperationParam(name = Constants.PARAM_TEXT, min = 0, max = OperationParam.MAX_UNLIMITED) List<StringType> theNarrative, @Sort SortSpec theSortSpec, RequestDetails theRequestDetails ) { startRequest(theServletRequest); try { return ((IFhirResourceDaoPatient<Patient>) getDao()).patientTypeEverything(theServletRequest, theCount, theLastUpdated, theSortSpec, toStringAndList(theContent), toStringAndList(theNarrative), theRequestDetails); } finally { endRequest(theServletRequest); } }