Codota Logo
BoundCodeDt
Code IndexAdd Codota to your IDE (free)

How to use
BoundCodeDt
in
ca.uhn.fhir.model.primitive

Best Java code snippets using ca.uhn.fhir.model.primitive.BoundCodeDt (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: jamesagnew/hapi-fhir

private int toOrder(Entry theO1) {
  int o1 = 0;
  if (theO1.getRequest().getMethodElement().getValueAsEnum() != null) {
    switch (theO1.getRequest().getMethodElement().getValueAsEnum()) {
      case DELETE:
        o1 = 1;
        break;
      case POST:
        o1 = 2;
        break;
      case PUT:
        o1 = 3;
        break;
      case GET:
        o1 = 4;
        break;
    }
  }
  return o1;
}
origin: jamesagnew/hapi-fhir

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;
}
origin: jamesagnew/hapi-fhir

public void setValueAsEnum(T theValue) {
  Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeDt() should not be called!");
  if (theValue==null) {
    setValue(null);
  } else {
    setValue(myBinder.toCodeString(theValue));
  }
}
origin: jamesagnew/hapi-fhir

private static <T extends Enum<?>> String extractSystem(BoundCodeDt<T> theBoundCode) {
  if (theBoundCode.getValueAsEnum() != null) {
    IValueSetEnumBinder<T> binder = theBoundCode.getBinder();
    return binder.toSystemString(theBoundCode.getValueAsEnum());
  }
  return null;
}
origin: jamesagnew/hapi-fhir

@SuppressWarnings("unused")
public static void codes() {
 // START SNIPPET: codes
 Patient patient = new Patient();
 // You can set this code using a String if you want. Note that
 // for "closed" valuesets (such as the one used for Patient.gender)
 // you must use one of the strings defined by the FHIR specification.
 // You must not define your own.
 patient.getGenderElement().setValue("male");
 
 // HAPI also provides Java enumerated types which make it easier to
 // deal with coded values. This code achieves the exact same result
 // as the code above.
 patient.setGender(AdministrativeGenderEnum.MALE);
 
 // You can also retrieve coded values the same way
 String genderString = patient.getGenderElement().getValueAsString();
 AdministrativeGenderEnum genderEnum = patient.getGenderElement().getValueAsEnum();
 
 // The following is a shortcut to create
 patient.setMaritalStatus(MaritalStatusCodesEnum.M);
 // END SNIPPET: codes
}
origin: jamesagnew/hapi-fhir

