public T getValueAsEnum() { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeDt() should not be called!"); T retVal = myBinder.fromCodeString(getValue()); if (retVal == null) { // TODO: throw special exception type? } return retVal; }
@SuppressWarnings("unchecked") private static <T extends Enum<?>> T getEnumFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum<?>, Object> theResourceMetadata, ResourceMetadataKeyEnum<T> theKey, Class<T> theEnumType, IValueSetEnumBinder<T> theBinder) { Object retValObj = theResourceMetadata.get(theKey); if (retValObj == null) { return null; } else if (theEnumType.equals(retValObj.getClass())) { return (T) retValObj; } else if (retValObj instanceof String) { return theBinder.fromCodeString((String) retValObj); } throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + InstantDt.class.getCanonicalName()); }
/** * Loops through the {@link #getCoding() codings} in this codeable concept * and returns the first bound enumerated type that matches. <b>Use * caution</b> using this method, see the return description for more * information. * * @return Returns the bound enumerated type, or <code>null</code> if none * are found. Note that a null return value doesn't neccesarily * imply that this Codeable Concept has no codes, only that it has * no codes that match the enum. */ public Set<T> getValueAsEnum() { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!"); Set<T> retVal = new HashSet<T>(); for (CodingDt next : getCoding()) { if (next == null) { continue; } T nextT = myBinder.fromCodeString(defaultString(next.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString())); if (nextT != null) { retVal.add(nextT); } else { // TODO: throw special exception type? } } return retVal; }
String[] bundleTypeValues = theRequest.getParameters().get(Constants.PARAM_BUNDLETYPE); if (bundleTypeValues != null) { bundleType = BundleTypeEnum.VALUESET_BINDER.fromCodeString(bundleTypeValues[0]);
public T getValueAsEnum() { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeDt() should not be called!"); T retVal = myBinder.fromCodeString(getValue()); if (retVal == null) { // TODO: throw special exception type? } return retVal; }
@SuppressWarnings("unchecked") private static <T extends Enum<?>> T getEnumFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum<?>, Object> theResourceMetadata, ResourceMetadataKeyEnum<T> theKey, Class<T> theEnumType, IValueSetEnumBinder<T> theBinder) { Object retValObj = theResourceMetadata.get(theKey); if (retValObj == null) { return null; } else if (theEnumType.equals(retValObj.getClass())) { return (T) retValObj; } else if (retValObj instanceof String) { return theBinder.fromCodeString((String) retValObj); } throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + InstantDt.class.getCanonicalName()); }
private void checkBindingForSystemOps(Rest rest, Set<SystemRestfulInteractionEnum> systemOps, BaseMethodBinding<?> nextMethodBinding) { if (nextMethodBinding.getRestOperationType() != null) { String sysOpCode = nextMethodBinding.getRestOperationType().getCode(); if (sysOpCode != null) { SystemRestfulInteractionEnum sysOp = SystemRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(sysOpCode); if (sysOp == null) { return; } if (systemOps.contains(sysOp) == false) { systemOps.add(sysOp); rest.addInteraction().setCode(sysOp); } } } }
/** * Loops through the {@link #getCoding() codings} in this codeable concept * and returns the first bound enumerated type that matches. <b>Use * caution</b> using this method, see the return description for more * information. * * @return Returns the bound enumerated type, or <code>null</code> if none * are found. Note that a null return value doesn't neccesarily * imply that this Codeable Concept has no codes, only that it has * no codes that match the enum. */ public Set<T> getValueAsEnum() { Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeableConceptDt() should not be called!"); Set<T> retVal = new HashSet<T>(); for (CodingDt next : getCoding()) { if (next == null) { continue; } T nextT = myBinder.fromCodeString(defaultString(next.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString())); if (nextT != null) { retVal.add(nextT); } else { // TODO: throw special exception type? } } return retVal; }
/** * Loops through the {@link #getCoding() codings} in this codeable concept * and returns the first bound enumerated type that matches. <b>Use * caution</b> using this method, see the return description for more * information. * * @return Returns the bound enumerated type, or <code>null</code> if none * are found. Note that a null return value doesn't neccesarily * imply that this Codeable Concept has no codes, only that it has * no codes that match the enum. */ public Set<T> getValueAsEnum() { Set<T> retVal = new HashSet<T>(); for (CodingDt next : getCoding()) { if (next == null) { continue; } T nextT = myBinder.fromCodeString(defaultString(next.getCode().getValue()), defaultString(next.getSystem().getValueAsString())); if (nextT != null) { retVal.add(nextT); } else { // TODO: throw special exception type? } } return retVal; }
private void fillName(StructureElement elem, BaseRuntimeElementDefinition<?> nextDef, String theServerBase) { assert nextDef != null; StructureElementDefinitionType type = elem.getDefinition().addType(); String name = nextDef.getName(); DataTypeEnum fromCodeString = DataTypeEnum.VALUESET_BINDER.fromCodeString(name); if (fromCodeString == null) { throw new ConfigurationException("Unknown type: " + name); } type.setCode(fromCodeString); }
RuntimeResourceDefinition targetDef = getServerConfiguration().getFhirContext().getResourceDefinition(nextTarget); if (targetDef != null) { ResourceTypeEnum code = ResourceTypeEnum.VALUESET_BINDER.fromCodeString(targetDef.getName()); if (code != null) { param.addTarget(code);
defn.getDefinition().addType().setCode(DataTypeEnum.VALUESET_BINDER.fromCodeString(pdef.getName())); } else if (nextChild.getChildType() != null && ICompositeDatatype.class.isAssignableFrom(nextChild.getChildType())) { RuntimeCompositeDatatypeDefinition pdef = (RuntimeCompositeDatatypeDefinition) nextChild.getSingleChildOrThrow(); defn.getDefinition().addType().setCode(DataTypeEnum.VALUESET_BINDER.fromCodeString(pdef.getName())); } else { BaseRuntimeElementDefinition<?> singleChildOrThrow = nextChild.getSingleChildOrThrow();
String[] bundleTypeValues = theRequest.getParameters().get(Constants.PARAM_BUNDLETYPE); if (bundleTypeValues != null) { bundleType = BundleTypeEnum.VALUESET_BINDER.fromCodeString(bundleTypeValues[0]);
RuntimeResourceDefinition targetDef = myServerConfiguration.getFhirContext().getResourceDefinition(nextTarget); if (targetDef != null) { ResourceTypeEnum code = ResourceTypeEnum.VALUESET_BINDER.fromCodeString(targetDef.getName()); if (code != null) { param.addTarget(code);
String resOpCode = nextMethodBinding.getRestOperationType().getCode(); if (resOpCode != null) { TypeRestfulInteractionEnum resOp = TypeRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(resOpCode); if (resOp != null) { if (resourceOps.contains(resOp) == false) {
RestfulOperationTypeEnum resOp = RestfulOperationTypeEnum.VALUESET_BINDER.fromCodeString(nextMethodBinding.getRestOperationType().getCode()); if (resOp != null) { if (resourceOps.contains(resOp) == false) { RestfulOperationSystemEnum sysOp = RestfulOperationSystemEnum.VALUESET_BINDER.fromCodeString(nextMethodBinding.getRestOperationType().getCode()); if (sysOp != null) { if (systemOps.contains(sysOp) == false) {