All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nedap.archie.rm.datavalues.quantity.ReferenceRange Maven / Gradle / Ivy

There is a newer version: 3.11.0
Show newest version
package com.nedap.archie.rm.datavalues.quantity;

import com.nedap.archie.rm.RMObject;
import com.nedap.archie.rm.datavalues.DvText;
import com.nedap.archie.rminfo.Invariant;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import java.util.Objects;

/**
 * Created by pieter.bos on 04/11/15.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "REFERENCE_RANGE", propOrder = {
        "meaning",
        "range"
})
public class ReferenceRange> extends RMObject {

    private DvInterval range;
    private DvText meaning;

    public ReferenceRange() {
    }

    public ReferenceRange(DvText meaning, DvInterval range) {
        this.range = range;
        this.meaning = meaning;
    }

    public DvInterval getRange() {
        return range;
    }

    public void setRange(DvInterval range) {
        this.range = range;
    }

    public DvText getMeaning() {
        return meaning;
    }

    public void setMeaning(DvText meaning) {
        this.meaning = meaning;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ReferenceRange that = (ReferenceRange) o;
        return Objects.equals(range, that.range) &&
                Objects.equals(meaning, that.meaning);
    }

    @Override
    public int hashCode() {
        return Objects.hash(range, meaning);
    }

    @Invariant("Range_is_simple")
    public boolean rangeIsSimple() {
        return (range.isLowerUnbounded() || (range.getLower() != null && range.getLower().isSimple())) && (range.isUpperUnbounded() || (range.getUpper() != null && range.getUpper().isSimple()));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy