com.nedap.archie.rm.datavalues.quantity.ReferenceRange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openehr-rm Show documentation
Show all versions of openehr-rm Show documentation
An implementation of the openehr reference model
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()));
}
}