java.lang.Object
org.openehealth.ipf.commons.ihe.xds.core.transform.requests.query.QuerySlotHelper

public class QuerySlotHelper extends Object
Wrapper class for ebXML query request to simplify access to slots.

This class ensures that the various encoding rules of query parameter values are met.

Note that this class is only used for ebXML 3.0!

Author:
Jens Riemschneider, Dmytro Rud
  • Constructor Details

  • Method Details

    • getSlots

      public List<EbXMLSlot> getSlots()
    • toString

      public String toString(QueryParameter param)
      Retrieves a string-valued parameter from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the string value.
    • fromString

      public void fromString(QueryParameter param, String value)
      Stores a string-valued parameter into a slot.
      Parameters:
      param - the parameter.
      value - the string value.
    • fromCode

      public void fromCode(QueryParameter param, List<Code> codes)
      Stores a list of codes into a slot.
      Parameters:
      param - the parameter.
      codes - the list of codes.
    • fromCode

      public void fromCode(QueryParameter param, QueryList<Code> queryList)
      Stores a code list with AND/OR semantics into a set of slots with the same name.
      Parameters:
      param - standard query parameter (implies the name of the slots).
      queryList - the list of codes.
    • toStringQueryList

      public QueryList<String> toStringQueryList(QueryParameter param)
      Retrieves a string list with AND/OR semantics from a set of slots with the same name.
      Parameters:
      param - standard query parameter (implies the name of the slots).
      Returns:
      the string list.
    • toStringQueryList

      public QueryList<String> toStringQueryList(String slotName)
      Retrieves a string list with AND/OR semantics from a set of slots with the same name.
      Parameters:
      slotName - name of the source slots, may correspond to either a standard query parameter or an extra parameter.
      Returns:
      the string list.
    • fromStringList

      public void fromStringList(QueryParameter param, List<String> values)
      Stores a list of strings into a slot.
      Parameters:
      param - standard query parameter (implies the name of the slots).
      values - the string list.
    • fromStringList

      public void fromStringList(String slotName, List<String> values)
      Stores a list of strings into a slot.
      Parameters:
      slotName - name of the target slot, may correspond to either a standard query parameter or an extra parameter.
      values - the string list.
    • fromStringList

      public void fromStringList(QueryParameter param, QueryList<String> queryList)
      Stores a string list with AND/OR semantics into a set of slots with the same name.
      Parameters:
      param - standard query parameter (implies the name of the slots).
      queryList - the list of strings.
    • fromStringList

      public void fromStringList(String slotName, QueryList<String> queryList)
      Stores a string list with AND/OR semantics into a set of slots with the same name.
      Parameters:
      slotName - name of the target slots, may correspond to either a standard query parameter or an extra parameter.
      queryList - the list of strings.
    • toStringList

      public List<String> toStringList(QueryParameter param)
      Retrieves a list of strings from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the string list.
    • fromPatientIdList

      public void fromPatientIdList(QueryParameter param, List<Identifiable> values)
      Stores a list of patient IDs into a slot.
      Parameters:
      param - the parameter.
      values - the patient ID list.
    • toPatientIdList

      public List<Identifiable> toPatientIdList(QueryParameter param)
      Retrieves a list of patient IDs from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the patient ID list.
    • toCodeList

      public List<Code> toCodeList(QueryParameter param)
      Retrieves a list of codes from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the codes.
    • toCodeQueryList

      public QueryList<Code> toCodeQueryList(QueryParameter param, QueryParameter schemeParam)
      Retrieves a code list with AND/OR semantics from a set of slots with the same name.
      Parameters:
      param - standard query parameter (implies the name of the slots).
      schemeParam - the code scheme parameter.
      Returns:
      the codes.
    • fromTimestamp

      public void fromTimestamp(QueryParameter param, Timestamp value)
      Stores a timestamp parameter into a slot.
      Parameters:
      param - the parameter.
      value - the value.
    • toTimestamp

      public String toTimestamp(QueryParameter param)
      Retrieves a timestamp parameter from a slot. According to CP-ITI-1260, a timestamp parameter may be enclosed in single quotes.
      Parameters:
      param - the parameter.
      Returns:
      the value.
    • fromStatus

      public void fromStatus(QueryParameter param, List<AvailabilityStatus> status)
      Stores a status parameter into a slot.
      Parameters:
      param - the parameter.
      status - the list of status values.
    • toStatus

      public List<AvailabilityStatus> toStatus(QueryParameter param)
      Retrieves a status parameter from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the list of status values.
    • fromAssociationType

      public void fromAssociationType(QueryParameter param, List<AssociationType> associationTypes)
      Stores an association parameter into a slot.
      Parameters:
      param - the parameter.
      associationTypes - the list of association types.
    • toAssociationType

      public List<AssociationType> toAssociationType(QueryParameter param)
      Retrieves an association parameter from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the list of association types.
    • fromDocumentEntryType

      public void fromDocumentEntryType(QueryParameter param, List<DocumentEntryType> documentEntryTypes)
    • toDocumentEntryType

      public List<DocumentEntryType> toDocumentEntryType(QueryParameter param)
    • toCode

      public static List<Code> toCode(List<String> slotValues)
    • fromDocumentAvailability

      public void fromDocumentAvailability(QueryParameter param, List<DocumentAvailability> status)
      Stores a status parameter into a slot.
      Parameters:
      param - the parameter.
      status - the list of documentAvailability values.
    • toDocumentAvailability

      public List<DocumentAvailability> toDocumentAvailability(QueryParameter param)
      Retrieves a status parameter from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the list of documentAvailability values.
    • fromInteger

      public void fromInteger(QueryParameter param, Integer value)
      Stores a numbered parameter into a slot.
      Parameters:
      param - the parameter.
      value - the value.
    • toInteger

      public Integer toInteger(QueryParameter param)
      Retrieves a numbered parameter from a slot.
      Parameters:
      param - the parameter.
      Returns:
      the value.
    • encodeAsString

      public static String encodeAsString(String value)
    • decodeString

      public static String decodeString(String value)
    • encodeAsStringList

      public static String encodeAsStringList(String value)
    • decodeStringList

      public static List<String> decodeStringList(String list)
    • render

      public static <T extends Hl7v2Based<?>> QueryList<String> render(QueryList<T> source)
    • render

      public static <T extends Hl7v2Based<?>> List<String> render(List<T> source)
    • parse

      public static <C extends Composite, T extends Hl7v2Based<C>> QueryList<T> parse(QueryList<String> source, Class<T> targetClass)
    • parse

      public static <C extends Composite, T extends Hl7v2Based<C>> List<T> parse(List<String> source, Class<T> targetClass)