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

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

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

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

public static boolean containsAll(ArchetypeReference ar1, ArchetypeReference ar2) {
  return ar1.getElementInstancesMap().keySet().containsAll(ar2.getElementInstancesMap().keySet());
}
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 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

private static String getDomainId(ArchetypeReference ar) {
  String idDomain = null;
  if (ar != null) {
    idDomain = ar.getIdDomain();
  }
  return idDomain;
}
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 String getTemplateId() {
  if (getValue() != null) {
    return getValue().getIdTemplate();
  } else {
    return null;
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public void add(ArchetypeReference archetypeReferenceToAdd, GuideManager guideManager, Calendar date) {
  if (archetypeReferenceToAdd instanceof GeneratedArchetypeReference) {
    ArchetypeReference arAux = archetypeReferenceToAdd.clone();
    for (String idElement : archetypeReferenceToAdd.getElementInstancesMap().keySet()) {
      ElementInstance originalEI = archetypeReferenceToAdd.getElementInstancesMap().get(idElement);
      if (originalEI instanceof PredicateGeneratedElementInstance) {
        PredicateGeneratedElementInstance predicateOriginalEI =
origin: org.gdl-lang.gdl-tools/cds-core

private void generateGtCodeMapForArchetypeBinding(ArchetypeBinding archetypeBinding) throws InternalErrorException {
  ArchetypeInstantiationRuleLine airl =
      new ArchetypeInstantiationRuleLine();
  airl.setReadableGuide(readableGuide);
  airl.setGTCode(archetypeBinding.getId());
  ArchetypeReference ar =
      new ArchetypeReference(
          archetypeBinding.getDomain(),
          archetypeBinding.getArchetypeId(),
          archetypeBinding.getTemplateId());
  airl.setArchetypeReference(ar);
  gtCodeElementMap.put(archetypeBinding.getId(), airl);
  if (archetypeBinding.getElements() != null) {
    for (ElementBinding elementBinding : archetypeBinding.getElements().values()) {
      generateGTCodeMapForElementBinding(archetypeBinding, airl, elementBinding);
    }
  }
}
origin: org.gdl-lang.gdl-tools/cds-core

public String getDomainId() {
  ArchetypeReference ar = getArchetypeReference();
  if (ar != null) {
    return ar.getIdDomain();
  } else {
    return null;
  }
}
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 static String getName(ArchetypeReference ar) {
  if (ar != null) {
    return ar.getIdArchetype();
  } else {
    return "*UNKNOWN*";
  }
}
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;
origin: org.gdl-lang.gdl-tools/cds-core

private List<PredicateGeneratedElementInstance> getPredicates(ArchetypeReference archetypeReference) {
  List<PredicateGeneratedElementInstance> predicates = new ArrayList<>();
  for (ElementInstance elementInstance : archetypeReference.getElementInstancesMap().values()) {
    if (elementInstance instanceof PredicateGeneratedElementInstance) {
      PredicateGeneratedElementInstance pgei = (PredicateGeneratedElementInstance) elementInstance;
      predicates.add(pgei);
    }
  }
  return predicates;
}
origin: org.gdl-lang.gdl-tools/cds-core

private Collection<RuleLine> getDefinitionRuleLinesByDomainId(List<RuleLine> definitionRulelines, String domainId) {
  List<RuleLine> ruleLines = new ArrayList<>();
  for (RuleLine ruleLine : definitionRulelines) {
    if (ruleLine instanceof ArchetypeReferenceRuleLine) {
      String domainIdRuleLine = ((ArchetypeReferenceRuleLine) ruleLine).getArchetypeReference().getIdDomain();
      if (domainId == null && domainIdRuleLine == null || (domainId != null && domainId.equals(domainIdRuleLine))) {
        ruleLines.add(ruleLine);
      }
    }
  }
  return ruleLines;
}
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

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-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;
}
origin: org.gdl-lang.gdl-tools/cds-core

public static boolean isEmpty(ArchetypeReference ar) {
  for (String idElement : ar.getElementInstancesMap().keySet()) {
    ElementInstance ei = ar.getElementInstancesMap().get(idElement);
    if (ei.getDataValue() != null) {
      return false;
    }
  }
  return true;
}
origin: org.gdl-lang.gdl-tools/cds-core

  public String getDomainId() {
    return getArchetypeReference().getIdDomain();
  }
}
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;
  }
}
se.cambio.cds.model.instanceArchetypeReference

Most used methods

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

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
  • CodeWhisperer 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