001package ca.uhn.fhir.model.api.annotation;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2021 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.Inherited;
025import java.lang.annotation.Retention;
026import java.lang.annotation.RetentionPolicy;
027import java.lang.annotation.Target;
028
029/**
030 * Class annotation which indicates a resource definition class
031 */
032@Inherited
033@Retention(RetentionPolicy.RUNTIME)
034@Target(value= {ElementType.TYPE})
035public @interface ResourceDef {
036
037        /**
038         * The name of the resource (e.g. "Patient" or "DiagnosticReport"). If you are defining your
039         * own custom extension to a built-in FHIR resource definition type (e.g. you are extending
040         * the built-in Patient class) you do not need to supply a value for this property, as it 
041         * will be inferred from the parent class.
042         */
043        String name() default "";
044
045        /**
046         * if set, will be used as the id for any profiles generated for this resource. This property
047         * should be set for custom profile definition classes, and will be used as the resource ID
048         * for the generated profile exported by the server. For example, if you set this value to
049         * "hello" on a custom resource class, your server will automatically export a profile with the
050         * identity: <code>http://localhost:8080/fhir/Profile/hello</code> (the base URL will be whatever
051         * your server uses, not necessarily "http://localhost:8080/fhir")
052         */
053        String id() default "";
054        
055        /**
056         * The URL indicating the profile for this resource definition. If specified, this URL will be
057         * automatically added to the meta tag when the resource is serialized.
058         * <p>
059         * This URL should be fully qualified to indicate the complete URL of
060         * the profile being used, e.g. <code>http://example.com/fhir/StructureDefiniton/some_profile</code>
061         * </p>
062         */
063        String profile() default "";
064        
065}