ConditionalDeleteStatusEnum conditionalDelete = nextResource.getConditionalDeleteElement().getValueAsEnum();
if (conditionalDelete == ConditionalDeleteStatusEnum.MULTIPLE_DELETES_SUPPORTED && myDaoConfig.isAllowMultipleDelete() == false) {
  nextResource.setConditionalDelete(ConditionalDeleteStatusEnum.SINGLE_DELETES_SUPPORTED);
Long count = counts.get(nextResource.getTypeElement().getValueAsString());
if (count != null) {
  nextResource.addUndeclaredExtension(false, ExtensionConstants.CONF_RESOURCE_COUNT, new DecimalDt(count));
  if (nextParam.getTypeElement().getValueAsEnum() == SearchParamTypeEnum.REFERENCE) {
    List<BoundCodeDt<ResourceTypeEnum>> targets = nextParam.getTarget();
    for (BoundCodeDt<ResourceTypeEnum> next : targets) {
      RuntimeResourceDefinition def = ctx.getResourceDefinition(next.getValue());
      for (RuntimeSearchParam nextChainedParam : def.getSearchParams()) {
        nextParam.addChain(nextChainedParam.getName());
origin: jamesagnew/hapi-fhir

public BoundCodeDt(IValueSetEnumBinder<T> theBinder, T theValue) {
  Validate.notNull(theBinder, "theBinder must not be null");
  myBinder = theBinder;
  setValueAsEnum(theValue);
}
origin: jamesagnew/hapi-fhir

private void verifyStatusOk(RestOperationTypeEnum theOperation, IBaseResource theOldResourceOrNull, IBaseResource theResource) {
  Subscription subscription = (Subscription) theResource;
  SubscriptionStatusEnum newStatus = subscription.getStatusElement().getValueAsEnum();
  if (newStatus == SubscriptionStatusEnum.REQUESTED || newStatus == SubscriptionStatusEnum.OFF) {
    return;
  }
  if (newStatus == null) {
    String actualCode = subscription.getStatusElement().getValueAsString();
    throw new UnprocessableEntityException("Can not " + theOperation.getCode() + " resource: Subscription.status must be populated on this server" + ((isNotBlank(actualCode)) ? " (invalid value " + actualCode + ")" : ""));
  }
  if (theOldResourceOrNull != null) {
    try {
      Subscription existing = (Subscription) theOldResourceOrNull;
      SubscriptionStatusEnum existingStatus = existing.getStatusElement().getValueAsEnum();
      if (existingStatus != newStatus) {
        verifyActiveStatus(theOperation, subscription, newStatus, existingStatus);
      }
    } catch (ResourceNotFoundException e) {
      verifyActiveStatus(theOperation, subscription, newStatus, null);
    }
  } else {
    verifyActiveStatus(theOperation, subscription, newStatus, null);
  }
}
origin: jamesagnew/hapi-fhir

BundleEntryTransactionMethodEnum httpVerb = ResourceMetadataKeyEnum.ENTRY_TRANSACTION_METHOD.get(next);
if (httpVerb != null) {
  entry.getRequest().getMethodElement().setValueAsString(httpVerb.getCode());
  entry.getSearch().getModeElement().setValue(searchMode.getCode());
origin: jamesagnew/hapi-fhir

/**
 * Add a value for <b>aggregation</b> ()
 *
 * <p>
 * <b>Definition:</b>
 * If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.
 * </p> 
 */
public BoundCodeDt<AggregationModeEnum> addAggregation() {
  BoundCodeDt<AggregationModeEnum> retVal = new BoundCodeDt<AggregationModeEnum>(AggregationModeEnum.VALUESET_BINDER);
  getAggregation().add(retVal);
  return retVal;
}
origin: jamesagnew/hapi-fhir

@Override
public INarrative setStatusAsString(String theString) {
  getStatus().setValueAsString(theString);
  return this;
}
origin: jamesagnew/hapi-fhir

@Override
public void addRootPropertiesToBundle(String theId, String theServerBase, String theLinkSelf, String theLinkPrev, String theLinkNext, Integer theTotalResults, BundleTypeEnum theBundleType,
                         IPrimitiveType<Date> theLastUpdated) {
  myBase = theServerBase;
  if (myBundle.getIdElement().isEmpty()) {
    myBundle.setId(theId);
  }
  if (myBundle.getId().isEmpty()) {
    myBundle.setId(UUID.randomUUID().toString());
  }
  if (ResourceMetadataKeyEnum.UPDATED.get(myBundle) == null) {
    ResourceMetadataKeyEnum.UPDATED.put(myBundle, (InstantDt) theLastUpdated);
  }
  if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkSelf)) {
    myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theLinkSelf);
  }
  if (!hasLink(Constants.LINK_NEXT, myBundle) && isNotBlank(theLinkNext)) {
    myBundle.addLink().setRelation(Constants.LINK_NEXT).setUrl(theLinkNext);
  }
  if (!hasLink(Constants.LINK_PREVIOUS, myBundle) && isNotBlank(theLinkPrev)) {
    myBundle.addLink().setRelation(Constants.LINK_PREVIOUS).setUrl(theLinkPrev);
  }
  if (myBundle.getTypeElement().isEmpty() && theBundleType != null) {
    myBundle.getTypeElement().setValueAsString(theBundleType.getCode());
  }
  if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) {
    myBundle.getTotalElement().setValue(theTotalResults);
  }
}
origin: jamesagnew/hapi-fhir

@Override
public String getStatusAsString() {
  return getStatus().getValueAsString();
}
origin: jamesagnew/hapi-fhir

    if (!needContactPointSystem.equals(nextValue.getSystemElement().getValueAsString())) {
      continue;
  systems.add(nextValue.getSystemElement().getValueAsString());
  codes.add(nextValue.getValueElement().getValue());
} else if (nextObject instanceof BoundCodeDt) {
  BoundCodeDt<?> obj = (BoundCodeDt<?>) nextObject;
  String system = extractSystem(obj);
  String code = obj.getValue();
  if (isNotBlank(code)) {
    systems.add(system);
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu

BundleEntry entry = myBundle.addResource(next, myContext, theServerBase);
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) {
  if (entry.getSearchMode().isEmpty()) {
    entry.getSearchMode().setValueAsEnum(BundleEntrySearchModeEnum.INCLUDE);
origin: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

ConditionalDeleteStatusEnum conditionalDelete = nextResource.getConditionalDeleteElement().getValueAsEnum();
if (conditionalDelete == ConditionalDeleteStatusEnum.MULTIPLE_DELETES_SUPPORTED && myDaoConfig.isAllowMultipleDelete() == false) {
  nextResource.setConditionalDelete(ConditionalDeleteStatusEnum.SINGLE_DELETES_SUPPORTED);
Long count = counts.get(nextResource.getTypeElement().getValueAsString());
if (count != null) {
  nextResource.addUndeclaredExtension(false, ExtensionConstants.CONF_RESOURCE_COUNT, new DecimalDt(count));
  if (nextParam.getTypeElement().getValueAsEnum() == SearchParamTypeEnum.REFERENCE) {
    List<BoundCodeDt<ResourceTypeEnum>> targets = nextParam.getTarget();
    for (BoundCodeDt<ResourceTypeEnum> next : targets) {
      RuntimeResourceDefinition def = ctx.getResourceDefinition(next.getValue());
      for (RuntimeSearchParam nextChainedParam : def.getSearchParams()) {
        nextParam.addChain(nextChainedParam.getName());
origin: jamesagnew/hapi-fhir

/**
 * Sets the value(s) for <b>severity</b> ()
 *
 * <p>
 * <b>Definition:</b>
 * Identifies the impact constraint violation has on the conformance of the instance
 * </p> 
 */
public Constraint setSeverity(ConstraintSeverityEnum theValue) {
  getSeverityElement().setValueAsEnum(theValue);
  return this;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

private void verifyStatusOk(RestOperationTypeEnum theOperation, IBaseResource theOldResourceOrNull, IBaseResource theResource) {
  Subscription subscription = (Subscription) theResource;
  SubscriptionStatusEnum newStatus = subscription.getStatusElement().getValueAsEnum();
  if (newStatus == SubscriptionStatusEnum.REQUESTED || newStatus == SubscriptionStatusEnum.OFF) {
    return;
  }
  if (newStatus == null) {
    String actualCode = subscription.getStatusElement().getValueAsString();
    throw new UnprocessableEntityException("Can not " + theOperation.getCode() + " resource: Subscription.status must be populated on this server" + ((isNotBlank(actualCode)) ? " (invalid value " + actualCode + ")" : ""));
  }
  if (theOldResourceOrNull != null) {
    try {
      Subscription existing = (Subscription) theOldResourceOrNull;
      SubscriptionStatusEnum existingStatus = existing.getStatusElement().getValueAsEnum();
      if (existingStatus != newStatus) {
        verifyActiveStatus(theOperation, subscription, newStatus, existingStatus);
      }
    } catch (ResourceNotFoundException e) {
      verifyActiveStatus(theOperation, subscription, newStatus, null);
    }
  } else {
    verifyActiveStatus(theOperation, subscription, newStatus, null);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

BundleEntryTransactionMethodEnum httpVerb = ResourceMetadataKeyEnum.ENTRY_TRANSACTION_METHOD.get(next);
if (httpVerb != null) {
  entry.getRequest().getMethodElement().setValueAsString(httpVerb.getCode());
  entry.getSearch().getModeElement().setValue(searchMode.getCode());
origin: jamesagnew/hapi-fhir

/**
 * Add a value for <b>representation</b> ()
 *
 * <p>
 * <b>Definition:</b>
 * Codes that define how this element is represented in instances, when the deviation varies from the normal case
 * </p> 
 */
public BoundCodeDt<PropertyRepresentationEnum> addRepresentation() {
  BoundCodeDt<PropertyRepresentationEnum> retVal = new BoundCodeDt<PropertyRepresentationEnum>(PropertyRepresentationEnum.VALUESET_BINDER);
  getRepresentation().add(retVal);
  return retVal;
}
ca.uhn.fhir.model.primitiveBoundCodeDt

Most used methods

  • getValueAsEnum
  • getValue
  • setValue
  • getValueAsString
  • setValueAsEnum
  • setValueAsString
  • <init>
  • isEmpty
  • getBinder

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now