Java Code Examples for org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem#EMAIL

The following examples show how to use org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem#EMAIL . 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: ResourceUtilities.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public static void renderContactPoint(StringBuilder b, ContactPoint cp) {
  if (cp != null && !cp.isEmpty()) {
    if (cp.getSystem() == ContactPointSystem.EMAIL)
      b.append("<a href=\"mailto:"+cp.getValue()+"\">"+cp.getValue()+"</a>");
    else if (cp.getSystem() == ContactPointSystem.FAX) 
      b.append("Fax: "+cp.getValue());
    else if (cp.getSystem() == ContactPointSystem.OTHER) 
      b.append("<a href=\""+cp.getValue()+"\">"+cp.getValue()+"</a>");
    else
      b.append(cp.getValue());
  }
}
 
Example 2
Source File: NarrativeGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private void addTelecom(XhtmlNode p, ContactPoint c) {
  if (c.getSystem() == ContactPointSystem.PHONE) {
    p.tx("Phone: "+c.getValue());
  } else if (c.getSystem() == ContactPointSystem.FAX) {
    p.tx("Fax: "+c.getValue());
  } else if (c.getSystem() == ContactPointSystem.EMAIL) {
    p.ah( "mailto:"+c.getValue()).addText(c.getValue());
  } else if (c.getSystem() == ContactPointSystem.URL) {
    if (c.getValue().length() > 30)
      p.ah(c.getValue()).addText(c.getValue().substring(0, 30)+"...");
    else
      p.ah(c.getValue()).addText(c.getValue());
  }
}
 
Example 3
Source File: NPMPackageGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private String email(List<ContactPoint> telecom) {
  for (ContactPoint cp : telecom) {
    if (cp.getSystem() == ContactPointSystem.EMAIL)
      return cp.getValue();
  }
  return null;
}