Class FlatHelper<T>

java.lang.Object
org.ehrbase.openehr.sdk.serialisation.walker.FlatHelper<T>

public class FlatHelper<T> extends Object
  • Constructor Details

    • FlatHelper

      public FlatHelper()
  • Method Details

    • buildNamePath

      public String buildNamePath(Context<T> context, boolean addCount)
    • isExactlyDvCodedText

      public static boolean isExactlyDvCodedText(Map<FlatPathDto,String> values, String path)
    • isExactlyPartySelf

      public static boolean isExactlyPartySelf(Map<FlatPathDto,String> values, String path, WebTemplateNode node)
    • isExactlyPartyRelated

      public static boolean isExactlyPartyRelated(Map<FlatPathDto,String> values, String path, WebTemplateNode node)
      Parameters:
      values -
      path -
      node - if given, the rmType is also checked
      Returns:
    • isExactlyPartyIdentified

      public static boolean isExactlyPartyIdentified(Map<FlatPathDto,String> values, String path, WebTemplateNode node)
    • isExactlyIntervalEvent

      public static boolean isExactlyIntervalEvent(Map<FlatPathDto,String> values, String path)
    • skip

      public boolean skip(Context<T> context)
    • skip

      public boolean skip(WebTemplateNode node, WebTemplateNode parent)
    • isEvent

      public boolean isEvent(WebTemplateNode node)
    • isNonMandatoryRmAttribute

      public boolean isNonMandatoryRmAttribute(WebTemplateNode node, WebTemplateNode parent)
    • consumeAllMatching

      public static void consumeAllMatching(String term, Map<FlatPathDto,String> values, Set<String> consumedPaths, boolean exact)
    • extractMultiValued

      public static Map<Integer,Map<FlatPathDto,String>> extractMultiValued(String currentTerm, String childTerm, Map<FlatPathDto,String> values)
      extract multi valued sub-values like "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:0|id": "id1", "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:0|type": "PERSON", "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:0|assigner": "assigner1", "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:0|issuer": "issuer1", "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:1|id": "id2", "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:1|type": "PERSON", "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:1|assigner": "assigner2", "vitals/vitals/body_temperature:0/_feeder_audit/feeder_system_item_id:1|issuer": "issuer2",
      Parameters:
      currentTerm -
      childTerm -
      values -
      Returns:
    • filter

      public static Map<FlatPathDto,String> filter(Map<FlatPathDto,String> values, String path, boolean includeRaw)
      Filter map by path prefix (string comparison)
      Parameters:
      values -
      path - filter path
      includeRaw - if raw nodes should be included
      Returns:
      a new map with the filtered entries
    • convertAttributeToFlat

      public static Map<FlatPathDto,String> convertAttributeToFlat(Map<FlatPathDto,String> values, String path, String attr, String node)
    • findEnumValueOrThrow

      public static <E extends EnumValueSet> E findEnumValueOrThrow(String value, Class<E> clazz)
    • buildDummyChild

      public static WebTemplateNode buildDummyChild(String attributeName, WebTemplateNode parent)
    • findOrBuildSubNode

      public static WebTemplateNode findOrBuildSubNode(Context<?> context, String id)