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 java.lang.annotation.ElementType;
023import java.lang.annotation.Retention;
024import java.lang.annotation.RetentionPolicy;
025import java.lang.annotation.Target;
026
027/**
028 * Field modifier to be placed on a child field (a field also annotated with the {@link Child} annotation) which
029 * indicates that this field is an extension.
030 */
031@Target(value = {ElementType.FIELD})
032@Retention(RetentionPolicy.RUNTIME)
033public @interface Extension {
034
035        /**
036         * This parameter affects how the extension is treated when the element definition containing this resource is
037         * exported to a profile.
038         *
039         * <p>
040         * If set to <b><code>true</code></b>, the resource is taken to be a local resource and its definition is exported
041         * along with the reference. Use this option for extension defintions that you have added locally (i.e. within your
042         * own organization)
043         * </p>
044         *
045         * <p>
046         * If set to <b><code>false</code></b>, the resource is taken to be a remote resource and its definition is
047         * <b>not</b> exported to the profile. Use this option for extensions that are defined by other organizations (i.e.
048         * by regional authorities or jurisdictional governments)
049         * </p>
050         */
051        boolean definedLocally() default true;
052
053        /**
054         * Returns <code>true</code> if this extension is a <a
055         * href="http://www.hl7.org/implement/standards/fhir/extensibility.html#modifierExtension">modifier extension</a>
056         */
057        boolean isModifier() default false;
058
059        /**
060         * The URL associated with this extension
061         */
062        String url();
063}