public org.hl7.fhir.instance.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu3.model.ContactPoint src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.ContactPoint tgt = new org.hl7.fhir.instance.model.ContactPoint(); copyElement(src, tgt); if (src.hasSystem()) tgt.setSystem(convertContactPointSystem(src.getSystem())); tgt.setValue(src.getValue()); tgt.setUse(convertContactPointUse(src.getUse())); tgt.setRank(src.getRank()); if (src.hasPeriod()) tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
public org.hl7.fhir.dstu3.model.ContactPoint convertContactPoint(org.hl7.fhir.instance.model.ContactPoint src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.ContactPoint tgt = new org.hl7.fhir.dstu3.model.ContactPoint(); copyElement(src, tgt); tgt.setSystem(convertContactPointSystem(src.getSystem())); tgt.setValue(src.getValue()); tgt.setUse(convertContactPointUse(src.getUse())); if (src.hasRank()) tgt.setRank(src.getRank()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
private void checkContactPoint(List<ValidationMessage> errors, String path, Element focus, ContactPoint fixed) { checkFixedValue(errors, path + ".system", focus.getNamedChild("system"), fixed.getSystemElement(), "system", focus); checkFixedValue(errors, path + ".value", focus.getNamedChild("value"), fixed.getValueElement(), "value", focus); checkFixedValue(errors, path + ".use", focus.getNamedChild("use"), fixed.getUseElement(), "use", focus); checkFixedValue(errors, path + ".period", focus.getNamedChild("period"), fixed.getPeriod(), "period", focus); }
if (e.hasAttribute("nullFlavor")) return null; ContactPoint c = new ContactPoint(); String use = e.getAttribute("use"); if (use != null) { if (use.equals("H") || use.equals("HP") || use.equals("HV")) c.setUse(ContactPointUse.HOME); else if (use.equals("WP") || use.equals("DIR") || use.equals("PUB")) c.setUse(ContactPointUse.WORK); else if (use.equals("TMP")) c.setUse(ContactPointUse.TEMP); else if (use.equals("BAD")) c.setUse(ContactPointUse.OLD); c.setValue(url[0].trim()); c.setSystem(ContactPointSystem.PHONE); } else { if (url[0].equals("tel")) c.setSystem(ContactPointSystem.PHONE); else if (url[0].equals("mailto")) c.setSystem(ContactPointSystem.EMAIL); else if (e.getAttribute("value").contains(":")) c.setSystem(ContactPointSystem.OTHER); else c.setSystem(ContactPointSystem.PHONE); c.setValue(url[1].trim());
public static org.hl7.fhir.dstu2016may.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu3.model.ContactPoint src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.ContactPoint tgt = new org.hl7.fhir.dstu2016may.model.ContactPoint(); copyElement(src, tgt); tgt.setSystem(convertContactPointSystem(src.getSystem())); if (src.hasValue()) tgt.setValue(src.getValue()); tgt.setUse(convertContactPointUse(src.getUse())); if (src.hasRank()) tgt.setRank(src.getRank()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
public static void main(String[] theArgs) { Patient pat = new Patient(); pat.addName().setFamily("Simpson").addGiven("Homer").addGiven("J"); pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135"); // Enumerated types are provided for many coded elements ContactPoint contact = pat.addTelecom(); contact.setUse(ContactPoint.ContactPointUse.HOME); contact.setSystem(ContactPoint.ContactPointSystem.PHONE); contact.setValue("1 (416) 340-4800"); pat.setGender(Enumerations.AdministrativeGender.MALE); } }
public static ContactPoint newContactPoint(ContactPointSystem system, String value) { ContactPoint res = new ContactPoint(); res.setSystem(system); res.setValue(value); return res; }
public ContactPoint addTelecom() { //3 ContactPoint t = new ContactPoint(); if (this.telecom == null) this.telecom = new ArrayList<ContactPoint>(); this.telecom.add(t); return t; }
if (nextValue.isEmpty()) { continue; systems.add(nextValue.getSystemElement().getValueAsString()); codes.add(nextValue.getValueElement().getValue()); } else if (nextObject instanceof Enumeration<?>) { Enumeration<?> obj = (Enumeration<?>) nextObject;
if (nextContact.getValueElement().isEmpty() == false) { addSearchTerm(theEntity, retVal, nextSpName, nextContact.getValue());
/** * Adds a contact element to the demographic panel. Uses default styling. * * @param root Root component. * @param contacts List of contacts from which to select. * @param type Type of contact desired (e.g., "home:phone"). * @param labelId The id of the label to use. */ protected void addContact(BaseUIComponent root, List<ContactPoint> contacts, String type, String labelId) { ContactPoint contact = FhirUtil.getContact(contacts, type); if (contact != null) { addDemographic(root, labelId == null ? contact.getUse().getDisplay() : labelId, contact.getValue(), null); } }
public static boolean matches(ContactPoint c1, ContactPoint c2, Object profile) { if (profile != null) throw new NotImplementedException("Not Implemented Yet"); // in the absence of a profile, we insist on system return matches(c1.getSystemElement(), c2.getSystemElement(), null) && matches(c1.getValue(), c2.getValue(), null); }
public static void merge(ContactPoint dst, ContactPoint src) { if (dst.getUseElement() == null && src.getUseElement() != null) dst.setUseElement(src.getUseElement()); if (dst.getPeriod() == null && src.getPeriod() != null) dst.setPeriod(src.getPeriod()); }
public ContactPoint copy() { ContactPoint dst = new ContactPoint(); copyValues(dst); dst.system = system == null ? null : system.copy(); dst.value = value == null ? null : value.copy(); dst.use = use == null ? null : use.copy(); dst.rank = rank == null ? null : rank.copy(); dst.period = period == null ? null : period.copy(); return dst; }
public static org.hl7.fhir.dstu2016may.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu3.model.ContactPoint src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.ContactPoint tgt = new org.hl7.fhir.dstu2016may.model.ContactPoint(); copyElement(src, tgt); tgt.setSystem(convertContactPointSystem(src.getSystem())); if (src.hasValue()) tgt.setValue(src.getValue()); tgt.setUse(convertContactPointUse(src.getUse())); if (src.hasRank()) tgt.setRank(src.getRank()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
if (e.hasAttribute("nullFlavor")) return null; ContactPoint c = new ContactPoint(); String use = e.getAttribute("use"); if (use != null) { if (use.equals("H") || use.equals("HP") || use.equals("HV")) c.setUse(ContactPointUse.HOME); else if (use.equals("WP") || use.equals("DIR") || use.equals("PUB")) c.setUse(ContactPointUse.WORK); else if (use.equals("TMP")) c.setUse(ContactPointUse.TEMP); else if (use.equals("BAD")) c.setUse(ContactPointUse.OLD); c.setValue(url[0].trim()); c.setSystem(ContactPointSystem.PHONE); } else { if (url[0].equals("tel")) c.setSystem(ContactPointSystem.PHONE); else if (url[0].equals("mailto")) c.setSystem(ContactPointSystem.EMAIL); else if (e.getAttribute("value").contains(":")) c.setSystem(ContactPointSystem.OTHER); else c.setSystem(ContactPointSystem.PHONE); c.setValue(url[1].trim());
public static void main(String[] theArgs) { Patient pat = new Patient(); pat.addName().setFamily("Simpson").addGiven("Homer").addGiven("J"); pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135"); // Enumerated types are provided for many coded elements ContactPoint contact = pat.addTelecom(); contact.setUse(ContactPoint.ContactPointUse.HOME); contact.setSystem(ContactPoint.ContactPointSystem.PHONE); contact.setValue("1 (416) 340-4800"); pat.setGender(Enumerations.AdministrativeGender.MALE); } }