Tabnine Logo
ContextItems.setItem
Code IndexAdd Tabnine to your IDE (free)

How to use
setItem
method
in
org.carewebframework.api.context.ContextItems

Best Java code snippets using org.carewebframework.api.context.ContextItems.setItem (Showing top 14 results out of 315)

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Saves a date item object as a context item.
 *
 * @param itemName Item name
 * @param date Date value
 */
public void setDate(String itemName, Date date) {
  if (date == null) {
    setItem(itemName, null);
  } else {
    setItem(itemName, DateUtil.toHL7(date));
  }
}
origin: org.carewebframework/org.carewebframework.api.core

  /**
   * Adds property values to the context item list.
   *
   * @param values Values to add.
   */
  private void addItems(Map<String, String> values) {
    for (String itemName : values.keySet()) {
      setItem(itemName, values.get(itemName));
    }
  }
}
origin: org.carewebframework/org.carewebframework.api

  /**
   * Adds property values to the context item list.
   * 
   * @param values Values to add.
   */
  private void addItems(Map<String, String> values) {
    for (String itemName : values.keySet()) {
      setItem(itemName, values.get(itemName));
    }
  }
}
origin: org.carewebframework/org.carewebframework.api

/**
 * Saves a date item object as a context item.
 * 
 * @param itemName Item name
 * @param date Date value
 */
public void setDate(String itemName, Date date) {
  if (date == null) {
    setItem(itemName, null);
  } else {
    setItem(itemName, DateUtil.toHL7(date));
  }
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Adds context items from a serialized string.
 *
 * @param values Serialized context items to add.
 * @throws Exception Unspecified exception.
 */
public void addItems(String values) throws Exception {
  for (String line : values.split("[\\r\\n]")) {
    String[] pcs = line.split("\\=", 2);
    if (pcs.length == 2) {
      setItem(pcs[0], pcs[1]);
    }
  }
}
origin: org.carewebframework/org.carewebframework.api

/**
 * Adds context items from a serialized string.
 * 
 * @param values Serialized context items to add.
 * @throws Exception Unspecified exception.
 */
public void addItems(String values) throws Exception {
  for (String line : values.split("[\\r\\n]")) {
    String[] pcs = line.split("\\=", 2);
    
    if (pcs.length == 2) {
      setItem(pcs[0], pcs[1]);
    }
  }
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Marshals the current context as a string.
 * 
 * @param contextItems The context items to marshal.
 * @return The marshaled context.
 */
public String marshal(ContextItems contextItems) {
  SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyyMMddHHmmssz");
  contextItems.setItem(PROPNAME_TIME, timestampFormat.format(new Date()));
  contextItems.setItem(PROPNAME_KEY, signer.getKeyName());
  return contextItems.toString();
}

origin: org.carewebframework/org.carewebframework.api

/**
 * Marshals the current context as a string.
 * 
 * @param contextItems The context items to marshal.
 * @return The marshaled context.
 */
public String marshal(ContextItems contextItems) {
  SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyyMMddHHmmssz");
  contextItems.setItem(PROPNAME_TIME, timestampFormat.format(new Date()));
  contextItems.setItem(PROPNAME_KEY, signer.getKeyName());
  return contextItems.toString();
}

origin: org.carewebframework/org.carewebframework.cal.api.core

/**
 * Creates a CCOW context from the specified patient object.
 */
@Override
public ContextItems toCCOWContext(Patient patient) {
  IdentifierDt mrn = FhirUtil.getIdentifier(patient.getIdentifier(), IdentifierTypeCodesEnum.MR);
  contextItems.setItem(CCOW_MRN, mrn == null ? null : mrn.getValue(), "MRN");
  contextItems.setItem(CCOW_NAM, patient.getName());
  contextItems.setItem(CCOW_SEX, patient.getGender());
  contextItems.setItem(CCOW_DOB, patient.getBirthDate());
  return contextItems;
}

origin: org.hspconsortium.carewebframework/cwf-api-core

/**
 * Creates a CCOW context from the specified patient object.
 */
@Override
public ContextItems toCCOWContext(Patient patient) {
  Identifier mrn = FhirUtil.getMRN(patient);
  contextItems.setItem(CCOW_MRN, mrn == null ? null : mrn.getValue(), "MRN");
  contextItems.setItem(CCOW_NAM, patient.getName());
  contextItems.setItem(CCOW_SEX, patient.getGender());
  contextItems.setItem(CCOW_DOB, patient.getBirthDate());
  return contextItems;
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Remove all context items for the specified subject.
 *
 * @param subject Prefix whose items are to be removed.
 */
public void removeSubject(String subject) {
  String prefix = normalizePrefix(subject);
  for (String suffix : getSuffixes(prefix).keySet()) {
    setItem(prefix + suffix, null);
  }
}
origin: org.carewebframework/org.carewebframework.api

/**
 * Remove all context items for the specified subject.
 * 
 * @param subject Prefix whose items are to be removed.
 */
public void removeSubject(String subject) {
  String prefix = normalizePrefix(subject);
  
  for (String suffix : getSuffixes(prefix).keySet()) {
    setItem(prefix + suffix, null);
  }
}

origin: org.carewebframework/org.carewebframework.api.core

/**
 * Sets a context item value.
 *
 * @param itemName Item name.
 * @param value The value to set. The value's class must have an associated context serializer
 *            registered for it.
 */
public void setItem(String itemName, Object value) {
  if (value == null) {
    setItem(itemName, (String) null);
  } else {
    @SuppressWarnings("unchecked")
    ISerializer<Object> contextSerializer = (ISerializer<Object>) ContextSerializerRegistry.getInstance()
        .get(value.getClass());
    if (contextSerializer == null) {
      throw new ContextException("No serializer found for type " + value.getClass().getName());
    }
    setItem(itemName, contextSerializer.serialize(value));
  }
}
origin: org.carewebframework/org.carewebframework.api

/**
 * Sets a context item value.
 * 
 * @param itemName Item name.
 * @param value The value to set. The value's class must have an associated context serializer
 *            registered for it.
 */
public void setItem(String itemName, Object value) {
  if (value == null) {
    setItem(itemName, (String) null);
  } else {
    @SuppressWarnings("unchecked")
    IContextSerializer<Object> contextSerializer = (IContextSerializer<Object>) ContextSerializerRegistry
        .getInstance().get(value.getClass());
    
    if (contextSerializer == null) {
      throw new ContextException("No serializer found for type " + value.getClass().getName());
    }
    
    setItem(itemName, contextSerializer.serialize(value));
  }
}

org.carewebframework.api.contextContextItemssetItem

Javadoc

Sets a context item value.

Popular methods of ContextItems

  • <init>
  • addItems
    Adds context items to this set.
  • clear
    Clear all context items and the index.
  • getItem
    Retrieves a context item qualified by a suffix.
  • getItemNames
    Returns a set of all item names.
  • getSuffixes
    Returns a map consisting of suffixes of context items that match the specified prefix.
  • lookupItemName
    Performs a case-insensitive lookup of the item name in the index.
  • normalizePrefix
    Normalizes a prefix by appending a "." if necessary and converting to lower case.
  • toString
    Serializes the context item set to a string.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ImageIO (javax.imageio)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now