Java Code Examples for org.hl7.fhir.dstu3.model.CodeableConcept#hasText()

The following examples show how to use org.hl7.fhir.dstu3.model.CodeableConcept#hasText() . 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: ProfileUtilities.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private boolean hasDescription(Type fixed) {
  if (fixed instanceof Coding) {
    return ((Coding) fixed).hasDisplay();
  } else if (fixed instanceof CodeableConcept) {
    CodeableConcept cc = (CodeableConcept) fixed;
    if (cc.hasText())
      return true;
    for (Coding c : cc.getCoding())
      if (c.hasDisplay())
       return true;
  } // (fixed instanceof CodeType) || (fixed instanceof Quantity);
  return false;
}
 
Example 2
Source File: ResourceUtilities.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private static String renderCodeable(CodeableConcept units) {
  if (units == null || units.isEmpty())
    return "";
  String v = renderCoding(units.getCoding());
  if (units.hasText())
    v = v + " " +Utilities.escapeXml(units.getText());
  return v;
}
 
Example 3
Source File: NarrativeGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public String gen(CodeableConcept code) {
	if (code == null)
  	return null;
	if (code.hasText())
		return code.getText();
	if (code.hasCoding())
		return gen(code.getCoding().get(0));
	return null;
}