View Javadoc
1   package ca.uhn.fhir.rest.annotation;
2   
3   /*
4    * #%L
5    * HAPI FHIR - Core Library
6    * %%
7    * Copyright (C) 2014 - 2018 University Health Network
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import java.lang.annotation.ElementType;
24  import java.lang.annotation.Retention;
25  import java.lang.annotation.RetentionPolicy;
26  import java.lang.annotation.Target;
27  
28  import org.hl7.fhir.instance.model.api.IBaseResource;
29  
30  import ca.uhn.fhir.model.api.IResource;
31  import ca.uhn.fhir.model.api.TagList;
32  import ca.uhn.fhir.model.primitive.IdDt;
33  
34  /**
35   * RESTful method annotation to be used for the FHIR <a
36   * href="http://hl7.org/implement/standards/fhir/http.html#tags">Tag
37   * Operations</a> which have to do with deleting tags.
38   * <ul>
39   * <li>
40   * To delete tag(s) <b>to the given resource
41   * instance</b>, this annotation should contain a {@link #type()} attribute
42   * specifying the resource type, and the method should have a parameter of type
43   * {@link IdDt} annotated with the {@link IdParam} annotation, as well as 
44   * a parameter of type {@link TagList} which will contain the list of tags
45   * to be deleted.
46   * Note that for a
47   * server implementation, the {@link #type()} annotation is optional if the
48   * method is defined in a <a href=
49   * "http://jamesagnew.github.io/hapi-fhir/doc_rest_server.html#resource_providers"
50   * >resource provider</a>, since the type is implied.</li>
51   * <li>
52   * To delete tag(s) on the server <b>to the given version of the
53   * resource instance</b>, this annotation should contain a {@link #type()}
54   * attribute specifying the resource type, and the method should have a
55   * parameter of type {@link IdDt} annotated with the {@link VersionIdParam}
56   * annotation, <b>and</b> a parameter of type {@link IdDt} annotated with the
57   * {@link IdParam} annotation, as well as 
58   * a parameter of type {@link TagList} which will contain the list of tags
59   * to be deleted.
60   * Note that for a server implementation, the
61   * {@link #type()} annotation is optional if the method is defined in a <a href=
62   * "http://jamesagnew.github.io/hapi-fhir/doc_rest_server.html#resource_providers"
63   * >resource provider</a>, since the type is implied.</li>
64   * </ul>
65   */
66  @Target(value= ElementType.METHOD)
67  @Retention(value=RetentionPolicy.RUNTIME)
68  public @interface DeleteTags {
69  
70  	/**
71  	 * If set to a type other than the default (which is {@link IResource}
72  	 * , this method is expected to return a TagList containing only tags which
73  	 * are specific to the given resource type.
74  	 */
75  	Class<? extends IBaseResource> type() default IBaseResource.class;
76  
77  }