Server is working a bit better still

This commit is contained in:
jamesagnew 2014-03-05 17:35:06 -05:00
parent d94d2719d9
commit b05ea01b45
109 changed files with 4092 additions and 1555 deletions

View File

@ -2,3 +2,5 @@
* Implement JSON parser and encoder
* Implement strategy for narrative generation
* Fix XML encoder to not encode empty elements
* Add SimpleSetters for all primitive datatypes
* Implement and add Simple Getters in a similar way to simple setters

View File

@ -80,7 +80,7 @@
<attribute name="javadoc_location" value="jar:file:/Users/james/.m2/repository/xmlunit/xmlunit/1.5/xmlunit-1.5-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="var" path="M2_REPO/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/hapi-fhir-structures-dstu"/>
<classpathentry kind="output" path="target/classes"/>

View File

@ -6,9 +6,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -96,4 +96,4 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.source=1.6

View File

@ -59,7 +59,7 @@ class ModelScanner {
private RuntimeChildUndeclaredExtensionDefinition myRuntimeChildUndeclaredExtensionDefinition;
ModelScanner(Class<? extends IResource> theResourceTypes) throws ConfigurationException {
Set<Class<? extends IElement>> singleton = new HashSet<>();
Set<Class<? extends IElement>> singleton = new HashSet<Class<? extends IElement>>();
singleton.add(theResourceTypes);
init(singleton);
}
@ -399,7 +399,13 @@ class ModelScanner {
try {
Field bindingField = bound.getField("VALUESET_BINDER");
return (IValueSetEnumBinder<Enum<?>>) bindingField.get(null);
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
} catch (IllegalArgumentException e) {
throw new ConfigurationException("Field '" + theNext + "' has type parameter " + bound.getCanonicalName() + " but this class has no valueset binding field", e);
} catch ( IllegalAccessException e) {
throw new ConfigurationException("Field '" + theNext + "' has type parameter " + bound.getCanonicalName() + " but this class has no valueset binding field", e);
} catch (NoSuchFieldException e) {
throw new ConfigurationException("Field '" + theNext + "' has type parameter " + bound.getCanonicalName() + " but this class has no valueset binding field", e);
} catch (SecurityException e) {
throw new ConfigurationException("Field '" + theNext + "' has type parameter " + bound.getCanonicalName() + " but this class has no valueset binding field", e);
}
}

View File

@ -17,11 +17,11 @@
package ca.uhn.fhir.model.dstu.composite;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Address</b> Datatype
@ -390,4 +390,5 @@ P.O. Box number, delivery hints, and similar address information
}

View File

