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