Fix for HAPI-FHIR issue 1820

This commit is contained in:
markiantorno 2020-04-29 14:08:36 -04:00
parent 6110b56396
commit 368a45a150
5 changed files with 3947 additions and 3656 deletions

View File

@ -50,16 +50,17 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Thu, Dec 13, 2018 14:07+1100 for FHIR v4.0.0
import java.util.List;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.ICompositeType;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import java.util.List;
/**
* A length of time.
*/
@DatatypeDef(name="Duration")
@DatatypeDef(name = "Duration")
public class Duration extends Quantity implements ICompositeType {
private static final long serialVersionUID = 0L;
@ -78,7 +79,8 @@ public class Duration extends Quantity implements ICompositeType {
@Override
public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
switch (_hash) {
default: return super.getNamedProperty(_hash, _name, _checkValid);
default:
return super.getNamedProperty(_hash, _name, _checkValid);
}
}
@ -86,7 +88,8 @@ public class Duration extends Quantity implements ICompositeType {
@Override
public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
switch (hash) {
default: return super.getProperty(hash, name, checkValid);
default:
return super.getProperty(hash, name, checkValid);
}
}
@ -94,7 +97,8 @@ public class Duration extends Quantity implements ICompositeType {
@Override
public Base setProperty(int hash, String name, Base value) throws FHIRException {
switch (hash) {
default: return super.setProperty(hash, name, value);
default:
return super.setProperty(hash, name, value);
}
}
@ -107,7 +111,8 @@ public class Duration extends Quantity implements ICompositeType {
@Override
public Base makeProperty(int hash, String name) throws FHIRException {
switch (hash) {
default: return super.makeProperty(hash, name);
default:
return super.makeProperty(hash, name);
}
}
@ -115,7 +120,8 @@ public class Duration extends Quantity implements ICompositeType {
@Override
public String[] getTypesForProperty(int hash, String name) throws FHIRException {
switch (hash) {
default: return super.getTypesForProperty(hash, name);
default:
return super.getTypesForProperty(hash, name);
}
}
@ -133,6 +139,11 @@ public class Duration extends Quantity implements ICompositeType {
public Duration copy() {
Duration dst = new Duration();
copyValues(dst);
dst.value = value == null ? null : value.copy();
dst.comparator = comparator == null ? null : comparator.copy();
dst.unit = unit == null ? null : unit.copy();
dst.system = system == null ? null : system.copy();
dst.code = code == null ? null : code.copy();
return dst;
}

View File

@ -9,10 +9,12 @@ import org.hl7.fhir.r5.model.DomainResource;
import org.hl7.fhir.r5.test.utils.TestingUtilities;
import org.hl7.fhir.r5.utils.NarrativeGenerator;
import org.hl7.fhir.utilities.xml.XMLUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@ -29,7 +31,7 @@ import java.util.List;
import java.util.stream.Stream;
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Disabled //Test case 1 doesn't pass in r5 yet
@Disabled //Test case 1 doesn't pass
public class NarrativeGenerationTests {
private IWorkerContext context;

View File

@ -47,7 +47,7 @@ import java.util.*;
import java.util.Map.Entry;
@RunWith(Parameterized.class)
public class ValidationTestSuite implements IEvaluationContext, IValidatorResourceFetcher {
public class ValidationTests implements IEvaluationContext, IValidatorResourceFetcher {
public final static boolean PRINT_OUTPUT_TO_CONSOLE = false;
@ -78,7 +78,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
private JsonObject content;
private String version;
public ValidationTestSuite(String name, JsonObject content) {
public ValidationTests(String name, JsonObject content) {
this.name = name;
this.content = content;
}

View File

@ -1,14 +1,5 @@
package org.hl7.fhir.validation.tests.utilities;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.validation.tests.ValidationTestSuite;
import com.google.common.base.Charsets;
public class TestUtilities {
public static boolean silent = false;
@ -17,5 +8,4 @@ public class TestUtilities {
// return org.hl7.fhir.utilities.Utilities.path(System.getProperty("user.dir"), "src", "test", "resources", name);
// }
}