@ -1,98 +1,299 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.primitive.Base64BinaryDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Attachment</b> Datatype
* (Content in a format defined elsewhere)
*
* <p>
* <b>Definition:</b>
* For referring to data content defined in other formats.
* </p>
*
* <p>
* <b>Requirements:</b>
* Many models need to include data defined in other specifications that is complex and opaque to the healthcare model. This includes documents, media recordings, structured data, etc.
* </p>
*/
@DatatypeDef(name="Attachment")
public class AttachmentDt extends BaseElement implements ICompositeDatatype {
@Child(name="contentType", order=0, min=1)
@Child(name="contentType", type=CodeDt.class, order=0, min=1, max=1)
private CodeDt myContentType;
@Child(name="language", order=1)
@Child(name="language", type=CodeDt.class, order=1, min=0, max=1)
private CodeDt myLanguage;
@Child(name="data", order=2)
@Child(name="data", type=Base64BinaryDt.class, order=2, min=0, max=1)
private Base64BinaryDt myData;
@Child(name="url", order=3)
@Child(name="url", type=UriDt.class, order=3, min=0, max=1)
private UriDt myUrl;
@Child(name="size", order=4)
@Child(name="size", type=IntegerDt.class, order=4, min=0, max=1)
private IntegerDt mySize;
@Child(name="hash", order=5)
@Description("Hash of the data (sha-1, base64ed )")
@Child(name="hash", type=Base64BinaryDt.class, order=5, min=0, max=1)
private Base64BinaryDt myHash;
@Child(name="title", order=6)
@Description("Label to display in place of the data")
@Child(name="title", type=StringDt.class, order=6, min=0, max=1)
private StringDt myTitle;
/**
* Gets the value(s) for <b>contentType</b> (Mime type of the content, with charset etc.).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate
* </p>
*/
public CodeDt getContentType() {
if (myContentType == null) {
myContentType = new CodeDt();
}
return myContentType;
}
public void setContentType(CodeDt theContentType) {
myContentType = theContentType;
/**
* Sets the value(s) for <b>contentType</b> (Mime type of the content, with charset etc.)
*
* <p>
* <b>Definition:</b>
* Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate
* </p>
*/
public void setContentType(CodeDt theValue) {
myContentType = theValue;
}
/**
* Gets the value(s) for <b>language</b> (Human language of the content (BCP-47)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The human language of the content. The value can be any valid value according to BCP 47
* </p>
*/
public CodeDt getLanguage() {
if (myLanguage == null) {
myLanguage = new CodeDt();
}
return myLanguage;
}
public void setLanguage(CodeDt theLanguage) {
myLanguage = theLanguage;
/**
* Sets the value(s) for <b>language</b> (Human language of the content (BCP-47))
*
* <p>
* <b>Definition:</b>
* The human language of the content. The value can be any valid value according to BCP 47
* </p>
*/
public void setLanguage(CodeDt theValue) {
myLanguage = theValue;
}
/**
* Gets the value(s) for <b>data</b> (Data inline, base64ed).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The actual data of the attachment - a sequence of bytes. In XML, represented using base64
* </p>
*/
public Base64BinaryDt getData() {
if (myData == null) {
myData = new Base64BinaryDt();
}
return myData;
}
public void setData(Base64BinaryDt theData) {
myData = theData;
/**
* Sets the value(s) for <b>data</b> (Data inline, base64ed)
*
* <p>
* <b>Definition:</b>
* The actual data of the attachment - a sequence of bytes. In XML, represented using base64
* </p>
*/
public void setData(Base64BinaryDt theValue) {
myData = theValue;
}
/**
* Gets the value(s) for <b>url</b> (Uri where the data can be found).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* An alternative location where the data can be accessed
* </p>
*/
public UriDt getUrl() {
if (myUrl == null) {
myUrl = new UriDt();
}
return myUrl;
}
public void setUrl(UriDt theUrl) {
myUrl = theUrl;
/**
* Sets the value(s) for <b>url</b> (Uri where the data can be found)
*
* <p>
* <b>Definition:</b>
* An alternative location where the data can be accessed
* </p>
*/
public void setUrl(UriDt theValue) {
myUrl = theValue;
}
public Base64BinaryDt getHash() {
return myHash;
}
public void setHash(Base64BinaryDt theHash) {
myHash = theHash;
}
public StringDt getTitle() {
return myTitle;
}
public void setTitle(StringDt theTitle) {
myTitle = theTitle;
/**
* Sets the value(s) for <b>url</b> (Uri where the data can be found)
*
* <p>
* <b>Definition:</b>
* An alternative location where the data can be accessed
* </p>
*/
public void setUrl( String theUri) {
myUrl = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>size</b> (Number of bytes of content (if url provided)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The number of bytes of data that make up this attachment.
* </p>
*/
public IntegerDt getSize() {
if (mySize == null) {
mySize = new IntegerDt();
}
return mySize;
}
public void setSize(IntegerDt theSize) {
mySize = theSize;
/**
* Sets the value(s) for <b>size</b> (Number of bytes of content (if url provided))
*
* <p>
* <b>Definition:</b>
* The number of bytes of data that make up this attachment.
* </p>
*/
public void setSize(IntegerDt theValue) {
mySize = theValue;
}
/**
* Gets the value(s) for <b>hash</b> (Hash of the data (sha-1, base64ed )).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The calculated hash of the data using SHA-1. Represented using base64
* </p>
*/
public Base64BinaryDt getHash() {
if (myHash == null) {
myHash = new Base64BinaryDt();
}
return myHash;
}
/**
* Sets the value(s) for <b>hash</b> (Hash of the data (sha-1, base64ed ))
*
* <p>
* <b>Definition:</b>
* The calculated hash of the data using SHA-1. Represented using base64
* </p>
*/
public void setHash(Base64BinaryDt theValue) {
myHash = theValue;
}
/**
* Gets the value(s) for <b>title</b> (Label to display in place of the data).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A label or set of text to display in place of the data
* </p>
*/
public StringDt getTitle() {
if (myTitle == null) {
myTitle = new StringDt();
}
return myTitle;
}
/**
* Sets the value(s) for <b>title</b> (Label to display in place of the data)
*
* <p>
* <b>Definition:</b>
* A label or set of text to display in place of the data
* </p>
*/
public void setTitle(StringDt theValue) {
myTitle = theValue;
}
/**
* Sets the value(s) for <b>title</b> (Label to display in place of the data)
*
* <p>
* <b>Definition:</b>
* A label or set of text to display in place of the data
* </p>
*/
public void setTitle( String theString) {
myTitle = new StringDt(theString);
}
}

View File

@ -20,6 +20,8 @@ import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>CodeableConcept</b> Datatype
@ -117,4 +119,5 @@ public class CodeableConceptDt extends BaseElement implements ICompositeDatatype
}

View File

@ -16,17 +16,12 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.ResourceReference;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.ChildResource;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.dstu.resource.ValueSet;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Coding</b> Datatype
@ -95,6 +90,17 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (Identity of the terminology system )
*
* <p>
* <b>Definition:</b>
* The identification of the code system that defines the meaning of the symbol in the code.
* </p>
*/
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>version</b> (Version of the system - if relevant).
@ -270,4 +276,5 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
}

View File

@ -17,11 +17,11 @@
package ca.uhn.fhir.model.dstu.composite;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Contact</b> Datatype
@ -209,4 +209,5 @@ public class ContactDt extends BaseElement implements ICompositeDatatype {
}

View File

@ -17,11 +17,11 @@
package ca.uhn.fhir.model.dstu.composite;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>HumanName</b> Datatype
@ -352,4 +352,5 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
}

View File

@ -1,56 +1,75 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.ResourceReference;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.ChildResource;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.dstu.resource.Organization;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Identifier</b> Datatype (An identifier intended for computation)
* HAPI/FHIR <b>Identifier</b> Datatype
* (An identifier intended for computation)
*
* <p>
* <b>Definition:</b> A technical identifier - identifies some entity uniquely and unambiguously
* <b>Definition:</b>
* A technical identifier - identifies some entity uniquely and unambiguously
* </p>
*
* <p>
* <b>Requirements:</b> Need to be able to identify things with confidence and be sure that the identification is not subject to misinterpretation
* <b>Requirements:</b>
* Need to be able to identify things with confidence and be sure that the identification is not subject to misinterpretation
* </p>
*/
@DatatypeDef(name = "Identifier")
@DatatypeDef(name="Identifier")
public class IdentifierDt extends BaseElement implements ICompositeDatatype {
@Child(name = "use", type = CodeDt.class, order = 0, min = 0, max = 1)
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
private BoundCodeDt<IdentifierUseEnum> myUse;
@Child(name = "label", type = StringDt.class, order = 1, min = 0, max = 1)
@Child(name="label", type=StringDt.class, order=1, min=0, max=1)
private StringDt myLabel;
@Child(name = "system", type = UriDt.class, order = 2, min = 0, max = 1)
@Child(name="system", type=UriDt.class, order=2, min=0, max=1)
private UriDt mySystem;
@Child(name = "value", type = StringDt.class, order = 3, min = 0, max = 1)
@Child(name="value", type=StringDt.class, order=3, min=0, max=1)
private StringDt myValue;
@Child(name = "period", type = PeriodDt.class, order = 4, min = 0, max = 1)
@Child(name="period", type=PeriodDt.class, order=4, min=0, max=1)
private PeriodDt myPeriod;
@Child(name = "assigner", order = 5, min = 0, max = 1)
@ChildResource(types = { Organization.class, })
@Child(name="assigner", order=5, min=0, max=1)
@ChildResource(types= {
Organization.class,
})
private ResourceReference myAssigner;
/**
* Gets the value(s) for <b>use</b> (usual | official | temp | secondary (If known) ). creating it if it does not exist. Will not return <code>null</code>.
* Gets the value(s) for <b>use</b> (usual | official | temp | secondary (If known)
).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> The purpose of this identifier
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public BoundCodeDt<IdentifierUseEnum> getUse() {
@ -61,10 +80,12 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known) )
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known)
)
*
* <p>
* <b>Definition:</b> The purpose of this identifier
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public void setUse(BoundCodeDt<IdentifierUseEnum> theValue) {
@ -72,21 +93,27 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known) )
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known)
)
*
* <p>
* <b>Definition:</b> The purpose of this identifier
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public void setUse(IdentifierUseEnum theValue) {
getUse().setValueAsEnum(theValue);
}
/**
* Gets the value(s) for <b>label</b> (Description of identifier). creating it if it does not exist. Will not return <code>null</code>.
* Gets the value(s) for <b>label</b> (Description of identifier).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> A text string for the identifier that can be displayed to a human so they can recognize the identifier
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public StringDt getLabel() {
@ -100,7 +127,8 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
* Sets the value(s) for <b>label</b> (Description of identifier)
*
* <p>
* <b>Definition:</b> A text string for the identifier that can be displayed to a human so they can recognize the identifier
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public void setLabel(StringDt theValue) {
@ -111,18 +139,22 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
* Sets the value(s) for <b>label</b> (Description of identifier)
*
* <p>
* <b>Definition:</b> A text string for the identifier that can be displayed to a human so they can recognize the identifier
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public void setLabel(String theString) {
public void setLabel( String theString) {
myLabel = new StringDt(theString);
}
/**
* Gets the value(s) for <b>system</b> (The namespace for the identifier). creating it if it does not exist. Will not return <code>null</code>.
* Gets the value(s) for <b>system</b> (The namespace for the identifier).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> Establishes the namespace in which set of possible id values is unique.
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public UriDt getSystem() {
@ -136,7 +168,8 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
* Sets the value(s) for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b> Establishes the namespace in which set of possible id values is unique.
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public void setSystem(UriDt theValue) {
@ -144,10 +177,25 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
}
/**
* Gets the value(s) for <b>value</b> (The value that is unique). creating it if it does not exist. Will not return <code>null</code>.
* Sets the value(s) for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b> The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>value</b> (The value that is unique).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public StringDt getValue() {
@ -161,7 +209,8 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
* Sets the value(s) for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b> The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public void setValue(StringDt theValue) {
@ -172,18 +221,22 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
* Sets the value(s) for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b> The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public void setValue(String theString) {
public void setValue( String theString) {
myValue = new StringDt(theString);
}
/**
* Gets the value(s) for <b>period</b> (Time period when id is/was valid for use). creating it if it does not exist. Will not return <code>null</code>.
* Gets the value(s) for <b>period</b> (Time period when id is/was valid for use).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> Time period during which identifier is/was valid for use
* <b>Definition:</b>
* Time period during which identifier is/was valid for use
* </p>
*/
public PeriodDt getPeriod() {
@ -197,18 +250,23 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
* Sets the value(s) for <b>period</b> (Time period when id is/was valid for use)
*
* <p>
* <b>Definition:</b> Time period during which identifier is/was valid for use
* <b>Definition:</b>
* Time period during which identifier is/was valid for use
* </p>
*/
public void setPeriod(PeriodDt theValue) {
myPeriod = theValue;
}
/**
* Gets the value(s) for <b>assigner</b> (Organization that issued id (may be just text)). creating it if it does not exist. Will not return <code>null</code>.
* Gets the value(s) for <b>assigner</b> (Organization that issued id (may be just text)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> Organization that issued/manages the identifier
* <b>Definition:</b>
* Organization that issued/manages the identifier
* </p>
*/
public ResourceReference getAssigner() {
@ -222,16 +280,20 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
* Sets the value(s) for <b>assigner</b> (Organization that issued id (may be just text))
*
* <p>
* <b>Definition:</b> Organization that issued/manages the identifier
* <b>Definition:</b>
* Organization that issued/manages the identifier
* </p>
*/
public void setAssigner(ResourceReference theValue) {
myAssigner = theValue;
}
/**
* Returns true if <code>this</code> identifier has the same {@link IdentifierDt#getValue() value} and {@link IdentifierDt#getSystem() system} (as compared by simple equals comparison). Does not
* compare other values (e.g. {@link IdentifierDt#getUse() use}) or any extensions.
* Returns true if <code>this</code> identifier has the same {@link IdentifierDt#getValue() value}
* and {@link IdentifierDt#getSystem() system} (as compared by simple equals comparison).
* Does not compare other values (e.g. {@link IdentifierDt#getUse() use}) or any extensions.
*/
public boolean matchesSystemAndValue(IdentifierDt theIdentifier) {
if (theIdentifier == null) {
@ -258,4 +320,5 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype {
}
}
}

View File

@ -1,38 +1,134 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Constraint;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Period</b> Datatype
* (Time range defined by start and end date/time)
*
* <p>
* <b>Definition:</b>
* A time period defined by a start and end date and optionally time.
* </p>
*
* <p>
* <b>Requirements:</b>
*
* </p>
*/
@DatatypeDef(name="Period")
public class PeriodDt extends BaseElement implements ICompositeDatatype {
@Child(name="start", order=0)
@Constraint(lessThan= {"end"})
@Child(name="start", type=DateTimeDt.class, order=0, min=0, max=1)
private DateTimeDt myStart;
@Child(name="end", order=1)
@Constraint(greaterThan= {"start"})
@Child(name="end", type=DateTimeDt.class, order=1, min=0, max=1)
private DateTimeDt myEnd;
/**
* Gets the value(s) for <b>start</b> (Starting time with inclusive boundary).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The start of the period. The boundary is inclusive.
* </p>
*/
public DateTimeDt getStart() {
if (myStart == null) {
myStart = new DateTimeDt();
}
return myStart;
}
public void setStart(DateTimeDt theStart) {
myStart = theStart;
/**
* Sets the value(s) for <b>start</b> (Starting time with inclusive boundary)
*
* <p>
* <b>Definition:</b>
* The start of the period. The boundary is inclusive.
* </p>
*/
public void setStart(DateTimeDt theValue) {
myStart = theValue;
}
/**
* Sets the value(s) for <b>start</b> (Starting time with inclusive boundary)
*
* <p>
* <b>Definition:</b>
* The start of the period. The boundary is inclusive.
* </p>
*/
public void setStartWithSecondsPrecision( Date theDate) {
myStart = new DateTimeDt(theDate);
}
/**
* Gets the value(s) for <b>end</b> (End time with inclusive boundary, if not ongoing).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The end of the period. If the end of the period is missing, it means that the period is ongoing
* </p>
*/
public DateTimeDt getEnd() {
if (myEnd == null) {
myEnd = new DateTimeDt();
}
return myEnd;
}
public void setEnd(DateTimeDt theEnd) {
myEnd = theEnd;
/**
* Sets the value(s) for <b>end</b> (End time with inclusive boundary, if not ongoing)
*
* <p>
* <b>Definition:</b>
* The end of the period. If the end of the period is missing, it means that the period is ongoing
* </p>
*/
public void setEnd(DateTimeDt theValue) {
myEnd = theValue;
}
/**
* Sets the value(s) for <b>end</b> (End time with inclusive boundary, if not ongoing)
*
* <p>
* <b>Definition:</b>
* The end of the period. If the end of the period is missing, it means that the period is ongoing
* </p>
*/
public void setEndWithSecondsPrecision( Date theDate) {
myEnd = new DateTimeDt(theDate);
}
}

View File

@ -21,6 +21,7 @@ import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Quantity</b> Datatype
@ -196,6 +197,17 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (System that defines coded unit form)
*
* <p>
* <b>Definition:</b>
* The identification of the system that provides the coded form of the unit
* </p>
*/
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>code</b> (Coded form of the unit).
@ -229,4 +241,5 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
}

View File

@ -1,36 +1,112 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Constraint;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Range</b> Datatype
* (Set of values bounded by low and high)
*
* <p>
* <b>Definition:</b>
* A set of ordered Quantities defined by a low and high limit.
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to be able to specify ranges of values
* </p>
*/
@DatatypeDef(name="Range")
public class RangeDt extends BaseElement implements ICompositeDatatype {
@Child(name="low", order=0)
@Constraint(lessThan= {"high"})
@Child(name="low", type=QuantityDt.class, order=0, min=0, max=1)
private QuantityDt myLow;
@Child(name="high", order=1)
@Constraint(greaterThan= {"low"})
@Child(name="high", type=QuantityDt.class, order=1, min=0, max=1)
private QuantityDt myHigh;
/**
* Gets the value(s) for <b>low</b> (Low limit ).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public QuantityDt getLow() {
if (myLow == null) {
myLow = new QuantityDt();
}
return myLow;
}
public void setLow(QuantityDt theLow) {
myLow = theLow;
/**
* Sets the value(s) for <b>low</b> (Low limit )
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public void setLow(QuantityDt theValue) {
myLow = theValue;
}
/**
* Gets the value(s) for <b>high</b> (High limit ).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public QuantityDt getHigh() {
if (myHigh == null) {
myHigh = new QuantityDt();
}
return myHigh;
}
public void setHigh(QuantityDt theHigh) {
myHigh = theHigh;
/**
* Sets the value(s) for <b>high</b> (High limit )
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public void setHigh(QuantityDt theValue) {
myHigh = theValue;
}
}

View File

@ -1,37 +1,112 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Constraint;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Ratio</b> Datatype
* (A ratio of two Quantity values - a numerator and a denominator)
*
* <p>
* <b>Definition:</b>
* A relationship of two Quantity values - expressed as a numerator and a denominator.
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to able to capture ratios for some measurements (titers) and some rates (costs)
* </p>
*/
@DatatypeDef(name="Ratio")
public class RatioDt extends BaseElement implements ICompositeDatatype {
@Child(name="numerator", order=0)
@Constraint(coRequirements= {"denominator"})
@Child(name="numerator", type=QuantityDt.class, order=0, min=0, max=1)
private QuantityDt myNumerator;
@Child(name="denominator", order=1)
@Constraint(coRequirements= {"numerator"})
@Child(name="denominator", type=QuantityDt.class, order=1, min=0, max=1)
private QuantityDt myDenominator;
/**
* Gets the value(s) for <b>numerator</b> (Numerator value).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public QuantityDt getNumerator() {
if (myNumerator == null) {
myNumerator = new QuantityDt();
}
return myNumerator;
}
public void setNumerator(QuantityDt theNumerator) {
myNumerator = theNumerator;
/**
* Sets the value(s) for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public void setNumerator(QuantityDt theValue) {
myNumerator = theValue;
}
/**
* Gets the value(s) for <b>denominator</b> (Denominator value).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public QuantityDt getDenominator() {
if (myDenominator == null) {
myDenominator = new QuantityDt();
}
return myDenominator;
}
public void setDenominator(QuantityDt theDenominator) {
myDenominator = theDenominator;
/**
* Sets the value(s) for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public void setDenominator(QuantityDt theValue) {
myDenominator = theValue;
}
}

View File

@ -0,0 +1,134 @@
package ca.uhn.fhir.model.dstu.composite;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>ResourceReference</b> Datatype
* (A reference from one resource to another)
*
* <p>
* <b>Definition:</b>
* A reference from one resource to another
* </p>
*
* <p>
* <b>Requirements:</b>
*
* </p>
*/
@DatatypeDef(name="ResourceReference")
public class ResourceReferenceDt extends BaseElement implements ICompositeDatatype {
@Child(name="reference", type=StringDt.class, order=0, min=0, max=1)
private StringDt myReference;
@Child(name="display", type=StringDt.class, order=1, min=0, max=1)
private StringDt myDisplay;
/**
* Gets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
* </p>
*/
public StringDt getReference() {
if (myReference == null) {
myReference = new StringDt();
}
return myReference;
}
/**
* Sets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference)
*
* <p>
* <b>Definition:</b>
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
* </p>
*/
public void setReference(StringDt theValue) {
myReference = theValue;
}
/**
* Sets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference)
*
* <p>
* <b>Definition:</b>
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
* </p>
*/
public void setReference( String theString) {
myReference = new StringDt(theString);
}
/**
* Gets the value(s) for <b>display</b> (Text alternative for the resource).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Plain text narrative that identifies the resource in addition to the resource reference
* </p>
*/
public StringDt getDisplay() {
if (myDisplay == null) {
myDisplay = new StringDt();
}
return myDisplay;
}
/**
* Sets the value(s) for <b>display</b> (Text alternative for the resource)
*
* <p>
* <b>Definition:</b>
* Plain text narrative that identifies the resource in addition to the resource reference
* </p>
*/
public void setDisplay(StringDt theValue) {
myDisplay = theValue;
}
/**
* Sets the value(s) for <b>display</b> (Text alternative for the resource)
*
* <p>
* <b>Definition:</b>
* Plain text narrative that identifies the resource in addition to the resource reference
* </p>
*/
public void setDisplay( String theString) {
myDisplay = new StringDt(theString);
}
}

View File

@ -1,94 +1,288 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>SampledData</b> Datatype
* (A series of measurements taken by a device)
*
* <p>
* <b>Definition:</b>
* A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data
* </p>
*
* <p>
* <b>Requirements:</b>
* There is a need for a concise way to handle the data produced by devices that sample a physical state at a high frequency
* </p>
*/
@DatatypeDef(name="SampledData")
public class SampledDataDt extends BaseElement implements ICompositeDatatype {
@Child(name="origin", order=0, min=1)
@Child(name="origin", type=QuantityDt.class, order=0, min=1, max=1)
private QuantityDt myOrigin;
@Child(name="period", order=1, min=1)
@Child(name="period", type=DecimalDt.class, order=1, min=1, max=1)
private DecimalDt myPeriod;
@Child(name="factor", order=2)
@Child(name="factor", type=DecimalDt.class, order=2, min=0, max=1)
private DecimalDt myFactor;
@Child(name="lowerLimit", order=3)
@Child(name="lowerLimit", type=DecimalDt.class, order=3, min=0, max=1)
private DecimalDt myLowerLimit;
@Child(name="upperLimit", order=4)
@Child(name="upperLimit", type=DecimalDt.class, order=4, min=0, max=1)
private DecimalDt myUpperLimit;
@Child(name="dimensions", order=5, min=1)
@Child(name="dimensions", type=IntegerDt.class, order=5, min=1, max=1)
private IntegerDt myDimensions;
@Child(name="data", order=6, min=1)
@Description("Decimal values with spaces, or \"E\" | \"U\" | \"L\"")
@Child(name="data", type=StringDt.class, order=6, min=1, max=1)
private StringDt myData;
/**
* Gets the value(s) for <b>origin</b> (Zero value and units).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public QuantityDt getOrigin() {
if (myOrigin == null) {
myOrigin = new QuantityDt();
}
return myOrigin;
}
public void setOrigin(QuantityDt theOrigin) {
myOrigin = theOrigin;
/**
* Sets the value(s) for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public void setOrigin(QuantityDt theValue) {
myOrigin = theValue;
}
/**
* Gets the value(s) for <b>period</b> (Number of milliseconds between samples).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The length of time between sampling times, measured in milliseconds
* </p>
*/
public DecimalDt getPeriod() {
if (myPeriod == null) {
myPeriod = new DecimalDt();
}
return myPeriod;
}
public void setPeriod(DecimalDt thePeriod) {
myPeriod = thePeriod;
/**
* Sets the value(s) for <b>period</b> (Number of milliseconds between samples)
*
* <p>
* <b>Definition:</b>
* The length of time between sampling times, measured in milliseconds
* </p>
*/
public void setPeriod(DecimalDt theValue) {
myPeriod = theValue;
}
/**
* Gets the value(s) for <b>factor</b> (Multiply data by this before adding to origin).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A correction factor that is applied to the sampled data points before they are added to the origin
* </p>
*/
public DecimalDt getFactor() {
if (myFactor == null) {
myFactor = new DecimalDt();
}
return myFactor;
}
public void setFactor(DecimalDt theFactor) {
myFactor = theFactor;
/**
* Sets the value(s) for <b>factor</b> (Multiply data by this before adding to origin)
*
* <p>
* <b>Definition:</b>
* A correction factor that is applied to the sampled data points before they are added to the origin
* </p>
*/
public void setFactor(DecimalDt theValue) {
myFactor = theValue;
}
/**
* Gets the value(s) for <b>lowerLimit</b> (Lower limit of detection).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit)
* </p>
*/
public DecimalDt getLowerLimit() {
if (myLowerLimit == null) {
myLowerLimit = new DecimalDt();
}
return myLowerLimit;
}
public void setLowerLimit(DecimalDt theLowerLimit) {
myLowerLimit = theLowerLimit;
/**
* Sets the value(s) for <b>lowerLimit</b> (Lower limit of detection)
*
* <p>
* <b>Definition:</b>
* The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit)
* </p>
*/
public void setLowerLimit(DecimalDt theValue) {
myLowerLimit = theValue;
}
/**
* Gets the value(s) for <b>upperLimit</b> (Upper limit of detection).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit)
* </p>
*/
public DecimalDt getUpperLimit() {
if (myUpperLimit == null) {
myUpperLimit = new DecimalDt();
}
return myUpperLimit;
}
public void setUpperLimit(DecimalDt theUpperLimit) {
myUpperLimit = theUpperLimit;
/**
* Sets the value(s) for <b>upperLimit</b> (Upper limit of detection)
*
* <p>
* <b>Definition:</b>
* The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit)
* </p>
*/
public void setUpperLimit(DecimalDt theValue) {
myUpperLimit = theValue;
}
/**
* Gets the value(s) for <b>dimensions</b> (Number of sample points at each time point).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once
* </p>
*/
public IntegerDt getDimensions() {
if (myDimensions == null) {
myDimensions = new IntegerDt();
}
return myDimensions;
}
public void setDimensions(IntegerDt theDimensions) {
myDimensions = theDimensions;
/**
* Sets the value(s) for <b>dimensions</b> (Number of sample points at each time point)
*
* <p>
* <b>Definition:</b>
* The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once
* </p>
*/
public void setDimensions(IntegerDt theValue) {
myDimensions = theValue;
}
/**
* Gets the value(s) for <b>data</b> (Decimal values with spaces, or "E" | "U" | "L").
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value
* </p>
*/
public StringDt getData() {
if (myData == null) {
myData = new StringDt();
}
return myData;
}
public void setData(StringDt theData) {
myData = theData;
/**
* Sets the value(s) for <b>data</b> (Decimal values with spaces, or "E" | "U" | "L")
*
* <p>
* <b>Definition:</b>
* A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value
* </p>
*/
public void setData(StringDt theValue) {
myData = theValue;
}
/**
* Sets the value(s) for <b>data</b> (Decimal values with spaces, or "E" | "U" | "L")
*
* <p>
* <b>Definition:</b>
* A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value
* </p>
*/
public void setData( String theString) {
myData = new StringDt(theString);
}
}

View File

@ -0,0 +1,360 @@
package ca.uhn.fhir.model.dstu.composite;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.dstu.valueset.*;
import ca.uhn.fhir.model.dstu.resource.*;
/**
* HAPI/FHIR <b>Schedule</b> Datatype
* (A schedule that specifies an event that may occur multiple times)
*
* <p>
* <b>Definition:</b>
* Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur.
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to able to track schedules. There are several different ways to do scheduling: one or more specified times, a simple rules like three times a day, or before/after meals
* </p>
*/
@DatatypeDef(name="Schedule")
public class ScheduleDt extends BaseElement implements ICompositeDatatype {
@Child(name="event", type=PeriodDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<PeriodDt> myEvent;
@Child(name="repeat", order=1, min=0, max=1)
private Repeat myRepeat;
/**
* Gets the value(s) for <b>event</b> (When the event occurs).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies specific time periods when the event should occur
* </p>
*/
public List<PeriodDt> getEvent() {
if (myEvent == null) {
myEvent = new ArrayList<PeriodDt>();
}
return myEvent;
}
/**
* Sets the value(s) for <b>event</b> (When the event occurs)
*
* <p>
* <b>Definition:</b>
* Identifies specific time periods when the event should occur
* </p>
*/
public void setEvent(List<PeriodDt> theValue) {
myEvent = theValue;
}
/**
* Gets the value(s) for <b>repeat</b> (Only if there is none or one event).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies a repeating pattern to the intended time periods.
* </p>
*/
public Repeat getRepeat() {
if (myRepeat == null) {
myRepeat = new Repeat();
}
return myRepeat;
}
/**
* Sets the value(s) for <b>repeat</b> (Only if there is none or one event)
*
* <p>
* <b>Definition:</b>
* Identifies a repeating pattern to the intended time periods.
* </p>
*/
public void setRepeat(Repeat theValue) {
myRepeat = theValue;
}
/**
* Block class for child element: <b>Schedule.repeat</b> (Only if there is none or one event)
*
* <p>
* <b>Definition:</b>
* Identifies a repeating pattern to the intended time periods.
* </p>
*/
@Block(name="Schedule.repeat")
public static class Repeat extends BaseElement implements IResourceBlock {
@Child(name="frequency", type=IntegerDt.class, order=0, min=0, max=1)
private IntegerDt myFrequency;
@Child(name="when", type=CodeDt.class, order=1, min=0, max=1)
private BoundCodeDt<EventTimingEnum> myWhen;
@Child(name="duration", type=DecimalDt.class, order=2, min=1, max=1)
private DecimalDt myDuration;
@Child(name="units", type=CodeDt.class, order=3, min=1, max=1)
private BoundCodeDt<UnitsOfTimeEnum> myUnits;
@Child(name="count", type=IntegerDt.class, order=4, min=0, max=1)
private IntegerDt myCount;
@Child(name="end", type=DateTimeDt.class, order=5, min=0, max=1)
private DateTimeDt myEnd;
/**
* Gets the value(s) for <b>frequency</b> (Event occurs frequency times per duration).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Indicates how often the event should occur.
* </p>
*/
public IntegerDt getFrequency() {
if (myFrequency == null) {
myFrequency = new IntegerDt();
}
return myFrequency;
}
/**
* Sets the value(s) for <b>frequency</b> (Event occurs frequency times per duration)
*
* <p>
* <b>Definition:</b>
* Indicates how often the event should occur.
* </p>
*/
public void setFrequency(IntegerDt theValue) {
myFrequency = theValue;
}
/**
* Gets the value(s) for <b>when</b> (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies the occurrence of daily life that determines timing
* </p>
*/
public BoundCodeDt<EventTimingEnum> getWhen() {
if (myWhen == null) {
myWhen = new BoundCodeDt<EventTimingEnum>(EventTimingEnum.VALUESET_BINDER);
}
return myWhen;
}
/**
* Sets the value(s) for <b>when</b> (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events)
*
* <p>
* <b>Definition:</b>
* Identifies the occurrence of daily life that determines timing
* </p>
*/
public void setWhen(BoundCodeDt<EventTimingEnum> theValue) {
myWhen = theValue;
}
/**
* Sets the value(s) for <b>when</b> (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events)
*
* <p>
* <b>Definition:</b>
* Identifies the occurrence of daily life that determines timing
* </p>
*/
public void setWhen(EventTimingEnum theValue) {
getWhen().setValueAsEnum(theValue);
}
/**
* Gets the value(s) for <b>duration</b> (Repeating or event-related duration).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public DecimalDt getDuration() {
if (myDuration == null) {
myDuration = new DecimalDt();
}
return myDuration;
}
/**
* Sets the value(s) for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public void setDuration(DecimalDt theValue) {
myDuration = theValue;
}
/**
* Gets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The units of time for the duration
* </p>
*/
public BoundCodeDt<UnitsOfTimeEnum> getUnits() {
if (myUnits == null) {
myUnits = new BoundCodeDt<UnitsOfTimeEnum>(UnitsOfTimeEnum.VALUESET_BINDER);
}
return myUnits;
}
/**
* Sets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM))
*
* <p>
* <b>Definition:</b>
* The units of time for the duration
* </p>
*/
public void setUnits(BoundCodeDt<UnitsOfTimeEnum> theValue) {
myUnits = theValue;
}
/**
* Sets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM))
*
* <p>
* <b>Definition:</b>
* The units of time for the duration
* </p>
*/
public void setUnits(UnitsOfTimeEnum theValue) {
getUnits().setValueAsEnum(theValue);
}
/**
* Gets the value(s) for <b>count</b> (Number of times to repeat).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A total count of the desired number of repetitions
* </p>
*/
public IntegerDt getCount() {
if (myCount == null) {
myCount = new IntegerDt();
}
return myCount;
}
/**
* Sets the value(s) for <b>count</b> (Number of times to repeat)
*
* <p>
* <b>Definition:</b>
* A total count of the desired number of repetitions
* </p>
*/
public void setCount(IntegerDt theValue) {
myCount = theValue;
}
/**
* Gets the value(s) for <b>end</b> (When to stop repeats).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public DateTimeDt getEnd() {
if (myEnd == null) {
myEnd = new DateTimeDt();
}
return myEnd;
}
/**
* Sets the value(s) for <b>end</b> (When to stop repeats)
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public void setEnd(DateTimeDt theValue) {
myEnd = theValue;
}
/**
* Sets the value(s) for <b>end</b> (When to stop repeats)
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public void setEndWithSecondsPrecision( Date theDate) {
myEnd = new DateTimeDt(theDate);
}
}
}

View File

@ -40,6 +40,87 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Device")
public class Device extends BaseResource implements IResource {
/**
* Search parameter constant for <b>type</b>
* <p>
* Description: <b>The type of the device</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Device.type</b><br/>
* </p>
*/
public static final String SP_TYPE = "type";
/**
* Search parameter constant for <b>manufacturer</b>
* <p>
* Description: <b>The manufacturer of the device</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Device.manufacturer</b><br/>
* </p>
*/
public static final String SP_MANUFACTURER = "manufacturer";
/**
* Search parameter constant for <b>model</b>
* <p>
* Description: <b>The model of the device</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Device.model</b><br/>
* </p>
*/
public static final String SP_MODEL = "model";
/**
* Search parameter constant for <b>organization</b>
* <p>
* Description: <b>The organization responsible for the device</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Device.owner</b><br/>
* </p>
*/
public static final String SP_ORGANIZATION = "organization";
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Device.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>location</b>
* <p>
* Description: <b>A location, where the resource is found</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Device.location</b><br/>
* </p>
*/
public static final String SP_LOCATION = "location";
/**
* Search parameter constant for <b>patient</b>
* <p>
* Description: <b>Patient information, if the resource is affixed to a person</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Device.patient</b><br/>
* </p>
*/
public static final String SP_PATIENT = "patient";
/**
* Search parameter constant for <b>udi</b>
* <p>
* Description: <b></b><br/>
* Type: <b>string</b><br/>
* Path: <b>Device.udi</b><br/>
* </p>
*/
public static final String SP_UDI = "udi";
@Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<IdentifierDt> myIdentifier;
@ -532,6 +613,17 @@ public class Device extends BaseResource implements IResource {
myUrl = theValue;
}
/**
* Sets the value(s) for <b>url</b> (Network address to contact device)
*
* <p>
* <b>Definition:</b>
* A network address on which the device may be contacted directly
* </p>
*/
public void setUrl( String theUri) {
myUrl = new UriDt(theUri);
}

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.resource;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -41,6 +40,97 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Group")
public class Group extends BaseResource implements IResource {
/**
* Search parameter constant for <b>type</b>
* <p>
* Description: <b>The type of resources the group contains</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Group.type</b><br/>
* </p>
*/
public static final String SP_TYPE = "type";
/**
* Search parameter constant for <b>code</b>
* <p>
* Description: <b>The kind of resources contained</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Group.code</b><br/>
* </p>
*/
public static final String SP_CODE = "code";
/**
* Search parameter constant for <b>actual</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Group.actual</b><br/>
* </p>
*/
public static final String SP_ACTUAL = "actual";
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Group.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>member</b>
* <p>
* Description: <b></b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Group.member</b><br/>
* </p>
*/
public static final String SP_MEMBER = "member";
/**
* Search parameter constant for <b>characteristic</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Group.characteristic.code</b><br/>
* </p>
*/
public static final String SP_CHARACTERISTIC = "characteristic";
/**
* Search parameter constant for <b>value</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Group.characteristic.value[x]</b><br/>
* </p>
*/
public static final String SP_VALUE = "value";
/**
* Search parameter constant for <b>exclude</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Group.characteristic.exclude</b><br/>
* </p>
*/
public static final String SP_EXCLUDE = "exclude";
/**
* Search parameter constant for <b>characteristic-value</b>
* <p>
* Description: <b>A composite of both characteristic and value</b><br/>
* Type: <b>composite</b><br/>
* Path: <b>characteristic & value</b><br/>
* </p>
*/
public static final String SP_CHARACTERISTIC_VALUE = "characteristic-value";
@Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1)
private IdentifierDt myIdentifier;

View File

@ -40,6 +40,87 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Location")
public class Location extends BaseResource implements IResource {
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Location.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b>A (portion of the) name of the location</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Location.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>type</b>
* <p>
* Description: <b>A code for the type of location</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Location.type</b><br/>
* </p>
*/
public static final String SP_TYPE = "type";
/**
* Search parameter constant for <b>address</b>
* <p>
* Description: <b>A (part of the) address of the location</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Location.address</b><br/>
* </p>
*/
public static final String SP_ADDRESS = "address";
/**
* Search parameter constant for <b>status</b>
* <p>
* Description: <b>Searches for locations with a specific kind of status</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Location.status</b><br/>
* </p>
*/
public static final String SP_STATUS = "status";
/**
* Search parameter constant for <b>partof</b>
* <p>
* Description: <b>The location of which this location is a part</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Location.partOf</b><br/>
* </p>
*/
public static final String SP_PARTOF = "partof";
/**
* Search parameter constant for <b>near</b>
* <p>
* Description: <b>The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)</b><br/>
* Type: <b>token</b><br/>
* Path: <b></b><br/>
* </p>
*/
public static final String SP_NEAR = "near";
/**
* Search parameter constant for <b>near-distance</b>
* <p>
* Description: <b>A distance quantity to limit the near search to locations within a specific distance</b><br/>
* Type: <b>token</b><br/>
* Path: <b></b><br/>
* </p>
*/
public static final String SP_NEAR_DISTANCE = "near-distance";
@Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1)
private IdentifierDt myIdentifier;

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.resource;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -41,6 +40,77 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Medication")
public class Medication extends BaseResource implements IResource {
/**
* Search parameter constant for <b>code</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Medication.code</b><br/>
* </p>
*/
public static final String SP_CODE = "code";
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b></b><br/>
* Type: <b>string</b><br/>
* Path: <b>Medication.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>manufacturer</b>
* <p>
* Description: <b></b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Medication.manufacturer</b><br/>
* </p>
*/
public static final String SP_MANUFACTURER = "manufacturer";
/**
* Search parameter constant for <b>form</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Medication.product.form</b><br/>
* </p>
*/
public static final String SP_FORM = "form";
/**
* Search parameter constant for <b>ingredient</b>
* <p>
* Description: <b></b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Medication.product.ingredient.item</b><br/>
* </p>
*/
public static final String SP_INGREDIENT = "ingredient";
/**
* Search parameter constant for <b>container</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Medication.package.container</b><br/>
* </p>
*/
public static final String SP_CONTAINER = "container";
/**
* Search parameter constant for <b>content</b>
* <p>
* Description: <b></b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Medication.package.content.item</b><br/>
* </p>
*/
public static final String SP_CONTENT = "content";
@Child(name="name", type=StringDt.class, order=0, min=0, max=1)
private StringDt myName;

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.resource;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -41,6 +40,157 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Observation")
public class Observation extends BaseResource implements IResource {
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b>The name of the observation type</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Observation.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>value-quantity</b>
* <p>
* Description: <b>The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)</b><br/>
* Type: <b>quantity</b><br/>
* Path: <b>Observation.value[x]</b><br/>
* </p>
*/
public static final String SP_VALUE_QUANTITY = "value-quantity";
/**
* Search parameter constant for <b>value-concept</b>
* <p>
* Description: <b>The value of the observation, if the value is a CodeableConcept</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Observation.value[x]</b><br/>
* </p>
*/
public static final String SP_VALUE_CONCEPT = "value-concept";
/**
* Search parameter constant for <b>value-date</b>
* <p>
* Description: <b>The value of the observation, if the value is a Period</b><br/>
* Type: <b>date</b><br/>
* Path: <b>Observation.value[x]</b><br/>
* </p>
*/
public static final String SP_VALUE_DATE = "value-date";
/**
* Search parameter constant for <b>value-string</b>
* <p>
* Description: <b>The value of the observation, if the value is a string, and also searches in CodeableConcept.text</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Observation.value[x]</b><br/>
* </p>
*/
public static final String SP_VALUE_STRING = "value-string";
/**
* Search parameter constant for <b>name-value-[x]</b>
* <p>
* Description: <b>Both name and one of the value parameters</b><br/>
* Type: <b>composite</b><br/>
* Path: <b>name & value-[x]</b><br/>
* </p>
*/
public static final String SP_NAME_VALUE_X = "name-value-[x]";
/**
* Search parameter constant for <b>date</b>
* <p>
* Description: <b>Obtained date/time. If the obtained element is a period, a date that falls in the period</b><br/>
* Type: <b>date</b><br/>
* Path: <b>Observation.applies[x]</b><br/>
* </p>
*/
public static final String SP_DATE = "date";
/**
* Search parameter constant for <b>status</b>
* <p>
* Description: <b>The status of the observation</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Observation.status</b><br/>
* </p>
*/
public static final String SP_STATUS = "status";
/**
* Search parameter constant for <b>reliability</b>
* <p>
* Description: <b>The reliability of the observation</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Observation.reliability</b><br/>
* </p>
*/
public static final String SP_RELIABILITY = "reliability";
/**
* Search parameter constant for <b>subject</b>
* <p>
* Description: <b>The subject that the observation is about</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Observation.subject</b><br/>
* </p>
*/
public static final String SP_SUBJECT = "subject";
/**
* Search parameter constant for <b>performer</b>
* <p>
* Description: <b>Who and/or what performed the observation</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Observation.performer</b><br/>
* </p>
*/
public static final String SP_PERFORMER = "performer";
/**
* Search parameter constant for <b>specimen</b>
* <p>
* Description: <b></b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Observation.specimen</b><br/>
* </p>
*/
public static final String SP_SPECIMEN = "specimen";
/**
* Search parameter constant for <b>related-type</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Observation.related.type</b><br/>
* </p>
*/
public static final String SP_RELATED_TYPE = "related-type";
/**
* Search parameter constant for <b>related-target</b>
* <p>
* Description: <b></b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Observation.related.target</b><br/>
* </p>
*/
public static final String SP_RELATED_TARGET = "related-target";
/**
* Search parameter constant for <b>related</b>
* <p>
* Description: <b>Related Observations - search on related-type and related-target together</b><br/>
* Type: <b>composite</b><br/>
* Path: <b>related-target & related-type</b><br/>
* </p>
*/
public static final String SP_RELATED = "related";
@Child(name="name", type=CodeableConceptDt.class, order=0, min=1, max=1)
private CodeableConceptDt myName;

View File

@ -40,6 +40,77 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Organization")
public class Organization extends BaseResource implements IResource {
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b>A portion of the organization's name</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Organization.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>phonetic</b>
* <p>
* Description: <b>A portion of the organization's name using some kind of phonetic matching algorithm</b><br/>
* Type: <b>string</b><br/>
* Path: <b></b><br/>
* </p>
*/
public static final String SP_PHONETIC = "phonetic";
/**
* Search parameter constant for <b>type</b>
* <p>
* Description: <b>A code for the type of organization</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Organization.type</b><br/>
* </p>
*/
public static final String SP_TYPE = "type";
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b>Any identifier for the organization (not the accreditation issuer's identifier)</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Organization.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>!accreditation</b>
* <p>
* Description: <b>Any accreditation code</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Organization.accreditation.code</b><br/>
* </p>
*/
public static final String SP_ACCREDITATION = "!accreditation";
/**
* Search parameter constant for <b>partof</b>
* <p>
* Description: <b>Search all organizations that are part of the given organization</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Organization.partOf</b><br/>
* </p>
*/
public static final String SP_PARTOF = "partof";
/**
* Search parameter constant for <b>active</b>
* <p>
* Description: <b>Whether the organization's record is active</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Organization.active</b><br/>
* </p>
*/
public static final String SP_ACTIVE = "active";
@Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<IdentifierDt> myIdentifier;

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.resource;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -41,6 +40,157 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Patient")
public class Patient extends BaseResource implements IResource {
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b>A patient identifier</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Patient.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b>A portion of either family or given name of the patient</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Patient.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>family</b>
* <p>
* Description: <b>A portion of the family name of the patient</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Patient.name.family</b><br/>
* </p>
*/
public static final String SP_FAMILY = "family";
/**
* Search parameter constant for <b>given</b>
* <p>
* Description: <b>A portion of the given name of the patient</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Patient.name.given</b><br/>
* </p>
*/
public static final String SP_GIVEN = "given";
/**
* Search parameter constant for <b>phonetic</b>
* <p>
* Description: <b>A portion of either family or given name using some kind of phonetic matching algorithm</b><br/>
* Type: <b>string</b><br/>
* Path: <b></b><br/>
* </p>
*/
public static final String SP_PHONETIC = "phonetic";
/**
* Search parameter constant for <b>telecom</b>
* <p>
* Description: <b>The value in any kind of telecom details of the patient</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Patient.telecom</b><br/>
* </p>
*/
public static final String SP_TELECOM = "telecom";
/**
* Search parameter constant for <b>address</b>
* <p>
* Description: <b>An address in any kind of address/part of the patient</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Patient.address</b><br/>
* </p>
*/
public static final String SP_ADDRESS = "address";
/**
* Search parameter constant for <b>gender</b>
* <p>
* Description: <b>Gender of the patient</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Patient.gender</b><br/>
* </p>
*/
public static final String SP_GENDER = "gender";
/**
* Search parameter constant for <b>language</b>
* <p>
* Description: <b>Language code (irrespective of use value)</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Patient.communication</b><br/>
* </p>
*/
public static final String SP_LANGUAGE = "language";
/**
* Search parameter constant for <b>birthdate</b>
* <p>
* Description: <b>The patient's date of birth</b><br/>
* Type: <b>date</b><br/>
* Path: <b>Patient.birthDate</b><br/>
* </p>
*/
public static final String SP_BIRTHDATE = "birthdate";
/**
* Search parameter constant for <b>provider</b>
* <p>
* Description: <b>The organization at which this person is a patient</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Patient.managingOrganization</b><br/>
* </p>
*/
public static final String SP_PROVIDER = "provider";
/**
* Search parameter constant for <b>active</b>
* <p>
* Description: <b>Whether the patient record is active</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Patient.active</b><br/>
* </p>
*/
public static final String SP_ACTIVE = "active";
/**
* Search parameter constant for <b>animal-species</b>
* <p>
* Description: <b>The species for animal patients</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Patient.animal.species</b><br/>
* </p>
*/
public static final String SP_ANIMAL_SPECIES = "animal-species";
/**
* Search parameter constant for <b>animal-breed</b>
* <p>
* Description: <b>The breed for animal patients</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Patient.animal.breed</b><br/>
* </p>
*/
public static final String SP_ANIMAL_BREED = "animal-breed";
/**
* Search parameter constant for <b>link</b>
* <p>
* Description: <b>All patients linked to the given patient</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Patient.link.other</b><br/>
* </p>
*/
public static final String SP_LINK = "link";
@Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<IdentifierDt> myIdentifier;

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.resource;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -41,6 +40,97 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Practitioner")
public class Practitioner extends BaseResource implements IResource {
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b>A practitioner's Identifier</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Practitioner.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b>A portion of either family or given name</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Practitioner.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>family</b>
* <p>
* Description: <b>A portion of the family name</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Practitioner.name</b><br/>
* </p>
*/
public static final String SP_FAMILY = "family";
/**
* Search parameter constant for <b>given</b>
* <p>
* Description: <b>A portion of the given name</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Practitioner.name</b><br/>
* </p>
*/
public static final String SP_GIVEN = "given";
/**
* Search parameter constant for <b>phonetic</b>
* <p>
* Description: <b>A portion of either family or given name using some kind of phonetic matching algorithm</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Practitioner.name</b><br/>
* </p>
*/
public static final String SP_PHONETIC = "phonetic";
/**
* Search parameter constant for <b>telecom</b>
* <p>
* Description: <b>The value in any kind of contact</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Practitioner.telecom</b><br/>
* </p>
*/
public static final String SP_TELECOM = "telecom";
/**
* Search parameter constant for <b>address</b>
* <p>
* Description: <b>An address in any kind of address/part</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Practitioner.address</b><br/>
* </p>
*/
public static final String SP_ADDRESS = "address";
/**
* Search parameter constant for <b>gender</b>
* <p>
* Description: <b>Gender of the practitioner</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Practitioner.gender</b><br/>
* </p>
*/
public static final String SP_GENDER = "gender";
/**
* Search parameter constant for <b>organization</b>
* <p>
* Description: <b>The identity of the organization the practitioner represents / acts on behalf of</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Practitioner.organization</b><br/>
* </p>
*/
public static final String SP_ORGANIZATION = "organization";
@Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<IdentifierDt> myIdentifier;

View File

@ -40,6 +40,117 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Profile")
public class Profile extends BaseResource implements IResource {
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b>The identifier of the profile</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Profile.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>version</b>
* <p>
* Description: <b>The version identifier of the profile</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Profile.version</b><br/>
* </p>
*/
public static final String SP_VERSION = "version";
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b>Name of the profile</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Profile.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>publisher</b>
* <p>
* Description: <b>Name of the publisher of the profile</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Profile.publisher</b><br/>
* </p>
*/
public static final String SP_PUBLISHER = "publisher";
/**
* Search parameter constant for <b>description</b>
* <p>
* Description: <b>Text search in the description of the profile</b><br/>
* Type: <b>string</b><br/>
* Path: <b>Profile.description</b><br/>
* </p>
*/
public static final String SP_DESCRIPTION = "description";
/**
* Search parameter constant for <b>status</b>
* <p>
* Description: <b>The current status of the profile</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Profile.status</b><br/>
* </p>
*/
public static final String SP_STATUS = "status";
/**
* Search parameter constant for <b>date</b>
* <p>
* Description: <b>The profile publication date</b><br/>
* Type: <b>date</b><br/>
* Path: <b>Profile.date</b><br/>
* </p>
*/
public static final String SP_DATE = "date";
/**
* Search parameter constant for <b>code</b>
* <p>
* Description: <b>A code for the profile in the format uri::code (server may choose to do subsumption)</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Profile.code</b><br/>
* </p>
*/
public static final String SP_CODE = "code";
/**
* Search parameter constant for <b>extension</b>
* <p>
* Description: <b>An extension code (use or definition)</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Profile.extensionDefn.code</b><br/>
* </p>
*/
public static final String SP_EXTENSION = "extension";
/**
* Search parameter constant for <b>valueset</b>
* <p>
* Description: <b>A vocabulary binding code</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Profile.structure.element.definition.binding.reference[x]</b><br/>
* </p>
*/
public static final String SP_VALUESET = "valueset";
/**
* Search parameter constant for <b>type</b>
* <p>
* Description: <b>Type of resource that is constrained in the profile</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Profile.structure.type</b><br/>
* </p>
*/
public static final String SP_TYPE = "type";
@Child(name="identifier", type=StringDt.class, order=0, min=0, max=1)
private StringDt myIdentifier;
@ -761,6 +872,17 @@ public class Profile extends BaseResource implements IResource {
myUri = theValue;
}
/**
* Sets the value(s) for <b>uri</b> (Identifies what this mapping refers to)
*
* <p>
* <b>Definition:</b>
* A URI that identifies the specification that this mapping is expressed to
* </p>
*/
public void setUri( String theUri) {
myUri = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>name</b> (Names what this mapping refers to).
@ -2244,6 +2366,17 @@ public class Profile extends BaseResource implements IResource {
myProfile = theValue;
}
/**
* Sets the value(s) for <b>profile</b> (Profile.structure to apply)
*
* <p>
* <b>Definition:</b>
* Identifies a profile that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile
* </p>
*/
public void setProfile( String theUri) {
myProfile = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>aggregation</b> (contained | referenced | bundled - how aggregated).

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.resource;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -41,6 +40,17 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Specimen")
public class Specimen extends BaseResource implements IResource {
/**
* Search parameter constant for <b>subject</b>
* <p>
* Description: <b>The subject of the specimen</b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Specimen.subject</b><br/>
* </p>
*/
public static final String SP_SUBJECT = "subject";
@Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<IdentifierDt> myIdentifier;

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.resource;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -41,6 +40,57 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="Substance")
public class Substance extends BaseResource implements IResource {
/**
* Search parameter constant for <b>type</b>
* <p>
* Description: <b>The type of the substance</b><br/>
* Type: <b>token</b><br/>
* Path: <b>Substance.type</b><br/>
* </p>
*/
public static final String SP_TYPE = "type";
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b></b><br/>
* Type: <b>token</b><br/>
* Path: <b>Substance.instance.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>expiry</b>
* <p>
* Description: <b></b><br/>
* Type: <b>date</b><br/>
* Path: <b>Substance.instance.expiry</b><br/>
* </p>
*/
public static final String SP_EXPIRY = "expiry";
/**
* Search parameter constant for <b>quantity</b>
* <p>
* Description: <b></b><br/>
* Type: <b>number</b><br/>
* Path: <b>Substance.instance.quantity</b><br/>
* </p>
*/
public static final String SP_QUANTITY = "quantity";
/**
* Search parameter constant for <b>substance</b>
* <p>
* Description: <b></b><br/>
* Type: <b>reference</b><br/>
* Path: <b>Substance.ingredient.substance</b><br/>
* </p>
*/
public static final String SP_SUBSTANCE = "substance";
@Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1)
private CodeableConceptDt myType;

View File

@ -40,6 +40,117 @@ import ca.uhn.fhir.model.dstu.valueset.*;
@ResourceDef(name="ValueSet")
public class ValueSet extends BaseResource implements IResource {
/**
* Search parameter constant for <b>identifier</b>
* <p>
* Description: <b>The identifier of the value set</b><br/>
* Type: <b>token</b><br/>
* Path: <b>ValueSet.identifier</b><br/>
* </p>
*/
public static final String SP_IDENTIFIER = "identifier";
/**
* Search parameter constant for <b>version</b>
* <p>
* Description: <b>The version identifier of the value set</b><br/>
* Type: <b>token</b><br/>
* Path: <b>ValueSet.version</b><br/>
* </p>
*/
public static final String SP_VERSION = "version";
/**
* Search parameter constant for <b>name</b>
* <p>
* Description: <b>The name of the value set</b><br/>
* Type: <b>string</b><br/>
* Path: <b>ValueSet.name</b><br/>
* </p>
*/
public static final String SP_NAME = "name";
/**
* Search parameter constant for <b>publisher</b>
* <p>
* Description: <b>Name of the publisher of the value set</b><br/>
* Type: <b>string</b><br/>
* Path: <b>ValueSet.publisher</b><br/>
* </p>
*/
public static final String SP_PUBLISHER = "publisher";
/**
* Search parameter constant for <b>description</b>
* <p>
* Description: <b>Text search in the description of the value set</b><br/>
* Type: <b>string</b><br/>
* Path: <b>ValueSet.description</b><br/>
* </p>
*/
public static final String SP_DESCRIPTION = "description";
/**
* Search parameter constant for <b>status</b>
* <p>
* Description: <b>The status of the value set</b><br/>
* Type: <b>token</b><br/>
* Path: <b>ValueSet.status</b><br/>
* </p>
*/
public static final String SP_STATUS = "status";
/**
* Search parameter constant for <b>date</b>
* <p>
* Description: <b>The value set publication date</b><br/>
* Type: <b>date</b><br/>
* Path: <b>ValueSet.date</b><br/>
* </p>
*/
public static final String SP_DATE = "date";
/**
* Search parameter constant for <b>system</b>
* <p>
* Description: <b>The system for any codes defined by this value set</b><br/>
* Type: <b>token</b><br/>
* Path: <b>ValueSet.define.system</b><br/>
* </p>
*/
public static final String SP_SYSTEM = "system";
/**
* Search parameter constant for <b>code</b>
* <p>
* Description: <b>A code defined in the value set</b><br/>
* Type: <b>token</b><br/>
* Path: <b>ValueSet.define.concept.code</b><br/>
* </p>
*/
public static final String SP_CODE = "code";
/**
* Search parameter constant for <b>reference</b>
* <p>
* Description: <b>A code system included or excluded in the value set or an imported value set</b><br/>
* Type: <b>token</b><br/>
* Path: <b>ValueSet.compose.include.system</b><br/>
* </p>
*/
public static final String SP_REFERENCE = "reference";
/**
* Search parameter constant for <b>!restricts</b>
* <p>
* Description: <b>A value set listed in the restricts list</b><br/>
* Type: <b>token</b><br/>
* Path: <b>ValueSet.compose.restricts</b><br/>
* </p>
*/
public static final String SP_RESTRICTS = "!restricts";
@Child(name="identifier", type=StringDt.class, order=0, min=0, max=1)
private StringDt myIdentifier;
@ -646,6 +757,17 @@ public class ValueSet extends BaseResource implements IResource {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (URI to identify the code system)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>version</b> (Version of this system).
@ -1003,6 +1125,20 @@ public class ValueSet extends BaseResource implements IResource {
myImport = theValue;
}
/**
* Sets the value(s) for <b>import</b> (Import the contents of another value set)
*
* <p>
* <b>Definition:</b>
* Includes the contents of the referenced value set as a part of the contents of this value set
* </p>
*/
public void addImport( String theUri) {
if (myImport == null) {
myImport = new ArrayList<UriDt>();
}
myImport.add(new UriDt(theUri));
}
/**
* Gets the value(s) for <b>include</b> (Include one or more codes from a code system).
@ -1119,6 +1255,17 @@ public class ValueSet extends BaseResource implements IResource {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (The system the codes come from)
*
* <p>
* <b>Definition:</b>
* The code system from which the selected codes come from
* </p>
*/
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>version</b> (Specific version of the code system referred to).
@ -1517,6 +1664,17 @@ public class ValueSet extends BaseResource implements IResource {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (System value for the code)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>code</b> (Code - if blank, this is not a choosable code).

View File

@ -8,32 +8,28 @@ import java.util.Map;
public enum AddressUseEnum {
/**
* home
*
* Code Value: <b>home</b>
*
* A communication address at a home.
*/
HOME("home"),
/**
* work
*
* Code Value: <b>work</b>
*
* An office address. First choice for business related contacts during business hours.
*/
WORK("work"),
/**
* temp
*
* Code Value: <b>temp</b>
*
* A temporary address. The period can provide more detailed information.
*/
TEMP("temp"),
/**
* old
*
* Code Value: <b>old</b>
*
* This address is no longer in use (or was never correct, but retained for records).
*/

View File

@ -8,16 +8,14 @@ import java.util.Map;
public enum AggregationModeEnum {
/**
* contained
*
* Code Value: <b>contained</b>
*
* The reference is a local reference to a contained resource.
*/
CONTAINED("contained"),
/**
* referenced
*
* Code Value: <b>referenced</b>
*
* The reference to to a resource that has to be resolved externally to the resource that includes the reference.
*/

View File

@ -8,28 +8,28 @@ import java.util.Map;
public enum AnimalSpeciesEnum {
/**
* canislf
* Dog
* Display: <b>Dog</b><br/>
* Code Value: <b>canislf</b>
*
* Canis lupus familiaris
*/
CANISLF("canislf"),
DOG("canislf"),
/**
* ovisa
* Sheep
* Display: <b>Sheep</b><br/>
* Code Value: <b>ovisa</b>
*
* Ovis aries
*/
OVISA("ovisa"),
SHEEP("ovisa"),
/**
* serinuscd
* Domestic Canary
* Display: <b>Domestic Canary</b><br/>
* Code Value: <b>serinuscd</b>
*
* Serinus canaria domestica
*/
SERINUSCD("serinuscd"),
DOMESTIC_CANARY("serinuscd"),
;

View File

@ -8,24 +8,21 @@ import java.util.Map;
public enum BindingConformanceEnum {
/**
* required
*
* Code Value: <b>required</b>
*
* Only codes in the specified set are allowed. If the binding is extensible, other codes may be used for concepts not covered by the bound set of codes.
*/
REQUIRED("required"),
/**
* preferred
*
* Code Value: <b>preferred</b>
*
* For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant.
*/
PREFERRED("preferred"),
/**
* example
*
* Code Value: <b>example</b>
*
* The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs.
*/

View File

@ -8,16 +8,14 @@ import java.util.Map;
public enum ConstraintSeverityEnum {
/**
* error
*
* Code Value: <b>error</b>
*
* If the constraint is violated, the resource is not conformant.
*/
ERROR("error"),
/**
* warning
*
* Code Value: <b>warning</b>
*
* If the constraint is violated, the resource is conformant, but it is not necessarily following best practice.
*/

View File

@ -8,32 +8,28 @@ import java.util.Map;
public enum ContactSystemEnum {
/**
* phone
*
* Code Value: <b>phone</b>
*
* The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required.
*/
PHONE("phone"),
/**
* fax
*
* Code Value: <b>fax</b>
*
* The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required.
*/
FAX("fax"),
/**
* email
*
* Code Value: <b>email</b>
*
* The value is an email address.
*/
EMAIL("email"),
/**
* url
*
* Code Value: <b>url</b>
*
* The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses.
*/

View File

@ -8,40 +8,35 @@ import java.util.Map;
public enum ContactUseEnum {
/**
* home
*
* Code Value: <b>home</b>
*
* A communication contact at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available.
*/
HOME("home"),
/**
* work
*
* Code Value: <b>work</b>
*
* An office contact. First choice for business related contacts during business hours.
*/
WORK("work"),
/**
* temp
*
* Code Value: <b>temp</b>
*
* A temporary contact. The period can provide more detailed information.
*/
TEMP("temp"),
/**
* old
*
* Code Value: <b>old</b>
*
* This contact is no longer in use (or was never correct, but retained for records).
*/
OLD("old"),
/**
* mobile
*
* Code Value: <b>mobile</b>
*
* A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business.
*/

View File

@ -8,272 +8,238 @@ import java.util.Map;
public enum DataTypeEnum {
/**
* Address
*
* Code Value: <b>Address</b>
*
* There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.
*/
ADDRESS("Address"),
/**
* Age
*
* Code Value: <b>Age</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive.
*/
AGE("Age"),
/**
* Attachment
*
* Code Value: <b>Attachment</b>
*
* For referring to data content defined in other formats.
*/
ATTACHMENT("Attachment"),
/**
* CodeableConcept
*
* Code Value: <b>CodeableConcept</b>
*
* A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
*/
CODEABLECONCEPT("CodeableConcept"),
/**
* Coding
*
* Code Value: <b>Coding</b>
*
* A reference to a code defined by a terminology system.
*/
CODING("Coding"),
/**
* Contact
*
* Code Value: <b>Contact</b>
*
* All kinds of technology mediated contact details for a person or organization, including telephone, email, etc.
*/
CONTACT("Contact"),
/**
* Count
*
* Code Value: <b>Count</b>
*
* There SHALL be a code with a value of "1" if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM. If present, the value SHALL a whole number.
*/
COUNT("Count"),
/**
* Distance
*
* Code Value: <b>Distance</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM.
*/
DISTANCE("Distance"),
/**
* Duration
*
* Code Value: <b>Duration</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM.
*/
DURATION("Duration"),
/**
* Extension
*
* Code Value: <b>Extension</b>
*
* Optional Extensions Element - found in all resources.
*/
EXTENSION("Extension"),
/**
* HumanName
*
* Code Value: <b>HumanName</b>
*
* A human's name with the ability to identify parts and usage.
*/
HUMANNAME("HumanName"),
/**
* Identifier
*
* Code Value: <b>Identifier</b>
*
* A technical identifier - identifies some entity uniquely and unambiguously.
*/
IDENTIFIER("Identifier"),
/**
* Money
*
* Code Value: <b>Money</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:std:iso:4217" - currency).
*/
MONEY("Money"),
/**
* Narrative
*
* Code Value: <b>Narrative</b>
*
* A human-readable formatted text, including images.
*/
NARRATIVE("Narrative"),
/**
* Period
*
* Code Value: <b>Period</b>
*
* A time period defined by a start and end date and optionally time.
*/
PERIOD("Period"),
/**
* Quantity
*
* Code Value: <b>Quantity</b>
*
* A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
*/
QUANTITY("Quantity"),
/**
* Range
*
* Code Value: <b>Range</b>
*
* A set of ordered Quantities defined by a low and high limit.
*/
RANGE("Range"),
/**
* Ratio
*
* Code Value: <b>Ratio</b>
*
* A relationship of two Quantity values - expressed as a numerator and a denominator.
*/
RATIO("Ratio"),
/**
* ResourceReference
*
* Code Value: <b>ResourceReference</b>
*
* A reference from one resource to another.
*/
RESOURCEREFERENCE("ResourceReference"),
/**
* SampledData
*
* Code Value: <b>SampledData</b>
*
* A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
*/
SAMPLEDDATA("SampledData"),
/**
* Schedule
*
* Code Value: <b>Schedule</b>
*
* Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur.
*/
SCHEDULE("Schedule"),
/**
* base64Binary
*
* Code Value: <b>base64Binary</b>
*
* A stream of bytes
*/
BASE64BINARY("base64Binary"),
/**
* boolean
*
* Code Value: <b>boolean</b>
*
* Value of "true" or "false"
*/
BOOLEAN("boolean"),
/**
* code
*
* Code Value: <b>code</b>
*
* A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents
*/
CODE("code"),
/**
* date
*
* Code Value: <b>date</b>
*
* A date, or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates.
*/
DATE("date"),
/**
* dateTime
*
* Code Value: <b>dateTime</b>
*
* A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds may be provided but may also be ignored. Dates SHALL be valid dates.
*/
DATETIME("dateTime"),
/**
* decimal
*
* Code Value: <b>decimal</b>
*
* A rational number with implicit precision
*/
DECIMAL("decimal"),
/**
* id
*
* Code Value: <b>id</b>
*
* A whole number in the range 0 to 2^64-1, optionally represented in hex, a uuid, an oid or any other combination of lower-case letters a-z, numerals, "-" and ".", with a length limit of 36 characters
*/
ID("id"),
/**
* instant
*
* Code Value: <b>instant</b>
*
* An instant in time - known at least to the second
*/
INSTANT("instant"),
/**
* integer
*
* Code Value: <b>integer</b>
*
* A whole number
*/
INTEGER("integer"),
/**
* oid
*
* Code Value: <b>oid</b>
*
* An oid represented as a URI
*/
OID("oid"),
/**
* string
*
* Code Value: <b>string</b>
*
* A sequence of Unicode characters
*/
STRING("string"),
/**
* uri
*
* Code Value: <b>uri</b>
*
* String of characters used to identify a name or a resource
*/
URI("uri"),
/**
* uuid
*
* Code Value: <b>uuid</b>
*
* A UUID, represented as a URI
*/

View File

@ -0,0 +1,71 @@
package ca.uhn.fhir.model.dstu.valueset;
import ca.uhn.fhir.model.api.*;
import java.util.HashMap;
import java.util.Map;
public enum EventTimingEnum {
;
/**
* Identifier for this Value Set:
* http://hl7.org/fhir/vs/event-timing
*/
public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/event-timing";
/**
* Name for this Value Set:
* EventTiming
*/
public static final String VALUESET_NAME = "EventTiming";
private static Map<String, EventTimingEnum> CODE_TO_ENUM = new HashMap<String, EventTimingEnum>();
private String myCode;
static {
for (EventTimingEnum next : EventTimingEnum.values()) {
CODE_TO_ENUM.put(next.getCode(), next);
}
}
/**
* Returns the code associated with this enumerated value
*/
public String getCode() {
return myCode;
}
/**
* Returns the enumerated value associated with this code
*/
public EventTimingEnum forCode(String theCode) {
EventTimingEnum retVal = CODE_TO_ENUM.get(theCode);
return retVal;
}
/**
* Converts codes to their respective enumerated values
*/
public static final IValueSetEnumBinder<EventTimingEnum> VALUESET_BINDER = new IValueSetEnumBinder<EventTimingEnum>() {
@Override
public String toCodeString(EventTimingEnum theEnum) {
return theEnum.getCode();
}
@Override
public EventTimingEnum fromCodeString(String theCodeString) {
return CODE_TO_ENUM.get(theCodeString);
}
};
/**
* Constructor
*/
EventTimingEnum(String theCode) {
myCode = theCode;
}
}

View File

@ -8,32 +8,28 @@ import java.util.Map;
public enum ExtensionContextEnum {
/**
* resource
*
* Code Value: <b>resource</b>
*
* The context is all elements matching a particular resource element path.
*/
RESOURCE("resource"),
/**
* datatype
*
* Code Value: <b>datatype</b>
*
* The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name).
*/
DATATYPE("datatype"),
/**
* mapping
*
* Code Value: <b>mapping</b>
*
* The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used.
*/
MAPPING("mapping"),
/**
* extension
*
* Code Value: <b>extension</b>
*
* The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code.
*/

View File

@ -8,656 +8,574 @@ import java.util.Map;
public enum FHIRDefinedTypeEnum {
/**
* Address
*
* Code Value: <b>Address</b>
*
* There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world.
*/
ADDRESS("Address"),
/**
* Age
*
* Code Value: <b>Age</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM. If value is present, it SHALL be positive.
*/
AGE("Age"),
/**
* Attachment
*
* Code Value: <b>Attachment</b>
*
* For referring to data content defined in other formats.
*/
ATTACHMENT("Attachment"),
/**
* CodeableConcept
*
* Code Value: <b>CodeableConcept</b>
*
* A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
*/
CODEABLECONCEPT("CodeableConcept"),
/**
* Coding
*
* Code Value: <b>Coding</b>
*
* A reference to a code defined by a terminology system.
*/
CODING("Coding"),
/**
* Contact
*
* Code Value: <b>Contact</b>
*
* All kinds of technology mediated contact details for a person or organization, including telephone, email, etc.
*/
CONTACT("Contact"),
/**
* Count
*
* Code Value: <b>Count</b>
*
* There SHALL be a code with a value of "1" if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM. If present, the value SHALL a whole number.
*/
COUNT("Count"),
/**
* Distance
*
* Code Value: <b>Distance</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM.
*/
DISTANCE("Distance"),
/**
* Duration
*
* Code Value: <b>Duration</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM.
*/
DURATION("Duration"),
/**
* Extension
*
* Code Value: <b>Extension</b>
*
* Optional Extensions Element - found in all resources.
*/
EXTENSION("Extension"),
/**
* HumanName
*
* Code Value: <b>HumanName</b>
*
* A human's name with the ability to identify parts and usage.
*/
HUMANNAME("HumanName"),
/**
* Identifier
*
* Code Value: <b>Identifier</b>
*
* A technical identifier - identifies some entity uniquely and unambiguously.
*/
IDENTIFIER("Identifier"),
/**
* Money
*
* Code Value: <b>Money</b>
*
* There SHALL be a code if there is a value and it SHALL be an expression of currency. If system is present, it SHALL be ISO 4217 (system = "urn:std:iso:4217" - currency).
*/
MONEY("Money"),
/**
* Narrative
*
* Code Value: <b>Narrative</b>
*
* A human-readable formatted text, including images.
*/
NARRATIVE("Narrative"),
/**
* Period
*
* Code Value: <b>Period</b>
*
* A time period defined by a start and end date and optionally time.
*/
PERIOD("Period"),
/**
* Quantity
*
* Code Value: <b>Quantity</b>
*
* A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
*/
QUANTITY("Quantity"),
/**
* Range
*
* Code Value: <b>Range</b>
*
* A set of ordered Quantities defined by a low and high limit.
*/
RANGE("Range"),
/**
* Ratio
*
* Code Value: <b>Ratio</b>
*
* A relationship of two Quantity values - expressed as a numerator and a denominator.
*/
RATIO("Ratio"),
/**
* ResourceReference
*
* Code Value: <b>ResourceReference</b>
*
* A reference from one resource to another.
*/
RESOURCEREFERENCE("ResourceReference"),
/**
* SampledData
*
* Code Value: <b>SampledData</b>
*
* A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data.
*/
SAMPLEDDATA("SampledData"),
/**
* Schedule
*
* Code Value: <b>Schedule</b>
*
* Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur.
*/
SCHEDULE("Schedule"),
/**
* base64Binary
*
* Code Value: <b>base64Binary</b>
*
* A stream of bytes
*/
BASE64BINARY("base64Binary"),
/**
* boolean
*
* Code Value: <b>boolean</b>
*
* Value of "true" or "false"
*/
BOOLEAN("boolean"),
/**
* code
*
* Code Value: <b>code</b>
*
* A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents
*/
CODE("code"),
/**
* date
*
* Code Value: <b>date</b>
*
* A date, or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates.
*/
DATE("date"),
/**
* dateTime
*
* Code Value: <b>dateTime</b>
*
* A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds may be provided but may also be ignored. Dates SHALL be valid dates.
*/
DATETIME("dateTime"),
/**
* decimal
*
* Code Value: <b>decimal</b>
*
* A rational number with implicit precision
*/
DECIMAL("decimal"),
/**
* id
*
* Code Value: <b>id</b>
*
* A whole number in the range 0 to 2^64-1, optionally represented in hex, a uuid, an oid or any other combination of lower-case letters a-z, numerals, "-" and ".", with a length limit of 36 characters
*/
ID("id"),
/**
* instant
*
* Code Value: <b>instant</b>
*
* An instant in time - known at least to the second
*/
INSTANT("instant"),
/**
* integer
*
* Code Value: <b>integer</b>
*
* A whole number
*/
INTEGER("integer"),
/**
* oid
*
* Code Value: <b>oid</b>
*
* An oid represented as a URI
*/
OID("oid"),
/**
* string
*
* Code Value: <b>string</b>
*
* A sequence of Unicode characters
*/
STRING("string"),
/**
* uri
*
* Code Value: <b>uri</b>
*
* String of characters used to identify a name or a resource
*/
URI("uri"),
/**
* uuid
*
* Code Value: <b>uuid</b>
*
* A UUID, represented as a URI
*/
UUID("uuid"),
/**
* AdverseReaction
*
* Code Value: <b>AdverseReaction</b>
*
* Records an unexpected reaction suspected to be related to the exposure of the reaction subject to a substance.
*/
ADVERSEREACTION("AdverseReaction"),
/**
* Alert
*
* Code Value: <b>Alert</b>
*
* Prospective warnings of potential issues when providing care to the patient.
*/
ALERT("Alert"),
/**
* AllergyIntolerance
*
* Code Value: <b>AllergyIntolerance</b>
*
* Indicates the patient has a susceptibility to an adverse reaction upon exposure to a specified substance.
*/
ALLERGYINTOLERANCE("AllergyIntolerance"),
/**
* CarePlan
*
* Code Value: <b>CarePlan</b>
*
* Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.
*/
CAREPLAN("CarePlan"),
/**
* Composition
*
* Code Value: <b>Composition</b>
*
* A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.
*/
COMPOSITION("Composition"),
/**
* ConceptMap
*
* Code Value: <b>ConceptMap</b>
*
* A statement of relationships from one set of concepts to one or more other concept systems.
*/
CONCEPTMAP("ConceptMap"),
/**
* Condition
*
* Code Value: <b>Condition</b>
*
* Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.
*/
CONDITION("Condition"),
/**
* Conformance
*
* Code Value: <b>Conformance</b>
*
* A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.
*/
CONFORMANCE("Conformance"),
/**
* Device
*
* Code Value: <b>Device</b>
*
* This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.
*/
DEVICE("Device"),
/**
* DeviceObservationReport
*
* Code Value: <b>DeviceObservationReport</b>
*
* Describes the data produced by a device at a point in time.
*/
DEVICEOBSERVATIONREPORT("DeviceObservationReport"),
/**
* DiagnosticOrder
*
* Code Value: <b>DiagnosticOrder</b>
*
* A request for a diagnostic investigation service to be performed.
*/
DIAGNOSTICORDER("DiagnosticOrder"),
/**
* DiagnosticReport
*
* Code Value: <b>DiagnosticReport</b>
*
* The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports.
*/
DIAGNOSTICREPORT("DiagnosticReport"),
/**
* DocumentManifest
*
* Code Value: <b>DocumentManifest</b>
*
* A manifest that defines a set of documents.
*/
DOCUMENTMANIFEST("DocumentManifest"),
/**
* DocumentReference
*
* Code Value: <b>DocumentReference</b>
*
* A reference to a document.
*/
DOCUMENTREFERENCE("DocumentReference"),
/**
* Encounter
*
* Code Value: <b>Encounter</b>
*
* An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.
*/
ENCOUNTER("Encounter"),
/**
* FamilyHistory
*
* Code Value: <b>FamilyHistory</b>
*
* Significant health events and conditions for people related to the subject relevant in the context of care for the subject.
*/
FAMILYHISTORY("FamilyHistory"),
/**
* Group
*
* Code Value: <b>Group</b>
*
* Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization.
*/
GROUP("Group"),
/**
* ImagingStudy
*
* Code Value: <b>ImagingStudy</b>
*
* Manifest of a set of images produced in study. The set of images may include every image in the study, or it may be an incomplete sample, such as a list of key images.
*/
IMAGINGSTUDY("ImagingStudy"),
/**
* Immunization
*
* Code Value: <b>Immunization</b>
*
* Immunization event information.
*/
IMMUNIZATION("Immunization"),
/**
* ImmunizationRecommendation
*
* Code Value: <b>ImmunizationRecommendation</b>
*
* A patient's point-of-time immunization status and recommendation with optional supporting justification.
*/
IMMUNIZATIONRECOMMENDATION("ImmunizationRecommendation"),
/**
* List
*
* Code Value: <b>List</b>
*
* A set of information summarized from a list of other resources.
*/
LIST("List"),
/**
* Location
*
* Code Value: <b>Location</b>
*
* Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated.
*/
LOCATION("Location"),
/**
* Media
*
* Code Value: <b>Media</b>
*
* A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.
*/
MEDIA("Media"),
/**
* Medication
*
* Code Value: <b>Medication</b>
*
* Primarily used for identification and definition of Medication, but also covers ingredients and packaging.
*/
MEDICATION("Medication"),
/**
* MedicationAdministration
*
* Code Value: <b>MedicationAdministration</b>
*
* Describes the event of a patient being given a dose of a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.
*/
MEDICATIONADMINISTRATION("MedicationAdministration"),
/**
* MedicationDispense
*
* Code Value: <b>MedicationDispense</b>
*
* Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication.
*/
MEDICATIONDISPENSE("MedicationDispense"),
/**
* MedicationPrescription
*
* Code Value: <b>MedicationPrescription</b>
*
* An order for both supply of the medication and the instructions for administration of the medicine to a patient.
*/
MEDICATIONPRESCRIPTION("MedicationPrescription"),
/**
* MedicationStatement
*
* Code Value: <b>MedicationStatement</b>
*
* A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician.
*/
MEDICATIONSTATEMENT("MedicationStatement"),
/**
* MessageHeader
*
* Code Value: <b>MessageHeader</b>
*
* The header for a message exchange that is either requesting or responding to an action. The resource(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.
*/
MESSAGEHEADER("MessageHeader"),
/**
* Observation
*
* Code Value: <b>Observation</b>
*
* Measurements and simple assertions made about a patient, device or other subject.
*/
OBSERVATION("Observation"),
/**
* OperationOutcome
*
* Code Value: <b>OperationOutcome</b>
*
* A collection of error, warning or information messages that result from a system action.
*/
OPERATIONOUTCOME("OperationOutcome"),
/**
* Order
*
* Code Value: <b>Order</b>
*
* A request to perform an action.
*/
ORDER("Order"),
/**
* OrderResponse
*
* Code Value: <b>OrderResponse</b>
*
* A response to an order.
*/
ORDERRESPONSE("OrderResponse"),
/**
* Organization
*
* Code Value: <b>Organization</b>
*
* A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.
*/
ORGANIZATION("Organization"),
/**
* Other
*
* Code Value: <b>Other</b>
*
* Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest.
*/
OTHER("Other"),
/**
* Patient
*
* Code Value: <b>Patient</b>
*
* Demographics and other administrative information about a person or animal receiving care or other health-related services.
*/
PATIENT("Patient"),
/**
* Practitioner
*
* Code Value: <b>Practitioner</b>
*
* A person who is directly or indirectly involved in the provisioning of healthcare.
*/
PRACTITIONER("Practitioner"),
/**
* Procedure
*
* Code Value: <b>Procedure</b>
*
* An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy.
*/
PROCEDURE("Procedure"),
/**
* Profile
*
* Code Value: <b>Profile</b>
*
* A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.
*/
PROFILE("Profile"),
/**
* Provenance
*
* Code Value: <b>Provenance</b>
*
* Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.
*/
PROVENANCE("Provenance"),
/**
* Query
*
* Code Value: <b>Query</b>
*
* A description of a query with a set of parameters.
*/
QUERY("Query"),
/**
* Questionnaire
*
* Code Value: <b>Questionnaire</b>
*
* A structured set of questions and their answers. The Questionnaire may contain questions, answers or both. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.
*/
QUESTIONNAIRE("Questionnaire"),
/**
* RelatedPerson
*
* Code Value: <b>RelatedPerson</b>
*
* Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.
*/
RELATEDPERSON("RelatedPerson"),
/**
* SecurityEvent
*
* Code Value: <b>SecurityEvent</b>
*
* A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.
*/
SECURITYEVENT("SecurityEvent"),
/**
* Specimen
*
* Code Value: <b>Specimen</b>
*
* Sample for analysis.
*/
SPECIMEN("Specimen"),
/**
* Substance
*
* Code Value: <b>Substance</b>
*
* A homogeneous material with a definite composition.
*/
SUBSTANCE("Substance"),
/**
* Supply
*
* Code Value: <b>Supply</b>
*
* A supply - a request for something, and provision of what is supplied.
*/
SUPPLY("Supply"),
/**
* ValueSet
*
* Code Value: <b>ValueSet</b>
*
* A value set specifies a set of codes drawn from one or more code systems.
*/

View File

@ -8,48 +8,42 @@ import java.util.Map;
public enum FilterOperatorEnum {
/**
* =
*
* Code Value: <b>=</b>
*
* The property value has the concept specified by the value.
*/
EQUALS("="),
/**
* is-a
*
* Code Value: <b>is-a</b>
*
* The property value has a concept that has an is-a relationship with the value.
*/
IS_A("is-a"),
/**
* is-not-a
*
* Code Value: <b>is-not-a</b>
*
* The property value has a concept that does not have an is-a relationship with the value.
*/
IS_NOT_A("is-not-a"),
/**
* regex
*
* Code Value: <b>regex</b>
*
* The property value representation matches the regex specified in the value.
*/
REGEX("regex"),
/**
* in
*
* Code Value: <b>in</b>
*
* The property value is in the set of codes or concepts identified by the value.
*/
IN("in"),
/**
* not in
*
* Code Value: <b>not in</b>
*
* The property value is not in the set of codes or concepts identified by the value.
*/

View File

@ -8,48 +8,42 @@ import java.util.Map;
public enum GroupTypeEnum {
/**
* person
*
* Code Value: <b>person</b>
*
* Group contains "person" Patient resources.
*/
PERSON("person"),
/**
* animal
*
* Code Value: <b>animal</b>
*
* Group contains "animal" Patient resources.
*/
ANIMAL("animal"),
/**
* practitioner
*
* Code Value: <b>practitioner</b>
*
* Group contains healthcare practitioner resources.
*/
PRACTITIONER("practitioner"),
/**
* device
*
* Code Value: <b>device</b>
*
* Group contains Device resources.
*/
DEVICE("device"),
/**
* medication
*
* Code Value: <b>medication</b>
*
* Group contains Medication resources.
*/
MEDICATION("medication"),
/**
* substance
*
* Code Value: <b>substance</b>
*
* Group contains Substance resources.
*/

View File

@ -8,16 +8,16 @@ import java.util.Map;
public enum HierarchicalRelationshipTypeEnum {
/**
* parent
* Parent
* Display: <b>Parent</b><br/>
* Code Value: <b>parent</b>
*
* The target resource is the parent of the focal specimen resource.
*/
PARENT("parent"),
/**
* child
* Child
* Display: <b>Child</b><br/>
* Code Value: <b>child</b>
*
* The target resource is the child of the focal specimen resource.
*/

View File

@ -8,32 +8,28 @@ import java.util.Map;
public enum IdentifierUseEnum {
/**
* usual
*
* Code Value: <b>usual</b>
*
* the identifier recommended for display and use in real-world interactions.
*/
USUAL("usual"),
/**
* official
*
* Code Value: <b>official</b>
*
* the identifier considered to be most trusted for the identification of this item.
*/
OFFICIAL("official"),
/**
* temp
*
* Code Value: <b>temp</b>
*
* A temporary identifier.
*/
TEMP("temp"),
/**
* secondary
*
* Code Value: <b>secondary</b>
*
* An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context.
*/

View File

@ -8,24 +8,21 @@ import java.util.Map;
public enum LinkTypeEnum {
/**
* replace
*
* Code Value: <b>replace</b>
*
* The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link.
*/
REPLACE("replace"),
/**
* refer
*
* Code Value: <b>refer</b>
*
* The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information.
*/
REFER("refer"),
/**
* seealso
*
* Code Value: <b>seealso</b>
*
* The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid.
*/

View File

@ -8,16 +8,14 @@ import java.util.Map;
public enum LocationModeEnum {
/**
* instance
*
* Code Value: <b>instance</b>
*
* The Location resource represents a specific instance of a Location.
*/
INSTANCE("instance"),
/**
* kind
*
* Code Value: <b>kind</b>
*
* The Location represents a class of Locations.
*/

View File

@ -8,24 +8,21 @@ import java.util.Map;
public enum LocationStatusEnum {
/**
* active
*
* Code Value: <b>active</b>
*
* The location is operational.
*/
ACTIVE("active"),
/**
* suspended
*
* Code Value: <b>suspended</b>
*
* The location is temporarily closed.
*/
SUSPENDED("suspended"),
/**
* inactive
*
* Code Value: <b>inactive</b>
*
* The location is no longer used.
*/

View File

@ -8,68 +8,52 @@ import java.util.Map;
public enum LocationTypeEnum {
/**
* bu
* Building
*
*
* Display: <b>Building</b><br/>
* Code Value: <b>bu</b>
*/
BU("bu"),
BUILDING("bu"),
/**
* wi
* Wing
*
*
* Display: <b>Wing</b><br/>
* Code Value: <b>wi</b>
*/
WI("wi"),
WING("wi"),
/**
* co
* Corridor
*
*
* Display: <b>Corridor</b><br/>
* Code Value: <b>co</b>
*/
CO("co"),
CORRIDOR("co"),
/**
* ro
* Room
*
*
* Display: <b>Room</b><br/>
* Code Value: <b>ro</b>
*/
RO("ro"),
ROOM("ro"),
/**
* ve
* Vehicle
*
*
* Display: <b>Vehicle</b><br/>
* Code Value: <b>ve</b>
*/
VE("ve"),
VEHICLE("ve"),
/**
* ho
* House
*
*
* Display: <b>House</b><br/>
* Code Value: <b>ho</b>
*/
HO("ho"),
HOUSE("ho"),
/**
* ca
* Cabinet
*
*
* Display: <b>Cabinet</b><br/>
* Code Value: <b>ca</b>
*/
CA("ca"),
CABINET("ca"),
/**
* rd
* Road
*
*
* Display: <b>Road</b><br/>
* Code Value: <b>rd</b>
*/
RD("rd"),
ROAD("rd"),
;

View File

@ -8,16 +8,14 @@ import java.util.Map;
public enum MedicationKindEnum {
/**
* product
*
* Code Value: <b>product</b>
*
* The medication is a product.
*/
PRODUCT("product"),
/**
* package
*
* Code Value: <b>package</b>
*
* The medication is a package - a contained group of one of more products.
*/

View File

@ -8,56 +8,49 @@ import java.util.Map;
public enum NameUseEnum {
/**
* usual
*
* Code Value: <b>usual</b>
*
* Known as/conventional/the one you normally use.
*/
USUAL("usual"),
/**
* official
*
* Code Value: <b>official</b>
*
* The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name".
*/
OFFICIAL("official"),
/**
* temp
*
* Code Value: <b>temp</b>
*
* A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations.
*/
TEMP("temp"),
/**
* nickname
*
* Code Value: <b>nickname</b>
*
* A name that is used to address the person in an informal manner, but is not part of their formal or usual name.
*/
NICKNAME("nickname"),
/**
* anonymous
*
* Code Value: <b>anonymous</b>
*
* Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons).
*/
ANONYMOUS("anonymous"),
/**
* old
*
* Code Value: <b>old</b>
*
* This name is no longer in use (or was never correct, but retained for records).
*/
OLD("old"),
/**
* maiden
*
* Code Value: <b>maiden</b>
*
* A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically.
*/

View File

@ -8,56 +8,49 @@ import java.util.Map;
public enum ObservationRelationshipTypeEnum {
/**
* has-component
*
* Code Value: <b>has-component</b>
*
* The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure).
*/
HAS_COMPONENT("has-component"),
/**
* has-member
*
* Code Value: <b>has-member</b>
*
* This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.
*/
HAS_MEMBER("has-member"),
/**
* derived-from
*
* Code Value: <b>derived-from</b>
*
* The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score).
*/
DERIVED_FROM("derived-from"),
/**
* sequel-to
*
* Code Value: <b>sequel-to</b>
*
* This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test).
*/
SEQUEL_TO("sequel-to"),
/**
* replaces
*
* Code Value: <b>replaces</b>
*
* This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete.
*/
REPLACES("replaces"),
/**
* qualified-by
*
* Code Value: <b>qualified-by</b>
*
* The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure).
*/
QUALIFIED_BY("qualified-by"),
/**
* interfered-by
*
* Code Value: <b>interfered-by</b>
*
* The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value).
*/

View File

@ -8,56 +8,49 @@ import java.util.Map;
public enum ObservationReliabilityEnum {
/**
* ok
*
* Code Value: <b>ok</b>
*
* The result has no reliability concerns.
*/
OK("ok"),
/**
* ongoing
*
* Code Value: <b>ongoing</b>
*
* An early estimate of value; measurement is still occurring.
*/
ONGOING("ongoing"),
/**
* early
*
* Code Value: <b>early</b>
*
* An early estimate of value; processing is still occurring.
*/
EARLY("early"),
/**
* questionable
*
* Code Value: <b>questionable</b>
*
* The observation value should be treated with care.
*/
QUESTIONABLE("questionable"),
/**
* calibrating
*
* Code Value: <b>calibrating</b>
*
* The result has been generated while calibration is occurring.
*/
CALIBRATING("calibrating"),
/**
* error
*
* Code Value: <b>error</b>
*
* The observation could not be completed because of an error.
*/
ERROR("error"),
/**
* unknown
*
* Code Value: <b>unknown</b>
*
* No observation value was available.
*/

View File

@ -8,48 +8,42 @@ import java.util.Map;
public enum ObservationStatusEnum {
/**
* registered
*
* Code Value: <b>registered</b>
*
* The existence of the observation is registered, but there is no result yet available.
*/
REGISTERED("registered"),
/**
* preliminary
*
* Code Value: <b>preliminary</b>
*
* This is an initial or interim observation: data may be incomplete or unverified.
*/
PRELIMINARY("preliminary"),
/**
* final
*
* Code Value: <b>final</b>
*
* The observation is complete and verified by an authorized person.
*/
FINAL("final"),
/**
* amended
*
* Code Value: <b>amended</b>
*
* The observation has been modified subsequent to being Final, and is complete and verified by an authorized person.
*/
AMENDED("amended"),
/**
* cancelled
*
* Code Value: <b>cancelled</b>
*
* The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted").
*/
CANCELLED("cancelled"),
/**
* entered in error
*
* Code Value: <b>entered in error</b>
*
* The observation has been withdrawn following previous Final release.
*/

View File

@ -8,76 +8,58 @@ import java.util.Map;
public enum OrganizationTypeEnum {
/**
* prov
* Healthcare Provider
*
*
* Display: <b>Healthcare Provider</b><br/>
* Code Value: <b>prov</b>
*/
PROV("prov"),
HEALTHCARE_PROVIDER("prov"),
/**
* dept
* Hospital Department
*
*
* Display: <b>Hospital Department</b><br/>
* Code Value: <b>dept</b>
*/
DEPT("dept"),
HOSPITAL_DEPARTMENT("dept"),
/**
* icu
* Intensive Care Unit
*
*
* Display: <b>Intensive Care Unit</b><br/>
* Code Value: <b>icu</b>
*/
ICU("icu"),
INTENSIVE_CARE_UNIT("icu"),
/**
* team
* Organizational team
*
*
* Display: <b>Organizational team</b><br/>
* Code Value: <b>team</b>
*/
TEAM("team"),
ORGANIZATIONAL_TEAM("team"),
/**
* fed
* Federal Government
*
*
* Display: <b>Federal Government</b><br/>
* Code Value: <b>fed</b>
*/
FED("fed"),
FEDERAL_GOVERNMENT("fed"),
/**
* ins
* Insurance Company
*
*
* Display: <b>Insurance Company</b><br/>
* Code Value: <b>ins</b>
*/
INS("ins"),
INSURANCE_COMPANY("ins"),
/**
* edu
* Educational Institute
*
*
* Display: <b>Educational Institute</b><br/>
* Code Value: <b>edu</b>
*/
EDU("edu"),
EDUCATIONAL_INSTITUTE("edu"),
/**
* reli
* Religious Institution
*
*
* Display: <b>Religious Institution</b><br/>
* Code Value: <b>reli</b>
*/
RELI("reli"),
RELIGIOUS_INSTITUTION("reli"),
/**
* pharm
* Pharmacy
*
*
* Display: <b>Pharmacy</b><br/>
* Code Value: <b>pharm</b>
*/
PHARM("pharm"),
PHARMACY("pharm"),
;

View File

@ -8,52 +8,36 @@ import java.util.Map;
public enum PractitionerRoleEnum {
/**
* doctor
*
*
*
* Code Value: <b>doctor</b>
*/
DOCTOR("doctor"),
/**
* nurse
*
*
*
* Code Value: <b>nurse</b>
*/
NURSE("nurse"),
/**
* pharmacist
*
*
*
* Code Value: <b>pharmacist</b>
*/
PHARMACIST("pharmacist"),
/**
* researcher
*
*
*
* Code Value: <b>researcher</b>
*/
RESEARCHER("researcher"),
/**
* teacher
* Teacher/educator
*
*
* Display: <b>Teacher/educator</b><br/>
* Code Value: <b>teacher</b>
*/
TEACHER("teacher"),
TEACHER_EDUCATOR("teacher"),
/**
* ict
* ICT professional
*
*
* Display: <b>ICT professional</b><br/>
* Code Value: <b>ict</b>
*/
ICT("ict"),
ICT_PROFESSIONAL("ict"),
;

View File

@ -8,44 +8,34 @@ import java.util.Map;
public enum PractitionerSpecialtyEnum {
/**
* cardio
* Cardiologist
*
*
* Display: <b>Cardiologist</b><br/>
* Code Value: <b>cardio</b>
*/
CARDIO("cardio"),
CARDIOLOGIST("cardio"),
/**
* dent
* Dentist
*
*
* Display: <b>Dentist</b><br/>
* Code Value: <b>dent</b>
*/
DENT("dent"),
DENTIST("dent"),
/**
* dietary
* Dietary consultant
*
*
* Display: <b>Dietary consultant</b><br/>
* Code Value: <b>dietary</b>
*/
DIETARY("dietary"),
DIETARY_CONSULTANT("dietary"),
/**
* midw
* Midwife
*
*
* Display: <b>Midwife</b><br/>
* Code Value: <b>midw</b>
*/
MIDW("midw"),
MIDWIFE("midw"),
/**
* sysarch
* Systems architect
*
*
* Display: <b>Systems architect</b><br/>
* Code Value: <b>sysarch</b>
*/
SYSARCH("sysarch"),
SYSTEMS_ARCHITECT("sysarch"),
;

View File

@ -8,8 +8,7 @@ import java.util.Map;
public enum PropertyRepresentationEnum {
/**
* xmlAttr
*
* Code Value: <b>xmlAttr</b>
*
* In XML, this property is represented as an attribute not an element.
*/

View File

@ -8,32 +8,28 @@ import java.util.Map;
public enum QuantityCompararatorEnum {
/**
* <
*
* Code Value: <b><</b>
*
* The actual value is less than the given value.
*/
LESSTHAN("<"),
/**
* <=
*
* Code Value: <b><=</b>
*
* The actual value is less than or equal to the given value.
*/
LESSTHAN_OR_EQUALS("<="),
/**
* >=
*
* Code Value: <b>>=</b>
*
* The actual value is greater than or equal to the given value.
*/
GREATERTHAN_OR_EQUALS(">="),
/**
* >
*
* Code Value: <b>></b>
*
* The actual value is greater than the given value.
*/

View File

@ -8,24 +8,21 @@ import java.util.Map;
public enum ResourceProfileStatusEnum {
/**
* draft
*
* Code Value: <b>draft</b>
*
* This profile is still under development.
*/
DRAFT("draft"),
/**
* active
*
* Code Value: <b>active</b>
*
* This profile is ready for normal use.
*/
ACTIVE("active"),
/**
* retired
*
* Code Value: <b>retired</b>
*
* This profile has been deprecated, withdrawn or superseded and should no longer be used.
*/

View File

@ -8,384 +8,336 @@ import java.util.Map;
public enum ResourceTypeEnum {
/**
* AdverseReaction
*
* Code Value: <b>AdverseReaction</b>
*
* Records an unexpected reaction suspected to be related to the exposure of the reaction subject to a substance.
*/
ADVERSEREACTION("AdverseReaction"),
/**
* Alert
*
* Code Value: <b>Alert</b>
*
* Prospective warnings of potential issues when providing care to the patient.
*/
ALERT("Alert"),
/**
* AllergyIntolerance
*
* Code Value: <b>AllergyIntolerance</b>
*
* Indicates the patient has a susceptibility to an adverse reaction upon exposure to a specified substance.
*/
ALLERGYINTOLERANCE("AllergyIntolerance"),
/**
* CarePlan
*
* Code Value: <b>CarePlan</b>
*
* Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions.
*/
CAREPLAN("CarePlan"),
/**
* Composition
*
* Code Value: <b>Composition</b>
*
* A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement.
*/
COMPOSITION("Composition"),
/**
* ConceptMap
*
* Code Value: <b>ConceptMap</b>
*
* A statement of relationships from one set of concepts to one or more other concept systems.
*/
CONCEPTMAP("ConceptMap"),
/**
* Condition
*
* Code Value: <b>Condition</b>
*
* Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary.
*/
CONDITION("Condition"),
/**
* Conformance
*
* Code Value: <b>Conformance</b>
*
* A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation.
*/
CONFORMANCE("Conformance"),
/**
* Device
*
* Code Value: <b>Device</b>
*
* This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health.
*/
DEVICE("Device"),
/**
* DeviceObservationReport
*
* Code Value: <b>DeviceObservationReport</b>
*
* Describes the data produced by a device at a point in time.
*/
DEVICEOBSERVATIONREPORT("DeviceObservationReport"),
/**
* DiagnosticOrder
*
* Code Value: <b>DiagnosticOrder</b>
*
* A request for a diagnostic investigation service to be performed.
*/
DIAGNOSTICORDER("DiagnosticOrder"),
/**
* DiagnosticReport
*
* Code Value: <b>DiagnosticReport</b>
*
* The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports.
*/
DIAGNOSTICREPORT("DiagnosticReport"),
/**
* DocumentManifest
*
* Code Value: <b>DocumentManifest</b>
*
* A manifest that defines a set of documents.
*/
DOCUMENTMANIFEST("DocumentManifest"),
/**
* DocumentReference
*
* Code Value: <b>DocumentReference</b>
*
* A reference to a document.
*/
DOCUMENTREFERENCE("DocumentReference"),
/**
* Encounter
*
* Code Value: <b>Encounter</b>
*
* An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient.
*/
ENCOUNTER("Encounter"),
/**
* FamilyHistory
*
* Code Value: <b>FamilyHistory</b>
*
* Significant health events and conditions for people related to the subject relevant in the context of care for the subject.
*/
FAMILYHISTORY("FamilyHistory"),
/**
* Group
*
* Code Value: <b>Group</b>
*
* Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization.
*/
GROUP("Group"),
/**
* ImagingStudy
*
* Code Value: <b>ImagingStudy</b>
*
* Manifest of a set of images produced in study. The set of images may include every image in the study, or it may be an incomplete sample, such as a list of key images.
*/
IMAGINGSTUDY("ImagingStudy"),
/**
* Immunization
*
* Code Value: <b>Immunization</b>
*
* Immunization event information.
*/
IMMUNIZATION("Immunization"),
/**
* ImmunizationRecommendation
*
* Code Value: <b>ImmunizationRecommendation</b>
*
* A patient's point-of-time immunization status and recommendation with optional supporting justification.
*/
IMMUNIZATIONRECOMMENDATION("ImmunizationRecommendation"),
/**
* List
*
* Code Value: <b>List</b>
*
* A set of information summarized from a list of other resources.
*/
LIST("List"),
/**
* Location
*
* Code Value: <b>Location</b>
*
* Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated.
*/
LOCATION("Location"),
/**
* Media
*
* Code Value: <b>Media</b>
*
* A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference.
*/
MEDIA("Media"),
/**
* Medication
*
* Code Value: <b>Medication</b>
*
* Primarily used for identification and definition of Medication, but also covers ingredients and packaging.
*/
MEDICATION("Medication"),
/**
* MedicationAdministration
*
* Code Value: <b>MedicationAdministration</b>
*
* Describes the event of a patient being given a dose of a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner.
*/
MEDICATIONADMINISTRATION("MedicationAdministration"),
/**
* MedicationDispense
*
* Code Value: <b>MedicationDispense</b>
*
* Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication.
*/
MEDICATIONDISPENSE("MedicationDispense"),
/**
* MedicationPrescription
*
* Code Value: <b>MedicationPrescription</b>
*
* An order for both supply of the medication and the instructions for administration of the medicine to a patient.
*/
MEDICATIONPRESCRIPTION("MedicationPrescription"),
/**
* MedicationStatement
*
* Code Value: <b>MedicationStatement</b>
*
* A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician.
*/
MEDICATIONSTATEMENT("MedicationStatement"),
/**
* MessageHeader
*
* Code Value: <b>MessageHeader</b>
*
* The header for a message exchange that is either requesting or responding to an action. The resource(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle.
*/
MESSAGEHEADER("MessageHeader"),
/**
* Observation
*
* Code Value: <b>Observation</b>
*
* Measurements and simple assertions made about a patient, device or other subject.
*/
OBSERVATION("Observation"),
/**
* OperationOutcome
*
* Code Value: <b>OperationOutcome</b>
*
* A collection of error, warning or information messages that result from a system action.
*/
OPERATIONOUTCOME("OperationOutcome"),
/**
* Order
*
* Code Value: <b>Order</b>
*
* A request to perform an action.
*/
ORDER("Order"),
/**
* OrderResponse
*
* Code Value: <b>OrderResponse</b>
*
* A response to an order.
*/
ORDERRESPONSE("OrderResponse"),
/**
* Organization
*
* Code Value: <b>Organization</b>
*
* A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc.
*/
ORGANIZATION("Organization"),
/**
* Other
*
* Code Value: <b>Other</b>
*
* Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest.
*/
OTHER("Other"),
/**
* Patient
*
* Code Value: <b>Patient</b>
*
* Demographics and other administrative information about a person or animal receiving care or other health-related services.
*/
PATIENT("Patient"),
/**
* Practitioner
*
* Code Value: <b>Practitioner</b>
*
* A person who is directly or indirectly involved in the provisioning of healthcare.
*/
PRACTITIONER("Practitioner"),
/**
* Procedure
*
* Code Value: <b>Procedure</b>
*
* An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy.
*/
PROCEDURE("Procedure"),
/**
* Profile
*
* Code Value: <b>Profile</b>
*
* A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions.
*/
PROFILE("Profile"),
/**
* Provenance
*
* Code Value: <b>Provenance</b>
*
* Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance.
*/
PROVENANCE("Provenance"),
/**
* Query
*
* Code Value: <b>Query</b>
*
* A description of a query with a set of parameters.
*/
QUERY("Query"),
/**
* Questionnaire
*
* Code Value: <b>Questionnaire</b>
*
* A structured set of questions and their answers. The Questionnaire may contain questions, answers or both. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions.
*/
QUESTIONNAIRE("Questionnaire"),
/**
* RelatedPerson
*
* Code Value: <b>RelatedPerson</b>
*
* Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process.
*/
RELATEDPERSON("RelatedPerson"),
/**
* SecurityEvent
*
* Code Value: <b>SecurityEvent</b>
*
* A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage.
*/
SECURITYEVENT("SecurityEvent"),
/**
* Specimen
*
* Code Value: <b>Specimen</b>
*
* Sample for analysis.
*/
SPECIMEN("Specimen"),
/**
* Substance
*
* Code Value: <b>Substance</b>
*
* A homogeneous material with a definite composition.
*/
SUBSTANCE("Substance"),
/**
* Supply
*
* Code Value: <b>Supply</b>
*
* A supply - a request for something, and provision of what is supplied.
*/
SUPPLY("Supply"),
/**
* ValueSet
*
* Code Value: <b>ValueSet</b>
*
* A value set specifies a set of codes drawn from one or more code systems.
*/

View File

@ -8,56 +8,49 @@ import java.util.Map;
public enum SearchParamTypeEnum {
/**
* number
*
* Code Value: <b>number</b>
*
* Search parameter SHALL be a number (a whole number, or a decimal).
*/
NUMBER("number"),
/**
* date
*
* Code Value: <b>date</b>
*
* Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported.
*/
DATE("date"),
/**
* string
*
* Code Value: <b>string</b>
*
* Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces.
*/
STRING("string"),
/**
* token
*
* Code Value: <b>token</b>
*
* Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used.
*/
TOKEN("token"),
/**
* reference
*
* Code Value: <b>reference</b>
*
* A reference to another resource.
*/
REFERENCE("reference"),
/**
* composite
*
* Code Value: <b>composite</b>
*
* A composite search parameter that combines a search on two values together.
*/
COMPOSITE("composite"),
/**
* quantity
*
* Code Value: <b>quantity</b>
*
* A search parameter that searches on a quantity.
*/

View File

@ -8,24 +8,21 @@ import java.util.Map;
public enum SlicingRulesEnum {
/**
* closed
*
* Code Value: <b>closed</b>
*
* No additional content is allowed other than that described by the slices in this profile.
*/
CLOSED("closed"),
/**
* open
*
* Code Value: <b>open</b>
*
* Additional content is allowed anywhere in the list.
*/
OPEN("open"),
/**
* openAtEnd
*
* Code Value: <b>openAtEnd</b>
*
* Additional content is allowed, but only at the end of the list.
*/

View File

@ -0,0 +1,71 @@
package ca.uhn.fhir.model.dstu.valueset;
import ca.uhn.fhir.model.api.*;
import java.util.HashMap;
import java.util.Map;
public enum UnitsOfTimeEnum {
;
/**
* Identifier for this Value Set:
* http://hl7.org/fhir/vs/units-of-time
*/
public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/units-of-time";
/**
* Name for this Value Set:
* UnitsOfTime
*/
public static final String VALUESET_NAME = "UnitsOfTime";
private static Map<String, UnitsOfTimeEnum> CODE_TO_ENUM = new HashMap<String, UnitsOfTimeEnum>();
private String myCode;
static {
for (UnitsOfTimeEnum next : UnitsOfTimeEnum.values()) {
CODE_TO_ENUM.put(next.getCode(), next);
}
}
/**
* Returns the code associated with this enumerated value
*/
public String getCode() {
return myCode;
}
/**
* Returns the enumerated value associated with this code
*/
public UnitsOfTimeEnum forCode(String theCode) {
UnitsOfTimeEnum retVal = CODE_TO_ENUM.get(theCode);
return retVal;
}
/**
* Converts codes to their respective enumerated values
*/
public static final IValueSetEnumBinder<UnitsOfTimeEnum> VALUESET_BINDER = new IValueSetEnumBinder<UnitsOfTimeEnum>() {
@Override
public String toCodeString(UnitsOfTimeEnum theEnum) {
return theEnum.getCode();
}
@Override
public UnitsOfTimeEnum fromCodeString(String theCodeString) {
return CODE_TO_ENUM.get(theCodeString);
}
};
/**
* Constructor
*/
UnitsOfTimeEnum(String theCode) {
myCode = theCode;
}
}

View File

@ -8,24 +8,21 @@ import java.util.Map;
public enum ValueSetStatusEnum {
/**
* draft
*
* Code Value: <b>draft</b>
*
* This valueset is still under development.
*/
DRAFT("draft"),
/**
* active
*
* Code Value: <b>active</b>
*
* This valueset is ready for normal use.
*/
ACTIVE("active"),
/**
* retired
*
* Code Value: <b>retired</b>
*
* This valueset has been withdrawn or superceded and should no longer be used.
*/

View File

@ -39,7 +39,7 @@ public class IdDt extends BaseElement implements IPrimitiveDatatype<String> {
*/
@SimpleSetter
public IdDt(@SimpleSetter.Parameter(name="theId") String theValue) {
myValue=theValue;
setValue(theValue);
}
@Override
@ -65,6 +65,7 @@ public class IdDt extends BaseElement implements IPrimitiveDatatype<String> {
*/
@Override
public void setValue(String theValue) throws DataFormatException {
// TODO: add validation
myValue = theValue;
}
@ -81,8 +82,12 @@ public class IdDt extends BaseElement implements IPrimitiveDatatype<String> {
*/
@Override
public void setValueAsString(String theValue) throws DataFormatException {
myValue = theValue;
setValue(theValue);
}
@Override
public String toString() {
return myValue;
}
}

View File

@ -3,6 +3,8 @@ package ca.uhn.fhir.model.primitive;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
@ -55,10 +57,15 @@ public class UriDt extends BaseElement implements IPrimitiveDatatype<URI> {
if (myValue == null) {
return null;
} else {
return myValue.toString();
return myValue.toASCIIString();
}
}
@Override
public String toString() {
return getValueAsString();
}
@Override
public int hashCode() {
final int prime = 31;
@ -67,6 +74,15 @@ public class UriDt extends BaseElement implements IPrimitiveDatatype<URI> {
return result;
}
/**
* Compares the given string to the string representation of this URI. In many cases it is preferable
* to use this instead of the standard {@link #equals(Object)} method, since that method returns <code>false</code>
* unless it is passed an instance of {@link UriDt}
*/
public boolean equals(String theString) {
return StringUtils.equals(getValueAsString(), theString);
}
@Override
public boolean equals(Object obj) {
if (this == obj)

View File

@ -9,4 +9,16 @@ import java.lang.annotation.Target;
@Target(ElementType.METHOD)
public @interface Read {
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface IdParam {
// just a marker
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface VersionIdParam {
// just a marker
}
}

View File

@ -0,0 +1,53 @@
package ca.uhn.fhir.rest.server;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
abstract class BaseMethod {
public enum ReturnTypeEnum {
RESOURCE, BUNDLE
}
private Resource resource;
public Resource getResource() {
return resource;
}
public abstract ReturnTypeEnum getReturnType();
public abstract boolean matches(String theResourceName, IdDt theId, IdDt theVersion, Set<String> theParameterNames);
public void setResource(Resource theResource) {
this.resource = theResource;
}
public abstract List<IResource> invoke(IResourceProvider theResourceProvider, IdDt theId, IdDt theVersionId, Map<String, String[]> theParameterValues) throws InvalidRequestException,
InternalErrorException;
protected static List<IResource> toResourceList(Object response) throws InternalErrorException {
if (response == null) {
return Collections.emptyList();
} else if (response instanceof IResource) {
return Collections.singletonList((IResource) response);
} else if (response instanceof Collection) {
List<IResource> retVal = new ArrayList<IResource>();
for (Object next : ((Collection<?>) response)) {
retVal.add((IResource) next);
}
return retVal;
} else {
throw new InternalErrorException("Unexpected return type: " + response.getClass().getCanonicalName());
}
}
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server;
package ca.uhn.fhir.rest.server;
public class Constants {

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server;
package ca.uhn.fhir.rest.server;
public enum EncodingUtil {

View File

@ -0,0 +1,14 @@
package ca.uhn.fhir.rest.server;
import ca.uhn.fhir.model.api.IResource;
public interface IResourceProvider {
/**
* Returns the type of resource returned by this provider
*
* @return Returns the type of resource returned by this provider
*/
Class<? extends IResource> getResourceType();
}

View File

@ -1,8 +1,10 @@
package ca.uhn.fhir.server;
package ca.uhn.fhir.rest.server;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
import ca.uhn.fhir.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
/**
* Created by dsotnikov on 2/25/2014.
@ -26,17 +28,30 @@ public class Parameter {
public void setType(final Class<?> type) {
this.type = type;
if (IdentifierDt.class.isAssignableFrom(type)) {
if (type.getSimpleName().equals("IdentifierDt")) {
this.parser = new IParser() {
@Override
public Object parse(String theString) throws InternalErrorException {
IdentifierDt dt;
Object dt;
try {
dt = (IdentifierDt) type.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
dt = type.newInstance();
Method method = dt.getClass().getMethod("setValueAsQueryToken", String.class);
method.invoke(dt, theString);
} catch (InstantiationException e) {
throw new InternalErrorException(e);
} catch (IllegalAccessException e) {
throw new InternalErrorException(e);
} catch (NoSuchMethodException e) {
throw new InternalErrorException(e);
} catch (SecurityException e) {
throw new InternalErrorException(e);
} catch (IllegalArgumentException e) {
throw new InternalErrorException(e);
} catch (InvocationTargetException e) {
throw new InternalErrorException(e);
}
dt.setValueAsQueryToken(theString);
return dt;
}
};

View File

@ -0,0 +1,83 @@
package ca.uhn.fhir.rest.server;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.Validate;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
class ReadMethod extends BaseMethod {
private Method myMethod;
private Integer myIdIndex;
private Integer myVersionIdIndex;
private int myParameterCount;
ReadMethod(Method theMethod, Integer theIdIndex, Integer theVersionIdIndex) {
Validate.notNull(theMethod, "Method must not be null");
Validate.notNull(theIdIndex, "ID Index must not be null");
myMethod = theMethod;
myIdIndex = theIdIndex;
myVersionIdIndex = theVersionIdIndex;
myParameterCount = myMethod.getParameterTypes().length;
Class<?>[] parameterTypes = theMethod.getParameterTypes();
if (!IdDt.class.equals(parameterTypes[myIdIndex])) {
throw new ConfigurationException("ID parameter must be of type: " + IdDt.class.getCanonicalName() + " - Found: "+parameterTypes[myIdIndex]);
}
if (myVersionIdIndex != null && !IdDt.class.equals(parameterTypes[myVersionIdIndex])) {
throw new ConfigurationException("Version ID parameter must be of type: " + IdDt.class.getCanonicalName()+ " - Found: "+parameterTypes[myVersionIdIndex]);
}
}
@Override
public boolean matches(String theResourceName, IdDt theId, IdDt theVersion, Set<String> theParameterNames) {
if (!theResourceName.equals(getResource().getResourceName())) {
return false;
}
if (theParameterNames.isEmpty() == false) {
return false;
}
if ((theVersion == null) != (myVersionIdIndex == null)) {
return false;
}
if (theId == null) {
return false;
}
return true;
}
@Override
public ReturnTypeEnum getReturnType() {
return ReturnTypeEnum.RESOURCE;
}
@Override
public List<IResource> invoke(IResourceProvider theResourceProvider, IdDt theId, IdDt theVersionId, Map<String, String[]> theParameterValues) throws InvalidRequestException,
InternalErrorException {
Object[] params = new Object[myParameterCount];
params[myIdIndex] = theId;
if (myVersionIdIndex != null) {
params[myVersionIdIndex] = theVersionId;
}
Object response;
try {
response = myMethod.invoke(theResourceProvider, params);
} catch (Exception e) {
throw new InternalErrorException("Failed to call access method",e);
}
return toResourceList(response);
}
}

View File

@ -0,0 +1,87 @@
package ca.uhn.fhir.rest.server;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import ca.uhn.fhir.model.primitive.IdDt;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class Resource {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(Resource.class);
private String resourceName;
private List<BaseMethod> methods = new ArrayList<BaseMethod>();
private IResourceProvider resourceProvider;
public Resource() {
}
public Resource(String resourceName, List<BaseMethod> methods) {
this.resourceName = resourceName;
this.methods = methods;
}
public BaseMethod getMethod(String theResourceName, IdDt theId, IdDt theVersionId, Set<String> theParameters) throws Exception {
if (null == methods) {
ourLog.warn("No methods exist for resource provider: {}", resourceProvider.getClass());
return null;
}
ourLog.info("Looking for a handler for {} / {} / {} / {}", new Object[] {theResourceName,theId, theVersionId, theParameters});
for (BaseMethod rm : methods) {
if (rm.matches(theResourceName, theId, theVersionId, theParameters)) {
ourLog.info("Handler {} matches", rm);
return rm;
} else {
ourLog.info("Handler {} does not match", rm);
}
}
return null;
}
public String getResourceName() {
return resourceName;
}
public void setResourceName(String resourceName) {
this.resourceName = resourceName;
}
public List<BaseMethod> getMethods() {
return methods;
}
public void setMethods(List<BaseMethod> methods) {
this.methods = methods;
}
public void addMethod(BaseMethod method) {
this.methods.add(method);
method.setResource(this);
}
@Override
public boolean equals(Object o) {
if (!(o instanceof Resource))
return false;
return resourceName.equals(((Resource) o).getResourceName());
}
@Override
public int hashCode() {
return 0;
}
public void setResourceProvider(IResourceProvider theProvider) {
resourceProvider = theProvider;
}
public IResourceProvider getResourceProvider() {
return resourceProvider;
}
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server;
package ca.uhn.fhir.rest.server;
import java.io.File;
import java.io.IOException;
@ -25,15 +25,17 @@ import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.BundleEntry;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.parser.XmlParser;
import ca.uhn.fhir.server.exceptions.AbstractResponseException;
import ca.uhn.fhir.server.exceptions.InternalErrorException;
import ca.uhn.fhir.server.exceptions.MethodNotFoundException;
import ca.uhn.fhir.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.server.operations.DELETE;
import ca.uhn.fhir.server.operations.GET;
import ca.uhn.fhir.server.operations.POST;
import ca.uhn.fhir.server.operations.PUT;
import ca.uhn.fhir.rest.annotation.Read;
import ca.uhn.fhir.rest.server.exceptions.AbstractResponseException;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.MethodNotFoundException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.operations.DELETE;
import ca.uhn.fhir.rest.server.operations.Search;
import ca.uhn.fhir.rest.server.operations.POST;
import ca.uhn.fhir.rest.server.operations.PUT;
public abstract class RestfulServer extends HttpServlet {
@ -43,33 +45,40 @@ public abstract class RestfulServer extends HttpServlet {
private FhirContext myFhirContext;
private Map<Class<? extends IResource>, IResourceProvider<?>> myTypeToProvider = new HashMap<Class<? extends IResource>, IResourceProvider<?>>();
private Map<Class<? extends IResource>, IResourceProvider> myTypeToProvider = new HashMap<Class<? extends IResource>, IResourceProvider>();
// map of request handler resources keyed by resource name
private Map<String, Resource> resources = new HashMap<String, Resource>();
private boolean addResourceMethod(Resource resource, Method method) throws Exception {
ResourceMethod rm = new ResourceMethod();
// each operation name must have a request type annotation and be unique
if (null != method.getAnnotation(GET.class)) {
rm.setRequestType(ResourceMethod.RequestType.GET);
if (null != method.getAnnotation(Read.class)) {
Integer idIndex = Util.findReadIdParameterIndex(method);
Integer versionIdIndex = Util.findReadVersionIdParameterIndex(method);
ReadMethod rm = new ReadMethod(method, idIndex, versionIdIndex);
resource.addMethod(rm);
return true;
}
SearchMethod sm = new SearchMethod();
if (null != method.getAnnotation(Search.class)) {
sm.setRequestType(SearchMethod.RequestType.GET);
} else if (null != method.getAnnotation(PUT.class)) {
rm.setRequestType(ResourceMethod.RequestType.PUT);
sm.setRequestType(SearchMethod.RequestType.PUT);
} else if (null != method.getAnnotation(POST.class)) {
rm.setRequestType(ResourceMethod.RequestType.POST);
sm.setRequestType(SearchMethod.RequestType.POST);
} else if (null != method.getAnnotation(DELETE.class)) {
rm.setRequestType(ResourceMethod.RequestType.DELETE);
sm.setRequestType(SearchMethod.RequestType.DELETE);
} else {
return false;
}
rm.setMethod(method);
rm.setResourceType(method.getReturnType());
rm.setParameters(Util.getResourceParameters(method));
sm.setMethod(method);
sm.setResourceType(method.getReturnType());
sm.setParameters(Util.getResourceParameters(method));
resource.addMethod(rm);
resource.addMethod(sm);
return true;
}
@ -82,25 +91,25 @@ public abstract class RestfulServer extends HttpServlet {
@Override
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
handleRequest(ResourceMethod.RequestType.DELETE, request, response);
handleRequest(SearchMethod.RequestType.DELETE, request, response);
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
handleRequest(ResourceMethod.RequestType.GET, request, response);
handleRequest(SearchMethod.RequestType.GET, request, response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
handleRequest(ResourceMethod.RequestType.POST, request, response);
handleRequest(SearchMethod.RequestType.POST, request, response);
}
@Override
protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
handleRequest(ResourceMethod.RequestType.PUT, request, response);
handleRequest(SearchMethod.RequestType.PUT, request, response);
}
private void findResourceMethods(IResourceProvider<? extends IResource> theProvider) throws Exception {
private void findResourceMethods(IResourceProvider theProvider) throws Exception {
Class<? extends IResource> resourceType = theProvider.getResourceType();
RuntimeResourceDefinition definition = myFhirContext.getResourceDefinition(resourceType);
@ -110,29 +119,42 @@ public abstract class RestfulServer extends HttpServlet {
r.setResourceName(definition.getName());
resources.put(definition.getName(), r);
ourLog.info("Scanning type for RESTful methods: {}", theProvider.getClass());
Class<?> clazz = theProvider.getClass();
for (Method m : clazz.getDeclaredMethods()) {
if (Modifier.isPublic(m.getModifiers())) {
ourLog.info("Scanning public method: {}#{}", theProvider.getClass(), m.getName());
boolean foundMethod = addResourceMethod(r, m);
if (foundMethod) {
ourLog.debug("found handler: " + m.getName());
ourLog.info(" * Method: {}#{} is a handler", theProvider.getClass(), m.getName());
}else {
ourLog.info(" * Method: {}#{} is not a handler", theProvider.getClass(), m.getName());
}
}
}
}
public abstract Collection<IResourceProvider<?>> getResourceProviders();
public abstract Collection<IResourceProvider> getResourceProviders();
protected void handleRequest(ResourceMethod.RequestType requestType, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void handleRequest(SearchMethod.RequestType requestType, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
String resourceName = null;
Long identity = null;
String requestPath = request.getRequestURI();
requestPath = requestPath.substring(request.getContextPath().length());
if (requestPath.charAt(0)=='/') {
requestPath = requestPath.substring(1);
}
ourLog.info("Request URI: {}", requestPath);
Map<String, String[]> params = new HashMap<String, String[]>(request.getParameterMap());
EncodingUtil responseEncoding = determineResponseEncoding(params);
StringTokenizer tok = new StringTokenizer(request.getRequestURI(), "/");
StringTokenizer tok = new StringTokenizer(requestPath, "/");
if (!tok.hasMoreTokens()) {
throw new MethodNotFoundException("No resource name specified");
}
@ -140,40 +162,60 @@ public abstract class RestfulServer extends HttpServlet {
Resource resourceBinding = resources.get(resourceName);
if (resourceBinding == null) {
throw new MethodNotFoundException("Unknown resource type: " + resourceBinding);
throw new MethodNotFoundException("Unknown resource type: " + resourceName);
}
IdDt id = null;
IdDt versionId = null;
if (tok.hasMoreTokens()) {
String identityString = tok.nextToken();
try {
identity = Long.parseLong(identityString);
} catch (NumberFormatException e) {
throw new NumberFormatException("Invalid identity token: " + identity);
}
id = new IdDt(identityString);
}
if (identity != null && !tok.hasMoreTokens()) {
if (params == null || params.isEmpty()) {
IResource resource = resourceBinding.getResourceProvider().getResourceById(identity);
if (resource == null) {
throw new ResourceNotFoundException(identity);
}
streamResponseAsResource(response, resource, resourceBinding, responseEncoding);
return;
}
}
// TODO: look for more tokens for version, compartments, etc...
ResourceMethod resourceMethod = resourceBinding.getMethod(params.keySet());
//
//
// if (identity != null && !tok.hasMoreTokens()) {
// if (params == null || params.isEmpty()) {
// IResource resource = resourceBinding.getResourceProvider().getResourceById(identity);
// if (resource == null) {
// throw new ResourceNotFoundException(identity);
// }
// streamResponseAsResource(response, resource, resourceBinding, responseEncoding);
// return;
// }
// }
BaseMethod resourceMethod = resourceBinding.getMethod(resourceName, id, versionId, params.keySet());
if (null == resourceMethod) {
throw new MethodNotFoundException("No resource method available for the supplied parameters " + params);
}
List<IResource> result = resourceMethod.invoke(resourceBinding.getResourceProvider(), params);
List<IResource> result = resourceMethod.invoke(resourceBinding.getResourceProvider(), id, versionId, params);
switch (resourceMethod.getReturnType()) {
case BUNDLE:
streamResponseAsBundle(response, result, responseEncoding);
break;
case RESOURCE:
if (result.size() == 0) {
throw new ResourceNotFoundException(id);
} else if (result.size() > 1) {
throw new InternalErrorException("Method returned multiple resources");
}
streamResponseAsResource(response, result.get(0), resourceBinding, responseEncoding);
break;
}
// resourceMethod.get
} catch (AbstractResponseException e) {
if (e instanceof InternalErrorException) {
ourLog.error("Failure during REST processing", e);
} else {
ourLog.warn("Failure during REST processing: {}", e.toString());
}
response.setStatus(e.getStatusCode());
response.setContentType("text/plain");
response.setCharacterEncoding("UTF-8");
@ -193,8 +235,8 @@ public abstract class RestfulServer extends HttpServlet {
try {
ourLog.info("Initializing HAPI FHIR restful server");
Collection<IResourceProvider<?>> resourceProvider = getResourceProviders();
for (IResourceProvider<?> nextProvider : resourceProvider) {
Collection<IResourceProvider> resourceProvider = getResourceProviders();
for (IResourceProvider nextProvider : resourceProvider) {
if (myTypeToProvider.containsKey(nextProvider.getResourceType())) {
throw new ServletException("Multiple providers for type: " + nextProvider.getResourceType().getCanonicalName());
}
@ -205,7 +247,7 @@ public abstract class RestfulServer extends HttpServlet {
myFhirContext = new FhirContext(myTypeToProvider.keySet());
for (IResourceProvider<?> provider : myTypeToProvider.values()) {
for (IResourceProvider provider : myTypeToProvider.values()) {
findResourceMethods(provider);
}
@ -251,52 +293,6 @@ public abstract class RestfulServer extends HttpServlet {
}
/**
* Recursive method used to find all classes in a given directory and subdirs.
*
* @param directory
* The base directory
* @param packageName
* The package name for classes found inside the base directory
* @return The classes
* @throws ClassNotFoundException
*/
private static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException {
List<Class<?>> classes = new ArrayList<Class<?>>();
if (!directory.exists()) {
return classes;
}
File[] files = directory.listFiles();
for (File file : files) {
if (file.isDirectory()) {
assert !file.getName().contains(".");
classes.addAll(findClasses(file, packageName + "." + file.getName()));
} else if (file.getName().endsWith(".class")) {
classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));
}
}
return classes;
}
private static List<Class<?>> getClasses(String packageName) throws ClassNotFoundException, IOException {
if (null == packageName)
throw new ClassNotFoundException("package name must be specified for JSON operations");
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
assert classLoader != null;
String path = packageName.replace('.', '/');
Enumeration<URL> resources = classLoader.getResources(path);
List<File> dirs = new ArrayList<File>();
while (resources.hasMoreElements()) {
URL resource = resources.nextElement();
dirs.add(new File(resource.getFile()));
}
ArrayList<Class<?>> classes = new ArrayList<Class<?>>();
for (File directory : dirs) {
classes.addAll(findClasses(directory, packageName));
}
return classes;
}
}

View File

@ -0,0 +1,142 @@
package ca.uhn.fhir.rest.server;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.junit.internal.MethodSorter;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class SearchMethod extends BaseMethod {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchMethod.class);
private Method method;
private List<Parameter> parameters;
private RequestType requestType;
private Class<?> resourceType;
public SearchMethod() {
}
public SearchMethod(Method method, List<Parameter> parameters) {
this.method = method;
this.parameters = parameters;
}
public Method getMethod() {
return method;
}
public List<Parameter> getParameters() {
return parameters;
}
public RequestType getRequestType() {
return requestType;
}
public Class getResourceType() {
return resourceType.getClass();
}
@Override
public ReturnTypeEnum getReturnType() {
return ReturnTypeEnum.BUNDLE;
}
@Override
public List<IResource> invoke(IResourceProvider theResourceProvider, IdDt theId, IdDt theVersionId, Map<String, String[]> parameterValues) throws InvalidRequestException, InternalErrorException {
assert theId == null;
assert theVersionId == null;
Object[] params = new Object[parameters.size()];
for (int i = 0; i < parameters.size(); i++) {
Parameter param = parameters.get(i);
String[] value = parameterValues.get(param.getName());
if (value == null || value.length == 0 || StringUtils.isBlank(value[0])) {
continue;
}
if (value.length > 1) {
throw new InvalidRequestException("Multiple values specified for parameter: " + param.getName());
}
params[i] = param.parse(value[0]);
}
Object response;
try {
response = this.method.invoke(theResourceProvider, params);
} catch (IllegalAccessException e) {
throw new InternalErrorException(e);
} catch (IllegalArgumentException e) {
throw new InternalErrorException(e);
} catch (InvocationTargetException e) {
throw new InternalErrorException(e);
}
return toResourceList(response);
}
@Override
public boolean matches(String theResourceName, IdDt theId, IdDt theVersion, Set<String> theParameterNames) {
if (!theResourceName.equals(getResource().getResourceName())) {
ourLog.info("Method {} doesn't match because resource name {} != {}", method.getName(), theResourceName, getResource().getResourceName());
return false;
}
if (theId != null || theVersion != null) {
ourLog.info("Method {} doesn't match because ID or Version are not null: {} - {}", theId, theVersion);
return false;
}
Set<String> methodParamsTemp = new HashSet<String>();
for (int i = 0; i < this.parameters.size(); i++) {
Parameter temp = this.parameters.get(i);
methodParamsTemp.add(temp.getName());
if (temp.isRequired() && !theParameterNames.contains(temp.getName())) {
ourLog.info("Method {} doesn't match param '{}' is not present", temp.getName());
return false;
}
}
boolean retVal = methodParamsTemp.containsAll(theParameterNames);
ourLog.info("Method {} matches: {}", method.getName(), retVal);
return retVal;
}
public void setMethod(Method method) {
this.method = method;
}
public void setParameters(List<Parameter> parameters) {
this.parameters = parameters;
}
public void setRequestType(RequestType requestType) {
this.requestType = requestType;
}
public void setResourceType(Class<?> resourceType) {
this.resourceType = resourceType;
}
public static enum RequestType {
DELETE, GET, POST, PUT
}
}

View File

@ -0,0 +1,83 @@
package ca.uhn.fhir.rest.server;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import ca.uhn.fhir.rest.annotation.Read;
import ca.uhn.fhir.rest.server.parameters.Optional;
import ca.uhn.fhir.rest.server.parameters.Required;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class Util {
public static Map<String, String> getQueryParams(String query) {
try {
Map<String, String> params = new HashMap<String, String>();
for (String param : query.split("&")) {
String[] pair = param.split("=");
String key = URLDecoder.decode(pair[0], "UTF-8");
String value = URLDecoder.decode(pair[1], "UTF-8");
params.put(key, value);
}
return params;
} catch (UnsupportedEncodingException ex) {
throw new AssertionError(ex);
}
}
public static List<Parameter> getResourceParameters(Method method) {
List<Parameter> parameters = new ArrayList<Parameter>();
Class<?>[] parameterTypes = method.getParameterTypes();
for (Annotation[] annotations : method.getParameterAnnotations()) {
for (int i = 0; i < annotations.length; i++) {
Annotation nextAnnotation = annotations[i];
Parameter parameter = new Parameter();
if (nextAnnotation instanceof Required) {
parameter.setName(((Required) nextAnnotation).name());
parameter.setRequired(true);
parameter.setType(parameterTypes[i]);
} else if (nextAnnotation instanceof Optional) {
parameter.setName(((Optional) nextAnnotation).name());
parameter.setRequired(false);
parameter.setType(parameterTypes[i]);
}
parameters.add(parameter);
}
}
return parameters;
}
public static Integer findReadIdParameterIndex(Method theMethod) {
return findParamIndex(theMethod, Read.IdParam.class);
}
public static Integer findReadVersionIdParameterIndex(Method theMethod) {
return findParamIndex(theMethod, Read.VersionIdParam.class);
}
private static Integer findParamIndex(Method theMethod, Class<?> toFind) {
int paramIndex = 0;
for (Annotation[] annotations : theMethod.getParameterAnnotations()) {
for (int annotationIndex = 0; annotationIndex < annotations.length; annotationIndex++) {
Annotation nextAnnotation = annotations[annotationIndex];
Class<? extends Annotation> class1 = nextAnnotation.getClass();
if (toFind.isAssignableFrom(class1)) {
return paramIndex;
}
}
paramIndex++;
}
return null;
}
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.exceptions;
package ca.uhn.fhir.rest.server.exceptions;
public abstract class AbstractResponseException extends Exception {
@ -19,6 +19,20 @@ public abstract class AbstractResponseException extends Exception {
myStatusCode = theStatusCode;
}
/**
* Constructor
*
* @param theStatusCode
* The HTTP status code corresponding to this problem
* @param theMessage
* The message
* @param theCause The cause
*/
public AbstractResponseException(int theStatusCode, String theMessage, Throwable theCause) {
super(theMessage, theCause);
myStatusCode = theStatusCode;
}
/**
* Constructor
*

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.exceptions;
package ca.uhn.fhir.rest.server.exceptions;
import javax.servlet.ServletException;

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.exceptions;
package ca.uhn.fhir.rest.server.exceptions;
public class InternalErrorException extends AbstractResponseException {
@ -8,6 +8,10 @@ public class InternalErrorException extends AbstractResponseException {
super(500, theMessage);
}
public InternalErrorException(String theMessage, Throwable theCause) {
super(500, theMessage, theCause);
}
public InternalErrorException(Throwable theCause) {
super(500, theCause);
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.exceptions;
package ca.uhn.fhir.rest.server.exceptions;
public class InvalidRequestException extends AbstractResponseException {

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.exceptions;
package ca.uhn.fhir.rest.server.exceptions;
/**
* Created by dsotnikov on 2/27/2014.

View File

@ -0,0 +1,13 @@
package ca.uhn.fhir.rest.server.exceptions;
import ca.uhn.fhir.model.primitive.IdDt;
public class ResourceNotFoundException extends AbstractResponseException {
public ResourceNotFoundException(IdDt theId) {
super(404, "Resource " + (theId != null ? theId.getValue() : "") + " is not known");
}
private static final long serialVersionUID = 1L;
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.operations;
package ca.uhn.fhir.rest.server.operations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.operations;
package ca.uhn.fhir.rest.server.operations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.operations;
package ca.uhn.fhir.rest.server.operations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

View File

@ -1,10 +1,10 @@
package ca.uhn.fhir.server.operations;
package ca.uhn.fhir.rest.server.operations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface GET {
public @interface Search {
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.parameters;
package ca.uhn.fhir.rest.server.parameters;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server.parameters;
package ca.uhn.fhir.rest.server.parameters;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

View File

@ -1,23 +0,0 @@
package ca.uhn.fhir.server;
import ca.uhn.fhir.model.api.IResource;
public interface IResourceProvider<T extends IResource> {
/**
* Returns the type of resource returned by this provider
*
* @return Returns the type of resource returned by this provider
*/
Class<T> getResourceType();
/**
* Retrieve the resource by its identifier
*
* @param theId
* The resource identity
* @return The resource
*/
T getResourceById(long theId);
}

View File

@ -1,75 +0,0 @@
package ca.uhn.fhir.server;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import ca.uhn.fhir.model.api.IResource;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class Resource {
private String resourceName;
private List<ResourceMethod> methods = new ArrayList<ResourceMethod>();
private IResourceProvider<? extends IResource> resourceProvider;
public Resource() {}
public Resource(String resourceName, List<ResourceMethod> methods) {
this.resourceName = resourceName;
this.methods = methods;
}
public ResourceMethod getMethod(Set<String> parameters) throws Exception {
if (null == methods) return null;
for (ResourceMethod rm : methods) {
if (rm.matches(parameters)) return rm;
}
return null;
}
public String getResourceName() {
return resourceName;
}
public void setResourceName(String resourceName) {
this.resourceName = resourceName;
}
public List<ResourceMethod> getMethods() {
return methods;
}
public void setMethods(List<ResourceMethod> methods) {
this.methods = methods;
}
public void addMethod(ResourceMethod method) {
this.methods.add(method);
method.setResource(this);
}
@Override
public boolean equals(Object o) {
if (!(o instanceof Resource)) return false;
return resourceName.equals(((Resource)o).getResourceName());
}
@Override
public int hashCode() {
return 0;
}
public void setResourceProvider(IResourceProvider<? extends IResource> theProvider) {
resourceProvider = theProvider;
}
public IResourceProvider<? extends IResource> getResourceProvider() {
return resourceProvider;
}
}

View File

@ -1,129 +0,0 @@
package ca.uhn.fhir.server;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.server.exceptions.InternalErrorException;
import ca.uhn.fhir.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.server.exceptions.MethodNotFoundException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class ResourceMethod {
private Class<?> resourceType;
public static enum RequestType {
GET,
POST,
PUT,
DELETE
}
private RequestType requestType;
private List<Parameter> parameters;
private Method method;
private Resource resource;
public ResourceMethod() {}
public ResourceMethod(Method method, List<Parameter> parameters) {
this.method = method;
this.parameters = parameters;
}
public void setResourceType(Class<?> resourceType) {
this.resourceType = resourceType;
}
public Class getResourceType() {
return resourceType.getClass();
}
public RequestType getRequestType() {
return requestType;
}
public void setRequestType(RequestType requestType) {
this.requestType = requestType;
}
public List<Parameter> getParameters() {
return parameters;
}
public void setParameters(List<Parameter> parameters) {
this.parameters = parameters;
}
public Method getMethod() {
return method;
}
public void setMethod(Method method) {
this.method = method;
}
public boolean matches(Set<String> parameterNames) {
Set<String> methodParamsTemp = new HashSet<String>();
for (int i = 0; i < this.parameters.size(); i++){
Parameter temp = this.parameters.get(i);
methodParamsTemp.add(temp.getName());
if (temp.isRequired() && !parameterNames.contains(temp.getName())){
return false;
}
}
return methodParamsTemp.containsAll(parameterNames);
}
public List<IResource> invoke(IResourceProvider theResourceProvider, Map<String,String[]> parameterValues) throws InvalidRequestException, InternalErrorException {
Object[] params = new Object[parameters.size()];
for (int i = 0; i < parameters.size(); i++) {
Parameter param = parameters.get(i);
String[] value = parameterValues.get(param.getName());
if (value == null || value.length == 0 || StringUtils.isBlank(value[0])) {
continue;
}
if (value.length > 1) {
throw new InvalidRequestException("Multiple values specified for parameter: " + param.getName());
}
params[i] = param.parse(value[0]);
}
Object response;
try {
response = this.method.invoke(theResourceProvider, params);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
throw new InternalErrorException(e);
}
if (response == null) {
return Collections.emptyList();
}else if (response instanceof IResource) {
return Collections.singletonList((IResource)response);
} else if (response instanceof Collection) {
List<IResource> retVal = new ArrayList<>();
for (Object next : ((Collection<?>)response)) {
retVal.add((IResource) next);
}
return retVal;
} else {
throw new InternalErrorException("Unexpected return type: " + response.getClass().getCanonicalName());
}
}
public void setResource(Resource theResource) {
this.resource = theResource;
}
}

View File

@ -1,61 +0,0 @@
package ca.uhn.fhir.server;
import ca.uhn.fhir.server.parameters.Optional;
import ca.uhn.fhir.server.parameters.Required;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class Util {
public static Map<String, String> getQueryParams(String query) throws UnsupportedEncodingException {
try {
Map<String, String> params = new HashMap<String, String>();
for (String param : query.split("&")) {
String[] pair = param.split("=");
String key = URLDecoder.decode(pair[0], "UTF-8");
String value = URLDecoder.decode(pair[1], "UTF-8");
params.put(key, value);
}
return params;
} catch (UnsupportedEncodingException ex) {
throw new AssertionError(ex);
}
}
public static List<Parameter> getResourceParameters(Method method) {
List<Parameter> parameters = new ArrayList<Parameter>();
Class<?>[] parameterTypes = method.getParameterTypes();
for (Annotation[] annotations : method.getParameterAnnotations()) {
for (int i = 0; i < annotations.length; i++) {
Annotation a = annotations[i];
Parameter parameter = new Parameter();
if (a instanceof Required) {
parameter.setName(((Required) a).name());
parameter.setRequired(true);
parameter.setType(parameterTypes[i]);
} else if (a instanceof Optional) {
parameter.setName(((Optional) a).name());
parameter.setRequired(false);
parameter.setType(parameterTypes[i]);
}
parameters.add(parameter);
}
}
return parameters;
}
}

View File

@ -1,11 +0,0 @@
package ca.uhn.fhir.server.exceptions;
public class ResourceNotFoundException extends AbstractResponseException {
public ResourceNotFoundException(long theId) {
super(404, "Resource " + theId + " is not known");
}
private static final long serialVersionUID = 1L;
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server;
package ca.uhn.fhir.rest.server;
import java.util.HashMap;
import java.util.Map;
@ -8,17 +8,19 @@ import ca.uhn.fhir.model.dstu.composite.HumanNameDt;
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.server.IResourceProvider;
import ca.uhn.fhir.server.operations.GET;
import ca.uhn.fhir.server.parameters.Required;
import ca.uhn.fhir.rest.annotation.Read;
import ca.uhn.fhir.rest.server.IResourceProvider;
import ca.uhn.fhir.rest.server.operations.Search;
import ca.uhn.fhir.rest.server.parameters.Required;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class DummyPatientResourceProvider implements IResourceProvider<Patient> {
public class DummyPatientResourceProvider implements IResourceProvider {
private Map<Long, Patient> myIdToPatient = new HashMap<>();
private Map<String, Patient> myIdToPatient = new HashMap<String, Patient>();
public DummyPatientResourceProvider() {
{
@ -32,7 +34,7 @@ public class DummyPatientResourceProvider implements IResourceProvider<Patient>
patient.getName().get(0).addGiven("PatientOne");
patient.setGender(new CodeableConceptDt());
patient.getGender().setText("M");
myIdToPatient.put(1L, patient);
myIdToPatient.put("1", patient);
}
{
Patient patient = new Patient();
@ -45,11 +47,11 @@ public class DummyPatientResourceProvider implements IResourceProvider<Patient>
patient.getName().get(0).addGiven("PatientTwo");
patient.setGender(new CodeableConceptDt());
patient.getGender().setText("F");
myIdToPatient.put(2L, patient);
myIdToPatient.put("2", patient);
}
}
@GET
@Search
public Patient getPatient(@Required(name = "identifier") IdentifierDt theIdentifier) {
for (Patient next : myIdToPatient.values()) {
for (IdentifierDt nextId : next.getIdentifier()) {
@ -66,8 +68,15 @@ public class DummyPatientResourceProvider implements IResourceProvider<Patient>
return Patient.class;
}
@Override
public Patient getResourceById(long theId) {
return myIdToPatient.get(theId);
/**
* Retrieve the resource by its identifier
*
* @param theId
* The resource identity
* @return The resource
*/
@Read
public Patient getResourceById(@Read.IdParam IdDt theId) {
return myIdToPatient.get(theId.getValue());
}
}

View File

@ -0,0 +1,24 @@
package ca.uhn.fhir.rest.server;
import java.util.Arrays;
import java.util.Collection;
import ca.uhn.fhir.rest.server.IResourceProvider;
import ca.uhn.fhir.rest.server.RestfulServer;
public class DummyRestfulServer extends RestfulServer {
private static final long serialVersionUID = 1L;
private Collection<IResourceProvider> myResourceProviders;
public DummyRestfulServer(IResourceProvider... theResourceProviders) {
myResourceProviders = Arrays.asList(theResourceProviders);
}
@Override
public Collection<IResourceProvider> getResourceProviders() {
return myResourceProviders;
}
}

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server;
package ca.uhn.fhir.rest.server;
import static org.junit.Assert.*;

View File

@ -1,4 +1,4 @@
package ca.uhn.fhir.server;
package ca.uhn.fhir.rest.server;
import static org.junit.Assert.*;
@ -7,16 +7,27 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import ca.uhn.fhir.server.Parameter;
import ca.uhn.fhir.server.ResourceMethod;
import ca.uhn.fhir.rest.server.Parameter;
import ca.uhn.fhir.rest.server.SearchMethod;
public class ResourceMethodTest {
private SearchMethod rm;
@Before
public void before() {
Resource resource = new Resource();
resource.setResourceName("ResName");
rm = new SearchMethod();
rm.setResource(resource);
}
@Test
public void testRequiredParamsMissing() {
ResourceMethod rm = new ResourceMethod();
List<Parameter> methodParams = new ArrayList<Parameter>();
methodParams.add(new Parameter("firstName", false));
@ -29,12 +40,11 @@ public class ResourceMethodTest {
inputParams.add("firstName");
inputParams.add("lastName");
assertEquals(false, rm.matches(inputParams)); // False
assertEquals(false, rm.matches("ResName", null, null, inputParams)); // False
}
@Test
public void testRequiredParamsOnly() {
ResourceMethod rm = new ResourceMethod();
List<Parameter> methodParams = new ArrayList<Parameter>();
methodParams.add(new Parameter("firstName", false));
@ -45,12 +55,11 @@ public class ResourceMethodTest {
Set<String> inputParams = new HashSet<String>();
inputParams.add("mrn");
assertEquals(true, rm.matches(inputParams)); // True
assertEquals(true, rm.matches("ResName", null, null, inputParams)); // True
}
@Test
public void testMixedParams() {
ResourceMethod rm = new ResourceMethod();
List<Parameter> methodParams = new ArrayList<Parameter>();
methodParams.add(new Parameter("firstName", false));
@ -63,12 +72,11 @@ public class ResourceMethodTest {
inputParams.add("firstName");
inputParams.add("mrn");
assertEquals(true, rm.matches(inputParams)); // True
assertEquals(true, rm.matches("ResName", null, null, inputParams)); // True
}
@Test
public void testAllParams() {
ResourceMethod rm = new ResourceMethod();
List<Parameter> methodParams = new ArrayList<Parameter>();
methodParams.add(new Parameter("firstName", false));
@ -82,12 +90,11 @@ public class ResourceMethodTest {
inputParams.add("lastName");
inputParams.add("mrn");
assertEquals(true, rm.matches(inputParams)); // True
assertEquals(true, rm.matches("ResName", null, null, inputParams)); // True
}
@Test
public void testAllParamsWithExtra() {
ResourceMethod rm = new ResourceMethod();
List<Parameter> methodParams = new ArrayList<Parameter>();
methodParams.add(new Parameter("firstName", false));
@ -102,6 +109,6 @@ public class ResourceMethodTest {
inputParams.add("mrn");
inputParams.add("foo");
assertEquals(false, rm.matches(inputParams)); // False
assertEquals(false, rm.matches("ResName", null, null, inputParams)); // False
}
}

Some files were not shown because too many files have changed in this diff Show More