Skip to content

Commit

Permalink
Update to final STU3 ballot definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Aug 26, 2016
1 parent 64066a9 commit ddc0abe
Show file tree
Hide file tree
Showing 360 changed files with 15,932 additions and 48,352 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private ValueSet doExpand(ValueSet theSource) {

HapiWorkerContext workerContext = new HapiWorkerContext(getContext(), myValidationSupport);

ValueSetExpansionOutcome outcome = workerContext.expand(theSource);
ValueSetExpansionOutcome outcome = workerContext.expand(theSource, null);

ValueSet retVal = outcome.getValueset();
retVal.setStatus(ConformanceResourceStatus.ACTIVE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public List<VersionIndependentConcept> expandValueSet(String theValueSet) {
ArrayList<VersionIndependentConcept> retVal = new ArrayList<VersionIndependentConcept>();

HapiWorkerContext worker = new HapiWorkerContext(myContext, myValidationSupport);
ValueSetExpansionOutcome outcome = worker.expand(source);
ValueSetExpansionOutcome outcome = worker.expand(source, null);
for (ValueSetExpansionContainsComponent next : outcome.getValueset().getExpansion().getContains()) {
retVal.add(new VersionIndependentConcept(next.getSystem(), next.getCode()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ public void testSearchCodeInValueSetThatImportsInvalidCodeSystem() {
try {
myObservationDao.search(params);
} catch(InvalidRequestException e) {
assertEquals("Unable to expand imported value set \"http://example.com/my_value_set\" - Error was: Unable to find imported value set http://non_existant_VS", e.getMessage());
assertEquals("Unable to expand imported value set: Unable to find imported value set http://non_existant_VS", e.getMessage());
}

// Now let's update
Expand Down
41 changes: 0 additions & 41 deletions hapi-fhir-structures-dstu3/differences.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.hl7.fhir.dstu3.hapi.validation;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -19,6 +21,7 @@
import org.hl7.fhir.dstu3.model.CodeableConcept;
import org.hl7.fhir.dstu3.model.Coding;
import org.hl7.fhir.dstu3.model.ConceptMap;
import org.hl7.fhir.dstu3.model.ExpansionProfile;
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity;
import org.hl7.fhir.dstu3.model.Resource;
import org.hl7.fhir.dstu3.model.ResourceType;
Expand All @@ -34,6 +37,7 @@
import org.hl7.fhir.dstu3.utils.INarrativeGenerator;
import org.hl7.fhir.dstu3.utils.IWorkerContext;
import org.hl7.fhir.dstu3.validation.IResourceValidator;
import org.hl7.fhir.exceptions.TerminologyServiceException;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
Expand All @@ -44,6 +48,7 @@ public final class HapiWorkerContext implements IWorkerContext, ValueSetExpander
private final FhirContext myCtx;
private Map<String, Resource> myFetchedResourceCache = new HashMap<String, Resource>();
private IValidationSupport myValidationSupport;
private ExpansionProfile myExpansionProfile;

public HapiWorkerContext(FhirContext theCtx, IValidationSupport theValidationSupport) {
Validate.notNull(theCtx, "theCtx must not be null");
Expand All @@ -57,33 +62,6 @@ public List<StructureDefinition> allStructures() {
return myValidationSupport.fetchAllStructureDefinitions(myCtx);
}

@Override
public ValueSetExpansionOutcome expand(ValueSet theSource) {
ValueSetExpansionOutcome vso;
try {
vso = getExpander().expand(theSource);
} catch (InvalidRequestException e) {
throw e;
} catch (Exception e) {
throw new InternalErrorException(e);
}
if (vso.getError() != null) {
throw new InvalidRequestException(vso.getError());
} else {
return vso;
}
}

@Override
public ValueSetExpansionComponent expandVS(ConceptSetComponent theInc) {
return myValidationSupport.expandValueSet(myCtx, theInc);
}

@Override
public ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk) {
throw new UnsupportedOperationException();
}

@Override
public CodeSystem fetchCodeSystem(String theSystem) {
if (myValidationSupport == null) {
Expand Down Expand Up @@ -275,7 +253,7 @@ public ValidationResult validateCode(String theSystem, String theCode, String th
// }

if (expandedValueSet == null) {
expandedValueSet = expand(theVs);
expandedValueSet = expand(theVs, null);
}

for (ValueSetExpansionContainsComponent next : expandedValueSet.getValueset().getExpansion().getContains()) {
Expand Down Expand Up @@ -335,4 +313,46 @@ public boolean hasCache() {
throw new UnsupportedOperationException();
}

@Override
public ValueSetExpansionOutcome expand(ValueSet theSource, ExpansionProfile theProfile) {
ValueSetExpansionOutcome vso;
try {
vso = getExpander().expand(theSource, theProfile);
} catch (InvalidRequestException e) {
throw e;
} catch (Exception e) {
throw new InternalErrorException(e);
}
if (vso.getError() != null) {
throw new InvalidRequestException(vso.getError());
} else {
return vso;
}
}

@Override
public ExpansionProfile getExpansionProfile() {
return myExpansionProfile;
}

@Override
public void setExpansionProfile(ExpansionProfile theExpProfile) {
myExpansionProfile = theExpProfile;
}

@Override
public ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk, boolean theHeiarchical) {
throw new UnsupportedOperationException();
}

@Override
public ValueSetExpansionComponent expandVS(ConceptSetComponent theInc, boolean theHeiarchical) throws TerminologyServiceException {
return myValidationSupport.expandValueSet(myCtx, theInc);
}

@Override
public void setLogger(ILoggingService theLogger) {
throw new UnsupportedOperationException();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down Expand Up @@ -301,6 +301,10 @@ public enum AllergyIntoleranceCategory {
* Substances administered to achieve a physiological effect.
*/
MEDICATION,
/**
* A preparation that is synthesized from living organisms or their products, especially a human or animal protein, such as a hormone or antitoxin, that is used as a diagnostic, preventive, or therapeutic agent. Also called biological drug. Examples of biological products include: vaccines; blood and blood products for transfusion and/or manufacturing into other products; allergenic extracts, which are used for both diagnosis and treatment (for example, allergy shots); human cells and tissues used for transplantation (for example, tendons, ligaments and bone); gene therapies; cellular therapies; tests to screen potential blood donors for infectious agents such as HIV.
*/
BIOLOGIC,
/**
* Substances that are encountered in the environment.
*/
Expand All @@ -316,6 +320,8 @@ public static AllergyIntoleranceCategory fromCode(String codeString) throws FHIR
return FOOD;
if ("medication".equals(codeString))
return MEDICATION;
if ("biologic".equals(codeString))
return BIOLOGIC;
if ("environment".equals(codeString))
return ENVIRONMENT;
if (Configuration.isAcceptInvalidEnums())
Expand All @@ -327,6 +333,7 @@ public String toCode() {
switch (this) {
case FOOD: return "food";
case MEDICATION: return "medication";
case BIOLOGIC: return "biologic";
case ENVIRONMENT: return "environment";
default: return "?";
}
Expand All @@ -335,6 +342,7 @@ public String getSystem() {
switch (this) {
case FOOD: return "http://hl7.org/fhir/allergy-intolerance-category";
case MEDICATION: return "http://hl7.org/fhir/allergy-intolerance-category";
case BIOLOGIC: return "http://hl7.org/fhir/allergy-intolerance-category";
case ENVIRONMENT: return "http://hl7.org/fhir/allergy-intolerance-category";
default: return "?";
}
Expand All @@ -343,6 +351,7 @@ public String getDefinition() {
switch (this) {
case FOOD: return "Any substance consumed to provide nutritional support for the body.";
case MEDICATION: return "Substances administered to achieve a physiological effect.";
case BIOLOGIC: return "A preparation that is synthesized from living organisms or their products, especially a human or animal protein, such as a hormone or antitoxin, that is used as a diagnostic, preventive, or therapeutic agent. Also called biological drug. Examples of biological products include: vaccines; blood and blood products for transfusion and/or manufacturing into other products; allergenic extracts, which are used for both diagnosis and treatment (for example, allergy shots); human cells and tissues used for transplantation (for example, tendons, ligaments and bone); gene therapies; cellular therapies; tests to screen potential blood donors for infectious agents such as HIV.";
case ENVIRONMENT: return "Substances that are encountered in the environment.";
default: return "?";
}
Expand All @@ -351,6 +360,7 @@ public String getDisplay() {
switch (this) {
case FOOD: return "Food";
case MEDICATION: return "Medication";
case BIOLOGIC: return "Biologic";
case ENVIRONMENT: return "Environment";
default: return "?";
}
Expand All @@ -366,6 +376,8 @@ public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgu
return AllergyIntoleranceCategory.FOOD;
if ("medication".equals(codeString))
return AllergyIntoleranceCategory.MEDICATION;
if ("biologic".equals(codeString))
return AllergyIntoleranceCategory.BIOLOGIC;
if ("environment".equals(codeString))
return AllergyIntoleranceCategory.ENVIRONMENT;
throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
Expand All @@ -380,6 +392,8 @@ public Enumeration<AllergyIntoleranceCategory> fromType(Base code) throws FHIREx
return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.FOOD);
if ("medication".equals(codeString))
return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.MEDICATION);
if ("biologic".equals(codeString))
return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.BIOLOGIC);
if ("environment".equals(codeString))
return new Enumeration<AllergyIntoleranceCategory>(this, AllergyIntoleranceCategory.ENVIRONMENT);
throw new FHIRException("Unknown AllergyIntoleranceCategory code '"+codeString+"'");
Expand All @@ -389,6 +403,8 @@ public String toCode(AllergyIntoleranceCategory code) {
return "food";
if (code == AllergyIntoleranceCategory.MEDICATION)
return "medication";
if (code == AllergyIntoleranceCategory.BIOLOGIC)
return "biologic";
if (code == AllergyIntoleranceCategory.ENVIRONMENT)
return "environment";
return "?";
Expand Down Expand Up @@ -1352,7 +1368,7 @@ public String fhirType() {
* Category of the identified substance.
*/
@Child(name = "category", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="food | medication | environment", formalDefinition="Category of the identified substance." )
@Description(shortDefinition="food | medication | biologic | environment", formalDefinition="Category of the identified substance." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/allergy-intolerance-category")
protected Enumeration<AllergyIntoleranceCategory> category;

Expand Down Expand Up @@ -2645,17 +2661,17 @@ public ResourceType getResourceType() {
/**
* Search parameter: <b>category</b>
* <p>
* Description: <b>food | medication | environment</b><br>
* Description: <b>food | medication | biologic | environment</b><br>
* Type: <b>token</b><br>
* Path: <b>AllergyIntolerance.category</b><br>
* </p>
*/
@SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment", type="token" )
@SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | biologic | environment", type="token" )
public static final String SP_CATEGORY = "category";
/**
* <b>Fluent Client</b> search parameter constant for <b>category</b>
* <p>
* Description: <b>food | medication | environment</b><br>
* Description: <b>food | medication | biologic | environment</b><br>
* Type: <b>token</b><br>
* Path: <b>AllergyIntolerance.category</b><br>
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
*/

// Generated on Wed, Aug 3, 2016 09:39-0400 for FHIR v1.5.0
// Generated on Thu, Aug 25, 2016 23:04-0400 for FHIR v1.6.0

import java.util.*;

Expand Down
Loading

0 comments on commit ddc0abe

Please sign in to comment.