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

The following examples show how to use org.hl7.fhir.dstu3.model.CodeSystem#ConceptDefinitionComponent . 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: CareConnectProfileDbValidationSupportSTU3.java    From careconnect-reference-implementation with Apache License 2.0 6 votes vote down vote up
private CodeValidationResult testIfConceptIsInListInner(List<CodeSystem.ConceptDefinitionComponent> conceptList, boolean theCaseSensitive, String code) {
  logT("CareConnect testIfConceptIsInListInner: code=" + code);
  CodeValidationResult retVal = null;
  for (CodeSystem.ConceptDefinitionComponent next : conceptList) {
    // KGM
    logT("CareConnect testIfConceptIsInListInner NextCode = "+next.getCode());
    String nextCandidate = next.getCode();
    if (theCaseSensitive == false) {
      nextCandidate = nextCandidate.toUpperCase();
    }
    if (nextCandidate.equals(code)) {
      logD("Code "+code+" is in the list");
      retVal = new CodeValidationResult(next);
      break;
    }

    // recurse
    retVal = testIfConceptIsInList(code, next.getConcept(), theCaseSensitive);
    if (retVal != null) {
      break;
    }
  }

  return retVal;
}
 
Example 2
Source File: CareConnectProfileDbValidationSupportSTU3.java    From careconnect-reference-implementation with Apache License 2.0 5 votes vote down vote up
private CodeValidationResult testIfConceptIsInList(String theCode, List<CodeSystem.ConceptDefinitionComponent> conceptList, boolean theCaseSensitive) {
  logT("CareConnect testIfConceptIsInList: {} code="+ theCode);

  String code = theCode;
  if (theCaseSensitive == false) {
    code = code.toUpperCase();
  }

  return testIfConceptIsInListInner(conceptList, theCaseSensitive, code);
}
 
Example 3
Source File: JpaTerminologyProvider.java    From cqf-ruler with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized Code lookup(Code code, CodeSystemInfo codeSystem) throws ResourceNotFoundException {
    CodeSystem cs = terminologySvcDstu3.fetchCodeSystem(context, codeSystem.getId());
    for (CodeSystem.ConceptDefinitionComponent concept : cs.getConcept()) {
        if (concept.getCode().equals(code.getCode()))
            return code.withSystem(codeSystem.getId()).withDisplay(concept.getDisplay());
    }
    return code;
}
 
Example 4
Source File: ConceptDao.java    From careconnect-reference-implementation with Apache License 2.0 3 votes vote down vote up
public ConceptEntity findAddCode(String codeSystemUri, CodeSystem.ConceptDefinitionComponent concept) {

        // KGM removed from CodeSystem
       Coding coding = new Coding().setCode(concept.getCode()).setSystem(codeSystemUri).setDisplay(concept.getDisplay());

       return findAddCode(coding);

    }