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() . These examples are extracted from open source projects. 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
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
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
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;