/** * @return If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL NOT be present. */ public int getOffset() { return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue(); }
/** * @param value Number of discrete units within this product. */ public BiologicallyDerivedProduct setQuantity(int value) { if (this.quantity == null) this.quantity = new IntegerType(); this.quantity.setValue(value); return this; }
@Override public IntegerType copy() { IntegerType ret = new IntegerType(getValue()); copyValues(ret); return ret; }
private String describeCardinality(ElementDefinition definition, ElementDefinition fallback, UnusedTracker tracker) { IntegerType min = definition.hasMinElement() ? definition.getMinElement() : new IntegerType(); StringType max = definition.hasMaxElement() ? definition.getMaxElement() : new StringType(); if (min.isEmpty() && fallback != null) min = fallback.getMinElement(); if (max.isEmpty() && fallback != null) max = fallback.getMaxElement(); tracker.used = !max.isEmpty() && !max.getValue().equals("0"); if (min.isEmpty() && max.isEmpty()) return null; else return (!min.hasValue() ? "" : Integer.toString(min.getValue())) + ".." + (!max.hasValue() ? "" : max.getValue()); }
public static org.hl7.fhir.dstu2016may.model.IntegerType convertInteger(org.hl7.fhir.r4.model.IntegerType src) throws FHIRException { org.hl7.fhir.dstu2016may.model.IntegerType tgt = new org.hl7.fhir.dstu2016may.model.IntegerType(); if (src.hasValue()) tgt.setValue(src.getValue()); copyElement(src, tgt); return tgt; }
/** * @return {@link #value} (The value of the parameter.) */ public IntegerType getValueIntegerType() throws FHIRException { if (this.value == null) this.value = new IntegerType(); if (!(this.value instanceof IntegerType)) throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); return (IntegerType) this.value; }
/** * @param value {@link #numFN} (The number of false negatives if the GQ score threshold was set to "score" field value.) */ public boolean hasNumFN(int value) { if (this.numFN == null) return false; for (IntegerType v : this.numFN) if (v.getValue().equals(value)) // integer return true; return false; }
private List<Base> funcLength(ExecutionContext context, List<Base> focus, ExpressionNode exp) { List<Base> result = new ArrayList<Base>(); if (focus.size() == 1) { String s = convertToString(focus.get(0)); result.add(new IntegerType(s.length()).noExtensions()); } return result; }
private void buildFixedExpression(ElementDefinition ed, StringBuilder expression, String discriminator, ElementDefinition criteriaElement) throws DefinitionException { Type fixed = criteriaElement.getFixed(); if (fixed instanceof CodeableConcept) { CodeableConcept cc = (CodeableConcept) fixed; buildCodeableConceptExpression(ed, expression, discriminator, cc); } else { expression.append(" and (" + discriminator + " = "); if (fixed instanceof StringType) { Gson gson = new Gson(); String json = gson.toJson((StringType)fixed); String escapedString = json.substring(json.indexOf(":")+2); escapedString = escapedString.substring(0, escapedString.indexOf(",\"myStringValue")-1); expression.append("'" + escapedString + "'"); } else if (fixed instanceof UriType) { expression.append("'" + ((UriType)fixed).asStringValue() + "'"); } else if (fixed instanceof IntegerType) { expression.append(((IntegerType)fixed).asStringValue()); } else if (fixed instanceof DecimalType) { expression.append(((IntegerType)fixed).asStringValue()); } else if (fixed instanceof BooleanType) { expression.append(((BooleanType)fixed).asStringValue()); } else throw new DefinitionException("Unsupported fixed value type for discriminator(" + discriminator + ") for slice " + ed.getId() + ": " + fixed.getClass().getName()); expression.append(")"); } }
private void genCardinality(HierarchicalTableGenerator gen, ElementDefinition definition, Row row, boolean hasDef, UnusedTracker tracker, ElementDefinition fallback) { IntegerType min = !hasDef ? new IntegerType() : definition.hasMinElement() ? definition.getMinElement() : new IntegerType(); StringType max = !hasDef ? new StringType() : definition.hasMaxElement() ? definition.getMaxElement() : new StringType(); if (min.isEmpty() && definition.getUserData(DERIVATION_POINTER) != null) { ElementDefinition base = (ElementDefinition) definition.getUserData(DERIVATION_POINTER); if (base.hasMinElement()) { min = base.getMinElement().copy(); min.setUserData(DERIVATION_EQUALS, true); if (min.isEmpty() && fallback != null) min = fallback.getMinElement(); if (max.isEmpty() && fallback != null) if (!min.isEmpty() || !max.isEmpty()) { cell.addPiece(checkForNoChange(min, gen.new Piece(null, !min.hasValue() ? "" : Integer.toString(min.getValue()), null))); cell.addPiece(checkForNoChange(min, max, gen.new Piece(null, "..", null))); cell.addPiece(checkForNoChange(min, gen.new Piece(null, !max.hasValue() ? "" : max.getValue(), null)));
/** * @return {@link #start} (Start position of the variant on the reference sequence. If the coordinate system is either 0-based or 1-based, then start position is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value */ public IntegerType getStartElement() { if (this.start == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create MolecularSequenceVariantComponent.start"); else if (Configuration.doAutoCreate()) this.start = new IntegerType(); // bb return this.start; }
public static int readIntegerExtension(DomainResource dr, String uri, int defaultValue) { Extension ex = ExtensionHelper.getExtension(dr, uri); if (ex == null) return defaultValue; if (ex.getValue() instanceof IntegerType) return ((IntegerType) ex.getValue()).getValue(); throw new Error("Unable to read extension "+uri+" as an integer"); }
private static void renderTransformParam(StringBuilder b, StructureMapGroupRuleTargetParameterComponent rtp) { try { if (rtp.hasValueBooleanType()) b.append(rtp.getValueBooleanType().asStringValue()); else if (rtp.hasValueDecimalType()) b.append(rtp.getValueDecimalType().asStringValue()); else if (rtp.hasValueIdType()) b.append(rtp.getValueIdType().asStringValue()); else if (rtp.hasValueDecimalType()) b.append(rtp.getValueDecimalType().asStringValue()); else if (rtp.hasValueIntegerType()) b.append(rtp.getValueIntegerType().asStringValue()); else b.append("'"+Utilities.escapeJava(rtp.getValueStringType().asStringValue())+"'"); } catch (FHIRException e) { e.printStackTrace(); b.append("error!"); } }
public static IntegerType newInteger(int value) { IntegerType res = new IntegerType(); res.setValue(value); return res; }
/** * @return {@link #end} (Structural variant inner end. If the coordinate system is 0-based then end is exclusive and does not include the last position. If the coordinate system is 1-base, then end is inclusive and includes the last position.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value */ public IntegerType getEndElement() { if (this.end == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create MolecularSequenceStructureVariantInnerComponent.end"); else if (Configuration.doAutoCreate()) this.end = new IntegerType(); // bb return this.end; }
public EffectEvidenceSynthesisSampleSizeComponent copy() { EffectEvidenceSynthesisSampleSizeComponent dst = new EffectEvidenceSynthesisSampleSizeComponent(); copyValues(dst); dst.description = description == null ? null : description.copy(); dst.numberOfStudies = numberOfStudies == null ? null : numberOfStudies.copy(); dst.numberOfParticipants = numberOfParticipants == null ? null : numberOfParticipants.copy(); return dst; }
public static String readStringExtension(DomainResource c, String uri) { Extension ex = getExtension(c, uri); if (ex == null) return null; if ((ex.getValue() instanceof StringType)) return ((StringType) ex.getValue()).getValue(); if ((ex.getValue() instanceof UriType)) return ((UriType) ex.getValue()).getValue(); if (ex.getValue() instanceof CodeType) return ((CodeType) ex.getValue()).getValue(); if (ex.getValue() instanceof IntegerType) return ((IntegerType) ex.getValue()).asStringValue(); if ((ex.getValue() instanceof MarkdownType)) return ((MarkdownType) ex.getValue()).getValue(); return null; }