Tabnine Logo
ElementInstance.getArchetypeReference
Code IndexAdd Tabnine to your IDE (free)

How to use
getArchetypeReference
method
in
se.cambio.cds.model.instance.ElementInstance

Best Java code snippets using se.cambio.cds.model.instance.ElementInstance.getArchetypeReference (Showing top 12 results out of 315)

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

private void filterIsALocalTerminology(
    boolean negation, Set<ArchetypeReference> archetypeReferencesToRemove, Set<CodePhrase> codePhrases,
    ElementInstance elementInstance, CodePhrase codePhrase) {
  boolean isA = simpleIsACheck(codePhrase, codePhrases);
  if ((!isA && !negation) || (isA && negation)) {
    archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public void addAll(Collection<ElementInstance> elementInstances) {
  Set<ArchetypeReference> archetypeReferences = new HashSet<>();
  for (ElementInstance elementInstance : elementInstances) {
    archetypeReferences.add(elementInstance.getArchetypeReference());
  }
  addAll(archetypeReferences, null);
}
origin: org.gdl-lang.gdl-tools/cds-core

private void filterIsAExternalTerminology(
    boolean negation, Set<ArchetypeReference> archetypeReferencesToRemove, Set<CodePhrase> codePhrases,
    ElementInstance elementInstance, CodePhrase codePhrase) {
  boolean isA = terminologyService.isSubclassOf(codePhrase, codePhrases);
  if ((!isA && !negation) || (isA && negation)) {
    archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public void add(ElementInstance elementInstance) {
  add(elementInstance.getArchetypeReference(), null, null);
}
origin: org.gdl-lang.gdl-tools/cds-core

private void filterMaxMin(String elementId, Collection<ArchetypeReference> ehrArchetypeReferences, boolean max) {
  final Set<ArchetypeReference> archetypeReferencesToRemove = new HashSet<>();
  ElementInstance maxElementInstance = null;
  for (ArchetypeReference archetypeReference : ehrArchetypeReferences) {
    ElementInstance elementInstance = archetypeReference.getElementInstancesMap().get(elementId);
    if (elementInstance != null) {
      if (elementInstance.getDataValue() != null) {
        if (maxElementInstance == null || isMaxMin(elementInstance, maxElementInstance, max)) {
          if (maxElementInstance != null) {
            archetypeReferencesToRemove.add(maxElementInstance.getArchetypeReference());
          }
          maxElementInstance = elementInstance;
        } else {
          archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
        }
      } else {
        archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
      }
    }
  }
  ehrArchetypeReferences.removeAll(archetypeReferencesToRemove);
}
origin: org.gdl-lang.gdl-tools/cds-core

private void filterEquals(
    PredicateGeneratedElementInstance predicate, Collection<ArchetypeReference> ehrArchetypeReferences, boolean negation) {
  final Set<ArchetypeReference> archetypeReferencesToRemove = new HashSet<>();
  for (ArchetypeReference archetypeReference : ehrArchetypeReferences) {
    ElementInstance elementInstance = archetypeReference.getElementInstancesMap().get(predicate.getId());
    if (elementInstance != null) {
      DataValue dataValue = elementInstance.getDataValue();
      if (dataValue != null) {
        boolean equals = dataValue.equals(predicate.getDataValue());
        if ((!equals && !negation) || (equals && negation)) {
          archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
        }
      } else {
        archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
      }
    }
  }
  ehrArchetypeReferences.removeAll(archetypeReferencesToRemove);
}
origin: org.gdl-lang.gdl-tools/cds-core

private void filterGreaterLessThanPredicate(
    String elementId, DataValue dv,
    Collection<ArchetypeReference> ehrArchetypeReferences,
    boolean greaterThan, Calendar date) {
  if (dv instanceof CurrentTimeExpressionDataValue) {
    OperatorKind operatorKind = greaterThan ? OperatorKind.GREATER_THAN_OR_EQUAL : OperatorKind.LESS_THAN_OR_EQUAL;
    dv = ElementInstanceCollectionManager.resolvePredicate(dv, operatorKind, null, date);
    if (dv == null) {
      LoggerFactory.getLogger(PredicateFilterManager.class).warn("No Data Value returned after resolving predicate!");
    }
  }
  final Set<ArchetypeReference> archetypeReferencesToRemove = new HashSet<>();
  for (ArchetypeReference archetypeReference : ehrArchetypeReferences) {
    ElementInstance elementInstance = archetypeReference.getElementInstancesMap().get(elementId);
    if (elementInstance != null) {
      if (elementInstance.getDataValue() != null) {
        int compare = DVUtil.compareDVs(dv, elementInstance.getDataValue());
        if (compare != 0 && ((greaterThan && compare > 0) || (!greaterThan && compare < 0))) {
          archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
        }
      } else {
        archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
      }
    }
  }
  ehrArchetypeReferences.removeAll(archetypeReferencesToRemove);
}
origin: org.gdl-lang.gdl-tools/cds-core

private void filterIsA(
    PredicateGeneratedElementInstance predicate, Collection<ArchetypeReference> ehrArchetypeReferences, boolean negation) {
  final Set<ArchetypeReference> archetypeReferencesToRemove = new HashSet<>();
  final Set<CodePhrase> codePhrases = getCodePhrases(predicate);
  ElementInstance elementInstance;
  for (ArchetypeReference archetypeReference : ehrArchetypeReferences) {
    elementInstance = archetypeReference.getElementInstancesMap().get(predicate.getId());
    if (elementInstance != null && codePhrases != null) {
      CodePhrase codePhrase = getCodePhrase(elementInstance);
      try {
        if (codePhrase != null) {
          if ("local".equalsIgnoreCase(codePhrase.getTerminologyId().name())) {
            filterIsALocalTerminology(negation, archetypeReferencesToRemove, codePhrases, elementInstance, codePhrase);
          } else {
            filterIsAExternalTerminology(negation, archetypeReferencesToRemove, codePhrases, elementInstance, codePhrase);
          }
        } else {
          archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
        }
      } catch (Exception exception) {
        archetypeReferencesToRemove.add(elementInstance.getArchetypeReference());
        logger.warn("Filter isA ", exception);
      }
    }
  }
  ehrArchetypeReferences.removeAll(archetypeReferencesToRemove);
}
origin: org.gdl-lang.gdl-tools/cds-gui-swing

public DVGenericPanel createDVGenericPanel(ElementInstance elementInstance) {
  if (!Domains.CDS_ID.equals(elementInstance.getArchetypeReference().getIdDomain())
      && elementInstance instanceof PredicateGeneratedElementInstance) {
    elementInstance = new ElementInstance(
        elementInstance.getId(),
        null,
        elementInstance.getArchetypeReference(),
        null,
        OpenEHRConstUI.NULL_FLAVOUR_CODE_NO_INFO);
  }
  DVGenericPanel dvGenericPanel = getDVGenericForElement(elementInstance);
  for (JComponent component : dvGenericPanel.getJComponents()) {
    if (component instanceof JDateChooser) {
      ((JDateChooser) component).getDateEditor().getUiComponent().addFocusListener(new DVGenericComponentFocusAdapter(dvGenericPanel, elementInstance));
    } else {
      component.addFocusListener(new DVGenericComponentFocusAdapter(dvGenericPanel, elementInstance));
    }
    if (Domains.CDS_ID.equals(elementInstance.getArchetypeReference().getIdDomain())
        || elementInstance instanceof PredicateGeneratedElementInstance) {
      DvSwingManager.disable(component);
    }
  }
  return dvGenericPanel;
}
origin: org.gdl-lang.gdl-tools/cds-gui-swing

public JLabel createLabelForElement(ElementInstance elementInstance, TermDefinition termDefinition) {
  ArchetypeElementVO archetypeElement =
      archetypeManager.getArchetypeElements().getArchetypeElement(
          elementInstance.getArchetypeReference().getIdTemplate(),
          elementInstance.getId());
  JLabel label;
      archetypeReferencesManager.getHTMLTooltip(
          archetypeElement,
          elementInstance.getArchetypeReference()));
  Icon dvIcon = OpenEHRDataValuesUI.getIcon(archetypeElement.getType());
  Icon domainIcon =
      DomainsUI.getGroupIconFromArchetypeReference(elementInstance.getArchetypeReference());
  label.setIcon(new MultipleIcon(new Icon[]{domainIcon, dvIcon}));
  return label;
origin: org.gdl-lang.gdl-tools/gdl-graph

  throw new InternalErrorException(new Exception("Element for assignment expression " + guideAssignmentExpression + " not found!"));
GeneratedArchetypeReference ar1 = (GeneratedArchetypeReference) conditionElementInstance.getArchetypeReference();
ArchetypeReference ar2 = assignmentElementInstance.getArchetypeReference();
if (!elementInstanceCollectionManager.matches(ar1, ar2, guideMap, cal)) {
  return false;
origin: org.gdl-lang.gdl-tools/cds-gui-swing

private DVGenericPanel getDVGenericForElement(ElementInstance elementInstance) {
  String idTemplate = elementInstance.getArchetypeReference().getIdTemplate();
  String idElement = elementInstance.getId();
  ArchetypeElementVO archetypeElement =
      archetypeManager.getArchetypeElements().getArchetypeElement(
          idTemplate,
          idElement);
  String rmType = archetypeElement.getType();
  DVGenericPanel dvGenericPanel = dvPanelFactory.createDVPanel(idElement, idTemplate, rmType, true, true, false);
  if (dvGenericPanel != null) {
    dvGenericPanel.setDataValue(elementInstance.getDataValue());
  }
  return dvGenericPanel;
}
se.cambio.cds.model.instanceElementInstancegetArchetypeReference

Popular methods of ElementInstance

  • getId
  • <init>
  • getDataValue
  • clone
  • setArchetypeReference
  • setDataValue
  • setNullFlavour

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 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