if (url.length == 1) { 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());
p.addName().setFamily("Smith").addGiven("John").addGiven("Q"); p.addIdentifier().setSystem("urn:foo:identifiers").setValue("12345"); p.addTelecom().setSystem(ContactPointSystem.PHONE).setValue("416 123-4567");
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; }
public static org.hl7.fhir.dstu3.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2016may.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())); 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 ContactPoint newContactPoint(ContactPointSystem system, String value) { ContactPoint res = new ContactPoint(); res.setSystem(system); res.setValue(value); return res; }
if (url.length == 1) { 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) { // Create a Patient Patient pat = new Patient(); pat.addName().setFamily("Simpson").addGiven("Homer").addGiven("J"); pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135"); pat.addTelecom().setUse(ContactPointUse.HOME).setSystem(ContactPointSystem.PHONE).setValue("1 (416) 340-4800"); pat.setGender(AdministrativeGender.MALE); // Create a context FhirContext ctx = FhirContext.forDstu3(); // Create a JSON parser IParser parser = ctx.newJsonParser(); parser.setPrettyPrint(true); String encode = parser.encodeResourceToString(pat); System.out.println(encode); } }
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 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); } }
/** * @return Practitioner representation as the creator/extractor of data */ default Practitioner createPractitioner() { final HumanName name = new HumanName(); name.setUse( HumanName.NameUse.OFFICIAL ); name.setFamily( getFamilyName() ); name.addGiven( getName() ); final ContactPoint contact = new ContactPoint(); contact.setSystem( ContactPoint.ContactPointSystem.EMAIL ); contact.setValue( getContactEmail() ); contact.setUse( ContactPoint.ContactPointUse.WORK ); final Practitioner practitioner = new Practitioner(); String hostname; try { hostname = InetAddress.getLocalHost() .getHostName(); } catch ( UnknownHostException uhE ) { hostname = "UnknownHost"; } practitioner.setId( getFamilyName() + DIVIDER_CHAR + getName() + DIVIDER_CHAR + getVersion() + DIVIDER_CHAR + hostname ); practitioner.setActive( true ); practitioner.addName( name ); practitioner.addTelecom( contact ); return practitioner; }
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; }
public static org.hl7.fhir.dstu3.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2016may.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())); 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; }