use of org.hl7.fhir.dstu3.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.
the class VersionConvertorPrimitiveType10_30Test method testNullValueDstu2Primitive.
@ParameterizedTest(name = "Testing dstu2 -> dstu3 conversion of null value {0}.")
@MethodSource("dstu2PrimitiveTypes")
public <T extends PrimitiveType> void testNullValueDstu2Primitive(String classname, T obj) {
obj.addExtension().setUrl("http://example.com/AnyValue").setValue(new StringType("A value"));
Assertions.assertNull(((org.hl7.fhir.dstu3.model.PrimitiveType) VersionConvertorFactory_10_30.convertType(obj)).getValue());
}
use of org.hl7.fhir.dstu3.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.
the class VersionConvertorPrimitiveType10_50Test method testNullValueDstu2Primitive.
@ParameterizedTest(name = "Testing dstu2 -> r5 conversion of null value {0}.")
@MethodSource("dstu2PrimitiveTypes")
public <T extends PrimitiveType> void testNullValueDstu2Primitive(String classname, T obj) {
obj.addExtension().setUrl("http://example.com/AnyValue").setValue(new StringType("A value"));
Assertions.assertNull(((org.hl7.fhir.r4.model.PrimitiveType) VersionConvertorFactory_10_40.convertType(obj)).getValue());
}
use of org.hl7.fhir.dstu3.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.
the class VersionConvertorPrimitiveType30_40Test method testNullValueDstu2Primitive.
@ParameterizedTest(name = "Testing dstu3 -> r4 conversion of null value {0}.")
@MethodSource("dstu3PrimitiveTypes")
public <T extends PrimitiveType> void testNullValueDstu2Primitive(String classname, T obj) {
obj.addExtension().setUrl("http://example.com/AnyValue").setValue(new StringType("A value"));
Assertions.assertNull(((org.hl7.fhir.r4.model.PrimitiveType) VersionConvertorFactory_30_40.convertType(obj)).getValue());
}
use of org.hl7.fhir.dstu3.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.
the class PrimitiveType method equalsDeep.
@Override
public boolean equalsDeep(Base obj) {
if (!super.equalsDeep(obj))
return false;
if (obj == null) {
return false;
}
if (!(obj.getClass() == getClass())) {
return false;
}
PrimitiveType<?> o = (PrimitiveType<?>) obj;
EqualsBuilder b = new EqualsBuilder();
b.append(getValue(), o.getValue());
return b.isEquals();
}
use of org.hl7.fhir.dstu3.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.
the class BaseWorkerContext method describeValidationParameters.
@SuppressWarnings("rawtypes")
private String describeValidationParameters(Parameters pin) {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
for (ParametersParameterComponent p : pin.getParameter()) {
if (p.hasValue() && p.getValue() instanceof PrimitiveType) {
b.append(p.getName() + "=" + ((PrimitiveType) p.getValue()).asStringValue());
} else if (p.hasValue() && p.getValue() instanceof Coding) {
b.append("system=" + ((Coding) p.getValue()).getSystem());
b.append("code=" + ((Coding) p.getValue()).getCode());
b.append("display=" + ((Coding) p.getValue()).getDisplay());
} else if (p.hasValue() && p.getValue() instanceof CodeableConcept) {
if (((CodeableConcept) p.getValue()).hasCoding()) {
Coding c = ((CodeableConcept) p.getValue()).getCodingFirstRep();
b.append("system=" + c.getSystem());
b.append("code=" + c.getCode());
b.append("display=" + c.getDisplay());
} else if (((CodeableConcept) p.getValue()).hasText()) {
b.append("text=" + ((CodeableConcept) p.getValue()).getText());
}
} else if (p.hasResource() && (p.getResource() instanceof ValueSet)) {
b.append("valueset=" + getVSSummary((ValueSet) p.getResource()));
}
}
return b.toString();
}
Aggregations