public static org.hl7.fhir.dstu2016may.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.r4.model.Quantity src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.SimpleQuantity tgt = new org.hl7.fhir.dstu2016may.model.SimpleQuantity(); copyElement(src, tgt); if (src.hasValue()) tgt.setValue(src.getValue()); tgt.setComparator(convertQuantityComparator(src.getComparator())); if (src.hasUnit()) tgt.setUnit(src.getUnit()); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasCode()) tgt.setCode(src.getCode()); return tgt; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 111972721: return getValueElement(); case -844673834: return getComparatorElement(); case 3594628: return getUnitElement(); case -887328209: return getSystemElement(); case 3059181: return getCodeElement(); default: return super.makeProperty(hash, name); } }
public Quantity addAreaUnderCurve() { //3 Quantity t = new Quantity(); if (this.areaUnderCurve == null) this.areaUnderCurve = new ArrayList<Quantity>(); this.areaUnderCurve.add(t); return t; }
public org.hl7.fhir.instance.model.Quantity convertQuantity(org.hl7.fhir.r4.model.Quantity src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Quantity tgt = new org.hl7.fhir.instance.model.Quantity(); copyElement(src, tgt); tgt.setValue(src.getValue()); tgt.setComparator(convertQuantityComparator(src.getComparator())); tgt.setUnit(src.getUnit()); tgt.setSystem(src.getSystem()); tgt.setCode(src.getCode()); return tgt; }
private void addQuantity(ResourceTable theEntity, HashSet<ResourceIndexedSearchParamQuantity> retVal, String resourceName, Quantity nextValue) { if (!nextValue.getValueElement().isEmpty()) { BigDecimal nextValueValue = nextValue.getValueElement().getValue(); String nextValueString = nextValue.getSystemElement().getValueAsString(); String nextValueCode = nextValue.getCode(); ResourceIndexedSearchParamQuantity nextEntity = new ResourceIndexedSearchParamQuantity(resourceName, nextValueValue, nextValueString, nextValueCode); nextEntity.setResource(theEntity); retVal.add(nextEntity); } }
} else if (nextObject instanceof Quantity) { Quantity nextValue = (Quantity) nextObject; if (nextValue.getValueElement().isEmpty()) { continue; ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue()); nextEntity.setResource(theEntity); retVal.add(nextEntity);
BigDecimal value = ((Quantity) nextObject).getValue(); if (value != null) { addSearchTerm(theEntity, retVal, nextSpName, value.toPlainString()); Quantity low = ((Range) nextObject).getLow(); if (low != null) { BigDecimal value = low.getValue(); if (value != null) { addSearchTerm(theEntity, retVal, nextSpName, value.toPlainString());
public org.hl7.fhir.instance.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.r4.model.Quantity src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.SimpleQuantity tgt = new org.hl7.fhir.instance.model.SimpleQuantity(); copyElement(src, tgt); tgt.setValue(src.getValue()); tgt.setComparator(convertQuantityComparator(src.getComparator())); tgt.setUnit(src.getUnit()); tgt.setSystem(src.getSystem()); tgt.setCode(src.getCode()); return tgt; }
else if (item instanceof Quantity) { Quantity q = (Quantity) item; if (q.getSystem().equals("http://unitsofmeasure.org")) { String u = "'"+q.getCode()+"'"; boolean plural = !q.getValue().toPlainString().equals("1"); if ("a".equals(q.getCode())) u = plural ? "years" : "year"; else if ("mo".equals(q.getCode())) u = plural ? "months" : "month"; else if ("wk".equals(q.getCode())) u = plural ? "weeks" : "week"; else if ("d".equals(q.getCode())) u = plural ? "days" : "day"; else if ("h".equals(q.getCode())) u = plural ? "hours" : "hour"; else if ("min".equals(q.getCode())) u = plural ? "minutes" : "minute"; else if ("s".equals(q.getCode())) u = plural ? "seconds" : "seconds"; else if ("ms".equals(q.getCode())) u = plural ? "milliseconds" : "milliseconds"; return q.getValue().toPlainString()+" "+u;
public static org.hl7.fhir.dstu2016may.model.Quantity convertQuantity(org.hl7.fhir.r4.model.Quantity src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Quantity tgt = new org.hl7.fhir.dstu2016may.model.Quantity(); copyElement(src, tgt); if (src.hasValue()) tgt.setValue(src.getValue()); tgt.setComparator(convertQuantityComparator(src.getComparator())); if (src.hasUnit()) tgt.setUnit(src.getUnit()); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasCode()) tgt.setCode(src.getCode()); return tgt; }
public SimpleQuantity castToSimpleQuantity(Base b) throws FHIRException { if (b instanceof SimpleQuantity) return (SimpleQuantity) b; else if (b instanceof Quantity) { Quantity q = (Quantity) b; SimpleQuantity sq = new SimpleQuantity(); sq.setValueElement(q.getValueElement()); sq.setComparatorElement(q.getComparatorElement()); sq.setUnitElement(q.getUnitElement()); sq.setSystemElement(q.getSystemElement()); sq.setCodeElement(q.getCodeElement()); return sq; } else throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an SimpleQuantity"); }
public org.hl7.fhir.instance.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.r4.model.Quantity src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.SimpleQuantity tgt = new org.hl7.fhir.instance.model.SimpleQuantity(); copyElement(src, tgt); tgt.setValue(src.getValue()); tgt.setComparator(convertQuantityComparator(src.getComparator())); tgt.setUnit(src.getUnit()); tgt.setSystem(src.getSystem()); tgt.setCode(src.getCode()); return tgt; }
private DecimalType qtyToCanonical(Quantity q) { if (!"http://unitsofmeasure.org".equals(q.getSystem())) return null; try { Pair p = new Pair(new Decimal(q.getValue().toPlainString()), q.getCode()); Pair c = worker.getUcumService().getCanonicalForm(p); return new DecimalType(c.getValue().asDecimal()); } catch (UcumException e) { return null; } }
public Quantity addLethalDose50() { //3 Quantity t = new Quantity(); if (this.lethalDose50 == null) this.lethalDose50 = new ArrayList<Quantity>(); this.lethalDose50.add(t); return t; }
public static org.hl7.fhir.dstu2016may.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.r4.model.Quantity src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.SimpleQuantity tgt = new org.hl7.fhir.dstu2016may.model.SimpleQuantity(); copyElement(src, tgt); if (src.hasValue()) tgt.setValue(src.getValue()); tgt.setComparator(convertQuantityComparator(src.getComparator())); if (src.hasUnit()) tgt.setUnit(src.getUnit()); if (src.hasSystem()) tgt.setSystem(src.getSystem()); if (src.hasCode()) tgt.setCode(src.getCode()); return tgt; }