congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ArchetypeReference.getIdArchetype
Code IndexAdd Tabnine to your IDE (free)

How to use
getIdArchetype
method
in
se.cambio.cds.model.instance.ArchetypeReference

Best Java code snippets using se.cambio.cds.model.instance.ArchetypeReference.getIdArchetype (Showing top 19 results out of 315)

origin: org.gdl-lang.gdl-tools/cds-core

public static String getDescription(ArchetypeReference ar) {
  if (ar != null) {
    return ar.getIdArchetype();
  } else {
    return "*UNKNOWN*";
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public static String getName(ArchetypeReference ar) {
  if (ar != null) {
    return ar.getIdArchetype();
  } else {
    return "*UNKNOWN*";
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

private Collection<ArchetypeReference> getEhrDataForArchetype(Collection<ArchetypeReference> ehrArchetypeReferences, String idArchetype) {
  Collection<ArchetypeReference> archetypeReferences = new ArrayList<>();
  for (ArchetypeReference archetypeReference : ehrArchetypeReferences) {
    if (idArchetype.equals(archetypeReference.getIdArchetype())) {
      archetypeReferences.add(archetypeReference);
    }
  }
  return archetypeReferences;
}
origin: org.gdl-lang.gdl-tools/cds-core

private void addEventTimeElements(Collection<ArchetypeReference> queryARs) {
  for (ArchetypeReference archetypeReference : queryARs) {
    String eventTimePath = dateTimeARFinder.getEventTimePath(archetypeReference.getIdArchetype());
    if (eventTimePath != null) {
      String eventTimeElementId = archetypeReference.getIdArchetype() + eventTimePath;
      if (!archetypeReference.getElementInstancesMap().containsKey(eventTimeElementId)) {
        log.info("Adding event path '" + eventTimeElementId + "' for archetype '" + archetypeReference.getIdArchetype() + "'!");
        new GeneratedElementInstance(eventTimeElementId, null, archetypeReference, null, OpenEHRConstUI.NULL_FLAVOUR_CODE_NO_INFO);
      }
    } else {
      log.warn("Could not find event path for archetype '" + archetypeReference.getIdArchetype() + "'!");
    }
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public static String getDescription(ArchetypeInstantiationRuleLine airl) {
  if (airl != null) {
    ArchetypeReference ar = airl.getArchetypeReference();
    if (ar != null) {
      return ar.getIdArchetype();
    }
  }
  return "*UNKNOWN*";
}
origin: org.gdl-lang.gdl-tools/cds-core

private static Map<String, ArchetypeReference> getCompressedQueryArchetypeReferencesMap(Collection<ArchetypeReference> generatedArchetypeReferences) {
  final Map<String, ArchetypeReference> archetypeReferencesMap = new HashMap<>();
  for (ArchetypeReference arNew : generatedArchetypeReferences) {
    GeneratedArchetypeReference gar = (GeneratedArchetypeReference) arNew;
    ArchetypeReference arPrev = archetypeReferencesMap.get(arNew.getIdArchetype());
    if (arPrev != null) {
      compressQueryArchetypeReference(arPrev, arNew);
    } else {
      arNew = getCleanArchetypeReferenceWithElements(gar);
      archetypeReferencesMap.put(arNew.getIdArchetype(), arNew);
    }
  }
  return archetypeReferencesMap;
}
origin: org.gdl-lang.gdl-tools/cds-core

public String getIdArchetype() {
  return getArchetypeReference().getIdArchetype();
}
origin: org.gdl-lang.gdl-tools/cds-core

public DateTime getDateTime(ArchetypeReference ar) {
  String dvDateTimePath = getEventTimePath(ar.getIdArchetype());
  if (dvDateTimePath != null) {
    ElementInstance ei = ar.getElementInstancesMap().get(ar.getIdArchetype() + dvDateTimePath);
    return getDateTime(ei);
  } else {
    return null;
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

  public Set<ArchetypeReference> filterEHRData(DateTime startDateTime, DateTime endDateTime, Collection<ArchetypeReference> ehrData) {
    Set<ArchetypeReference> ehrDataAux = new HashSet<>();
    for (ArchetypeReference archetypeReference : ehrData) {
      boolean useAR = true;
      DateTime dateTime = dateTimeARFinder.getDateTime(archetypeReference);
      if (dateTime == null
          || endDateTime != null && dateTime.isAfter(endDateTime)
          || startDateTime != null && dateTime.isBefore(startDateTime)) {
        useAR = false;
        if (dateTime == null) {
          LoggerFactory.getLogger(EhrDataFilterManager.class).warn("Date time for Archetype Reference " + archetypeReference.getIdArchetype() + " is null!");
        }
      }
      if (useAR) {
        ehrDataAux.add(archetypeReference);
      }
    }
    return ehrDataAux;
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public Set<ArchetypeReference> filterEHRData(String ehrId, DateTime ehrDate, Collection<ArchetypeReference> ehrData) {
  Set<ArchetypeReference> ehrIdARs = new HashSet<>();
  if (ehrData == null) {
    LoggerFactory.getLogger(EhrDataFilterManager.class).warn("No ehrData found for ehrId '" + ehrId + "'");
  } else {
    for (ArchetypeReference archetypeReference : ehrData) {
      //If using time series comparison filter elements outside the range
      boolean useAR = true;
      if (ehrDate != null) {
        DateTime dateTime = dateTimeARFinder.getDateTime(archetypeReference);
        if (dateTime == null) {
          LoggerFactory.getLogger(EhrDataFilterManager.class).debug("Date time for ehrId " + ehrId + " with AR " + archetypeReference.getIdArchetype() + " is null!");
        }
        if (dateTime != null && dateTime.isAfter(ehrDate)) {
          useAR = false;
          DateFormat df = DateFormat.getDateTimeInstance();
          LoggerFactory.getLogger(EhrDataFilterManager.class).debug(df.format(dateTime.toDate()) + " after " + df.format(ehrDate.toDate()));
        }
      }
      if (useAR) {
        ehrIdARs.add(archetypeReference);
      }
    }
  }
  return ehrIdARs;
}
origin: org.gdl-lang.gdl-tools/cds-core

public static String getName(ArchetypeInstantiationRuleLine airl, boolean withPredicate) {
  if (airl != null) {
    ArchetypeReference ar = airl.getArchetypeReference();
    if (ar != null) {
      String name = ar.getIdArchetype();
      if (withPredicate) {
        String predicateDesc = getShortPredicateDescription(airl);
        if (!predicateDesc.isEmpty()) {
          name = name + " (" + predicateDesc + ")";
        }
      }
      return name;
    }
  }
  LoggerFactory.getLogger(ArchetypeReference.class).warn("Unknown name for AR '" + airl + "'");
  return "*UNKNOWN*";
}
origin: org.gdl-lang.gdl-tools/cds-core

private static String getArchetypeImageName(ArchetypeReference ar) {
  String archetypeImageName = null;
  if (ar != null) {
    archetypeImageName = OpenEHRConstUI.getIconName(Archetypes.getEntryType(ar.getIdArchetype()));
  }
  return archetypeImageName;
}
origin: org.gdl-lang.gdl-tools/cds-core

public void filterByPredicates(
    Collection<ArchetypeReference> definitionArchetypeReferences,
    Collection<ArchetypeReference> ehrArchetypeReferences, Calendar date) {
  boolean filterActive = true;
  repeatedArchetypeReferencesFilter.filter(definitionArchetypeReferences);
  Set<ArchetypeReference> archetypeReferences = new HashSet<>();
  for (ArchetypeReference archetypeReference : definitionArchetypeReferences) {
    Collection<ArchetypeReference> ehrDataForArchetype = getEhrDataForArchetype(ehrArchetypeReferences, archetypeReference.getIdArchetype());
    Collection<ArchetypeReference> filteredEhrData = getFilteredEhrData(archetypeReference, date, ehrDataForArchetype);
    if (filteredEhrData.size() == ehrArchetypeReferences.size()) {
      filterActive = false;
      break;
    }
    archetypeReferences.addAll(filteredEhrData);
  }
  if (filterActive) {
    ehrArchetypeReferences.clear();
    ehrArchetypeReferences.addAll(archetypeReferences);
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public Set<ArchetypeReference> getArchetypeReferences(ArchetypeReference archetypeReference) {
  String idDomain = archetypeReference.getIdDomain() != null ? archetypeReference.getIdDomain() : EMPTY_CODE;
  String idAux = null;
  if (Domains.CDS_ID.equals(idDomain)) {
    idAux = archetypeReference.getIdTemplate();
  }
  if (idAux == null) {
    idAux = EMPTY_CODE;
  }
  return getArchetypeReferences(archetypeReference.getIdArchetype(), idDomain, idAux);
}
origin: org.gdl-lang.gdl-tools/cds-core

private static void checkForMissingPathsInEHR(
    ElementInstanceCollection ehrEIC,
    ElementInstanceCollection generatedEIC) {
  Map<String, ArchetypeReference> compressedARsMap = getCompressedQueryArchetypeReferencesMap(generatedEIC.getAllArchetypeReferences());
  for (ArchetypeReference ar : ehrEIC.getAllArchetypeReferences()) {
    ArchetypeReference compressedAR = compressedARsMap.get(ar.getIdArchetype());
    if (compressedAR != null) {
      for (String elementId : compressedAR.getElementInstancesMap().keySet()) {
        if (!ar.getElementInstancesMap().containsKey(elementId)) {
          new ElementInstance(elementId, null, ar, null, OpenEHRConstUI.NULL_FLAVOUR_CODE_NO_INFO);
        }
      }
    }
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public boolean matches(GeneratedArchetypeReference ar1, ArchetypeReference ar2, Map<String, Guide> guideMap, Calendar date) {
  if (!ar1.getIdArchetype().equals(ar2.getIdArchetype())) {
    return false;
  } else {
    for (String idElement : ar1.getElementInstancesMap().keySet()) {
      ElementInstance ei1 = ar1.getElementInstancesMap().get(idElement);
      ElementInstance ei2 = ar2.getElementInstancesMap().get(idElement);
      if (ei1 instanceof PredicateGeneratedElementInstance) {
        if (ei2 != null) {
          OperatorKind operatorKind = ((PredicateGeneratedElementInstance) ei1).getOperatorKind();
          Set<String> guideIds = new HashSet<>();
          DataValue dv = getResolveDataValueIfNeeded(guideMap, date, ei1, guideIds);
          DataValue dv2 = getResolveDataValueIfNeeded(guideMap, date, ei2, guideIds);
          Collection<Guide> guides = getGuides(guideMap, guideIds);
          if (!matches(dv, dv2, operatorKind, guides)) {
            return false;
          }
        } else {
          return false;
        }
      }
    }
    return true;
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

@Override
public AssignmentExpression toAssignmentExpression() throws IllegalStateException {
  ArchetypeReference archetypeReference = getArchetypeReference();
  if (archetypeReference != null) {
    String name = archetypeReference.getIdArchetype();
    Variable var = new Variable(
        cdsEntryRuleLineElement.getValue().getValue(),
        null, name, CreateInstanceExpression.FUNCTION_CREATE_NAME);
    List<AssignmentExpression> assignmentExpressions = new ArrayList<>();
    if (!getChildrenRuleLines().getRuleLines().isEmpty()) {
      for (RuleLine childRuleLine : getChildrenRuleLines().getRuleLines()) {
        AssignmentExpressionRuleLine assignmentExpressionRuleLine = (AssignmentExpressionRuleLine) childRuleLine;
        assignmentExpressions.add(assignmentExpressionRuleLine.toAssignmentExpression());
      }
    } else {
      log.debug("No assignment rules on create instance action rule");
      return null;
    }
    return new CreateInstanceExpression(
        var,
        assignmentExpressions);
  } else {
    log.debug("No archetype reference set on create instance action rule");
    return null;
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

@Override
public String getLabelText(String lang) {
  if (getValue() != null) {
    String idArchetype = getValue().getIdArchetype();
    ArchetypeDTO archetypeVO = getArchetypeManager().getArchetypes().getCMElement(idArchetype);
    if (archetypeVO != null) {
      return archetypeVO.getId();
    } else {
      log.error("Archetype not found! (" + idArchetype + ")");
      return "";
    }
  } else {
    return super.getLabelText(lang);
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

  public static String getHTMLTooltip(ArchetypeInstantiationRuleLine airl) {
    ArchetypeReference ar = airl.getArchetypeReference();
    if (ar != null) {
      String archetypeImageName = OpenEHRConstUI.getIconName(Archetypes.getEntryType(ar.getIdArchetype()));
      String archetypeName = getName(airl, false);
      return "<html><table width=500>"
          + "<tr><td><b>"
          + OpenEHRLanguageManager.getMessage("Archetype") + ": </b>"
          + OpenEHRImageUtil.getImgHTMLTag(archetypeImageName) + "&nbsp;" + archetypeName + "</td></tr>"
          + "<tr><td><b>"
          + OpenEHRLanguageManager.getMessage("Description") + ": </b>" + getDescription(airl) + "</td></tr>"
          + getHTMLPredicate(airl) + "</table></html>";
    } else {
      return "*UNKNOWN*";
    }
  }
}
se.cambio.cds.model.instanceArchetypeReferencegetIdArchetype

Popular methods of ArchetypeReference

  • getElementInstancesMap
  • getIdDomain
  • getIdTemplate
  • <init>
  • clone

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Github Copilot alternatives
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