Java Code Examples for org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent#getConcept()

The following examples show how to use org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent#getConcept() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValueSet10_30.java    From org.hl7.fhir.core with Apache License 2.0 6 votes vote down vote up
static public void processConcept(List<ValueSet.ConceptDefinitionComponent> concepts, ConceptDefinitionComponent cs, CodeSystem srcCS) throws FHIRException {
    org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent ct = new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent();
    concepts.add(ct);
    ct.setCode(cs.getCode());
    ct.setDisplay(cs.getDisplay());
    ct.setDefinition(cs.getDefinition());
    if (CodeSystemUtilities.isNotSelectable(srcCS, cs))
        ct.setAbstract(true);
    for (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent csd : cs.getDesignation()) {
        org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent cst = new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent();
        cst.setLanguage(csd.getLanguage());
        cst.setUse(VersionConvertor_10_30.convertCoding(csd.getUse()));
        cst.setValue(csd.getValue());
    }
    for (ConceptDefinitionComponent csc : cs.getConcept()) processConcept(ct.getConcept(), csc, srcCS);
}
 
Example 2
Source File: NarrativeGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private void scanLangs(ConceptDefinitionComponent c, List<String> langs) {
  for (ConceptDefinitionDesignationComponent designation : c.getDesignation()) {
    String lang = designation.getLanguage();
    if (langs != null && !langs.contains(lang))
      langs.add(lang);
  }
  for (ConceptDefinitionComponent g : c.getConcept())
    scanLangs(g, langs);
}
 
Example 3
Source File: NarrativeGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private boolean conceptsHaveComments(ConceptDefinitionComponent c) {
  if (ToolingExtensions.hasCSComment(c))
    return true;
  for (ConceptDefinitionComponent g : c.getConcept())
    if (conceptsHaveComments(g))
      return true;
  return false;
}
 
Example 4
Source File: NarrativeGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private boolean conceptsHaveDisplay(ConceptDefinitionComponent c) {
  if (c.hasDisplay())
    return true;
  for (ConceptDefinitionComponent g : c.getConcept())
    if (conceptsHaveDisplay(g))
      return true;
  return false;
}
 
Example 5
Source File: NarrativeGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private boolean conceptsHaveDeprecated(CodeSystem cs, ConceptDefinitionComponent c) {
  if (CodeSystemUtilities.isDeprecated(cs, c))
    return true;
  for (ConceptDefinitionComponent g : c.getConcept())
    if (conceptsHaveDeprecated(cs, g))
      return true;
  return false;
}
 
Example 6
Source File: NarrativeGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private boolean inConcept(String code, ConceptDefinitionComponent c) {
  if (c.hasCodeElement() && c.getCode().equals(code))
    return true;
  for (ConceptDefinitionComponent g : c.getConcept()) {
    if (inConcept(code, g))
      return true;
  }
  return false;
}
 
Example 7
Source File: BaseWorkerContext.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private ConceptDefinitionComponent processCSConcept(ConceptDefinitionComponent cc) {
  ConceptDefinitionComponent ccid = new ConceptDefinitionComponent();
  ccid.setCode(cc.getCode());
  ccid.setDisplay(cc.getDisplay());
  for (ConceptDefinitionComponent cci : cc.getConcept()) {
    ccid.getConcept().add(processCSConcept(cci));
  }
  return ccid;
}