Doc cleanup

This commit is contained in:
James Agnew 2015-06-24 17:42:46 -04:00
parent dd9f80ecb1
commit 75f5b47762
8 changed files with 472 additions and 639 deletions

View File

@ -126,8 +126,8 @@ public class JsonParser extends BaseParser implements IParser {
private boolean myPrettyPrint; private boolean myPrettyPrint;
/** /**
* Do not use this constructor, the recommended way to obtain a new instance of the JSON parser is to invoke * Do not use this constructor, the recommended way to obtain a new instance of the JSON parser is to invoke {@link FhirContext#newJsonParser()}.
* {@link FhirContext#newJsonParser()}. *
* @param theParserErrorHandler * @param theParserErrorHandler
*/ */
public JsonParser(FhirContext theContext, IParserErrorHandler theParserErrorHandler) { public JsonParser(FhirContext theContext, IParserErrorHandler theParserErrorHandler) {
@ -433,10 +433,8 @@ public class JsonParser extends BaseParser implements IParser {
case CONTAINED_RESOURCE_LIST: case CONTAINED_RESOURCE_LIST:
case CONTAINED_RESOURCES: { case CONTAINED_RESOURCES: {
/* /*
* Disabled per #103 ContainedDt value = (ContainedDt) theNextValue; for (IResource next : * Disabled per #103 ContainedDt value = (ContainedDt) theNextValue; for (IResource next : value.getContainedResources()) { if (getContainedResources().getResourceId(next) != null) {
* value.getContainedResources()) { if (getContainedResources().getResourceId(next) != null) { continue; } * continue; } encodeResourceToJsonStreamWriter(theResDef, next, theWriter, null, true, fixContainedResourceId(next.getId().getValue())); }
* encodeResourceToJsonStreamWriter(theResDef, next, theWriter, null, true,
* fixContainedResourceId(next.getId().getValue())); }
*/ */
List<IBaseResource> containedResources = getContainedResources().getContainedResources(); List<IBaseResource> containedResources = getContainedResources().getContainedResources();
if (containedResources.size() > 0) { if (containedResources.size() > 0) {
@ -545,7 +543,7 @@ public class JsonParser extends BaseParser implements IParser {
} }
boolean primitive = childDef.getChildType() == ChildTypeEnum.PRIMITIVE_DATATYPE; boolean primitive = childDef.getChildType() == ChildTypeEnum.PRIMITIVE_DATATYPE;
if ((childDef.getChildType() == ChildTypeEnum.CONTAINED_RESOURCES||childDef.getChildType()==ChildTypeEnum.CONTAINED_RESOURCE_LIST) && theContainedResource) { if ((childDef.getChildType() == ChildTypeEnum.CONTAINED_RESOURCES || childDef.getChildType() == ChildTypeEnum.CONTAINED_RESOURCE_LIST) && theContainedResource) {
continue; continue;
} }
@ -670,7 +668,7 @@ public class JsonParser extends BaseParser implements IParser {
} }
} else if (theResource instanceof IAnyResource) { } else if (theResource instanceof IAnyResource) {
IAnyResource res = (IAnyResource) theResource; IAnyResource res = (IAnyResource) theResource;
if (/*theContainedResource && */ StringUtils.isNotBlank(res.getIdElement().getIdPart())) { if (/* theContainedResource && */StringUtils.isNotBlank(res.getIdElement().getIdPart())) {
resourceId = res.getIdElement().getIdPart(); resourceId = res.getIdElement().getIdPart();
} }
} }
@ -682,7 +680,8 @@ public class JsonParser extends BaseParser implements IParser {
encodeResourceToJsonStreamWriter(theResDef, theResource, theEventWriter, theObjectNameOrNull, theContainedResource, resourceId); encodeResourceToJsonStreamWriter(theResDef, theResource, theEventWriter, theObjectNameOrNull, theContainedResource, resourceId);
} }
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonGenerator theEventWriter, String theObjectNameOrNull, boolean theContainedResource, String theResourceId) throws IOException { private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonGenerator theEventWriter, String theObjectNameOrNull,
boolean theContainedResource, String theResourceId) throws IOException {
if (!theContainedResource) { if (!theContainedResource) {
super.containResourcesForEncoding(theResource); super.containResourcesForEncoding(theResource);
} }
@ -807,10 +806,10 @@ public class JsonParser extends BaseParser implements IParser {
} }
/** /**
* This is useful only for the two cases where extensions are encoded as direct children (e.g. not in some object * This is useful only for the two cases where extensions are encoded as direct children (e.g. not in some object called _name): resource extensions, and extension extensions
* called _name): resource extensions, and extension extensions
*/ */
private void extractAndWriteExtensionsAsDirectChild(IBase theElement, JsonGenerator theEventWriter, BaseRuntimeElementDefinition<?> theElementDef, RuntimeResourceDefinition theResDef, IBaseResource theResource, String theParentExtensionUrl) throws IOException { private void extractAndWriteExtensionsAsDirectChild(IBase theElement, JsonGenerator theEventWriter, BaseRuntimeElementDefinition<?> theElementDef, RuntimeResourceDefinition theResDef,
IBaseResource theResource, String theParentExtensionUrl) throws IOException {
List<HeldExtension> extensions = new ArrayList<HeldExtension>(0); List<HeldExtension> extensions = new ArrayList<HeldExtension>(0);
List<HeldExtension> modifierExtensions = new ArrayList<HeldExtension>(0); List<HeldExtension> modifierExtensions = new ArrayList<HeldExtension>(0);
@ -944,7 +943,8 @@ public class JsonParser extends BaseParser implements IParser {
object = reader.readObject(); object = reader.readObject();
} catch (JsonParsingException e) { } catch (JsonParsingException e) {
if (e.getMessage().startsWith("Unexpected char 39")) { if (e.getMessage().startsWith("Unexpected char 39")) {
throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage() + " - This may indicate that single quotes are being used as JSON escapes where double quotes are required", e); throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage()
+ " - This may indicate that single quotes are being used as JSON escapes where double quotes are required", e);
} }
throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage(), e); throw new DataFormatException("Failed to parse JSON encoded FHIR content: " + e.getMessage(), e);
} }
@ -1308,7 +1308,8 @@ public class JsonParser extends BaseParser implements IParser {
} }
} }
private void writeExtensionsAsDirectChild(IBaseResource theResource, JsonGenerator theEventWriter, RuntimeResourceDefinition resDef, List<HeldExtension> extensions, List<HeldExtension> modifierExtensions, String theParentExtensionUrl) throws IOException { private void writeExtensionsAsDirectChild(IBaseResource theResource, JsonGenerator theEventWriter, RuntimeResourceDefinition resDef, List<HeldExtension> extensions,
List<HeldExtension> modifierExtensions, String theParentExtensionUrl) throws IOException {
if (extensions.isEmpty() == false) { if (extensions.isEmpty() == false) {
theEventWriter.writeStartArray("extension"); theEventWriter.writeStartArray("extension");
for (HeldExtension next : extensions) { for (HeldExtension next : extensions) {

View File

@ -212,7 +212,7 @@ class ParserState<T> {
myState.xmlEvent(theNextEvent); myState.xmlEvent(theNextEvent);
} }
public static ParserState<Bundle> getPreAtomInstance(FhirContext theContext, Class<? extends IBaseResource> theResourceType, boolean theJsonMode, IParserErrorHandler theErrorHandler) static ParserState<Bundle> getPreAtomInstance(FhirContext theContext, Class<? extends IBaseResource> theResourceType, boolean theJsonMode, IParserErrorHandler theErrorHandler)
throws DataFormatException { throws DataFormatException {
ParserState<Bundle> retVal = new ParserState<Bundle>(theContext, theJsonMode, theErrorHandler); ParserState<Bundle> retVal = new ParserState<Bundle>(theContext, theJsonMode, theErrorHandler);
if (theContext.getVersion().getVersion() == FhirVersionEnum.DSTU1) { if (theContext.getVersion().getVersion() == FhirVersionEnum.DSTU1) {
@ -227,7 +227,7 @@ class ParserState<T> {
* @param theResourceType * @param theResourceType
* May be null * May be null
*/ */
public static <T extends IBaseResource> ParserState<T> getPreResourceInstance(Class<T> theResourceType, FhirContext theContext, boolean theJsonMode, IParserErrorHandler theErrorHandler) static <T extends IBaseResource> ParserState<T> getPreResourceInstance(Class<T> theResourceType, FhirContext theContext, boolean theJsonMode, IParserErrorHandler theErrorHandler)
throws DataFormatException { throws DataFormatException {
ParserState<T> retVal = new ParserState<T>(theContext, theJsonMode, theErrorHandler); ParserState<T> retVal = new ParserState<T>(theContext, theJsonMode, theErrorHandler);
if (theResourceType == null) { if (theResourceType == null) {
@ -246,13 +246,13 @@ class ParserState<T> {
return retVal; return retVal;
} }
public static ParserState<TagList> getPreTagListInstance(FhirContext theContext, boolean theJsonMode, IParserErrorHandler theErrorHandler) { static ParserState<TagList> getPreTagListInstance(FhirContext theContext, boolean theJsonMode, IParserErrorHandler theErrorHandler) {
ParserState<TagList> retVal = new ParserState<TagList>(theContext, theJsonMode, theErrorHandler); ParserState<TagList> retVal = new ParserState<TagList>(theContext, theJsonMode, theErrorHandler);
retVal.push(retVal.new PreTagListState()); retVal.push(retVal.new PreTagListState());
return retVal; return retVal;
} }
public class AtomAuthorState extends BaseState { private class AtomAuthorState extends BaseState {
private BaseBundle myInstance; private BaseBundle myInstance;
@ -355,7 +355,7 @@ class ParserState<T> {
} }
public class AtomDeletedEntryByState extends BaseState { private class AtomDeletedEntryByState extends BaseState {
private BundleEntry myEntry; private BundleEntry myEntry;
@ -382,7 +382,7 @@ class ParserState<T> {
} }
public class AtomDeletedEntryState extends AtomEntryState { private class AtomDeletedEntryState extends AtomEntryState {
public AtomDeletedEntryState(Bundle theInstance, Class<? extends IBaseResource> theResourceType) { public AtomDeletedEntryState(Bundle theInstance, Class<? extends IBaseResource> theResourceType) {
super(theInstance, theResourceType); super(theInstance, theResourceType);
@ -450,7 +450,7 @@ class ParserState<T> {
} }
public class AtomEntryState extends BaseState { private class AtomEntryState extends BaseState {
private boolean myDeleted; private boolean myDeleted;
private BundleEntry myEntry; private BundleEntry myEntry;
@ -995,7 +995,7 @@ class ParserState<T> {
} }
public class BundleEntrySearchState extends BaseState { private class BundleEntrySearchState extends BaseState {
private BundleEntry myEntry; private BundleEntry myEntry;
@ -1022,7 +1022,7 @@ class ParserState<T> {
} }
public class BundleEntryState extends BaseState { private class BundleEntryState extends BaseState {
private BundleEntry myEntry; private BundleEntry myEntry;
private Class<? extends IBaseResource> myResourceType; private Class<? extends IBaseResource> myResourceType;
@ -1120,7 +1120,7 @@ class ParserState<T> {
} }
public class BundleEntryTransactionState extends BaseState { private class BundleEntryTransactionState extends BaseState {
private BundleEntry myEntry; private BundleEntry myEntry;

View File

@ -36,7 +36,7 @@ public @interface OperationParam {
/** /**
* Value for {@link OperationParam#max()} indicating no maximum * Value for {@link OperationParam#max()} indicating no maximum
*/ */
int MAX_UNLIMITED = -1; final int MAX_UNLIMITED = -1;
/** /**
* The name of the parameter * The name of the parameter

View File

@ -95,6 +95,10 @@ public abstract class BaseClient implements IRestfulClient {
return retVal; return retVal;
} }
void forceConformanceCheck() {
myFactory.validateServerBase(myUrlBase, myClient, this);
}
/** /**
* Returns the encoding that will be used on requests. Default is <code>null</code>, which means the client will not explicitly request an encoding. (This is standard behaviour according to the * Returns the encoding that will be used on requests. Default is <code>null</code>, which means the client will not explicitly request an encoding. (This is standard behaviour according to the
* FHIR specification) * FHIR specification)
@ -111,6 +115,10 @@ public abstract class BaseClient implements IRestfulClient {
return myClient; return myClient;
} }
public List<IClientInterceptor> getInterceptors() {
return Collections.unmodifiableList(myInterceptors);
}
/** /**
* For now, this is a part of the internal API of HAPI - Use with caution as this method may change! * For now, this is a part of the internal API of HAPI - Use with caution as this method may change!
*/ */
@ -153,11 +161,8 @@ public abstract class BaseClient implements IRestfulClient {
return invokeClient(theContext, binding, clientInvocation, null, null, theLogRequestAndResponse); return invokeClient(theContext, binding, clientInvocation, null, null, theLogRequestAndResponse);
} }
void forceConformanceCheck() { <T> T invokeClient(FhirContext theContext, IClientResponseHandler<T> binding, BaseHttpClientInvocation clientInvocation, EncodingEnum theEncoding, Boolean thePrettyPrint,
myFactory.validateServerBase(myUrlBase, myClient, this); boolean theLogRequestAndResponse) {
}
<T> T invokeClient(FhirContext theContext, IClientResponseHandler<T> binding, BaseHttpClientInvocation clientInvocation, EncodingEnum theEncoding, Boolean thePrettyPrint, boolean theLogRequestAndResponse) {
if (!myDontValidateConformance) { if (!myDontValidateConformance) {
myFactory.validateServerBaseIfConfiguredToDoSo(myUrlBase, myClient, this); myFactory.validateServerBaseIfConfiguredToDoSo(myUrlBase, myClient, this);
@ -180,10 +185,9 @@ public abstract class BaseClient implements IRestfulClient {
params.put(Constants.PARAM_PRETTY, Collections.singletonList(Constants.PARAM_PRETTY_VALUE_TRUE)); params.put(Constants.PARAM_PRETTY, Collections.singletonList(Constants.PARAM_PRETTY_VALUE_TRUE));
} }
EncodingEnum encoding = getEncoding(); EncodingEnum encoding = getEncoding();
if (theEncoding != null) { if (theEncoding != null) {
encoding=theEncoding; encoding = theEncoding;
} }
httpRequest = clientInvocation.asHttpRequest(myUrlBase, params, encoding, thePrettyPrint); httpRequest = clientInvocation.asHttpRequest(myUrlBase, params, encoding, thePrettyPrint);
@ -250,7 +254,7 @@ public abstract class BaseClient implements IRestfulClient {
} }
String message = "HTTP " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase(); String message = "HTTP " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase();
BaseOperationOutcome oo=null; BaseOperationOutcome oo = null;
if (Constants.CT_TEXT.equals(mimeType)) { if (Constants.CT_TEXT.equals(mimeType)) {
message = message + ": " + body; message = message + ": " + body;
} else { } else {
@ -259,8 +263,8 @@ public abstract class BaseClient implements IRestfulClient {
IParser p = enc.newParser(theContext); IParser p = enc.newParser(theContext);
try { try {
// TODO: handle if something other than OO comes back // TODO: handle if something other than OO comes back
oo = (BaseOperationOutcome) p.parseResource( body); oo = (BaseOperationOutcome) p.parseResource(body);
if (oo.getIssueFirstRep().getDetailsElement().isEmpty()==false) { if (oo.getIssueFirstRep().getDetailsElement().isEmpty() == false) {
message = message + ": " + oo.getIssueFirstRep().getDetailsElement().getValue(); message = message + ": " + oo.getIssueFirstRep().getDetailsElement().getValue();
} }
} catch (Exception e) { } catch (Exception e) {
@ -375,20 +379,20 @@ public abstract class BaseClient implements IRestfulClient {
} }
/** /**
* This method is an internal part of the HAPI API and may change, use with caution. If you * This method is an internal part of the HAPI API and may change, use with caution. If you want to disable the loading of conformance statements, use
* want to disable the loading of conformance statements, use {@link IRestfulClientFactory#setServerValidationModeEnum(ServerValidationModeEnum)} * {@link IRestfulClientFactory#setServerValidationModeEnum(ServerValidationModeEnum)}
*/ */
public void setDontValidateConformance(boolean theDontValidateConformance) { public void setDontValidateConformance(boolean theDontValidateConformance) {
myDontValidateConformance = theDontValidateConformance; myDontValidateConformance = theDontValidateConformance;
} }
/** /**
* Sets the encoding that will be used on requests. Default is <code>null</code>, which means the client will not explicitly request an encoding. (This is perfectly acceptable behaviour according to the FHIR * Sets the encoding that will be used on requests. Default is <code>null</code>, which means the client will not explicitly request an encoding. (This is perfectly acceptable behaviour according
* specification. In this case, the server will choose which encoding to return, and the client can handle either XML or JSON) * to the FHIR specification. In this case, the server will choose which encoding to return, and the client can handle either XML or JSON)
*/ */
public void setEncoding(EncodingEnum theEncoding) { public void setEncoding(EncodingEnum theEncoding) {
myEncoding = theEncoding; myEncoding = theEncoding;
// return this; // return this;
} }
/** /**
@ -418,7 +422,7 @@ public abstract class BaseClient implements IRestfulClient {
*/ */
public void setPrettyPrint(Boolean thePrettyPrint) { public void setPrettyPrint(Boolean thePrettyPrint) {
myPrettyPrint = thePrettyPrint; myPrettyPrint = thePrettyPrint;
// return this; // return this;
} }
public void unregisterInterceptor(IClientInterceptor theInterceptor) { public void unregisterInterceptor(IClientInterceptor theInterceptor) {
@ -447,8 +451,4 @@ public abstract class BaseClient implements IRestfulClient {
return reader; return reader;
} }
public List<IClientInterceptor> getInterceptors() {
return Collections.unmodifiableList(myInterceptors);
}
} }

View File

@ -1,19 +1,3 @@
package ca.uhn.fhir.rest.param; package ca.uhn.fhir.rest.param;
/* /*
@ -49,8 +33,7 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt; import ca.uhn.fhir.model.primitive.UriDt;
public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype {
{
/** /**
* Constructor * Constructor
@ -67,46 +50,29 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
setCode(theCode); setCode(theCode);
} }
@Child(name="system", type=UriDt.class, order=0, min=0, max=1) @Child(name = "system", type = UriDt.class, order = 0, min = 0, max = 1)
@Description( @Description(shortDefinition = "Identity of the terminology system", formalDefinition = "The identification of the code system that defines the meaning of the symbol in the code.")
shortDefinition="Identity of the terminology system",
formalDefinition="The identification of the code system that defines the meaning of the symbol in the code."
)
private UriDt mySystem; private UriDt mySystem;
@Child(name="version", type=StringDt.class, order=1, min=0, max=1) @Child(name = "version", type = StringDt.class, order = 1, min = 0, max = 1)
@Description( @Description(shortDefinition = "Version of the system - if relevant", formalDefinition = "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged")
shortDefinition="Version of the system - if relevant",
formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged"
)
private StringDt myVersion; private StringDt myVersion;
@Child(name="code", type=CodeDt.class, order=2, min=0, max=1) @Child(name = "code", type = CodeDt.class, order = 2, min = 0, max = 1)
@Description( @Description(shortDefinition = "Symbol in syntax defined by the system", formalDefinition = "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)")
shortDefinition="Symbol in syntax defined by the system",
formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)"
)
private CodeDt myCode; private CodeDt myCode;
@Child(name="display", type=StringDt.class, order=3, min=0, max=1) @Child(name = "display", type = StringDt.class, order = 3, min = 0, max = 1)
@Description( @Description(shortDefinition = "Representation defined by the system", formalDefinition = "A representation of the meaning of the code in the system, following the rules of the system.")
shortDefinition="Representation defined by the system",
formalDefinition="A representation of the meaning of the code in the system, following the rules of the system."
)
private StringDt myDisplay; private StringDt myDisplay;
@Child(name="primary", type=BooleanDt.class, order=4, min=0, max=1) @Child(name = "primary", type = BooleanDt.class, order = 4, min = 0, max = 1)
@Description( @Description(shortDefinition = "If this code was chosen directly by the user", formalDefinition = "Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)")
shortDefinition="If this code was chosen directly by the user",
formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)"
)
private BooleanDt myPrimary; private BooleanDt myPrimary;
@Override @Override
public boolean isEmpty() { public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myPrimary); return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(mySystem, myVersion, myCode, myDisplay, myPrimary);
} }
@Override @Override
@ -115,14 +81,11 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
} }
/** /**
* Gets the value(s) for <b>system</b> (Identity of the terminology system). * Gets the value(s) for <b>system</b> (Identity of the terminology system). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The identification of the code system that defines the meaning of the symbol in the code.
* The identification of the code system that defines the meaning of the symbol in the code. * </p>
* </p>
*/ */
public UriDt getSystemElement() { public UriDt getSystemElement() {
if (mySystem == null) { if (mySystem == null) {
@ -134,39 +97,34 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
/** /**
* Sets the value(s) for <b>system</b> (Identity of the terminology system) * Sets the value(s) for <b>system</b> (Identity of the terminology system)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The identification of the code system that defines the meaning of the symbol in the code.
* The identification of the code system that defines the meaning of the symbol in the code. * </p>
* </p>
*/ */
public InternalCodingDt setSystem(UriDt theValue) { public InternalCodingDt setSystem(UriDt theValue) {
mySystem = theValue; mySystem = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>system</b> (Identity of the terminology system) * Sets the value for <b>system</b> (Identity of the terminology system)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The identification of the code system that defines the meaning of the symbol in the code.
* The identification of the code system that defines the meaning of the symbol in the code. * </p>
* </p>
*/ */
public InternalCodingDt setSystem( String theUri) { public InternalCodingDt setSystem(String theUri) {
mySystem = new UriDt(theUri); mySystem = new UriDt(theUri);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>version</b> (Version of the system - if relevant). * Gets the value(s) for <b>version</b> (Version of the system - if relevant). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes
* The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged * is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged
* </p> * </p>
*/ */
public StringDt getVersion() { public StringDt getVersion() {
if (myVersion == null) { if (myVersion == null) {
@ -178,39 +136,35 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
/** /**
* Sets the value(s) for <b>version</b> (Version of the system - if relevant) * Sets the value(s) for <b>version</b> (Version of the system - if relevant)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes
* The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged * is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged
* </p> * </p>
*/ */
public InternalCodingDt setVersion(StringDt theValue) { public InternalCodingDt setVersion(StringDt theValue) {
myVersion = theValue; myVersion = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>version</b> (Version of the system - if relevant) * Sets the value for <b>version</b> (Version of the system - if relevant)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes
* The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged * is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged
* </p> * </p>
*/ */
public InternalCodingDt setVersion( String theString) { public InternalCodingDt setVersion(String theString) {
myVersion = new StringDt(theString); myVersion = new StringDt(theString);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>code</b> (Symbol in syntax defined by the system). * Gets the value(s) for <b>code</b> (Symbol in syntax defined by the system). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination) * </p>
* </p>
*/ */
public CodeDt getCodeElement() { public CodeDt getCodeElement() {
if (myCode == null) { if (myCode == null) {
@ -222,39 +176,33 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
/** /**
* Sets the value(s) for <b>code</b> (Symbol in syntax defined by the system) * Sets the value(s) for <b>code</b> (Symbol in syntax defined by the system)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination) * </p>
* </p>
*/ */
public InternalCodingDt setCode(CodeDt theValue) { public InternalCodingDt setCode(CodeDt theValue) {
myCode = theValue; myCode = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>code</b> (Symbol in syntax defined by the system) * Sets the value for <b>code</b> (Symbol in syntax defined by the system)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination) * </p>
* </p>
*/ */
public InternalCodingDt setCode( String theCode) { public InternalCodingDt setCode(String theCode) {
myCode = new CodeDt(theCode); myCode = new CodeDt(theCode);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>display</b> (Representation defined by the system). * Gets the value(s) for <b>display</b> (Representation defined by the system). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A representation of the meaning of the code in the system, following the rules of the system.
* A representation of the meaning of the code in the system, following the rules of the system. * </p>
* </p>
*/ */
public StringDt getDisplay() { public StringDt getDisplay() {
if (myDisplay == null) { if (myDisplay == null) {
@ -266,39 +214,33 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
/** /**
* Sets the value(s) for <b>display</b> (Representation defined by the system) * Sets the value(s) for <b>display</b> (Representation defined by the system)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A representation of the meaning of the code in the system, following the rules of the system.
* A representation of the meaning of the code in the system, following the rules of the system. * </p>
* </p>
*/ */
public InternalCodingDt setDisplay(StringDt theValue) { public InternalCodingDt setDisplay(StringDt theValue) {
myDisplay = theValue; myDisplay = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>display</b> (Representation defined by the system) * Sets the value for <b>display</b> (Representation defined by the system)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A representation of the meaning of the code in the system, following the rules of the system.
* A representation of the meaning of the code in the system, following the rules of the system. * </p>
* </p>
*/ */
public InternalCodingDt setDisplay( String theString) { public InternalCodingDt setDisplay(String theString) {
myDisplay = new StringDt(theString); myDisplay = new StringDt(theString);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>primary</b> (If this code was chosen directly by the user). * Gets the value(s) for <b>primary</b> (If this code was chosen directly by the user). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) * </p>
* </p>
*/ */
public BooleanDt getPrimary() { public BooleanDt getPrimary() {
if (myPrimary == null) { if (myPrimary == null) {
@ -310,56 +252,38 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
/** /**
* Sets the value(s) for <b>primary</b> (If this code was chosen directly by the user) * Sets the value(s) for <b>primary</b> (If this code was chosen directly by the user)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) * </p>
* </p>
*/ */
public InternalCodingDt setPrimary(BooleanDt theValue) { public InternalCodingDt setPrimary(BooleanDt theValue) {
myPrimary = theValue; myPrimary = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>primary</b> (If this code was chosen directly by the user) * Sets the value for <b>primary</b> (If this code was chosen directly by the user)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) * </p>
* </p>
*/ */
public InternalCodingDt setPrimary( boolean theBoolean) { public InternalCodingDt setPrimary(boolean theBoolean) {
myPrimary = new BooleanDt(theBoolean); myPrimary = new BooleanDt(theBoolean);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>valueSet</b> (Set this coding was chosen from). * Gets the value(s) for <b>valueSet</b> (Set this coding was chosen from). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The set of possible coded values this coding was chosen from or constrained by
* The set of possible coded values this coding was chosen from or constrained by * </p>
* </p>
*/ */
public BaseResourceReferenceDt getValueSet() { public BaseResourceReferenceDt getValueSet() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* Sets the value(s) for <b>valueSet</b> (Set this coding was chosen from)
*
* <p>
* <b>Definition:</b>
* The set of possible coded values this coding was chosen from or constrained by
* </p>
*/
public InternalCodingDt setValueSet(BaseResourceReferenceDt theValue) {
throw new UnsupportedOperationException();
}
@Override @Override
public StringDt getDisplayElement() { public StringDt getDisplayElement() {
return getDisplay(); return getDisplay();
@ -375,7 +299,4 @@ public class InternalCodingDt extends BaseCodingDt implements ICompositeDatatype
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
} }

View File

@ -1,19 +1,3 @@
package ca.uhn.fhir.rest.param; package ca.uhn.fhir.rest.param;
/* /*
@ -51,9 +35,10 @@ import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt; import ca.uhn.fhir.model.primitive.UriDt;
class InternalQuantityDt /**
extends BaseQuantityDt implements ICompositeDatatype * Base class for QuantityDt of any version
{ */
class InternalQuantityDt extends BaseQuantityDt implements ICompositeDatatype {
/** /**
* Constructor * Constructor
@ -66,7 +51,7 @@ class InternalQuantityDt
* Constructor * Constructor
*/ */
@SimpleSetter @SimpleSetter
public InternalQuantityDt(@SimpleSetter.Parameter(name="theValue") double theValue) { public InternalQuantityDt(@SimpleSetter.Parameter(name = "theValue") double theValue) {
setValue(theValue); setValue(theValue);
} }
@ -74,7 +59,7 @@ class InternalQuantityDt
* Constructor * Constructor
*/ */
@SimpleSetter @SimpleSetter
public InternalQuantityDt(@SimpleSetter.Parameter(name="theValue") long theValue) { public InternalQuantityDt(@SimpleSetter.Parameter(name = "theValue") long theValue) {
setValue(theValue); setValue(theValue);
} }
@ -104,7 +89,8 @@ class InternalQuantityDt
* Constructor * Constructor
*/ */
@SimpleSetter @SimpleSetter
public InternalQuantityDt(@SimpleSetter.Parameter(name="theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name="theValue") double theValue, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theUnits") String theUnits) { public InternalQuantityDt(@SimpleSetter.Parameter(name = "theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name = "theValue") double theValue,
@SimpleSetter.Parameter(name = "theSystem") String theSystem, @SimpleSetter.Parameter(name = "theUnits") String theUnits) {
setValue(theValue); setValue(theValue);
setComparator(theComparator); setComparator(theComparator);
setSystem(theSystem); setSystem(theSystem);
@ -115,53 +101,37 @@ class InternalQuantityDt
* Constructor * Constructor
*/ */
@SimpleSetter @SimpleSetter
public InternalQuantityDt(@SimpleSetter.Parameter(name="theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name="theValue") long theValue, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theUnits") String theUnits) { public InternalQuantityDt(@SimpleSetter.Parameter(name = "theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name = "theValue") long theValue,
@SimpleSetter.Parameter(name = "theSystem") String theSystem, @SimpleSetter.Parameter(name = "theUnits") String theUnits) {
setValue(theValue); setValue(theValue);
setComparator(theComparator); setComparator(theComparator);
setSystem(theSystem); setSystem(theSystem);
setUnits(theUnits); setUnits(theUnits);
} }
@Child(name = "value", type = DecimalDt.class, order = 0, min = 0, max = 1)
@Child(name="value", type=DecimalDt.class, order=0, min=0, max=1) @Description(shortDefinition = "Numerical value (with implicit precision)", formalDefinition = "The value of the measured amount. The value includes an implicit precision in the presentation of the value")
@Description(
shortDefinition="Numerical value (with implicit precision)",
formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value"
)
private DecimalDt myValue; private DecimalDt myValue;
@Child(name="comparator", type=CodeDt.class, order=1, min=0, max=1) @Child(name = "comparator", type = CodeDt.class, order = 1, min = 0, max = 1)
@Description( @Description(shortDefinition = "< | <= | >= | > - how to understand the value", formalDefinition = "How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value")
shortDefinition="< | <= | >= | > - how to understand the value",
formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value"
)
private BoundCodeDt<QuantityCompararatorEnum> myComparator; private BoundCodeDt<QuantityCompararatorEnum> myComparator;
@Child(name="units", type=StringDt.class, order=2, min=0, max=1) @Child(name = "units", type = StringDt.class, order = 2, min = 0, max = 1)
@Description( @Description(shortDefinition = "Unit representation", formalDefinition = "A human-readable form of the units")
shortDefinition="Unit representation",
formalDefinition="A human-readable form of the units"
)
private StringDt myUnits; private StringDt myUnits;
@Child(name="system", type=UriDt.class, order=3, min=0, max=1) @Child(name = "system", type = UriDt.class, order = 3, min = 0, max = 1)
@Description( @Description(shortDefinition = "System that defines coded unit form", formalDefinition = "The identification of the system that provides the coded form of the unit")
shortDefinition="System that defines coded unit form",
formalDefinition="The identification of the system that provides the coded form of the unit"
)
private UriDt mySystem; private UriDt mySystem;
@Child(name="code", type=CodeDt.class, order=4, min=0, max=1) @Child(name = "code", type = CodeDt.class, order = 4, min = 0, max = 1)
@Description( @Description(shortDefinition = "Coded form of the unit", formalDefinition = "A computer processable form of the units in some unit representation system")
shortDefinition="Coded form of the unit",
formalDefinition="A computer processable form of the units in some unit representation system"
)
private CodeDt myCode; private CodeDt myCode;
@Override @Override
public boolean isEmpty() { public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myValue, myComparator, myUnits, mySystem, myCode); return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(myValue, myComparator, myUnits, mySystem, myCode);
} }
@Override @Override
@ -170,14 +140,11 @@ class InternalQuantityDt
} }
/** /**
* Gets the value(s) for <b>value</b> (Numerical value (with implicit precision)). * Gets the value(s) for <b>value</b> (Numerical value (with implicit precision)). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The value of the measured amount. The value includes an implicit precision in the presentation of the value
* The value of the measured amount. The value includes an implicit precision in the presentation of the value * </p>
* </p>
*/ */
public DecimalDt getValueElement() { public DecimalDt getValueElement() {
if (myValue == null) { if (myValue == null) {
@ -189,25 +156,23 @@ class InternalQuantityDt
/** /**
* Sets the value(s) for <b>value</b> (Numerical value (with implicit precision)) * Sets the value(s) for <b>value</b> (Numerical value (with implicit precision))
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The value of the measured amount. The value includes an implicit precision in the presentation of the value
* The value of the measured amount. The value includes an implicit precision in the presentation of the value * </p>
* </p>
*/ */
public InternalQuantityDt setValue(DecimalDt theValue) { public InternalQuantityDt setValue(DecimalDt theValue) {
myValue = theValue; myValue = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>value</b> (Numerical value (with implicit precision)) * Sets the value for <b>value</b> (Numerical value (with implicit precision))
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The value of the measured amount. The value includes an implicit precision in the presentation of the value
* The value of the measured amount. The value includes an implicit precision in the presentation of the value * </p>
* </p>
*/ */
public InternalQuantityDt setValue( long theValue) { public InternalQuantityDt setValue(long theValue) {
myValue = new DecimalDt(theValue); myValue = new DecimalDt(theValue);
return this; return this;
} }
@ -215,12 +180,11 @@ class InternalQuantityDt
/** /**
* Sets the value for <b>value</b> (Numerical value (with implicit precision)) * Sets the value for <b>value</b> (Numerical value (with implicit precision))
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The value of the measured amount. The value includes an implicit precision in the presentation of the value
* The value of the measured amount. The value includes an implicit precision in the presentation of the value * </p>
* </p>
*/ */
public InternalQuantityDt setValue( double theValue) { public InternalQuantityDt setValue(double theValue) {
myValue = new DecimalDt(theValue); myValue = new DecimalDt(theValue);
return this; return this;
} }
@ -228,26 +192,22 @@ class InternalQuantityDt
/** /**
* Sets the value for <b>value</b> (Numerical value (with implicit precision)) * Sets the value for <b>value</b> (Numerical value (with implicit precision))
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The value of the measured amount. The value includes an implicit precision in the presentation of the value
* The value of the measured amount. The value includes an implicit precision in the presentation of the value * </p>
* </p>
*/ */
public InternalQuantityDt setValue( java.math.BigDecimal theValue) { public InternalQuantityDt setValue(java.math.BigDecimal theValue) {
myValue = new DecimalDt(theValue); myValue = new DecimalDt(theValue);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value). * Gets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is
* How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value * \"<\" , then the real value is < stated value
* </p> * </p>
*/ */
public BoundCodeDt<QuantityCompararatorEnum> getComparatorElement() { public BoundCodeDt<QuantityCompararatorEnum> getComparatorElement() {
if (myComparator == null) { if (myComparator == null) {
@ -259,10 +219,10 @@ class InternalQuantityDt
/** /**
* Sets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value) * Sets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is
* How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value * \"<\" , then the real value is < stated value
* </p> * </p>
*/ */
public InternalQuantityDt setComparator(BoundCodeDt<QuantityCompararatorEnum> theValue) { public InternalQuantityDt setComparator(BoundCodeDt<QuantityCompararatorEnum> theValue) {
myComparator = theValue; myComparator = theValue;
@ -272,26 +232,22 @@ class InternalQuantityDt
/** /**
* Sets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value) * Sets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is
* How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value * \"<\" , then the real value is < stated value
* </p> * </p>
*/ */
public InternalQuantityDt setComparator(QuantityCompararatorEnum theValue) { public InternalQuantityDt setComparator(QuantityCompararatorEnum theValue) {
getComparatorElement().setValueAsEnum(theValue); getComparatorElement().setValueAsEnum(theValue);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>units</b> (Unit representation). * Gets the value(s) for <b>units</b> (Unit representation). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A human-readable form of the units
* A human-readable form of the units * </p>
* </p>
*/ */
public StringDt getUnitsElement() { public StringDt getUnitsElement() {
if (myUnits == null) { if (myUnits == null) {
@ -303,39 +259,33 @@ class InternalQuantityDt
/** /**
* Sets the value(s) for <b>units</b> (Unit representation) * Sets the value(s) for <b>units</b> (Unit representation)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A human-readable form of the units
* A human-readable form of the units * </p>
* </p>
*/ */
public InternalQuantityDt setUnits(StringDt theValue) { public InternalQuantityDt setUnits(StringDt theValue) {
myUnits = theValue; myUnits = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>units</b> (Unit representation) * Sets the value for <b>units</b> (Unit representation)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A human-readable form of the units
* A human-readable form of the units * </p>
* </p>
*/ */
public InternalQuantityDt setUnits( String theString) { public InternalQuantityDt setUnits(String theString) {
myUnits = new StringDt(theString); myUnits = new StringDt(theString);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>system</b> (System that defines coded unit form). * Gets the value(s) for <b>system</b> (System that defines coded unit form). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The identification of the system that provides the coded form of the unit
* The identification of the system that provides the coded form of the unit * </p>
* </p>
*/ */
public UriDt getSystemElement() { public UriDt getSystemElement() {
if (mySystem == null) { if (mySystem == null) {
@ -347,39 +297,33 @@ class InternalQuantityDt
/** /**
* Sets the value(s) for <b>system</b> (System that defines coded unit form) * Sets the value(s) for <b>system</b> (System that defines coded unit form)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The identification of the system that provides the coded form of the unit
* The identification of the system that provides the coded form of the unit * </p>
* </p>
*/ */
public InternalQuantityDt setSystem(UriDt theValue) { public InternalQuantityDt setSystem(UriDt theValue) {
mySystem = theValue; mySystem = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>system</b> (System that defines coded unit form) * Sets the value for <b>system</b> (System that defines coded unit form)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> The identification of the system that provides the coded form of the unit
* The identification of the system that provides the coded form of the unit * </p>
* </p>
*/ */
public InternalQuantityDt setSystem( String theUri) { public InternalQuantityDt setSystem(String theUri) {
mySystem = new UriDt(theUri); mySystem = new UriDt(theUri);
return this; return this;
} }
/** /**
* Gets the value(s) for <b>code</b> (Coded form of the unit). * Gets the value(s) for <b>code</b> (Coded form of the unit). creating it if it does not exist. Will not return <code>null</code>.
* creating it if it does
* not exist. Will not return <code>null</code>.
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A computer processable form of the units in some unit representation system
* A computer processable form of the units in some unit representation system * </p>
* </p>
*/ */
public CodeDt getCodeElement() { public CodeDt getCodeElement() {
if (myCode == null) { if (myCode == null) {
@ -391,25 +335,23 @@ class InternalQuantityDt
/** /**
* Sets the value(s) for <b>code</b> (Coded form of the unit) * Sets the value(s) for <b>code</b> (Coded form of the unit)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A computer processable form of the units in some unit representation system
* A computer processable form of the units in some unit representation system * </p>
* </p>
*/ */
public InternalQuantityDt setCode(CodeDt theValue) { public InternalQuantityDt setCode(CodeDt theValue) {
myCode = theValue; myCode = theValue;
return this; return this;
} }
/** /**
* Sets the value for <b>code</b> (Coded form of the unit) * Sets the value for <b>code</b> (Coded form of the unit)
* *
* <p> * <p>
* <b>Definition:</b> * <b>Definition:</b> A computer processable form of the units in some unit representation system
* A computer processable form of the units in some unit representation system * </p>
* </p>
*/ */
public InternalQuantityDt setCode( String theCode) { public InternalQuantityDt setCode(String theCode) {
myCode = new CodeDt(theCode); myCode = new CodeDt(theCode);
return this; return this;
} }
@ -424,7 +366,4 @@ class InternalQuantityDt
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
} }

View File

@ -31,31 +31,30 @@ import ca.uhn.fhir.util.ResourceReferenceInfo;
* Controls how bundles decide whether referenced resources should be included * Controls how bundles decide whether referenced resources should be included
*/ */
public enum BundleInclusionRule { public enum BundleInclusionRule {
/**
* Decision is based on whether the resource's Include is in the IncludeSet (e.g. DiagnosticReport.result). Note that
* the resource has to be populated to be included.
*
* This is the default behavior
*/
BASED_ON_INCLUDES {
@Override
public boolean shouldIncludeReferencedResource(ResourceReferenceInfo theReferenceInfo, Set<Include> theIncludes) {
return theReferenceInfo.matchesIncludeSet(theIncludes);
}
},
/** /**
* Decision is based on whether the resource reference is set to a populated resource (in which case its included) or just * Decision is based on whether the resource's Include is in the IncludeSet (e.g. DiagnosticReport.result). Note that the resource has to be populated to be included.
* an id (in which case it's not included) *
* * This is the default behavior
* This is the original HAPI behavior */
*/ BASED_ON_INCLUDES {
BASED_ON_RESOURCE_PRESENCE { @Override
@Override public boolean shouldIncludeReferencedResource(ResourceReferenceInfo theReferenceInfo, Set<Include> theIncludes) {
public boolean shouldIncludeReferencedResource(ResourceReferenceInfo theReferenceInfo, Set<Include> theIncludes) { return theReferenceInfo.matchesIncludeSet(theIncludes);
return true; }
} },
};
public abstract boolean shouldIncludeReferencedResource(ResourceReferenceInfo theReferenceInfo, Set<Include> theIncludes); /**
* Decision is based on whether the resource reference is set to a populated resource (in which case its included) or just an id (in which case it's not included)
*
* This is the original HAPI behavior
*/
BASED_ON_RESOURCE_PRESENCE {
@Override
public boolean shouldIncludeReferencedResource(ResourceReferenceInfo theReferenceInfo, Set<Include> theIncludes) {
return true;
}
};
public abstract boolean shouldIncludeReferencedResource(ResourceReferenceInfo theReferenceInfo, Set<Include> theIncludes);
} }

View File

@ -3,207 +3,180 @@
"-//Puppy Crawl//DTD Check Configuration 1.3//EN" "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!-- <module name="Checker">
<property name="charset" value="UTF-8"/>
Checkstyle configuration that checks the Google coding conventions from: <property name="severity" value="warning"/>
- Google Java Style <!--<property name="fileExtensions" value="java, properties, xml"/> -->
https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html
Checkstyle is very configurable. Be sure to read the documentation at <module name="TreeWalker">
http://checkstyle.sf.net (or in your downloaded distribution). <property name="tabWidth" value="3"/>
<module name="OuterTypeFilename"/>
Most Checks are configurable, be sure to consult the documentation. <module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
To completely disable a check, just comment it out or delete it from the file. <property name="format"
value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov. <property name="message"
value="Avoid using corresponding octal or Unicode escape."/>
--> </module>
<module name="AvoidEscapedUnicodeCharacters">
<module name = "Checker"> <property name="allowEscapesForControlCharacters" value="true"/>
<property name="charset" value="UTF-8"/> <property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
<property name="severity" value="warning"/> </module>
<module name="LineLength">
<!--<property name="fileExtensions" value="java, properties, xml"/>--> <property name="max" value="300"/>
<property name="ignorePattern"
<module name="TreeWalker"> value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
<property name="tabWidth" value="3"/> </module>
<module name="OuterTypeFilename"/> <!--<module name="AvoidStarImport"/> -->
<module name="IllegalTokenText"> <module name="OneTopLevelClass"/>
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/> <module name="NoLineWrap"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/> <module name="EmptyBlock">
<property name="message" value="Avoid using corresponding octal or Unicode escape."/> <property name="option" value="TEXT"/>
</module> <property name="tokens"
<module name="AvoidEscapedUnicodeCharacters"> value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
<property name="allowEscapesForControlCharacters" value="true"/> </module>
<property name="allowByTailComment" value="true"/> <module name="NeedBraces"/>
<property name="allowNonPrintableEscapes" value="true"/> <module name="LeftCurly">
</module> <property name="maxLineLength" value="300"/>
<module name="LineLength"> </module>
<property name="max" value="300"/> <module name="RightCurly"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/> <module name="RightCurly">
</module> <property name="option" value="alone"/>
<!--<module name="AvoidStarImport"/>--> <property name="tokens"
<module name="OneTopLevelClass"/> value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
<module name="NoLineWrap"/> </module>
<module name="EmptyBlock"> <!-- <module name="WhitespaceAround"> <property name="allowEmptyConstructors"
<property name="option" value="TEXT"/> value="true"/> <property name="allowEmptyMethods" value="true"/> <property
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/> name="allowEmptyTypes" value="true"/> <property name="allowEmptyLoops" value="true"/>
</module> <message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed
<module name="NeedBraces"/> by whitespace. Empty blocks may only be represented as '{}' when not part
<module name="LeftCurly"> of a multi-block statement (4.1.3)"/> <message key="ws.notPreceded" value="WhitespaceAround:
<property name="maxLineLength" value="300"/> ''{0}'' is not preceded with whitespace."/> </module> -->
</module> <module name="OneStatementPerLine"/>
<module name="RightCurly"/> <module name="MultipleVariableDeclarations"/>
<module name="RightCurly"> <module name="ArrayTypeStyle"/>
<property name="option" value="alone"/> <!-- <module name="MissingSwitchDefault"/> -->
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/> <module name="FallThrough"/>
</module> <module name="UpperEll"/>
<!-- <module name="ModifierOrder"/>
<module name="WhitespaceAround"> <module name="EmptyLineSeparator">
<property name="allowEmptyConstructors" value="true"/> <property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowEmptyMethods" value="true"/> </module>
<property name="allowEmptyTypes" value="true"/> <module name="SeparatorWrap">
<property name="allowEmptyLoops" value="true"/> <property name="tokens" value="DOT"/>
<message key="ws.notFollowed" <property name="option" value="nl"/>
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/> </module>
<message key="ws.notPreceded" <module name="SeparatorWrap">
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/> <property name="tokens" value="COMMA"/>
</module> <property name="option" value="EOL"/>
--> </module>
<module name="OneStatementPerLine"/> <module name="PackageName">
<module name="MultipleVariableDeclarations"/> <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<module name="ArrayTypeStyle"/> <message key="name.invalidPattern"
<!-- value="Package name ''{0}'' must match pattern ''{1}''."/>
<module name="MissingSwitchDefault"/> </module>
--> <module name="TypeName">
<module name="FallThrough"/> <message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
<module name="UpperEll"/> </module>
<module name="ModifierOrder"/> <module name="MemberName">
<module name="EmptyLineSeparator"> <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<property name="allowNoEmptyLineBetweenFields" value="true"/> <message key="name.invalidPattern"
</module> value="Member name ''{0}'' must match pattern ''{1}''."/>
<module name="SeparatorWrap"> </module>
<property name="tokens" value="DOT"/> <module name="ParameterName">
<property name="option" value="nl"/> <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
</module> <message key="name.invalidPattern"
<module name="SeparatorWrap"> value="Parameter name ''{0}'' must match pattern ''{1}''."/>
<property name="tokens" value="COMMA"/> </module>
<property name="option" value="EOL"/> <module name="LocalVariableName">
</module> <property name="tokens" value="VARIABLE_DEF"/>
<module name="PackageName"> <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/> <message key="name.invalidPattern"
<message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
value="Package name ''{0}'' must match pattern ''{1}''."/> </module>
</module> <module name="ClassTypeParameterName">
<module name="TypeName"> <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/> value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="MemberName"> <module name="MethodTypeParameterName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/> <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" <message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/> value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="ParameterName"> <module name="NoFinalizer"/>
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/> <module name="GenericWhitespace">
<message key="name.invalidPattern" <message key="ws.followed"
value="Parameter name ''{0}'' must match pattern ''{1}''."/> value="GenericWhitespace ''{0}'' is followed by whitespace."/>
</module> <message key="ws.preceded"
<module name="LocalVariableName"> value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<property name="tokens" value="VARIABLE_DEF"/> <message key="ws.illegalFollow"
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/> value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="name.invalidPattern" <message key="ws.notPreceded"
value="Local variable name ''{0}'' must match pattern ''{1}''."/> value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module> </module>
<module name="ClassTypeParameterName"> <module name="UncommentedMain"/>
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/> <module name="Indentation">
<message key="name.invalidPattern" <property name="basicOffset" value="3"/>
value="Class type name ''{0}'' must match pattern ''{1}''."/> <property name="braceAdjustment" value="0"/>
</module> <property name="caseIndent" value="0"/>
<module name="MethodTypeParameterName"> <property name="throwsIndent" value="6"/>
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/> <property name="lineWrappingIndentation" value="6"/>
<message key="name.invalidPattern" <property name="arrayInitIndent" value="3"/>
value="Method type name ''{0}'' must match pattern ''{1}''."/> </module>
</module> <module name="AbbreviationAsWordInName">
<module name="NoFinalizer"/> <property name="ignoreFinal" value="false"/>
<module name="GenericWhitespace"> <property name="allowedAbbreviationLength" value="1"/>
<message key="ws.followed" </module>
value="GenericWhitespace ''{0}'' is followed by whitespace."/> <module name="OverloadMethodsDeclarationOrder"/>
<message key="ws.preceded" <module name="VariableDeclarationUsageDistance"/>
value="GenericWhitespace ''{0}'' is preceded with whitespace."/> <!-- <module name="CustomImportOrder"> <property name="specialImportsRegExp"
<message key="ws.illegalFollow" value="com.google"/> <property name="sortImportsInGroupAlphabetically" value="true"/>
value="GenericWhitespace ''{0}'' should followed by whitespace."/> <property name="customImportOrderRules" value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
<message key="ws.notPreceded" </module> -->
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/> <module name="MethodParamPad"/>
</module> <module name="OperatorWrap">
<module name="UncommentedMain"/> <property name="option" value="NL"/>
<module name="Indentation"> <property name="tokens"
<property name="basicOffset" value="3"/> value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
<property name="braceAdjustment" value="0"/> </module>
<property name="caseIndent" value="0"/> <module name="AnnotationLocation">
<property name="throwsIndent" value="6"/> <property name="tokens"
<property name="lineWrappingIndentation" value="6"/> value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
<property name="arrayInitIndent" value="3"/> </module>
</module> <module name="AnnotationLocation">
<module name="AbbreviationAsWordInName"> <property name="tokens" value="VARIABLE_DEF"/>
<property name="ignoreFinal" value="false"/> <property name="allowSamelineMultipleAnnotations" value="true"/>
<property name="allowedAbbreviationLength" value="1"/> </module>
</module> <module name="NonEmptyAtclauseDescription"/>
<module name="OverloadMethodsDeclarationOrder"/> <module name="JavadocTagContinuationIndentation"/>
<module name="VariableDeclarationUsageDistance"/> <module name="SummaryJavadocCheck">
<!-- <property name="forbiddenSummaryFragments"
<module name="CustomImportOrder"> value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
<property name="specialImportsRegExp" value="com.google"/> </module>
<property name="sortImportsInGroupAlphabetically" value="true"/> <module name="AtclauseOrder">
<property name="customImportOrderRules" value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/> <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
</module> <property name="target"
--> value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<module name="MethodParamPad"/> </module>
<module name="OperatorWrap"> <!-- <module name="JavadocMethod"> <module name="JavadocParagraph"/> <property
<property name="option" value="NL"/> name="scope" value="public"/> <property name="allowMissingParamTags" value="true"/>
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/> <property name="allowMissingThrowsTags" value="true"/> <property name="allowMissingReturnTag"
</module> value="true"/> <property name="minLineCount" value="2"/> <property name="allowedAnnotations"
<module name="AnnotationLocation"> value="Override, Test"/> <property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/> </module> -->
</module> <module name="MethodName">
<module name="AnnotationLocation"> <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<property name="tokens" value="VARIABLE_DEF"/> <message key="name.invalidPattern"
<property name="allowSamelineMultipleAnnotations" value="true"/> value="Method name ''{0}'' must match pattern ''{1}''."/>
</module> </module>
<module name="NonEmptyAtclauseDescription"/> <module name="SingleLineJavadoc"/>
<module name="JavadocTagContinuationIndentation"/> <!--<property name="ignoreInlineTags" value="false"/> -->
<module name="SummaryJavadocCheck"> <!--<module name="EmptyCatchBlock"> <property name="exceptionVariableName"
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/> value="expected"/> </module> -->
</module> </module>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<!--
<module name="JavadocMethod">
<module name="JavadocParagraph"/>
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
-->
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc"/>
<!--<property name="ignoreInlineTags" value="false"/>-->
<!--<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>-->
</module>
</module> </module>