
001package ca.uhn.fhir.model.api.annotation; 002 003/* 004 * #%L 005 * HAPI FHIR - Core Library 006 * %% 007 * Copyright (C) 2014 - 2022 Smile CDR, Inc. 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023import java.lang.annotation.ElementType; 024import java.lang.annotation.Retention; 025import java.lang.annotation.RetentionPolicy; 026import java.lang.annotation.Target; 027 028import org.hl7.fhir.instance.model.api.IBaseResource; 029 030@Target(value=ElementType.FIELD) 031@Retention(RetentionPolicy.RUNTIME) 032public @interface SearchParamDefinition { 033 034 /** 035 * The name for this parameter 036 */ 037 String name(); 038 039 /** 040 * The path for this parameter 041 */ 042 String path(); 043 044 /** 045 * A description of this parameter 046 */ 047 String description() default ""; 048 049 /** 050 * The type for this parameter, e.g. "string", or "token" 051 */ 052 String type() default "string"; 053 054 /** 055 * If the parameter is of type "composite", this parameter lists the names of the parameters 056 * which this parameter is a composite of. E.g. "name-value-token" is a composite of "name" and "value-token". 057 * <p> 058 * If the parameter is not a composite, this parameter must be empty 059 * </p> 060 */ 061 String[] compositeOf() default {}; 062 063 /** 064 * For search params of type "reference", this can optionally be used to 065 * specify the resource type(s) that this parameter applies to. 066 */ 067 Class<? extends IBaseResource>[] target() default {}; 068 069 /** 070 * Indicates that this field indicates that resources linked to by this parameter 071 * (must be a reference parameter) place the resource in the given compartment. 072 */ 073 Compartment[] providesMembershipIn() default {}; 074 075}