Lots more work on DSTU2.1 structures
This commit is contained in:
parent
47721ddf54
commit
056900f324
|
@ -66,7 +66,7 @@ public abstract class BaseRuntimeElementDefinition<T extends IBase> {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName()+"[" + getName() + "]";
|
||||
return getClass().getSimpleName()+"[" + getName() + ", " + getImplementingClass().getSimpleName() + "]";
|
||||
}
|
||||
|
||||
public void addExtension(RuntimeChildDeclaredExtensionDefinition theExtension) {
|
||||
|
|
|
@ -232,7 +232,8 @@ class ModelScanner {
|
|||
}
|
||||
|
||||
private boolean isStandardType(Class<? extends IBase> theClass) {
|
||||
return myVersionTypes.contains(theClass);
|
||||
boolean retVal = myVersionTypes.contains(theClass);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -690,7 +691,13 @@ class ModelScanner {
|
|||
}
|
||||
myClassToElementDefinitions.put(theClass, resourceDef);
|
||||
if (!theDatatypeDefinition.isSpecialization()) {
|
||||
myNameToElementDefinitions.put(resourceName, resourceDef);
|
||||
if (myVersion.isRi() && IDatatype.class.isAssignableFrom(theClass)) {
|
||||
ourLog.debug("Not adding non RI type {} to RI context", theClass);
|
||||
} else if (!myVersion.isRi() && !IDatatype.class.isAssignableFrom(theClass)) {
|
||||
ourLog.debug("Not adding RI type {} to non RI context", theClass);
|
||||
} else {
|
||||
myNameToElementDefinitions.put(resourceName, resourceDef);
|
||||
}
|
||||
}
|
||||
|
||||
return resourceName;
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
|
@ -35,7 +34,6 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
|
|||
import ca.uhn.fhir.model.api.ExtensionDt;
|
||||
import ca.uhn.fhir.model.api.IDatatype;
|
||||
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
|
||||
import ca.uhn.fhir.model.primitive.CodeDt;
|
||||
|
||||
public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildDefinition {
|
||||
|
||||
|
@ -149,6 +147,8 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RuntimeChildUndeclaredExtensionDefinition.class);
|
||||
|
||||
@Override
|
||||
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
|
||||
Map<String, BaseRuntimeElementDefinition<?>> datatypeAttributeNameToDefinition = new HashMap<String, BaseRuntimeElementDefinition<?>>();
|
||||
|
@ -160,7 +160,12 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
|
|||
|
||||
myDatatypeToDefinition.put(next.getImplementingClass(), next);
|
||||
|
||||
if (!((IRuntimeDatatypeDefinition) next).isSpecialization()) {
|
||||
boolean isSpecialization = ((IRuntimeDatatypeDefinition) next).isSpecialization();
|
||||
if (isSpecialization) {
|
||||
ourLog.trace("Not adding specialization: {}", next.getImplementingClass());
|
||||
}
|
||||
|
||||
if (!isSpecialization) {
|
||||
|
||||
if (!next.isStandardType()) {
|
||||
continue;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package ca.uhn.fhir.rest.client;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR - Core Library
|
||||
|
@ -47,6 +49,7 @@ import org.apache.http.client.methods.CloseableHttpResponse;
|
|||
import org.apache.http.client.methods.HttpRequestBase;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
|
@ -71,6 +74,7 @@ import ca.uhn.fhir.rest.method.MethodUtil;
|
|||
import ca.uhn.fhir.rest.server.Constants;
|
||||
import ca.uhn.fhir.rest.server.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
|
||||
import ca.uhn.fhir.util.OperationOutcomeUtil;
|
||||
|
||||
public abstract class BaseClient implements IRestfulClient {
|
||||
|
||||
|
@ -284,7 +288,7 @@ public abstract class BaseClient implements IRestfulClient {
|
|||
}
|
||||
|
||||
String message = "HTTP " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase();
|
||||
BaseOperationOutcome oo = null;
|
||||
IBaseOperationOutcome oo = null;
|
||||
if (Constants.CT_TEXT.equals(mimeType)) {
|
||||
message = message + ": " + body;
|
||||
} else {
|
||||
|
@ -293,9 +297,10 @@ public abstract class BaseClient implements IRestfulClient {
|
|||
IParser p = enc.newParser(theContext);
|
||||
try {
|
||||
// TODO: handle if something other than OO comes back
|
||||
oo = (BaseOperationOutcome) p.parseResource(body);
|
||||
if (oo.getIssueFirstRep().getDetailsElement().isEmpty() == false) {
|
||||
message = message + ": " + oo.getIssueFirstRep().getDetailsElement().getValue();
|
||||
oo = (IBaseOperationOutcome) p.parseResource(body);
|
||||
String details = OperationOutcomeUtil.getFirstIssueDetails(getFhirContext(), oo);
|
||||
if (isNotBlank(details)) {
|
||||
message = message + ": " + details;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ourLog.debug("Failed to process OperationOutcome response");
|
||||
|
|
|
@ -160,7 +160,8 @@ public class OperationOutcomeUtil {
|
|||
} else {
|
||||
detailsChild = issueElement.getChildByName("details");
|
||||
}
|
||||
BaseRuntimeElementDefinition<?> stringDef = theCtx.getElementDefinition("string");
|
||||
|
||||
BaseRuntimeElementDefinition<?> stringDef = detailsChild.getChildByName(detailsChild.getElementName());
|
||||
BaseRuntimeChildDefinition severityChild = issueElement.getChildByName("severity");
|
||||
BaseRuntimeChildDefinition locationChild = issueElement.getChildByName("location");
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class ParametersUtil {
|
|||
IBase parameter = paramChildElem.newInstance();
|
||||
paramChild.getMutator().addValue(theTargetResource, parameter);
|
||||
IPrimitiveType<?> value;
|
||||
if (theContext.getVersion().getVersion().equals(FhirVersionEnum.DSTU2_HL7ORG)) {
|
||||
if (theContext.getVersion().getVersion().isRi()) {
|
||||
value = (IPrimitiveType<?>) theContext.getElementDefinition("string").newInstance(theName);
|
||||
} else {
|
||||
value = new StringDt(theName);
|
||||
|
|
|
@ -27,6 +27,10 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.instance.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.instance.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.instance.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.instance.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
|
@ -51,17 +55,12 @@ import ca.uhn.fhir.rest.api.ValidationModeEnum;
|
|||
import ca.uhn.fhir.rest.server.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||
import ca.uhn.fhir.util.FhirTerser;
|
||||
import ca.uhn.fhir.validation.DefaultProfileValidationSupport;
|
||||
import ca.uhn.fhir.validation.FhirInstanceValidator;
|
||||
import ca.uhn.fhir.validation.FhirValidator;
|
||||
import ca.uhn.fhir.validation.IValidationContext;
|
||||
import ca.uhn.fhir.validation.IValidationSupport;
|
||||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
import ca.uhn.fhir.validation.ValidationSupportChain;
|
||||
import net.sourceforge.cobertura.CoverageIgnore;
|
||||
|
||||
public class FhirResourceDaoDstu2<T extends IResource> extends BaseHapiFhirResourceDao<T> {
|
||||
|
|
|
@ -26,16 +26,17 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.hapi.validation.FhirInstanceValidator;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.OperationOutcomeIssueComponent;
|
||||
import org.hl7.fhir.dstu21.validation.IResourceValidator.BestPracticeWarningLevel;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.validation.IResourceValidator.BestPracticeWarningLevel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
|
@ -44,7 +45,6 @@ import ca.uhn.fhir.context.RuntimeSearchParam;
|
|||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
import ca.uhn.fhir.jpa.util.DeleteConflict;
|
||||
import ca.uhn.fhir.model.api.Bundle;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.api.Include;
|
||||
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
|
||||
import ca.uhn.fhir.rest.api.MethodOutcome;
|
||||
|
@ -55,13 +55,10 @@ import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
|||
import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||
import ca.uhn.fhir.util.FhirTerser;
|
||||
import ca.uhn.fhir.validation.DefaultProfileValidationSupport;
|
||||
import ca.uhn.fhir.validation.FhirInstanceValidator;
|
||||
import ca.uhn.fhir.validation.FhirValidator;
|
||||
import ca.uhn.fhir.validation.IValidationContext;
|
||||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
import ca.uhn.fhir.validation.ValidationSupportChain;
|
||||
import net.sourceforge.cobertura.CoverageIgnore;
|
||||
|
||||
public class FhirResourceDaoDstu21<T extends IAnyResource> extends BaseHapiFhirResourceDao<T> {
|
||||
|
|
|
@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.hl7.fhir.instance.hapi.validation.FhirQuestionnaireResponseValidator;
|
||||
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
|
@ -36,7 +37,6 @@ import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
|
|||
import ca.uhn.fhir.model.dstu2.resource.ValueSet;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
import ca.uhn.fhir.validation.FhirQuestionnaireResponseValidator;
|
||||
import ca.uhn.fhir.validation.FhirValidator;
|
||||
import ca.uhn.fhir.validation.IResourceLoader;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
|
|
|
@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.hl7.fhir.dstu21.hapi.validation.FhirQuestionnaireResponseValidator;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome;
|
||||
import org.hl7.fhir.dstu21.model.Questionnaire;
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
||||
|
@ -30,25 +31,21 @@ import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
|
|||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
import ca.uhn.fhir.validation.FhirQuestionnaireResponseValidator;
|
||||
import ca.uhn.fhir.validation.FhirValidator;
|
||||
import ca.uhn.fhir.validation.IResourceLoader;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
|
||||
public class FhirResourceDaoQuestionnaireResponseDstu21 extends FhirResourceDaoDstu21<QuestionnaireResponse> {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myFhirContextDstu2Hl7Org")
|
||||
private FhirContext myRefImplCtx;
|
||||
|
||||
private Boolean myValidateResponses;
|
||||
|
||||
@Autowired
|
||||
private IJpaValidationSupportDstu21 myValidationSupport;
|
||||
|
||||
/**
|
||||
* Initialize the bean
|
||||
*/
|
||||
|
@ -74,17 +71,17 @@ public class FhirResourceDaoQuestionnaireResponseDstu21 extends FhirResourceDaoD
|
|||
return;
|
||||
}
|
||||
|
||||
FhirValidator val = myRefImplCtx.newValidator();
|
||||
FhirValidator val = getContext().newValidator();
|
||||
val.setValidateAgainstStandardSchema(false);
|
||||
val.setValidateAgainstStandardSchematron(false);
|
||||
|
||||
FhirQuestionnaireResponseValidator module = new FhirQuestionnaireResponseValidator();
|
||||
module.setResourceLoader(new JpaResourceLoader());
|
||||
module.setValidationSupport(myValidationSupport);
|
||||
val.registerValidatorModule(module);
|
||||
|
||||
ValidationResult result = val.validateWithResult(myRefImplCtx.newJsonParser().parseResource(getContext().newJsonParser().encodeResourceToString(qa)));
|
||||
ValidationResult result = val.validateWithResult(getContext().newJsonParser().parseResource(getContext().newJsonParser().encodeResourceToString(qa)));
|
||||
if (!result.isSuccessful()) {
|
||||
IBaseOperationOutcome oo = getContext().newJsonParser().parseResource(OperationOutcome.class, myRefImplCtx.newJsonParser().encodeResourceToString(result.toOperationOutcome()));
|
||||
IBaseOperationOutcome oo = getContext().newJsonParser().parseResource(OperationOutcome.class, getContext().newJsonParser().encodeResourceToString(result.toOperationOutcome()));
|
||||
throw new UnprocessableEntityException(getContext(), oo);
|
||||
}
|
||||
}
|
||||
|
@ -101,16 +98,11 @@ public class FhirResourceDaoQuestionnaireResponseDstu21 extends FhirResourceDaoD
|
|||
if ("ValueSet".equals(theType.getSimpleName())) {
|
||||
IFhirResourceDao<ValueSet> dao = getDao(ValueSet.class);
|
||||
ValueSet in = dao.read(theId);
|
||||
String encoded = getContext().newJsonParser().encodeResourceToString(in);
|
||||
|
||||
// TODO: this is temporary until structures-dstu2 catches up to structures-hl7org.dstu2
|
||||
encoded = encoded.replace("\"define\"", "\"codeSystem\"");
|
||||
|
||||
return myRefImplCtx.newJsonParser().parseResource(theType, encoded);
|
||||
return (T) in;
|
||||
} else if ("Questionnaire".equals(theType.getSimpleName())) {
|
||||
IFhirResourceDao<Questionnaire> dao = getDao(Questionnaire.class);
|
||||
Questionnaire vs = dao.read(theId);
|
||||
return myRefImplCtx.newJsonParser().parseResource(theType, getContext().newJsonParser().encodeResourceToString(vs));
|
||||
return (T) vs;
|
||||
} else {
|
||||
// Should not happen, validator will only ask for these two
|
||||
throw new IllegalStateException("Unexpected request to load resource of type " + theType);
|
||||
|
|
|
@ -31,6 +31,8 @@ import java.util.Set;
|
|||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.codec.binary.StringUtils;
|
||||
import org.hl7.fhir.instance.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.instance.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -52,8 +54,6 @@ import ca.uhn.fhir.rest.param.UriParam;
|
|||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.validation.DefaultProfileValidationSupport;
|
||||
import ca.uhn.fhir.validation.ValidationSupportChain;
|
||||
|
||||
public class FhirResourceDaoValueSetDstu2 extends FhirResourceDaoDstu2<ValueSet>implements IFhirResourceDaoValueSet<ValueSet, CodingDt, CodeableConceptDt> {
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ package ca.uhn.fhir.jpa.dao;
|
|||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
|
@ -32,6 +34,10 @@ import java.util.Set;
|
|||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.codec.binary.StringUtils;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.DefaultProfileValidationSupport;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.HapiWorkerContext;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport.CodeValidationResult;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.ValidationSupportChain;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
|
@ -39,32 +45,29 @@ import org.hl7.fhir.dstu21.model.ValueSet;
|
|||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptReferenceComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionContainsComponent;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpander;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpander.ETooCostly;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.hl7.fhir.instance.model.api.IPrimitiveType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.jpa.entity.BaseHasResource;
|
||||
import ca.uhn.fhir.rest.param.TokenParam;
|
||||
import ca.uhn.fhir.rest.param.UriParam;
|
||||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.validation.DefaultProfileValidationSupport;
|
||||
import ca.uhn.fhir.validation.ValidationSupportChain;
|
||||
|
||||
public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSet>implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
||||
public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSet> implements IFhirResourceDaoValueSet<ValueSet, Coding, CodeableConcept> {
|
||||
|
||||
@Autowired
|
||||
private IJpaValidationSupportDstu21 myJpaValidationSupport;
|
||||
|
||||
|
||||
private ValidationSupportChain myValidationSupport;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myFhirContextDstu2Hl7Org")
|
||||
private FhirContext myRiCtx;
|
||||
|
||||
private DefaultProfileValidationSupport myDefaultProfileValidationSupport;
|
||||
|
||||
|
@ -72,22 +75,29 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
super.postConstruct();
|
||||
// myDefaultProfileValidationSupport = new DefaultProfileValidationSupport();
|
||||
// myValidationSupport = new ValidationSupportChain(myDefaultProfileValidationSupport, myJpaValidationSupport);
|
||||
myDefaultProfileValidationSupport = new DefaultProfileValidationSupport();
|
||||
myValidationSupport = new ValidationSupportChain(myDefaultProfileValidationSupport, myJpaValidationSupport);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ValueSet expand(IIdType theId, String theFilter) {
|
||||
ValueSet source = loadValueSetForExpansion(theId);
|
||||
return expand(source, theFilter);
|
||||
// throw new UnsupportedOperationException();
|
||||
HapiWorkerContext workerContext = new HapiWorkerContext(getContext(), myValidationSupport);
|
||||
ConceptSetComponent inc = new ConceptSetComponent();
|
||||
inc.setSystem(theId.getValue());
|
||||
ValueSetExpansionComponent outcome = workerContext.expandVS(inc);
|
||||
|
||||
ValueSet retVal = new ValueSet();
|
||||
retVal.setExpansion(outcome);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
private ValueSet loadValueSetForExpansion(IIdType theId) {
|
||||
if (theId.getValue().startsWith("http://hl7.org/fhir/")) {
|
||||
org.hl7.fhir.instance.model.ValueSet valueSet = myValidationSupport.fetchResource(myRiCtx, org.hl7.fhir.instance.model.ValueSet.class, theId.getValue());
|
||||
ValueSet valueSet = myValidationSupport.fetchResource(getContext(), ValueSet.class, theId.getValue());
|
||||
if (valueSet != null) {
|
||||
return getContext().newJsonParser().parseResource(ValueSet.class, myRiCtx.newJsonParser().encodeResourceToString(valueSet));
|
||||
return valueSet; // getContext().newJsonParser().parseResource(ValueSet.class,
|
||||
// getContext().newJsonParser().encodeResourceToString(valueSet));
|
||||
}
|
||||
}
|
||||
BaseHasResource sourceEntity = readEntity(theId);
|
||||
|
@ -104,10 +114,10 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
throw new InvalidRequestException("URI must not be blank or missing");
|
||||
}
|
||||
ValueSet source;
|
||||
|
||||
org.hl7.fhir.instance.model.ValueSet defaultValueSet = myDefaultProfileValidationSupport.fetchResource(myRiCtx, org.hl7.fhir.instance.model.ValueSet.class, theUri);
|
||||
|
||||
org.hl7.fhir.instance.model.ValueSet defaultValueSet = myDefaultProfileValidationSupport.fetchResource(getContext(), org.hl7.fhir.instance.model.ValueSet.class, theUri);
|
||||
if (defaultValueSet != null) {
|
||||
source = getContext().newJsonParser().parseResource(ValueSet.class, myRiCtx.newJsonParser().encodeResourceToString(defaultValueSet));
|
||||
source = getContext().newJsonParser().parseResource(ValueSet.class, getContext().newJsonParser().encodeResourceToString(defaultValueSet));
|
||||
} else {
|
||||
IBundleProvider ids = search(ValueSet.SP_URL, new UriParam(theUri));
|
||||
if (ids.size() == 0) {
|
||||
|
@ -124,7 +134,7 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
public ValueSet expand(ValueSet source, String theFilter) {
|
||||
ValueSet retVal = new ValueSet();
|
||||
retVal.setDate(new Date());
|
||||
|
||||
|
||||
/*
|
||||
* Add composed concepts
|
||||
*/
|
||||
|
@ -178,7 +188,8 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
}
|
||||
|
||||
@Override
|
||||
public ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult validateCode(IPrimitiveType<String> theValueSetIdentifier, IIdType theId, IPrimitiveType<String> theCode, IPrimitiveType<String> theSystem, IPrimitiveType<String> theDisplay, Coding theCoding, CodeableConcept theCodeableConcept) {
|
||||
public ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult validateCode(IPrimitiveType<String> theValueSetIdentifier, IIdType theId, IPrimitiveType<String> theCode, IPrimitiveType<String> theSystem, IPrimitiveType<String> theDisplay, Coding theCoding,
|
||||
CodeableConcept theCodeableConcept) {
|
||||
List<IIdType> valueSetIds;
|
||||
|
||||
boolean haveCodeableConcept = theCodeableConcept != null && theCodeableConcept.getCoding().size() > 0;
|
||||
|
@ -228,10 +239,10 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
}
|
||||
|
||||
private List<IIdType> findValueSetIdsContainingSystemAndCode(String theCode, String theSystem) {
|
||||
if (theSystem != null && theSystem.startsWith("http://hl7.org/fhir/")) {
|
||||
return Collections.singletonList((IIdType)new IdType(theSystem));
|
||||
if (theSystem != null && theSystem.startsWith("http://hl7.org/fhir/ValueSet")) {
|
||||
return Collections.singletonList((IIdType) new IdType(theSystem));
|
||||
}
|
||||
|
||||
|
||||
List<IIdType> valueSetIds;
|
||||
Set<Long> ids = searchForIds(ValueSet.SP_CODE, new TokenParam(theSystem, theCode));
|
||||
valueSetIds = new ArrayList<IIdType>();
|
||||
|
@ -255,8 +266,7 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
return thePrimitive != null ? thePrimitive.getValue() : null;
|
||||
}
|
||||
|
||||
private ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult validateCodeIsInContains(List<ValueSetExpansionContainsComponent> contains, String theSystem, String theCode, Coding theCoding,
|
||||
CodeableConcept theCodeableConcept) {
|
||||
private ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult validateCodeIsInContains(List<ValueSetExpansionContainsComponent> contains, String theSystem, String theCode, Coding theCoding, CodeableConcept theCodeableConcept) {
|
||||
for (ValueSetExpansionContainsComponent nextCode : contains) {
|
||||
ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult result = validateCodeIsInContains(nextCode.getContains(), theSystem, theCode, theCoding, theCodeableConcept);
|
||||
if (result != null) {
|
||||
|
@ -309,15 +319,47 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
code = theCode.getValue();
|
||||
system = theSystem.getValue();
|
||||
}
|
||||
|
||||
// CodeValidationResult validateOutcome = myJpaValidationSupport.validateCode(getContext(), system, code, null);
|
||||
//
|
||||
// LookupCodeResult result = new LookupCodeResult();
|
||||
// result.setSearchedForCode(code);
|
||||
// result.setSearchedForSystem(system);
|
||||
// result.setFound(false);
|
||||
// if (validateOutcome.isOk()) {
|
||||
// result.setFound(true);
|
||||
// result.setCodeIsAbstract(validateOutcome.asConceptDefinition().getAbstract());
|
||||
// result.setCodeDisplay(validateOutcome.asConceptDefinition().getDisplay());
|
||||
// }
|
||||
// return result;
|
||||
// result.getDisplay()
|
||||
//
|
||||
// List<IIdType> valueSetIds = findValueSetIdsContainingSystemAndCode(code, system);
|
||||
// for (IIdType nextId : valueSetIds) {
|
||||
// ValueSet expansion = expand(nextId, null);
|
||||
// List<ValueSetExpansionContainsComponent> contains = expansion.getExpansion().getContains();
|
||||
// ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult result = lookup(contains, system, code);
|
||||
// if (result != null) {
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
List<IIdType> valueSetIds = findValueSetIdsContainingSystemAndCode(code, system);
|
||||
for (IIdType nextId : valueSetIds) {
|
||||
ValueSet expansion = expand(nextId, null);
|
||||
List<ValueSetExpansionContainsComponent> contains = expansion.getExpansion().getContains();
|
||||
ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult result = lookup(contains, system, code);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
HapiWorkerContext ctx = new HapiWorkerContext(getContext(), myValidationSupport);
|
||||
ValueSetExpander expander = ctx.getExpander();
|
||||
ValueSet source = new ValueSet();
|
||||
source.getCompose().addInclude().setSystem(system).addConcept().setCode(code);
|
||||
|
||||
ValueSetExpansionOutcome expansion;
|
||||
try {
|
||||
expansion = expander.expand(source);
|
||||
} catch (Exception e) {
|
||||
throw new InternalErrorException(e);
|
||||
}
|
||||
List<ValueSetExpansionContainsComponent> contains = expansion.getValueset().getExpansion().getContains();
|
||||
ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult result = lookup(contains, system, code);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
|
||||
LookupCodeResult retVal = new LookupCodeResult();
|
||||
|
@ -325,29 +367,30 @@ public class FhirResourceDaoValueSetDstu21 extends FhirResourceDaoDstu21<ValueSe
|
|||
retVal.setSearchedForCode(code);
|
||||
retVal.setSearchedForSystem(system);
|
||||
return retVal;
|
||||
|
||||
}
|
||||
|
||||
private ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult lookup(List<ValueSetExpansionContainsComponent> theContains, String theSystem, String theCode) {
|
||||
for (ValueSetExpansionContainsComponent nextCode : theContains) {
|
||||
|
||||
String system = nextCode.getSystem();
|
||||
String code = nextCode.getCode();
|
||||
if (theSystem.equals(system) && theCode.equals(code)) {
|
||||
ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult retVal = new LookupCodeResult();
|
||||
retVal.setSearchedForCode(code);
|
||||
retVal.setSearchedForSystem(system);
|
||||
retVal.setFound(true);
|
||||
if (nextCode.getAbstractElement() != null) {
|
||||
retVal.setCodeIsAbstract(nextCode.getAbstractElement().booleanValue());
|
||||
}
|
||||
retVal.setCodeDisplay(nextCode.getDisplay());
|
||||
retVal.setCodeSystemVersion(nextCode.getVersion());
|
||||
retVal.setCodeSystemDisplayName("Unknown"); // TODO: implement
|
||||
return retVal;
|
||||
String system = nextCode.getSystem();
|
||||
String code = nextCode.getCode();
|
||||
if (theSystem.equals(system) && theCode.equals(code)) {
|
||||
ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.LookupCodeResult retVal = new LookupCodeResult();
|
||||
retVal.setSearchedForCode(code);
|
||||
retVal.setSearchedForSystem(system);
|
||||
retVal.setFound(true);
|
||||
if (nextCode.getAbstractElement().getValue() != null) {
|
||||
retVal.setCodeIsAbstract(nextCode.getAbstractElement().booleanValue());
|
||||
}
|
||||
|
||||
retVal.setCodeDisplay(nextCode.getDisplay());
|
||||
retVal.setCodeSystemVersion(nextCode.getVersion());
|
||||
retVal.setCodeSystemDisplayName("Unknown"); // TODO: implement
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +1,6 @@
|
|||
package ca.uhn.fhir.jpa.dao;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
import ca.uhn.fhir.validation.IValidationSupport;
|
||||
import org.hl7.fhir.instance.hapi.validation.IValidationSupport;
|
||||
|
||||
public interface IJpaValidationSupportDstu2 extends IValidationSupport {
|
||||
|
||||
|
|
|
@ -37,10 +37,6 @@ public class JpaValidationSupportDstu21 implements IJpaValidationSupportDstu21 {
|
|||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JpaValidationSupportDstu21.class);
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myFhirContextDstu2Hl7Org")
|
||||
private FhirContext myRiCtx;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("myStructureDefinitionDaoDstu21")
|
||||
private IFhirResourceDao<StructureDefinition> myStructureDefinitionDao;
|
||||
|
@ -65,7 +61,7 @@ public class JpaValidationSupportDstu21 implements IJpaValidationSupportDstu21 {
|
|||
|
||||
@Override
|
||||
public <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri) {
|
||||
String resourceName = myRiCtx.getResourceDefinition(theClass).getName();
|
||||
String resourceName = myDstu21Ctx.getResourceDefinition(theClass).getName();
|
||||
IBundleProvider search;
|
||||
if ("ValueSet".equals(resourceName)) {
|
||||
search = myValueSetDao.search(ca.uhn.fhir.model.dstu2.resource.ValueSet.SP_URL, new UriParam(theUri));
|
||||
|
@ -83,15 +79,7 @@ public class JpaValidationSupportDstu21 implements IJpaValidationSupportDstu21 {
|
|||
ourLog.warn("Found multiple {} instances with URL search value of: {}", resourceName, theUri);
|
||||
}
|
||||
|
||||
IBaseResource res = search.getResources(0, 1).get(0);
|
||||
|
||||
/*
|
||||
* Validator wants RI structures and not HAPI ones, so convert
|
||||
*
|
||||
* TODO: we really need a more efficient way of converting.. Or maybe this will just go away when we move to RI structures
|
||||
*/
|
||||
String encoded = myDstu21Ctx.newJsonParser().encodeResourceToString(res);
|
||||
return myRiCtx.newJsonParser().parseResource(theClass, encoded);
|
||||
return (T) search.getResources(0, 1).get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Date;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.springframework.beans.factory.annotation.Required;
|
||||
|
||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
||||
|
@ -57,7 +58,7 @@ public abstract class BaseJpaResourceProvider<T extends IBaseResource> extends B
|
|||
}
|
||||
|
||||
@History
|
||||
public IBundleProvider getHistoryForResourceInstance(HttpServletRequest theRequest, @IdParam IdDt theId, @Since Date theDate) {
|
||||
public IBundleProvider getHistoryForResourceInstance(HttpServletRequest theRequest, @IdParam IIdType theId, @Since Date theDate) {
|
||||
startRequest(theRequest);
|
||||
try {
|
||||
return myDao.history(theId, theDate);
|
||||
|
|
|
@ -85,6 +85,7 @@ import org.hl7.fhir.dstu21.model.UriType;
|
|||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
|
@ -321,6 +322,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testCreateQuestionnaireResponseWithValidation() throws IOException {
|
||||
ValueSet options = new ValueSet();
|
||||
options.getCodeSystem().setSystem("urn:system").addConcept().setCode("code0");
|
||||
|
@ -759,14 +761,14 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
public void testDiagnosticOrderResources() throws Exception {
|
||||
IGenericClient client = ourClient;
|
||||
|
||||
int initialSize = client.search().forResource(DiagnosticOrder.class).execute().size();
|
||||
int initialSize = client.search().forResource(DiagnosticOrder.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
||||
DiagnosticOrder res = new DiagnosticOrder();
|
||||
res.addIdentifier().setSystem("urn:foo").setValue("123");
|
||||
|
||||
client.create().resource(res).execute();
|
||||
|
||||
int newSize = client.search().forResource(DiagnosticOrder.class).execute().size();
|
||||
int newSize = client.search().forResource(DiagnosticOrder.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
||||
assertEquals(1, newSize - initialSize);
|
||||
|
||||
|
@ -1264,14 +1266,14 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
|
||||
Bundle history = ourClient.history().onInstance(id).andReturnBundle(Bundle.class).prettyPrint().summaryMode(SummaryEnum.DATA).execute();
|
||||
assertEquals(3, history.getEntry().size());
|
||||
assertEquals(id.withVersion("3"), history.getEntry().get(0).getResource().getId());
|
||||
assertEquals(id.withVersion("3").getValue(), history.getEntry().get(0).getResource().getId());
|
||||
assertEquals(1, ((Patient) history.getEntry().get(0).getResource()).getName().size());
|
||||
|
||||
assertEquals(id.withVersion("2"), history.getEntry().get(1).getResource().getId());
|
||||
assertEquals(id.withVersion("2").getValue(), history.getEntry().get(1).getResource().getId());
|
||||
assertEquals(HTTPVerb.DELETE, history.getEntry().get(1).getRequest().getMethodElement().getValue());
|
||||
assertEquals(0, ((Patient) history.getEntry().get(1).getResource()).getName().size());
|
||||
|
||||
assertEquals(id.withVersion("1"), history.getEntry().get(2).getResource().getId());
|
||||
assertEquals(id.withVersion("1").getValue(), history.getEntry().get(2).getResource().getId());
|
||||
assertEquals(1, ((Patient) history.getEntry().get(2).getResource()).getName().size());
|
||||
}
|
||||
|
||||
|
@ -1282,12 +1284,12 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
public void testImagingStudyResources() throws Exception {
|
||||
IGenericClient client = ourClient;
|
||||
|
||||
int initialSize = client.search().forResource(ImagingStudy.class).execute().size();
|
||||
int initialSize = client.search().forResource(ImagingStudy.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
||||
String resBody = IOUtils.toString(ResourceProviderDstu21Test.class.getResource("/imagingstudy.json"));
|
||||
client.create().resource(resBody).execute();
|
||||
|
||||
int newSize = client.search().forResource(ImagingStudy.class).execute().size();
|
||||
int newSize = client.search().forResource(ImagingStudy.class).returnBundle(Bundle.class).execute().getEntry().size();
|
||||
|
||||
assertEquals(1, newSize - initialSize);
|
||||
|
||||
|
@ -1424,7 +1426,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
IIdType newId = ourClient.create().resource(p1).encodedXml().execute().getId();
|
||||
|
||||
Patient actual = ourClient.read().resource(Patient.class).withId(newId).encodedXml().execute();
|
||||
assertEquals("<div xmlns=\"http://www.w3.org/1999/xhtml\">HELLO WORLD</div>", actual.getText().getDiv().getValueAsString());
|
||||
assertEquals("<div>HELLO WORLD</div>", actual.getText().getDiv().getValueAsString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1441,7 +1443,6 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
|
||||
Patient actual = ourClient.read(Patient.class, new UriDt(newId.getValue()));
|
||||
assertEquals(1, actual.getContained().size());
|
||||
assertThat(actual.getText().getDiv().getValueAsString(), containsString("<td>Identifier</td><td>testSaveAndRetrieveWithContained01</td>"));
|
||||
|
||||
//@formatter:off
|
||||
Bundle b = ourClient
|
||||
|
@ -1459,6 +1460,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
@Test
|
||||
public void testSaveAndRetrieveWithoutNarrative() {
|
||||
Patient p1 = new Patient();
|
||||
p1.getText().setDivAsString("<div><td>Identifier</td><td>testSearchByResourceChain01</td></div>");
|
||||
p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01");
|
||||
|
||||
IdType newId = (IdType) ourClient.create().resource(p1).execute().getId();
|
||||
|
@ -1772,6 +1774,7 @@ public class ResourceProviderDstu21Test extends BaseResourceProviderDstu21Test {
|
|||
.forResource(Observation.class)
|
||||
.sort().ascending(Observation.CODE_VALUE_QUANTITY) // composite sort not supported yet
|
||||
.prettyPrint()
|
||||
.returnBundle(Bundle.class)
|
||||
.execute();
|
||||
//@formatter:on
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.hl7.fhir.dstu21.model.UriType;
|
|||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@ -52,7 +51,7 @@ public class ResourceProviderDstu21ValueSetTest extends BaseResourceProviderDstu
|
|||
String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
|
||||
ourLog.info(resp);
|
||||
|
||||
assertEquals(new BooleanType(true), respParam.getParameter().get(0).getValue());
|
||||
assertEquals(true, ((BooleanType)respParam.getParameter().get(0).getValue()).booleanValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -70,7 +69,7 @@ public class ResourceProviderDstu21ValueSetTest extends BaseResourceProviderDstu
|
|||
String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(respParam);
|
||||
ourLog.info(resp);
|
||||
|
||||
assertEquals(new BooleanType(true), respParam.getParameter().get(0).getValue());
|
||||
assertEquals(true, ((BooleanType)respParam.getParameter().get(0).getValue()).booleanValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -89,15 +88,15 @@ public class ResourceProviderDstu21ValueSetTest extends BaseResourceProviderDstu
|
|||
ourLog.info(resp);
|
||||
|
||||
assertEquals("name", respParam.getParameter().get(0).getName());
|
||||
assertEquals(new StringType("Unknown"), respParam.getParameter().get(0).getValue());
|
||||
assertEquals(("Unknown"), ((StringType)respParam.getParameter().get(0).getValue()).getValue());
|
||||
assertEquals("display", respParam.getParameter().get(1).getName());
|
||||
assertEquals(new StringType("Systolic blood pressure--expiration"), respParam.getParameter().get(1).getValue());
|
||||
assertEquals(("Systolic blood pressure--expiration"), ((StringType)respParam.getParameter().get(1).getValue()).getValue());
|
||||
assertEquals("abstract", respParam.getParameter().get(2).getName());
|
||||
assertEquals(new BooleanType(false), respParam.getParameter().get(2).getValue());
|
||||
assertEquals(false, ((BooleanType)respParam.getParameter().get(2).getValue()).getValue().booleanValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
// @Ignore
|
||||
public void testLookupOperationForBuiltInCode() {
|
||||
//@formatter:off
|
||||
Parameters respParam = ourClient
|
||||
|
@ -113,11 +112,11 @@ public class ResourceProviderDstu21ValueSetTest extends BaseResourceProviderDstu
|
|||
ourLog.info(resp);
|
||||
|
||||
assertEquals("name", respParam.getParameter().get(0).getName());
|
||||
assertEquals(new StringType("Unknown"), respParam.getParameter().get(0).getValue());
|
||||
assertEquals("Unknown", ((StringType)respParam.getParameter().get(0).getValue()).getValue());
|
||||
assertEquals("display", respParam.getParameter().get(1).getName());
|
||||
assertEquals(new StringType("Married"), respParam.getParameter().get(1).getValue());
|
||||
assertEquals("Married", ((StringType)respParam.getParameter().get(1).getValue()).getValue());
|
||||
assertEquals("abstract", respParam.getParameter().get(2).getName());
|
||||
assertEquals(new BooleanType(false), respParam.getParameter().get(2).getValue());
|
||||
assertEquals(false, ((BooleanType)respParam.getParameter().get(2).getValue()).booleanValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -135,11 +134,11 @@ public class ResourceProviderDstu21ValueSetTest extends BaseResourceProviderDstu
|
|||
ourLog.info(resp);
|
||||
|
||||
assertEquals("name", respParam.getParameter().get(0).getName());
|
||||
assertEquals(new StringType("Unknown"), respParam.getParameter().get(0).getValue());
|
||||
assertEquals(("Unknown"), ((StringType)respParam.getParameter().get(0).getValue()).getValue());
|
||||
assertEquals("display", respParam.getParameter().get(1).getName());
|
||||
assertEquals(new StringType("Systolic blood pressure--expiration"), respParam.getParameter().get(1).getValue());
|
||||
assertEquals(("Systolic blood pressure--expiration"), ((StringType)respParam.getParameter().get(1).getValue()).getValue());
|
||||
assertEquals("abstract", respParam.getParameter().get(2).getName());
|
||||
assertEquals(new BooleanType(false), respParam.getParameter().get(2).getValue());
|
||||
assertEquals(false, ((BooleanType)respParam.getParameter().get(2).getValue()).getValue().booleanValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package ca.uhn.fhir.validator;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.hl7.fhir.instance.hapi.validation.FhirInstanceValidator;
|
||||
import org.junit.Test;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.dstu2.resource.QuestionnaireResponse;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.validation.FhirInstanceValidator;
|
||||
import ca.uhn.fhir.validation.FhirValidator;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
|
||||
|
|
|
@ -451,8 +451,8 @@
|
|||
"text": "Doxycycline"
|
||||
},
|
||||
"status": "confirmed",
|
||||
"criticality": "high",
|
||||
"type": "immune",
|
||||
"criticality": "CRITH",
|
||||
"type": "allergy",
|
||||
"event": [
|
||||
{
|
||||
"manifestation": [
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package org.hl7.fhir.dstu21.exceptions;
|
||||
|
||||
public class DefinitionException extends FHIRException {
|
||||
|
||||
public DefinitionException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public DefinitionException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public DefinitionException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public DefinitionException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.hl7.fhir.dstu21.exceptions;
|
||||
|
||||
public class FHIRException extends Exception {
|
||||
|
||||
// Note that the 4-argument constructor has been removed as it is not JDK6 compatible
|
||||
|
||||
public FHIRException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public FHIRException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public FHIRException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public FHIRException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.hl7.fhir.dstu21.exceptions;
|
||||
|
||||
public class FHIRFormatError extends FHIRException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public FHIRFormatError() {
|
||||
super();
|
||||
}
|
||||
|
||||
public FHIRFormatError(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public FHIRFormatError(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public FHIRFormatError(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.hl7.fhir.dstu21.exceptions;
|
||||
|
||||
public class PathEngineException extends FHIRException {
|
||||
|
||||
public PathEngineException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PathEngineException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public PathEngineException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public PathEngineException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.hl7.fhir.dstu21.exceptions;
|
||||
|
||||
public class TerminologyServiceException extends FHIRException {
|
||||
|
||||
public TerminologyServiceException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public TerminologyServiceException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public TerminologyServiceException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public TerminologyServiceException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package org.hl7.fhir.dstu21.exceptions;
|
||||
|
||||
public class UcumException extends FHIRException {
|
||||
|
||||
public UcumException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public UcumException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public UcumException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public UcumException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package org.hl7.fhir.dstu21.formats;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
public abstract class FormatUtilities {
|
||||
public static final String ID_REGEX = "[A-Za-z0-9\\-\\.]{1,64}";
|
||||
public static final String FHIR_NS = "http://hl7.org/fhir";
|
||||
public static final String XHTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
|
||||
protected String toString(String value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
protected String toString(int value) {
|
||||
return java.lang.Integer.toString(value);
|
||||
}
|
||||
|
||||
protected String toString(boolean value) {
|
||||
return java.lang.Boolean.toString(value);
|
||||
}
|
||||
|
||||
protected String toString(BigDecimal value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
protected String toString(URI value) {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
public static String toString(byte[] value) {
|
||||
byte[] encodeBase64 = Base64.encodeBase64(value);
|
||||
return new String(encodeBase64);
|
||||
}
|
||||
|
||||
public static boolean isValidId(String tail) {
|
||||
return tail.matches(ID_REGEX);
|
||||
}
|
||||
|
||||
public static String makeId(String candidate) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for (char c : candidate.toCharArray())
|
||||
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '-')
|
||||
b.append(c);
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,221 @@
|
|||
package org.hl7.fhir.dstu21.formats;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.dstu21.model.Resource;
|
||||
import org.hl7.fhir.dstu21.model.Type;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
|
||||
/**
|
||||
* General interface - either an XML or JSON parser: read or write instances
|
||||
*
|
||||
* Defined to allow a factory to create a parser of the right type
|
||||
*/
|
||||
public interface IParser {
|
||||
|
||||
/**
|
||||
* check what kind of parser this is
|
||||
*
|
||||
* @return what kind of parser this is
|
||||
*/
|
||||
public ParserType getType();
|
||||
|
||||
// -- Parser Configuration ----------------------------------
|
||||
/**
|
||||
* Whether to parse or ignore comments - either reading or writing
|
||||
*/
|
||||
public boolean getHandleComments();
|
||||
public IParser setHandleComments(boolean value);
|
||||
|
||||
/**
|
||||
* @param allowUnknownContent Whether to throw an exception if unknown content is found (or just skip it) when parsing
|
||||
*/
|
||||
public boolean isAllowUnknownContent();
|
||||
public IParser setAllowUnknownContent(boolean value);
|
||||
|
||||
|
||||
public enum OutputStyle {
|
||||
/**
|
||||
* Produce normal output - no whitespace, except in HTML where whitespace is untouched
|
||||
*/
|
||||
NORMAL,
|
||||
|
||||
/**
|
||||
* Produce pretty output - human readable whitespace, HTML whitespace untouched
|
||||
*/
|
||||
PRETTY,
|
||||
|
||||
/**
|
||||
* Produce canonical output - no comments, no whitspace, HTML whitespace normlised, JSON attributes sorted alphabetically (slightly slower)
|
||||
*/
|
||||
CANONICAL,
|
||||
}
|
||||
|
||||
/**
|
||||
* Writing:
|
||||
*/
|
||||
public OutputStyle getOutputStyle();
|
||||
public IParser setOutputStyle(OutputStyle value);
|
||||
|
||||
/**
|
||||
* This method is used by the publication tooling to stop the xhrtml narrative being generated.
|
||||
* It is not valid to use in production use. The tooling uses it to generate json/xml representations in html that are not cluttered by escaped html representations of the html representation
|
||||
*/
|
||||
public IParser setSuppressXhtml(String message);
|
||||
|
||||
// -- Reading methods ----------------------------------------
|
||||
|
||||
/**
|
||||
* parse content that is known to be a resource
|
||||
* @throws XmlPullParserException
|
||||
* @throws FHIRFormatError
|
||||
* @throws IOException
|
||||
*/
|
||||
public Resource parse(InputStream input) throws IOException, FHIRFormatError;
|
||||
|
||||
/**
|
||||
* parse content that is known to be a resource
|
||||
* @throws UnsupportedEncodingException
|
||||
* @throws IOException
|
||||
* @throws FHIRFormatError
|
||||
*/
|
||||
public Resource parse(String input) throws UnsupportedEncodingException, FHIRFormatError, IOException;
|
||||
|
||||
/**
|
||||
* parse content that is known to be a resource
|
||||
* @throws IOException
|
||||
* @throws FHIRFormatError
|
||||
*/
|
||||
public Resource parse(byte[] bytes) throws FHIRFormatError, IOException;
|
||||
|
||||
/**
|
||||
* This is used to parse a type - a fragment of a resource.
|
||||
* There's no reason to use this in production - it's used
|
||||
* in the build tools
|
||||
*
|
||||
* Not supported by all implementations
|
||||
*
|
||||
* @param input
|
||||
* @param knownType. if this is blank, the parser may try to infer the type (xml only)
|
||||
* @return
|
||||
* @throws XmlPullParserException
|
||||
* @throws FHIRFormatError
|
||||
* @throws IOException
|
||||
*/
|
||||
public Type parseType(InputStream input, String knownType) throws IOException, FHIRFormatError;
|
||||
/**
|
||||
* This is used to parse a type - a fragment of a resource.
|
||||
* There's no reason to use this in production - it's used
|
||||
* in the build tools
|
||||
*
|
||||
* Not supported by all implementations
|
||||
*
|
||||
* @param input
|
||||
* @param knownType. if this is blank, the parser may try to infer the type (xml only)
|
||||
* @return
|
||||
* @throws UnsupportedEncodingException
|
||||
* @throws IOException
|
||||
* @throws FHIRFormatError
|
||||
*/
|
||||
public Type parseType(String input, String knownType) throws UnsupportedEncodingException, FHIRFormatError, IOException;
|
||||
/**
|
||||
* This is used to parse a type - a fragment of a resource.
|
||||
* There's no reason to use this in production - it's used
|
||||
* in the build tools
|
||||
*
|
||||
* Not supported by all implementations
|
||||
*
|
||||
* @param input
|
||||
* @param knownType. if this is blank, the parser may try to infer the type (xml only)
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws FHIRFormatError
|
||||
*/
|
||||
public Type parseType(byte[] bytes, String knownType) throws FHIRFormatError, IOException;
|
||||
|
||||
// -- Writing methods ----------------------------------------
|
||||
|
||||
/**
|
||||
* Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
|
||||
* @throws IOException
|
||||
*/
|
||||
public void compose(OutputStream stream, Resource resource) throws IOException;
|
||||
|
||||
/**
|
||||
* Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
|
||||
* @throws IOException
|
||||
*/
|
||||
public String composeString(Resource resource) throws IOException;
|
||||
|
||||
/**
|
||||
* Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
|
||||
* @throws IOException
|
||||
*/
|
||||
public byte[] composeBytes(Resource resource) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
* Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
|
||||
*
|
||||
* Not supported by all implementations. rootName is ignored in the JSON format
|
||||
* @throws XmlPullParserException
|
||||
* @throws FHIRFormatError
|
||||
* @throws IOException
|
||||
*/
|
||||
public void compose(OutputStream stream, Type type, String rootName) throws IOException;
|
||||
|
||||
/**
|
||||
* Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
|
||||
*
|
||||
* Not supported by all implementations. rootName is ignored in the JSON format
|
||||
* @throws IOException
|
||||
*/
|
||||
public String composeString(Type type, String rootName) throws IOException;
|
||||
|
||||
/**
|
||||
* Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)
|
||||
*
|
||||
* Not supported by all implementations. rootName is ignored in the JSON format
|
||||
* @throws IOException
|
||||
*/
|
||||
public byte[] composeBytes(Type type, String rootName) throws IOException;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package org.hl7.fhir.dstu21.formats;
|
||||
|
||||
/**
|
||||
* Used in factory methods for parsers, for requesting a parser of a particular type
|
||||
* (see IWorkerContext)
|
||||
*
|
||||
* @author Grahame
|
||||
*
|
||||
*/
|
||||
public enum ParserType {
|
||||
/**
|
||||
* XML as specified in specification
|
||||
*/
|
||||
XML,
|
||||
|
||||
/**
|
||||
* JSON as specified in the specification
|
||||
*/
|
||||
JSON,
|
||||
|
||||
/**
|
||||
* XHTML - write narrative (generate if necessary). No read
|
||||
*/
|
||||
XHTML,
|
||||
|
||||
/**
|
||||
* RDF is not supported yet
|
||||
*/
|
||||
RDF
|
||||
}
|
|
@ -38,6 +38,7 @@ import javax.servlet.ServletContext;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Conformance;
|
||||
import org.hl7.fhir.dstu21.model.Conformance.ConditionalDeleteStatus;
|
||||
import org.hl7.fhir.dstu21.model.Conformance.ConformanceRestComponent;
|
||||
|
@ -56,7 +57,6 @@ import org.hl7.fhir.dstu21.model.OperationDefinition;
|
|||
import org.hl7.fhir.dstu21.model.OperationDefinition.OperationDefinitionParameterComponent;
|
||||
import org.hl7.fhir.dstu21.model.OperationDefinition.OperationParameterUse;
|
||||
import org.hl7.fhir.dstu21.model.ResourceType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package org.hl7.fhir.dstu21.hapi.validation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.validation.ValidationMessage;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.model.api.Bundle;
|
||||
import ca.uhn.fhir.validation.IValidationContext;
|
||||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
||||
import ca.uhn.fhir.validation.SingleValidationMessage;
|
||||
|
||||
/**
|
||||
* Base class for a bridge between the RI validation tools and HAPI
|
||||
*/
|
||||
abstract class BaseValidatorBridge implements IValidatorModule {
|
||||
|
||||
public BaseValidatorBridge() {
|
||||
super();
|
||||
}
|
||||
|
||||
private void doValidate(IValidationContext<?> theCtx) {
|
||||
List<ValidationMessage> messages = validate(theCtx);
|
||||
|
||||
for (ValidationMessage riMessage : messages) {
|
||||
SingleValidationMessage hapiMessage = new SingleValidationMessage();
|
||||
if (riMessage.getCol() != -1) {
|
||||
hapiMessage.setLocationCol(riMessage.getCol());
|
||||
}
|
||||
if (riMessage.getLine() != -1) {
|
||||
hapiMessage.setLocationLine(riMessage.getLine());
|
||||
}
|
||||
hapiMessage.setLocationString(riMessage.getLocation());
|
||||
hapiMessage.setMessage(riMessage.getMessage());
|
||||
if (riMessage.getLevel() != null) {
|
||||
hapiMessage.setSeverity(ResultSeverityEnum.fromCode(riMessage.getLevel().toCode()));
|
||||
}
|
||||
theCtx.addValidationMessage(hapiMessage);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract List<ValidationMessage> validate(IValidationContext<?> theCtx);
|
||||
|
||||
@Override
|
||||
public void validateBundle(IValidationContext<Bundle> theCtx) {
|
||||
doValidate(theCtx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateResource(IValidationContext<IBaseResource> theCtx) {
|
||||
doValidate(theCtx);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
package org.hl7.fhir.dstu21.hapi.validation;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Bundle;
|
||||
import org.hl7.fhir.dstu21.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.dstu21.model.IdType;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
|
||||
public class DefaultProfileValidationSupport implements IValidationSupport {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(DefaultProfileValidationSupport.class);
|
||||
private Map<String, ValueSet> myCodeSystems;
|
||||
|
||||
private Map<String, ValueSet> myDefaultValueSets;
|
||||
|
||||
@Override
|
||||
public ValueSetExpansionComponent expandValueSet(FhirContext theContext, ConceptSetComponent theInclude) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSet fetchCodeSystem(FhirContext theContext, String theSystem) {
|
||||
Map<String, ValueSet> codeSystems = myCodeSystems;
|
||||
if (codeSystems == null) {
|
||||
codeSystems = new HashMap<String, ValueSet>();
|
||||
|
||||
loadCodeSystems(theContext, codeSystems, "/org/hl7/fhir/instance/model/dstu21/valueset/valuesets.xml");
|
||||
loadCodeSystems(theContext, codeSystems, "/org/hl7/fhir/instance/model/dstu21/valueset/v2-tables.xml");
|
||||
loadCodeSystems(theContext, codeSystems, "/org/hl7/fhir/instance/model/dstu21/valueset/v3-codesystems.xml");
|
||||
|
||||
myCodeSystems = codeSystems;
|
||||
}
|
||||
|
||||
return codeSystems.get(theSystem);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri) {
|
||||
if (theUri.startsWith("http://hl7.org/fhir/StructureDefinition/")) {
|
||||
return (T) FhirInstanceValidator.loadProfileOrReturnNull(null, theContext, theUri.substring("http://hl7.org/fhir/StructureDefinition/".length()));
|
||||
}
|
||||
if (theUri.startsWith("http://hl7.org/fhir/ValueSet/")) {
|
||||
Map<String, ValueSet> defaultValueSets = myDefaultValueSets;
|
||||
if (defaultValueSets == null) {
|
||||
String path = theContext.getVersion().getPathToSchemaDefinitions().replace("/schema", "/valueset") + "/valuesets.xml";
|
||||
InputStream valuesetText = DefaultProfileValidationSupport.class.getResourceAsStream(path);
|
||||
if (valuesetText == null) {
|
||||
return null;
|
||||
}
|
||||
InputStreamReader reader;
|
||||
try {
|
||||
reader = new InputStreamReader(valuesetText, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Shouldn't happen!
|
||||
throw new InternalErrorException("UTF-8 encoding not supported on this platform", e);
|
||||
}
|
||||
|
||||
defaultValueSets = new HashMap<String, ValueSet>();
|
||||
|
||||
Bundle bundle = theContext.newXmlParser().parseResource(Bundle.class, reader);
|
||||
for (BundleEntryComponent next : bundle.getEntry()) {
|
||||
IdType nextId = new IdType(next.getFullUrl());
|
||||
if (nextId.isEmpty() || !nextId.getValue().startsWith("http://hl7.org/fhir/ValueSet/")) {
|
||||
continue;
|
||||
}
|
||||
defaultValueSets.put(nextId.toVersionless().getValue(), (ValueSet) next.getResource());
|
||||
}
|
||||
|
||||
myDefaultValueSets = defaultValueSets;
|
||||
}
|
||||
|
||||
return (T) defaultValueSets.get(theUri);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCodeSystemSupported(FhirContext theContext, String theSystem) {
|
||||
ValueSet cs = fetchCodeSystem(theContext, theSystem);
|
||||
return cs != null;
|
||||
}
|
||||
|
||||
private void loadCodeSystems(FhirContext theContext, Map<String, ValueSet> theCodeSystems, String theClasspath) {
|
||||
ourLog.info("Loading code systems from file: {}", theClasspath);
|
||||
InputStream valuesetText = DefaultProfileValidationSupport.class.getResourceAsStream(theClasspath);
|
||||
if (valuesetText != null) {
|
||||
InputStreamReader reader;
|
||||
try {
|
||||
reader = new InputStreamReader(valuesetText, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// Shouldn't happen!
|
||||
throw new InternalErrorException("UTF-8 encoding not supported on this platform", e);
|
||||
}
|
||||
|
||||
Bundle bundle = theContext.newXmlParser().parseResource(Bundle.class, reader);
|
||||
for (BundleEntryComponent next : bundle.getEntry()) {
|
||||
ValueSet nextValueSet = (ValueSet) next.getResource();
|
||||
String system = nextValueSet.getCodeSystem().getSystem();
|
||||
if (isNotBlank(system)) {
|
||||
theCodeSystems.put(system, nextValueSet);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ourLog.warn("Unable to load resource: {}", theClasspath);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodeValidationResult validateCode(FhirContext theContext, String theCodeSystem, String theCode, String theDisplay) {
|
||||
ValueSet cs = fetchCodeSystem(theContext, theCodeSystem);
|
||||
if (cs != null) {
|
||||
for (ConceptDefinitionComponent next : cs.getCodeSystem().getConcept()) {
|
||||
if (next.getCode().equals(theCode)) {
|
||||
return new CodeValidationResult(next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new CodeValidationResult(IssueSeverity.INFORMATION, "Unknown code: " + theCodeSystem + " / " + theCode);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,238 @@
|
|||
package org.hl7.fhir.dstu21.hapi.validation;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.StructureDefinition;
|
||||
import org.hl7.fhir.dstu21.validation.IResourceValidator.BestPracticeWarningLevel;
|
||||
import org.hl7.fhir.dstu21.validation.InstanceValidator;
|
||||
import org.hl7.fhir.dstu21.validation.ValidationMessage;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import ca.uhn.fhir.context.ConfigurationException;
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.rest.server.EncodingEnum;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.validation.IValidationContext;
|
||||
import ca.uhn.fhir.validation.IValidatorModule;
|
||||
|
||||
public class FhirInstanceValidator extends BaseValidatorBridge implements IValidatorModule {
|
||||
|
||||
private static FhirContext ourHl7OrgCtx;
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirInstanceValidator.class);
|
||||
private BestPracticeWarningLevel myBestPracticeWarningLevel;
|
||||
private DocumentBuilderFactory myDocBuilderFactory;
|
||||
private StructureDefinition myStructureDefintion;
|
||||
private IValidationSupport myValidationSupport;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Uses {@link DefaultProfileValidationSupport} for {@link IValidationSupport validation support}
|
||||
*/
|
||||
public FhirInstanceValidator() {
|
||||
this(new DefaultProfileValidationSupport());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which uses the given validation support
|
||||
*
|
||||
* @param theValidationSupport
|
||||
* The validation support
|
||||
*/
|
||||
public FhirInstanceValidator(IValidationSupport theValidationSupport) {
|
||||
myDocBuilderFactory = DocumentBuilderFactory.newInstance();
|
||||
myDocBuilderFactory.setNamespaceAware(true);
|
||||
myValidationSupport = theValidationSupport;
|
||||
}
|
||||
|
||||
private String determineResourceName(Document theDocument) {
|
||||
Element root = null;
|
||||
|
||||
NodeList list = theDocument.getChildNodes();
|
||||
for (int i = 0; i < list.getLength(); i++) {
|
||||
if (list.item(i) instanceof Element) {
|
||||
root = (Element) list.item(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
root = theDocument.getDocumentElement();
|
||||
return root.getLocalName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "best practice" warning level (default is {@link BestPracticeWarningLevel#Hint}).
|
||||
* <p>
|
||||
* The FHIR Instance Validator has a number of checks for best practices in terms of FHIR usage. If this setting is
|
||||
* set to {@link BestPracticeWarningLevel#Error}, any resource data which does not meet these best practices will be
|
||||
* reported at the ERROR level. If this setting is set to {@link BestPracticeWarningLevel#Ignore}, best practice
|
||||
* guielines will be ignored.
|
||||
* </p>
|
||||
*
|
||||
* @see {@link #setBestPracticeWarningLevel(BestPracticeWarningLevel)}
|
||||
*/
|
||||
public BestPracticeWarningLevel getBestPracticeWarningLevel() {
|
||||
return myBestPracticeWarningLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link IValidationSupport validation support} in use by this validator. Default is an instance of
|
||||
* {@link DefaultProfileValidationSupport} if the no-arguments constructor for this object was used.
|
||||
*/
|
||||
public IValidationSupport getValidationSupport() {
|
||||
return myValidationSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the "best practice warning level". When validating, any deviations from best practices will be reported at
|
||||
* this level.
|
||||
* <p>
|
||||
* The FHIR Instance Validator has a number of checks for best practices in terms of FHIR usage. If this setting is
|
||||
* set to {@link BestPracticeWarningLevel#Error}, any resource data which does not meet these best practices will be
|
||||
* reported at the ERROR level. If this setting is set to {@link BestPracticeWarningLevel#Ignore}, best practice
|
||||
* guielines will be ignored.
|
||||
* </p>
|
||||
*
|
||||
* @param theBestPracticeWarningLevel
|
||||
* The level, must not be <code>null</code>
|
||||
*/
|
||||
public void setBestPracticeWarningLevel(BestPracticeWarningLevel theBestPracticeWarningLevel) {
|
||||
Validate.notNull(theBestPracticeWarningLevel);
|
||||
myBestPracticeWarningLevel = theBestPracticeWarningLevel;
|
||||
}
|
||||
|
||||
public void setStructureDefintion(StructureDefinition theStructureDefintion) {
|
||||
myStructureDefintion = theStructureDefintion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link IValidationSupport validation support} in use by this validator. Default is an instance of
|
||||
* {@link DefaultProfileValidationSupport} if the no-arguments constructor for this object was used.
|
||||
*/
|
||||
public void setValidationSupport(IValidationSupport theValidationSupport) {
|
||||
myValidationSupport = theValidationSupport;
|
||||
}
|
||||
|
||||
protected List<ValidationMessage> validate(final FhirContext theCtx, String theInput, EncodingEnum theEncoding) {
|
||||
HapiWorkerContext workerContext = new HapiWorkerContext(theCtx, myValidationSupport);
|
||||
|
||||
InstanceValidator v;
|
||||
try {
|
||||
v = new InstanceValidator(workerContext);
|
||||
} catch (Exception e) {
|
||||
throw new ConfigurationException(e);
|
||||
}
|
||||
|
||||
v.setBestPracticeWarningLevel(myBestPracticeWarningLevel);
|
||||
v.setAnyExtensionsAllowed(true);
|
||||
|
||||
List<ValidationMessage> messages = new ArrayList<ValidationMessage>();
|
||||
|
||||
if (theEncoding == EncodingEnum.XML) {
|
||||
Document document;
|
||||
try {
|
||||
DocumentBuilder builder = myDocBuilderFactory.newDocumentBuilder();
|
||||
InputSource src = new InputSource(new StringReader(theInput));
|
||||
document = builder.parse(src);
|
||||
} catch (Exception e2) {
|
||||
ourLog.error("Failure to parse XML input", e2);
|
||||
ValidationMessage m = new ValidationMessage();
|
||||
m.setLevel(IssueSeverity.FATAL);
|
||||
m.setMessage("Failed to parse input, it does not appear to be valid XML:" + e2.getMessage());
|
||||
return Collections.singletonList(m);
|
||||
}
|
||||
|
||||
String resourceName = determineResourceName(document);
|
||||
StructureDefinition profile = myStructureDefintion != null ? myStructureDefintion : loadProfileOrReturnNull(messages, theCtx, resourceName);
|
||||
if (profile != null) {
|
||||
try {
|
||||
v.validate(messages, document, profile);
|
||||
} catch (Exception e) {
|
||||
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
||||
}
|
||||
}
|
||||
} else if (theEncoding == EncodingEnum.JSON) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
JsonObject json = gson.fromJson(theInput, JsonObject.class);
|
||||
|
||||
String resourceName = json.get("resourceType").getAsString();
|
||||
StructureDefinition profile = myStructureDefintion != null ? myStructureDefintion : loadProfileOrReturnNull(messages, theCtx, resourceName);
|
||||
if (profile != null) {
|
||||
try {
|
||||
v.validate(messages, json, profile);
|
||||
} catch (Exception e) {
|
||||
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unknown encoding: " + theEncoding);
|
||||
}
|
||||
|
||||
for (int i = 0; i < messages.size(); i++) {
|
||||
ValidationMessage next = messages.get(i);
|
||||
if ("Binding has no source, so can't be checked".equals(next.getMessage())) {
|
||||
messages.remove(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ValidationMessage> validate(IValidationContext<?> theCtx) {
|
||||
return validate(theCtx.getFhirContext(), theCtx.getResourceAsString(), theCtx.getResourceAsStringEncoding());
|
||||
}
|
||||
|
||||
static StructureDefinition loadProfileOrReturnNull(List<ValidationMessage> theMessages, FhirContext theCtx, String theResourceName) {
|
||||
if (isBlank(theResourceName)) {
|
||||
if (theMessages != null) {
|
||||
theMessages.add(new ValidationMessage().setLevel(IssueSeverity.FATAL).setMessage("Could not determine resource type from request. Content appears invalid."));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
String profileClasspath = theCtx.getVersion().getPathToSchemaDefinitions().replace("/schema", "/profile");
|
||||
String profileCpName = profileClasspath + '/' + theResourceName.toLowerCase() + ".profile.xml";
|
||||
String profileText;
|
||||
try {
|
||||
InputStream inputStream = FhirInstanceValidator.class.getResourceAsStream(profileCpName);
|
||||
if (inputStream == null) {
|
||||
if (theMessages != null) {
|
||||
theMessages.add(new ValidationMessage().setLevel(IssueSeverity.FATAL).setMessage("No profile found for resource type " + theResourceName));
|
||||
return null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
profileText = IOUtils.toString(inputStream, "UTF-8");
|
||||
} catch (IOException e1) {
|
||||
if (theMessages != null) {
|
||||
theMessages.add(new ValidationMessage().setLevel(IssueSeverity.FATAL).setMessage("No profile found for resource type " + theResourceName));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
StructureDefinition profile = theCtx.newXmlParser().parseResource(StructureDefinition.class, profileText);
|
||||
return profile;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
package org.hl7.fhir.dstu21.hapi.validation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.QuestionnaireResponse;
|
||||
import org.hl7.fhir.dstu21.utils.IWorkerContext;
|
||||
import org.hl7.fhir.dstu21.validation.QuestionnaireResponseValidator;
|
||||
import org.hl7.fhir.dstu21.validation.ValidationMessage;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.parser.IParser;
|
||||
import ca.uhn.fhir.validation.IValidationContext;
|
||||
|
||||
public class FhirQuestionnaireResponseValidator extends BaseValidatorBridge {
|
||||
|
||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirQuestionnaireResponseValidator.class);
|
||||
private IValidationSupport myValidationSupport;
|
||||
|
||||
/**
|
||||
* Specifies the validation support module which will be used to load as a resource loader (i.e. to
|
||||
* fetch Questionnaires, Valusets, etc.)
|
||||
*
|
||||
* @param theValidationSupport
|
||||
* The resourceloader to use. May be <code>null</code> if no resource loader should be used (in which case
|
||||
* any <code>QuestionaireResponse</code> with external references will fail to validate.)
|
||||
*/
|
||||
public void setValidationSupport(IValidationSupport theValidationSupport) {
|
||||
myValidationSupport = theValidationSupport;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ValidationMessage> validate(IValidationContext<?> theCtx) {
|
||||
Object resource = theCtx.getResource();
|
||||
if (!(theCtx.getResource() instanceof IBaseResource)) {
|
||||
ourLog.debug("Not validating object of type {}", theCtx.getResource().getClass());
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
if (resource instanceof QuestionnaireResponse) {
|
||||
return doValidate(theCtx, (QuestionnaireResponse) resource);
|
||||
}
|
||||
|
||||
RuntimeResourceDefinition def = theCtx.getFhirContext().getResourceDefinition((IBaseResource) resource);
|
||||
if ("QuestionnaireResponse".equals(def.getName()) == false) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have a non-RI structure, convert it
|
||||
*/
|
||||
|
||||
IParser p = theCtx.getFhirContext().newJsonParser();
|
||||
String string = p.encodeResourceToString((IBaseResource) resource);
|
||||
QuestionnaireResponse qa = p.parseResource(QuestionnaireResponse.class, string);
|
||||
|
||||
return doValidate(theCtx, qa);
|
||||
}
|
||||
|
||||
private List<ValidationMessage> doValidate(IValidationContext<?> theValCtx, QuestionnaireResponse theResource) {
|
||||
|
||||
IWorkerContext workerCtx = new HapiWorkerContext(theValCtx.getFhirContext(), myValidationSupport);
|
||||
ArrayList<ValidationMessage> retVal = new ArrayList<ValidationMessage>();
|
||||
|
||||
// if (!loadReferences(theResource, workerCtx, theValCtx, retVal)) {
|
||||
// return retVal;
|
||||
// }
|
||||
|
||||
QuestionnaireResponseValidator val = new QuestionnaireResponseValidator(workerCtx);
|
||||
|
||||
val.validate(retVal, theResource);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// private boolean loadReferences(IBaseResource theResource, IWorkerContext theWorkerCtx, IValidationContext<?> theValCtx, ArrayList<ValidationMessage> theMessages) {
|
||||
// List<ResourceReferenceInfo> refs = theValCtx.getFhirContext().newTerser().getAllResourceReferences(theResource);
|
||||
//
|
||||
// List<IBaseResource> newResources = new ArrayList<IBaseResource>();
|
||||
//
|
||||
// for (ResourceReferenceInfo nextRefInfo : refs) {
|
||||
// IIdType nextRef = nextRefInfo.getResourceReference().getReferenceElement();
|
||||
// String resourceType = nextRef.getResourceType();
|
||||
// if (nextRef.isLocal()) {
|
||||
// IBaseResource resource = nextRefInfo.getResourceReference().getResource();
|
||||
// if (resource instanceof ValueSet) {
|
||||
// theWorkerCtx.getValueSets().put(nextRef.getValue(), (ValueSet) resource);
|
||||
// newResources.add(resource);
|
||||
// } else if (resource instanceof Questionnaire) {
|
||||
// theWorkerCtx.getQuestionnaires().put(nextRef.getValue(), (Questionnaire) resource);
|
||||
// newResources.add(resource);
|
||||
// } else if (resource == null) {
|
||||
// theMessages.add(new ValidationMessage(Source.QuestionnaireResponseValidator, org.hl7.fhir.instance.model.OperationOutcome.IssueType.INVALID, "Invalid reference '" + nextRef.getValue() + "' - No contained resource with this ID found", IssueSeverity.FATAL));
|
||||
// }
|
||||
// } else if (isBlank(resourceType)) {
|
||||
// theMessages.add(new ValidationMessage(Source.QuestionnaireResponseValidator, org.hl7.fhir.instance.model.OperationOutcome.IssueType.INVALID, "Invalid reference '" + nextRef.getValue() + "' - Does not identify resource type", IssueSeverity.FATAL));
|
||||
// } else if ("ValueSet".equals(resourceType)) {
|
||||
// if (!theWorkerCtx.getValueSets().containsKey(nextRef.getValue())) {
|
||||
// ValueSet resource = tryToLoad(ValueSet.class, nextRef, theMessages);
|
||||
// if (resource == null) {
|
||||
// return false;
|
||||
// }
|
||||
// theWorkerCtx.getValueSets().put(nextRef.getValue(), resource);
|
||||
// newResources.add(resource);
|
||||
// }
|
||||
// } else if ("Questionnaire".equals(resourceType)) {
|
||||
// if (!theWorkerCtx.getQuestionnaires().containsKey(nextRef.getValue())) {
|
||||
// Questionnaire resource = tryToLoad(Questionnaire.class, nextRef, theMessages);
|
||||
// if (resource == null) {
|
||||
// return false;
|
||||
// }
|
||||
// theWorkerCtx.getQuestionnaires().put(nextRef.getValue(), resource);
|
||||
// newResources.add(resource);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (IBaseResource nextAddedResource : newResources) {
|
||||
// boolean outcome = loadReferences(nextAddedResource, theWorkerCtx, theValCtx, theMessages);
|
||||
// if (!outcome) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// private <T extends IBaseResource> T tryToLoad(Class<T> theType, IIdType theReference, List<ValidationMessage> theMessages) {
|
||||
// if (myResourceLoader == null) {
|
||||
// theMessages.add(new ValidationMessage().setLevel(IssueSeverity.FATAL).setMessage("No resource loader present, could not load " + theReference));
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// T retVal = myResourceLoader.load(theType, theReference);
|
||||
// if (retVal == null) {
|
||||
// throw new IllegalStateException("ResourceLoader returned null. This is a bug with the resourceloader. Reference was: " + theReference);
|
||||
// }
|
||||
// return retVal;
|
||||
// } catch (ResourceNotFoundException e) {
|
||||
// theMessages.add(new ValidationMessage().setLevel(IssueSeverity.FATAL).setMessage("Reference could not be found: " + theReference));
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
package org.hl7.fhir.dstu21.hapi.validation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.dstu21.formats.IParser;
|
||||
import org.hl7.fhir.dstu21.formats.ParserType;
|
||||
import org.hl7.fhir.dstu21.hapi.validation.IValidationSupport.CodeValidationResult;
|
||||
import org.hl7.fhir.dstu21.model.CodeableConcept;
|
||||
import org.hl7.fhir.dstu21.model.Coding;
|
||||
import org.hl7.fhir.dstu21.model.ConceptMap;
|
||||
import org.hl7.fhir.dstu21.model.OperationOutcome.IssueSeverity;
|
||||
import org.hl7.fhir.dstu21.model.Resource;
|
||||
import org.hl7.fhir.dstu21.model.ResourceType;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptReferenceComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpander;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpanderFactory;
|
||||
import org.hl7.fhir.dstu21.terminologies.ValueSetExpanderSimple;
|
||||
import org.hl7.fhir.dstu21.utils.INarrativeGenerator;
|
||||
import org.hl7.fhir.dstu21.utils.IWorkerContext;
|
||||
import org.hl7.fhir.dstu21.validation.IResourceValidator;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
|
||||
public final class HapiWorkerContext implements IWorkerContext, ValueSetExpander, ValueSetExpanderFactory {
|
||||
private final FhirContext myCtx;
|
||||
private IValidationSupport myValidationSupport;
|
||||
|
||||
public HapiWorkerContext(FhirContext theCtx, IValidationSupport theValidationSupport) {
|
||||
myCtx = theCtx;
|
||||
myValidationSupport = theValidationSupport;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSetExpansionComponent expandVS(ConceptSetComponent theInc) {
|
||||
return myValidationSupport.expandValueSet(myCtx, theInc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSet fetchCodeSystem(String theSystem) {
|
||||
if (myValidationSupport == null) {
|
||||
return null;
|
||||
} else {
|
||||
return myValidationSupport.fetchCodeSystem(myCtx, theSystem);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Resource> T fetchResource(Class<T> theClass, String theUri) {
|
||||
if (myValidationSupport == null) {
|
||||
return null;
|
||||
} else {
|
||||
return myValidationSupport.fetchResource(myCtx, theClass, theUri);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public INarrativeGenerator getNarrativeGenerator(String thePrefix, String theBasePath) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParser getParser(ParserType theType) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParser getParser(String theType) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Resource> boolean hasResource(Class<T> theClass_, String theUri) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParser newJsonParser() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IResourceValidator newValidator() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IParser newXmlParser() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSystem(String theSystem) {
|
||||
if (myValidationSupport == null) {
|
||||
return false;
|
||||
} else {
|
||||
return myValidationSupport.isCodeSystemSupported(myCtx, theSystem);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(String theSystem, String theCode, String theDisplay) {
|
||||
CodeValidationResult result = myValidationSupport.validateCode(myCtx, theSystem, theCode, theDisplay);
|
||||
if (result == null) {
|
||||
return null;
|
||||
}
|
||||
return new ValidationResult(result.getSeverity(), result.getMessage(), result.asConceptDefinition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(String theSystem, String theCode, String theDisplay, ConceptSetComponent theVsi) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(String theSystem, String theCode, String theDisplay, ValueSet theVs) {
|
||||
if (theSystem == null || StringUtils.equals(theSystem, theVs.getCodeSystem().getSystem())) {
|
||||
for (ConceptDefinitionComponent next : theVs.getCodeSystem().getConcept()) {
|
||||
ValidationResult retVal = validateCodeSystem(theCode, next);
|
||||
if (retVal != null && retVal.isOk()) {
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (ConceptSetComponent nextComposeConceptSet : theVs.getCompose().getInclude()) {
|
||||
if (StringUtils.equals(theSystem, nextComposeConceptSet.getSystem())) {
|
||||
for (ConceptReferenceComponent nextComposeCode : nextComposeConceptSet.getConcept()) {
|
||||
ConceptDefinitionComponent conceptDef = new ConceptDefinitionComponent();
|
||||
conceptDef.setCode(nextComposeCode.getCode());
|
||||
conceptDef.setDisplay(nextComposeCode.getDisplay());
|
||||
ValidationResult retVal = validateCodeSystem(theCode, conceptDef);
|
||||
if (retVal != null && retVal.isOk()) {
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ValidationResult(IssueSeverity.ERROR, "Unknown code[" + theCode + "] in system[" + theSystem + "]");
|
||||
}
|
||||
|
||||
private ValidationResult validateCodeSystem(String theCode, ConceptDefinitionComponent theConcept) {
|
||||
if (StringUtils.equals(theCode, theConcept.getCode())) {
|
||||
return new ValidationResult(theConcept);
|
||||
} else {
|
||||
for (ConceptDefinitionComponent next : theConcept.getConcept()) {
|
||||
ValidationResult retVal = validateCodeSystem(theCode, next);
|
||||
if (retVal != null && retVal.isOk()) {
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSetExpansionOutcome expand(ValueSet theSource) {
|
||||
ValueSetExpansionOutcome vso;
|
||||
try {
|
||||
vso = getExpander().expand(theSource);
|
||||
} catch (Exception e) {
|
||||
throw new InternalErrorException(e);
|
||||
}
|
||||
if (vso.getError() != null) {
|
||||
return null;
|
||||
} else {
|
||||
return vso;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ConceptMap> findMapsForSource(String theUrl) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(Coding theCode, ValueSet theVs) {
|
||||
String system = theCode.getSystem();
|
||||
String code = theCode.getCode();
|
||||
String display = theCode.getDisplay();
|
||||
return validateCode(system, code, display, theVs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(CodeableConcept theCode, ValueSet theVs) {
|
||||
for (Coding next : theCode.getCoding()) {
|
||||
ValidationResult retVal = validateCode(next, theVs);
|
||||
if (retVal != null && retVal.isOk()) {
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
||||
return new ValidationResult(null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getResourceNames() {
|
||||
List<String> result = new ArrayList<String>();
|
||||
for (ResourceType next : ResourceType.values()) {
|
||||
result.add(next.name());
|
||||
}
|
||||
Collections.sort(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAbbreviation(String theName) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSetExpander getExpander() {
|
||||
return new ValueSetExpanderSimple(this, this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package org.hl7.fhir.dstu21.hapi.validation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.ValueSet;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.dstu21.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
|
||||
public class ValidationSupportChain implements IValidationSupport {
|
||||
|
||||
private List<IValidationSupport> myChain;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public ValidationSupportChain() {
|
||||
myChain = new ArrayList<IValidationSupport>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public ValidationSupportChain(IValidationSupport... theValidationSupportModules) {
|
||||
this();
|
||||
for (IValidationSupport next : theValidationSupportModules) {
|
||||
if (next != null) {
|
||||
myChain.add(next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidationSupport(IValidationSupport theValidationSupport) {
|
||||
myChain.add(theValidationSupport);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSetExpansionComponent expandValueSet(FhirContext theCtx, ConceptSetComponent theInclude) {
|
||||
for (IValidationSupport next : myChain) {
|
||||
if (next.isCodeSystemSupported(theCtx, theInclude.getSystem())) {
|
||||
return next.expandValueSet(theCtx, theInclude);
|
||||
}
|
||||
}
|
||||
return myChain.get(0).expandValueSet(theCtx, theInclude);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueSet fetchCodeSystem(FhirContext theCtx, String theSystem) {
|
||||
for (IValidationSupport next : myChain) {
|
||||
ValueSet retVal = next.fetchCodeSystem(theCtx, theSystem);
|
||||
if (retVal != null) {
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri) {
|
||||
for (IValidationSupport next : myChain) {
|
||||
T retVal = next.fetchResource(theContext, theClass, theUri);
|
||||
if (retVal != null) {
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCodeSystemSupported(FhirContext theCtx, String theSystem) {
|
||||
for (IValidationSupport next : myChain) {
|
||||
if (next.isCodeSystemSupported(theCtx, theSystem)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodeValidationResult validateCode(FhirContext theCtx, String theCodeSystem, String theCode, String theDisplay) {
|
||||
for (IValidationSupport next : myChain) {
|
||||
if (next.isCodeSystemSupported(theCtx, theCodeSystem)) {
|
||||
return next.validateCode(theCtx, theCodeSystem, theCode, theDisplay);
|
||||
}
|
||||
}
|
||||
return myChain.get(0).validateCode(theCtx, theCodeSystem, theCode, theDisplay);
|
||||
}
|
||||
|
||||
}
|
|
@ -29,18 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc.
|
||||
*/
|
||||
|
|
|
@ -29,17 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.ICompositeType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,12 +29,9 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.
|
||||
*/
|
||||
|
|
|
@ -29,17 +29,16 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.ICompositeType;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* A text note which also contains information about who made the statement and when.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.ICompositeType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* For referring to data content defined in other formats.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,16 +29,16 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* Base definition for all elements that are defined inside a resource - but not those in a data type.
|
||||
*/
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
|
||||
|
|
|
@ -29,17 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,16 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBinary;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A binary resource can contain any content, whether text, image, pdf, zip archive, etc.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.hl7.fhir.dstu21.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
@ -29,19 +31,21 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.math.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A container for a collection of resources.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.hl7.fhir.dstu21.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
@ -29,20 +31,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.math.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.hl7.fhir.dstu21.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
@ -29,20 +31,22 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.math.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.RemittanceOutcome;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.RemittanceOutcomeEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* This resource provides the adjudication details from the processing of a Claim resource.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score.
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,7 @@ import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
|||
/**
|
||||
* Primitive type "code" in FHIR, when not bound to an enumerated list of codes
|
||||
*/
|
||||
@DatatypeDef(name="code", profileOf=StringType.class)
|
||||
@DatatypeDef(name="code")
|
||||
public class CodeType extends StringType implements Comparable<CodeType> {
|
||||
|
||||
private static final long serialVersionUID = 3L;
|
||||
|
|
|
@ -29,17 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.ICompositeType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text.
|
||||
*/
|
||||
|
|
|
@ -29,17 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseCoding;
|
||||
import org.hl7.fhir.instance.model.api.ICompositeType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* A reference to a code defined by a terminology system.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,19 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,19 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition.
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.hl7.fhir.dstu21.model;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,24 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConceptMapEquivalence;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConceptMapEquivalenceEnumFactory;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatus;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatusEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,25 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatus;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatusEnumFactory;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.SearchParamType;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.SearchParamTypeEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.instance.model.api.IBaseConformance;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
|
||||
*/
|
||||
|
|
|
@ -29,12 +29,12 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
public class Constants {
|
||||
|
||||
public final static String VERSION = "1.2.0";
|
||||
public final static String REVISION = "7464";
|
||||
public final static String DATE = "Mon Dec 21 19:58:53 EST 2015";
|
||||
public final static String DATE = "Mon Dec 21 20:18:28 EST 2015";
|
||||
}
|
||||
|
|
|
@ -29,17 +29,16 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.ICompositeType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.hl7.fhir.dstu21.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
@ -29,19 +31,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.math.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A formal agreement between parties regarding the conduct of business, exchange of information or other matters.
|
||||
*/
|
||||
|
|
|
@ -29,12 +29,9 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Financial instrument which may be used to pay for or reimburse health care products and services.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,22 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatus;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatusEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* The formal description of a single piece of information that can be gathered and reported.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
/**
|
||||
* This resource defines a decision support rule of the form [on Event] if Condition then Action.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
/**
|
||||
* The DecisionSupportServiceModule resource describes decision support functionality that is available as a service.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* This resource identifies an instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Describes the characteristics, operational status and capabilities of a medical-related component of a medical device.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,19 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Describes a measurement, calculation or setting capability of a medical device.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A record of a device being used by a patient where the record is the result of a report from the patient or another clinician.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,19 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A record of a request for a diagnostic investigation service to be performed.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* 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 interpretations, and formatted representation of diagnostic reports.
|
||||
*/
|
||||
|
|
|
@ -29,12 +29,9 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,22 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.DocumentReferenceStatus;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.DocumentReferenceStatusEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A manifest that defines a set of documents.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,22 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.DocumentReferenceStatus;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.DocumentReferenceStatusEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* A reference to a document .
|
||||
*/
|
||||
|
|
|
@ -29,17 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseHasExtensions;
|
||||
import org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions;
|
||||
import org.hl7.fhir.instance.model.api.IDomainResource;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
/**
|
||||
* A resource that includes narrative, extensions, and contained resources.
|
||||
*/
|
||||
|
|
|
@ -29,12 +29,9 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,17 +29,16 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseHasExtensions;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
/**
|
||||
* Base definition for all elements in a resource.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,21 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.BindingStrength;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.BindingStrengthEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseDatatypeElement;
|
||||
import org.hl7.fhir.instance.model.api.ICompositeType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* Captures constraints on each element within the resource, profile, or extension.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,22 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.RemittanceOutcome;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.RemittanceOutcomeEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* This resource provides eligibility and plan details from the processing of an Eligibility resource.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
@ -29,18 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* This resource provides the insurance enrollment details to the insurer regarding a specified coverage.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.RemittanceOutcome;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.RemittanceOutcomeEnumFactory;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* This resource provides enrollment and plan details from the processing of an Enrollment resource.
|
||||
*/
|
||||
|
|
|
@ -1,39 +1,6 @@
|
|||
package org.hl7.fhir.dstu21.model;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
|
||||
public class Enumerations {
|
||||
|
||||
|
|
|
@ -29,18 +29,18 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.
|
||||
*/
|
||||
|
|
|
@ -29,19 +29,22 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatus;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.ConformanceResourceStatusEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Resource to define constraints on the Expansion of a FHIR ValueSet.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.hl7.fhir.dstu21.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
@ -29,20 +31,20 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.math.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided.
|
||||
*/
|
||||
|
|
|
@ -29,17 +29,17 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.List;
|
||||
|
||||
import java.util.*;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseDatatype;
|
||||
import org.hl7.fhir.instance.model.api.IBaseExtension;
|
||||
import org.hl7.fhir.instance.model.api.IBaseHasExtensions;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
/**
|
||||
* Optional Extensions Element - found in all resources.
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.hl7.fhir.dstu21.model;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
|
||||
/**
|
||||
* in a language with helper classes, this would be a helper class (at least, the base exgtension helpers would be)
|
||||
|
|
|
@ -5,9 +5,9 @@ import java.net.URISyntaxException;
|
|||
import java.text.ParseException;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.ContactPoint.ContactPointSystem;
|
||||
import org.hl7.fhir.dstu21.model.Narrative.NarrativeStatus;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlParser;
|
||||
|
||||
|
@ -143,7 +143,11 @@ public class Factory {
|
|||
public static Narrative newNarrative(NarrativeStatus status, String html) throws IOException, FHIRException {
|
||||
Narrative n = new Narrative();
|
||||
n.setStatus(status);
|
||||
n.setDiv(new XhtmlParser().parseFragment("<div>"+Utilities.escapeXml(html)+"</div>"));
|
||||
try {
|
||||
n.setDiv(new XhtmlParser().parseFragment("<div>"+Utilities.escapeXml(html)+"</div>"));
|
||||
} catch (org.hl7.fhir.exceptions.FHIRException e) {
|
||||
throw new FHIRException(e.getMessage(), e);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,19 +29,22 @@ package org.hl7.fhir.dstu21.model;
|
|||
|
||||
*/
|
||||
|
||||
// Generated on Mon, Dec 21, 2015 19:58-0500 for FHIR v1.2.0
|
||||
|
||||
import java.util.*;
|
||||
// Generated on Mon, Dec 21, 2015 20:18-0500 for FHIR v1.2.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.dstu21.exceptions.FHIRException;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.AdministrativeGender;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.AdministrativeGenderEnumFactory;
|
||||
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.dstu21.model.Enumerations.*;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Block;
|
||||
import org.hl7.fhir.instance.model.api.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
/**
|
||||
* Significant health events and conditions for a person related to the patient relevant in the context of care for the patient.
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue