Search in sources :

Example 51 with PrimitiveType

use of org.hl7.fhir.r4b.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.

the class PrimitiveType method equalsShallow.

@Override
public boolean equalsShallow(Base obj) {
    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();
}
Also used : IPrimitiveType(org.hl7.fhir.instance.model.api.IPrimitiveType) EqualsBuilder(org.apache.commons.lang3.builder.EqualsBuilder)

Example 52 with PrimitiveType

use of org.hl7.fhir.r4b.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();
}
Also used : IPrimitiveType(org.hl7.fhir.instance.model.api.IPrimitiveType) EqualsBuilder(org.apache.commons.lang3.builder.EqualsBuilder)

Example 53 with PrimitiveType

use of org.hl7.fhir.r4b.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();
}
Also used : IPrimitiveType(org.hl7.fhir.instance.model.api.IPrimitiveType) EqualsBuilder(org.apache.commons.lang3.builder.EqualsBuilder)

Example 54 with PrimitiveType

use of org.hl7.fhir.r4b.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.

the class PrimitiveType method equalsShallow.

@Override
public boolean equalsShallow(Base obj) {
    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();
}
Also used : IPrimitiveType(org.hl7.fhir.instance.model.api.IPrimitiveType) EqualsBuilder(org.apache.commons.lang3.builder.EqualsBuilder)

Example 55 with PrimitiveType

use of org.hl7.fhir.r4b.model.PrimitiveType in project org.hl7.fhir.core by hapifhir.

the class StructureMapUtilities method describeTransformCCorC.

@SuppressWarnings("rawtypes")
private String describeTransformCCorC(StructureMapGroupRuleTargetComponent tgt) throws FHIRException {
    if (tgt.getParameter().size() < 2)
        return null;
    DataType p1 = tgt.getParameter().get(0).getValue();
    DataType p2 = tgt.getParameter().get(1).getValue();
    if (p1 instanceof IdType || p2 instanceof IdType)
        return null;
    if (!(p1 instanceof PrimitiveType) || !(p2 instanceof PrimitiveType))
        return null;
    String uri = ((PrimitiveType) p1).asStringValue();
    String code = ((PrimitiveType) p2).asStringValue();
    if (Utilities.noString(uri))
        throw new FHIRException("Describe Transform, but the uri is blank");
    if (Utilities.noString(code))
        throw new FHIRException("Describe Transform, but the code is blank");
    Coding c = buildCoding(uri, code);
    return TerminologyRenderer.describeSystem(c.getSystem()) + "#" + c.getCode() + (c.hasDisplay() ? "(" + c.getDisplay() + ")" : "");
}
Also used : FHIRException(org.hl7.fhir.exceptions.FHIRException)

Aggregations

FHIRException (org.hl7.fhir.exceptions.FHIRException)18 EqualsBuilder (org.apache.commons.lang3.builder.EqualsBuilder)12 IPrimitiveType (org.hl7.fhir.instance.model.api.IPrimitiveType)12 IOException (java.io.IOException)10 NotImplementedException (org.apache.commons.lang3.NotImplementedException)10 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 MethodSource (org.junit.jupiter.params.provider.MethodSource)9 PrimitiveType (org.hl7.fhir.r5.model.PrimitiveType)8 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)8 URISyntaxException (java.net.URISyntaxException)6 PrimitiveType (org.hl7.fhir.definitions.model.PrimitiveType)6 FileNotFoundException (java.io.FileNotFoundException)5 ArrayList (java.util.ArrayList)5 PrimitiveType (org.hl7.fhir.dstu3.model.PrimitiveType)5 PrimitiveType (org.hl7.fhir.r4b.model.PrimitiveType)5 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)5 URI (java.net.URI)4 ElementDefn (org.hl7.fhir.definitions.model.ElementDefn)4 StringType (org.hl7.fhir.dstu3.model.StringType)4 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)3