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