org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem Java Examples

The following examples show how to use org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem. 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 static String describeSystem(ContactPointSystem system) {
  if (system == null)
    return "";
  switch (system) {
  case PHONE: return "ph: ";
  case FAX: return "fax: ";
  default:
    return "";
  }
}
 
Example #3
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 #4
Source File: NPMPackageGenerator.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
private String url(List<ContactPoint> telecom) {
  for (ContactPoint cp : telecom) {
    if (cp.getSystem() == ContactPointSystem.URL)
      return cp.getValue();
  }
  return null;
}
 
Example #5
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;
}
 
Example #6
Source File: CountryCodesConverter.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public void setMetadata(Document src, CodeSystem cs, String id, String url, String partName, String partTitle) {
  cs.setId(id);
  cs.setUrl(url);
  cs.setName("ISOCountryCodes"+partName);
  cs.setTitle("ISO Country Codes (ISO-3166)"+partTitle);
  cs.setVersion(XMLUtil.getFirstChild(src.getDocumentElement()).getAttribute("version"));
  cs.setStatus(PublicationStatus.ACTIVE);
  cs.setExperimental(false);
  cs.addContact().setName("FHIR Project Team").addTelecom().setSystem(ContactPointSystem.URL).setValue("http://hl7.org/fhir");
  cs.setDateElement(new DateTimeType(src.getDocumentElement().getAttribute("generated")));
  cs.setCopyright("Copyright ISO. See https://www.iso.org/obp/ui/#search/code/");
  cs.setCaseSensitive(true);
  cs.setContent(CodeSystemContentMode.COMPLETE);
  cs.setLanguage("en");
}
 
Example #7
Source File: IPatientPatientAttributeMapper.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void mapAddressTelecom(Patient source, IPatient target) {
	List<Address> addresses = source.getAddress();
	for (Address address : addresses) {
		if (AddressUse.HOME.equals(address.getUse())) {
			target.setCity(address.getCity());
			target.setZip(address.getPostalCode());
			if (!address.getLine().isEmpty()) {
				target.setStreet(address.getLine().get(0).asStringValue());
			}
			Country country = null;
			try {
				country = Country.valueOf(address.getCountry());
			} catch (IllegalArgumentException | NullPointerException e) {
				// ignore
			}
			target.setCountry(country);
		}
	}

	List<ContactPoint> telecoms = source.getTelecom();
	for (ContactPoint contactPoint : telecoms) {
		if (ContactPointSystem.PHONE.equals(contactPoint.getSystem())) {
			if (ContactPointUse.MOBILE.equals(contactPoint.getUse())) {
				target.setMobile(contactPoint.getValue());
			} else if (1 == contactPoint.getRank()) {
				target.setPhone1(contactPoint.getValue());
			} else if (2 == contactPoint.getRank()) {
				target.setPhone2(contactPoint.getValue());
			}
		} else if (ContactPointSystem.EMAIL.equals(contactPoint.getSystem())) {
			target.setEmail(contactPoint.getValue());
		} else if (ContactPointSystem.FAX.equals(contactPoint.getSystem())) {
			target.setFax(contactPoint.getValue());
		}
	}
}
 
Example #8
Source File: Factory.java    From org.hl7.fhir.core with Apache License 2.0 4 votes vote down vote up
public static ContactPoint newContactPoint(ContactPointSystem system, String value) {
 	ContactPoint res = new ContactPoint();
res.setSystem(system);
res.setValue(value);
return res;
 }