mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-16 18:05:19 +00:00
Annotation documentation updates
This commit is contained in:
parent
0b7cfec06b
commit
deef33317d
@ -277,7 +277,6 @@
|
|||||||
<escapeHTML>false</escapeHTML>
|
<escapeHTML>false</escapeHTML>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!--
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||||
@ -328,7 +327,6 @@
|
|||||||
</reportSet>
|
</reportSet>
|
||||||
</reportSets>
|
</reportSets>
|
||||||
</plugin>
|
</plugin>
|
||||||
-->
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
@ -20,7 +20,7 @@ package ca.uhn.fhir.context;
|
|||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
import static org.apache.commons.lang3.StringUtils.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -55,7 +55,6 @@ import ca.uhn.fhir.model.api.IResourceBlock;
|
|||||||
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
|
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
|
||||||
import ca.uhn.fhir.model.api.annotation.Block;
|
import ca.uhn.fhir.model.api.annotation.Block;
|
||||||
import ca.uhn.fhir.model.api.annotation.Child;
|
import ca.uhn.fhir.model.api.annotation.Child;
|
||||||
import ca.uhn.fhir.model.api.annotation.CodeTableDef;
|
|
||||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||||
import ca.uhn.fhir.model.api.annotation.Description;
|
import ca.uhn.fhir.model.api.annotation.Description;
|
||||||
import ca.uhn.fhir.model.api.annotation.Extension;
|
import ca.uhn.fhir.model.api.annotation.Extension;
|
||||||
@ -257,16 +256,6 @@ class ModelScanner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CodeTableDef codeTableDefinition = theClass.getAnnotation(CodeTableDef.class);
|
|
||||||
if (codeTableDefinition != null) {
|
|
||||||
if (ICodeEnum.class.isAssignableFrom(theClass)) {
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Class<? extends ICodeEnum> resClass = (Class<? extends ICodeEnum>) theClass;
|
|
||||||
scanCodeTable(resClass, codeTableDefinition);
|
|
||||||
} else {
|
|
||||||
throw new ConfigurationException("Type contains a @" + CodeTableDef.class.getSimpleName() + " annotation but does not implement " + ICodeEnum.class.getCanonicalName() + ": " + theClass.getCanonicalName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Block blockDefinition = theClass.getAnnotation(Block.class);
|
Block blockDefinition = theClass.getAnnotation(Block.class);
|
||||||
if (blockDefinition != null) {
|
if (blockDefinition != null) {
|
||||||
@ -279,7 +268,7 @@ class ModelScanner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockDefinition == null && codeTableDefinition == null && datatypeDefinition == null && resourceDefinition == null) {
|
if (blockDefinition == null && datatypeDefinition == null && resourceDefinition == null) {
|
||||||
throw new ConfigurationException("Resource type does not contain any valid HAPI-FHIR annotations: " + theClass.getCanonicalName());
|
throw new ConfigurationException("Resource type does not contain any valid HAPI-FHIR annotations: " + theClass.getCanonicalName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -287,8 +276,7 @@ class ModelScanner {
|
|||||||
private void scanBlock(Class<? extends IResourceBlock> theClass, Block theBlockDefinition) {
|
private void scanBlock(Class<? extends IResourceBlock> theClass, Block theBlockDefinition) {
|
||||||
ourLog.debug("Scanning resource block class: {}", theClass.getName());
|
ourLog.debug("Scanning resource block class: {}", theClass.getName());
|
||||||
|
|
||||||
String resourceName = theBlockDefinition.name(); // TODO: remove name
|
String resourceName = theClass.getCanonicalName();
|
||||||
resourceName = theClass.getCanonicalName();
|
|
||||||
if (isBlank(resourceName)) {
|
if (isBlank(resourceName)) {
|
||||||
throw new ConfigurationException("Block type @" + Block.class.getSimpleName() + " annotation contains no name: " + theClass.getCanonicalName());
|
throw new ConfigurationException("Block type @" + Block.class.getSimpleName() + " annotation contains no name: " + theClass.getCanonicalName());
|
||||||
}
|
}
|
||||||
@ -299,9 +287,6 @@ class ModelScanner {
|
|||||||
scanCompositeElementForChildren(theClass, resourceDef);
|
scanCompositeElementForChildren(theClass, resourceDef);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String scanCodeTable(Class<? extends ICodeEnum> theCodeType, CodeTableDef theCodeTableDefinition) {
|
|
||||||
return null; // TODO: implement
|
|
||||||
}
|
|
||||||
|
|
||||||
private void scanCompositeDatatype(Class<? extends ICompositeDatatype> theClass, DatatypeDef theDatatypeDefinition) {
|
private void scanCompositeDatatype(Class<? extends ICompositeDatatype> theClass, DatatypeDef theDatatypeDefinition) {
|
||||||
ourLog.debug("Scanning resource class: {}", theClass.getName());
|
ourLog.debug("Scanning resource class: {}", theClass.getName());
|
||||||
|
@ -25,6 +25,14 @@ import java.lang.annotation.Retention;
|
|||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class annotation used to indicate a class which is a "block"/"component" type. A block
|
||||||
|
* is a nested group of fields within a resource definition and can contain other blocks as
|
||||||
|
* well as data types.
|
||||||
|
* <p>
|
||||||
|
* An example of a block would be Patient.contact
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(value= {ElementType.TYPE})
|
@Target(value= {ElementType.TYPE})
|
||||||
public @interface Block {
|
public @interface Block {
|
||||||
|
@ -27,6 +27,10 @@ import java.lang.annotation.Target;
|
|||||||
|
|
||||||
import ca.uhn.fhir.model.api.IElement;
|
import ca.uhn.fhir.model.api.IElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field annotation for fields within resource and datatype definitions, indicating
|
||||||
|
* a child of that type.
|
||||||
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(value= {ElementType.FIELD})
|
@Target(value= {ElementType.FIELD})
|
||||||
public @interface Child {
|
public @interface Child {
|
||||||
@ -42,14 +46,37 @@ public @interface Child {
|
|||||||
*/
|
*/
|
||||||
int MAX_UNLIMITED = -1;
|
int MAX_UNLIMITED = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of this field, as it will appear in serialized versions of the message
|
||||||
|
*/
|
||||||
String name();
|
String name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The order in which this field comes within its parent. The first field should have a
|
||||||
|
* value of 0, the second a value of 1, etc.
|
||||||
|
*/
|
||||||
int order() default ORDER_UNKNOWN;
|
int order() default ORDER_UNKNOWN;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The minimum number of repetitions allowed for this child
|
||||||
|
*/
|
||||||
int min() default 0;
|
int min() default 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The maximum number of repetitions allowed for this child. Should be
|
||||||
|
* set to {@link #MAX_UNLIMITED} if there is no limit to the number of
|
||||||
|
* repetitions.
|
||||||
|
*/
|
||||||
int max() default 1;
|
int max() default 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lists the allowable types for this field, if the field supports multiple
|
||||||
|
* types (otherwise does not need to be populated).
|
||||||
|
* <p>
|
||||||
|
* For example, if this field supports either DateTimeDt or BooleanDt types,
|
||||||
|
* those two classes should be supplied here.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
Class<? extends IElement>[] type() default {};
|
Class<? extends IElement>[] type() default {};
|
||||||
|
|
||||||
// Not implemented
|
// Not implemented
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
package ca.uhn.fhir.model.api.annotation;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* #%L
|
|
||||||
* HAPI FHIR - Core Library
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.IElement;
|
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target(value= {ElementType.FIELD})
|
|
||||||
public @interface Choice {
|
|
||||||
|
|
||||||
Class<? extends IElement>[] types() default {};
|
|
||||||
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
package ca.uhn.fhir.model.api.annotation;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* #%L
|
|
||||||
* HAPI FHIR - Core Library
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target(value= {ElementType.TYPE})
|
|
||||||
public @interface CodeTableDef {
|
|
||||||
|
|
||||||
int tableId();
|
|
||||||
|
|
||||||
String name();
|
|
||||||
|
|
||||||
int[] restrictedToSnomedIsA() default {};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
package ca.uhn.fhir.model.api.annotation;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* #%L
|
|
||||||
* HAPI FHIR - Core Library
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target(value= {ElementType.FIELD})
|
|
||||||
public @interface Constraint {
|
|
||||||
|
|
||||||
String[] coRequirements() default {};
|
|
||||||
|
|
||||||
String[] lessThan() default {};
|
|
||||||
|
|
||||||
String[] greaterThan() default {};
|
|
||||||
}
|
|
@ -28,6 +28,9 @@ import java.lang.annotation.Target;
|
|||||||
import ca.uhn.fhir.model.primitive.BoundCodeDt;
|
import ca.uhn.fhir.model.primitive.BoundCodeDt;
|
||||||
import ca.uhn.fhir.model.primitive.CodeDt;
|
import ca.uhn.fhir.model.primitive.CodeDt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class annotation to note a class which defines a datatype
|
||||||
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(value= {ElementType.TYPE})
|
@Target(value= {ElementType.TYPE})
|
||||||
public @interface DatatypeDef {
|
public @interface DatatypeDef {
|
||||||
|
@ -25,6 +25,10 @@ import java.lang.annotation.Retention;
|
|||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Annotation which may be placed on a resource/datatype definition, or a field, or
|
||||||
|
* a search parameter definition in order to provide documentation for that item.
|
||||||
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(value= {ElementType.FIELD, ElementType.TYPE, ElementType.PARAMETER, ElementType.METHOD})
|
@Target(value= {ElementType.FIELD, ElementType.TYPE, ElementType.PARAMETER, ElementType.METHOD})
|
||||||
public @interface Description {
|
public @interface Description {
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
package ca.uhn.fhir.model.api.annotation;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* #%L
|
|
||||||
* HAPI FHIR - Core Library
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target(value= {ElementType.FIELD})
|
|
||||||
public @interface EnumeratedCodeValue {
|
|
||||||
|
|
||||||
String value();
|
|
||||||
|
|
||||||
String system() default "";
|
|
||||||
}
|
|
@ -25,36 +25,41 @@ import java.lang.annotation.Retention;
|
|||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field modifier to be placed on a child field (a field also annotated with the {@link Child} annotation) which
|
||||||
|
* indicates that this field is an extension.
|
||||||
|
*/
|
||||||
@Target(value = { ElementType.FIELD })
|
@Target(value = { ElementType.FIELD })
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Extension {
|
public @interface Extension {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This parameter affects how the extension is treated when the element
|
* This parameter affects how the extension is treated when the element definition containing this resource is
|
||||||
* definition containing this resource is exported to a profile.
|
* exported to a profile.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* If set to <b><code>true</code></b>, the resource is taken to be a local
|
* If set to <b><code>true</code></b>, the resource is taken to be a local resource and its definition is exported
|
||||||
* resource and its definition is exported along with the reference. Use
|
* along with the reference. Use this option for extension defintions that you have added locally (i.e. within your
|
||||||
* this option for extension defintions that you have added locally (i.e.
|
* own organization)
|
||||||
* within your own organization)
|
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* If set to <b><code>false</code></b>, the resource is taken to be a remote
|
* If set to <b><code>false</code></b>, the resource is taken to be a remote resource and its definition is
|
||||||
* resource and its definition is <b>not</b> exported to the profile. Use
|
* <b>not</b> exported to the profile. Use this option for extensions that are defined by other organizations (i.e.
|
||||||
* this option for extensions that are defined by other organizations (i.e.
|
|
||||||
* by regional authorities or jurisdictional governments)
|
* by regional authorities or jurisdictional governments)
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
boolean definedLocally();
|
boolean definedLocally();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns <code>true</code> if this extension is a
|
* Returns <code>true</code> if this extension is a <a
|
||||||
* <a href="http://www.hl7.org/implement/standards/fhir/extensibility.html#modifierExtension">modifier extension</a>
|
* href="http://www.hl7.org/implement/standards/fhir/extensibility.html#modifierExtension">modifier extension</a>
|
||||||
*/
|
*/
|
||||||
boolean isModifier();
|
boolean isModifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL associated with this extension
|
||||||
|
*/
|
||||||
String url();
|
String url();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package ca.uhn.fhir.model.api.annotation;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* #%L
|
|
||||||
* HAPI FHIR - Core Library
|
|
||||||
* %%
|
|
||||||
* Copyright (C) 2014 University Health Network
|
|
||||||
* %%
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* #L%
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Target(value= {ElementType.FIELD})
|
|
||||||
public @interface IsIdentifier {
|
|
||||||
|
|
||||||
// nothing
|
|
||||||
|
|
||||||
}
|
|
@ -25,6 +25,9 @@ import java.lang.annotation.Retention;
|
|||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class annotation which indicates a resource definition class
|
||||||
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(value= {ElementType.TYPE})
|
@Target(value= {ElementType.TYPE})
|
||||||
public @interface ResourceDef {
|
public @interface ResourceDef {
|
||||||
@ -34,8 +37,14 @@ public @interface ResourceDef {
|
|||||||
*/
|
*/
|
||||||
String name();
|
String name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not currently used
|
||||||
|
*/
|
||||||
String id() default "";
|
String id() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The URL indicating the profile for this resource definition, if known
|
||||||
|
*/
|
||||||
String profile() default "";
|
String profile() default "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,24 @@ import java.lang.annotation.Target;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface SearchParamDefinition {
|
public @interface SearchParamDefinition {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name for this parameter
|
||||||
|
*/
|
||||||
String name();
|
String name();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path for this parameter
|
||||||
|
*/
|
||||||
String path();
|
String path();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A description of this parameter
|
||||||
|
*/
|
||||||
String description() default "";
|
String description() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type for this parameter, e.g. "string", or "token"
|
||||||
|
*/
|
||||||
String type() default "string";
|
String type() default "string";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,10 @@ import java.lang.annotation.Target;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Marker annotation for a primitive setter method that can be used to
|
* Marker annotation for a primitive setter method that can be used to
|
||||||
* indicate a "simple setter" method on a resource or composite type
|
* indicate a "simple setter" method on a resource or composite type.
|
||||||
|
*
|
||||||
|
* This annotation is used by HAPI's code generator and can be ignored by
|
||||||
|
* client code
|
||||||
*/
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(value= {ElementType.CONSTRUCTOR})
|
@Target(value= {ElementType.CONSTRUCTOR})
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package ca.uhn.fhir.model.api.annotation;
|
package ca.uhn.fhir.rest.annotation;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* #%L
|
* #%L
|
||||||
@ -26,9 +26,6 @@ import java.lang.annotation.RetentionPolicy;
|
|||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.TagList;
|
import ca.uhn.fhir.model.api.TagList;
|
||||||
import ca.uhn.fhir.rest.annotation.AddTags;
|
|
||||||
import ca.uhn.fhir.rest.annotation.DeleteTags;
|
|
||||||
import ca.uhn.fhir.rest.annotation.GetTags;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parameter annotation for the {@link TagList} parameter in a {@link GetTags},
|
* Parameter annotation for the {@link TagList} parameter in a {@link GetTags},
|
@ -33,12 +33,12 @@ import ca.uhn.fhir.context.ConfigurationException;
|
|||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.api.IResource;
|
import ca.uhn.fhir.model.api.IResource;
|
||||||
import ca.uhn.fhir.model.api.TagList;
|
import ca.uhn.fhir.model.api.TagList;
|
||||||
import ca.uhn.fhir.model.api.annotation.TagListParam;
|
|
||||||
import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum;
|
import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum;
|
||||||
import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum;
|
import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
import ca.uhn.fhir.model.primitive.IdDt;
|
||||||
import ca.uhn.fhir.parser.IParser;
|
import ca.uhn.fhir.parser.IParser;
|
||||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||||
|
import ca.uhn.fhir.rest.annotation.TagListParam;
|
||||||
import ca.uhn.fhir.rest.client.BaseHttpClientInvocation;
|
import ca.uhn.fhir.rest.client.BaseHttpClientInvocation;
|
||||||
import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType;
|
import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType;
|
||||||
import ca.uhn.fhir.rest.server.Constants;
|
import ca.uhn.fhir.rest.server.Constants;
|
||||||
|
@ -34,7 +34,6 @@ import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
|||||||
import ca.uhn.fhir.model.api.Tag;
|
import ca.uhn.fhir.model.api.Tag;
|
||||||
import ca.uhn.fhir.model.api.TagList;
|
import ca.uhn.fhir.model.api.TagList;
|
||||||
import ca.uhn.fhir.model.api.annotation.Description;
|
import ca.uhn.fhir.model.api.annotation.Description;
|
||||||
import ca.uhn.fhir.model.api.annotation.TagListParam;
|
|
||||||
import ca.uhn.fhir.model.dstu.resource.OperationOutcome;
|
import ca.uhn.fhir.model.dstu.resource.OperationOutcome;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
import ca.uhn.fhir.model.primitive.IdDt;
|
||||||
import ca.uhn.fhir.model.primitive.InstantDt;
|
import ca.uhn.fhir.model.primitive.InstantDt;
|
||||||
@ -48,6 +47,7 @@ import ca.uhn.fhir.rest.annotation.ResourceParam;
|
|||||||
import ca.uhn.fhir.rest.annotation.ServerBase;
|
import ca.uhn.fhir.rest.annotation.ServerBase;
|
||||||
import ca.uhn.fhir.rest.annotation.Since;
|
import ca.uhn.fhir.rest.annotation.Since;
|
||||||
import ca.uhn.fhir.rest.annotation.Sort;
|
import ca.uhn.fhir.rest.annotation.Sort;
|
||||||
|
import ca.uhn.fhir.rest.annotation.TagListParam;
|
||||||
import ca.uhn.fhir.rest.annotation.TransactionParam;
|
import ca.uhn.fhir.rest.annotation.TransactionParam;
|
||||||
import ca.uhn.fhir.rest.annotation.VersionIdParam;
|
import ca.uhn.fhir.rest.annotation.VersionIdParam;
|
||||||
import ca.uhn.fhir.rest.api.MethodOutcome;
|
import ca.uhn.fhir.rest.api.MethodOutcome;
|
||||||
|
@ -66,6 +66,15 @@ public class XmlParserTest {
|
|||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserTest.class);
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserTest.class);
|
||||||
private static FhirContext ourCtx;
|
private static FhirContext ourCtx;
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testParseLanguage() {
|
||||||
|
String input = "<Patient xmlns=\"http://hl7.org/fhir\"><language value=\"zh-CN\"/><text><status value=\"generated\"/><div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\"> 海生 <b>王 </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td>URNo</td></tr><tr><td>Address</td><td><span>99 Houston Road </span><br/><span>BENTLEIGH </span><span>Victoria </span></td></tr><tr><td>Date of birth</td><td><span>01 January 1997</span></td></tr></tbody></table></div></text><identifier><use value=\"usual\"/><label value=\"URNo\"/><value value=\"89532\"/></identifier><name><text value=\"王海生\"/><family value=\"王\"/><given value=\"海生\"/></name><telecom><system value=\"phone\"/><value value=\"9899 9878\"/><use value=\"home\"/></telecom><telecom><system value=\"email\"/><value value=\"zimmerman@datacorp.com.au\"/><use value=\"home\"/></telecom><gender><coding><system value=\"http://hl7.org/fhir/v3/AdministrativeGender\"/><code value=\"M\"/><display value=\"Male\"/></coding><text value=\"Male\"/></gender><birthDate value=\"1997-01-01\"/><address><use value=\"home\"/><text value=\"99 Houston Road, BENTLEIGH, 3204\"/><line value=\"99 Houston Road\"/><city value=\"BENTLEIGH\"/><state value=\"Victoria\"/><zip value=\"3204\"/><period><start value=\"2006-06-16\"/></period></address><active value=\"true\"/></Patient>";
|
||||||
|
Patient pt = ourCtx.newXmlParser().parseResource(Patient.class, input);
|
||||||
|
|
||||||
|
assertEquals("zh-CN", pt.getLanguage().getValue());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEncodeBoundCode() {
|
public void testEncodeBoundCode() {
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
|
|||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.api.Tag;
|
import ca.uhn.fhir.model.api.Tag;
|
||||||
import ca.uhn.fhir.model.api.TagList;
|
import ca.uhn.fhir.model.api.TagList;
|
||||||
import ca.uhn.fhir.model.api.annotation.TagListParam;
|
|
||||||
import ca.uhn.fhir.model.dstu.resource.Conformance;
|
import ca.uhn.fhir.model.dstu.resource.Conformance;
|
||||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
import ca.uhn.fhir.model.primitive.IdDt;
|
||||||
@ -33,6 +32,7 @@ import ca.uhn.fhir.rest.annotation.AddTags;
|
|||||||
import ca.uhn.fhir.rest.annotation.DeleteTags;
|
import ca.uhn.fhir.rest.annotation.DeleteTags;
|
||||||
import ca.uhn.fhir.rest.annotation.GetTags;
|
import ca.uhn.fhir.rest.annotation.GetTags;
|
||||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||||
|
import ca.uhn.fhir.rest.annotation.TagListParam;
|
||||||
import ca.uhn.fhir.rest.annotation.VersionIdParam;
|
import ca.uhn.fhir.rest.annotation.VersionIdParam;
|
||||||
import ca.uhn.fhir.rest.client.api.IBasicClient;
|
import ca.uhn.fhir.rest.client.api.IBasicClient;
|
||||||
import ca.uhn.fhir.rest.server.Constants;
|
import ca.uhn.fhir.rest.server.Constants;
|
||||||
|
@ -25,7 +25,6 @@ import org.junit.Test;
|
|||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.model.api.Tag;
|
import ca.uhn.fhir.model.api.Tag;
|
||||||
import ca.uhn.fhir.model.api.TagList;
|
import ca.uhn.fhir.model.api.TagList;
|
||||||
import ca.uhn.fhir.model.api.annotation.TagListParam;
|
|
||||||
import ca.uhn.fhir.model.dstu.resource.Observation;
|
import ca.uhn.fhir.model.dstu.resource.Observation;
|
||||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
import ca.uhn.fhir.model.primitive.IdDt;
|
||||||
@ -33,6 +32,7 @@ import ca.uhn.fhir.rest.annotation.AddTags;
|
|||||||
import ca.uhn.fhir.rest.annotation.DeleteTags;
|
import ca.uhn.fhir.rest.annotation.DeleteTags;
|
||||||
import ca.uhn.fhir.rest.annotation.GetTags;
|
import ca.uhn.fhir.rest.annotation.GetTags;
|
||||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||||
|
import ca.uhn.fhir.rest.annotation.TagListParam;
|
||||||
import ca.uhn.fhir.rest.annotation.VersionIdParam;
|
import ca.uhn.fhir.rest.annotation.VersionIdParam;
|
||||||
import ca.uhn.fhir.testutil.RandomServerPortProvider;
|
import ca.uhn.fhir.testutil.RandomServerPortProvider;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<dependent-module archiveName="hapi-fhir-base-0.6-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/hapi-fhir-base/hapi-fhir-base">
|
<dependent-module archiveName="hapi-fhir-base-0.6-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/hapi-fhir-base/hapi-fhir-base">
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<dependent-module deploy-path="/" handle="module:/overlay/prj/hapi-fhir-testpage-overlay?includes=**/**&excludes=META-INF/MANIFEST.MF">
|
<dependent-module deploy-path="/" handle="module:/overlay/prj/hapi-fhir-tester-overlay?includes=**/**&excludes=META-INF/MANIFEST.MF">
|
||||||
<dependency-type>consumes</dependency-type>
|
<dependency-type>consumes</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<dependent-module deploy-path="/" handle="module:/overlay/slf/?includes=**/**&excludes=META-INF/MANIFEST.MF">
|
<dependent-module deploy-path="/" handle="module:/overlay/slf/?includes=**/**&excludes=META-INF/MANIFEST.MF">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user