if (use != null) { if (use.equals("L")) hn.setUse(NameUse.USUAL); else if (use.equals("C")) hn.setUse(NameUse.OFFICIAL); else if (use.equals("P") || use.equals("A")) hn.setUse(NameUse.ANONYMOUS); else if (use.equals("TMP")) hn.setUse(NameUse.TEMP); else if (use.equals("BAD")) hn.setUse(NameUse.OLD);
public org.hl7.fhir.dstu3.model.HumanName convertHumanName(org.hl7.fhir.instance.model.HumanName src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.HumanName tgt = new org.hl7.fhir.dstu3.model.HumanName(); copyElement(src, tgt); tgt.setUse(convertNameUse(src.getUse())); tgt.setText(src.getText()); for (org.hl7.fhir.instance.model.StringType t : src.getFamily()) tgt.setFamily(t.getValue()); for (org.hl7.fhir.instance.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue()); for (org.hl7.fhir.instance.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue()); for (org.hl7.fhir.instance.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
public static org.hl7.fhir.dstu3.model.HumanName convertHumanName(org.hl7.fhir.dstu2016may.model.HumanName src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.HumanName tgt = new org.hl7.fhir.dstu3.model.HumanName(); copyElement(src, tgt); tgt.setUse(convertNameUse(src.getUse())); if (src.hasText()) tgt.setText(src.getText()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getFamily()) tgt.setFamily(t.getValue()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
if (use != null) { if (use.equals("L")) hn.setUse(NameUse.USUAL); else if (use.equals("C")) hn.setUse(NameUse.OFFICIAL); else if (use.equals("P") || use.equals("A")) hn.setUse(NameUse.ANONYMOUS); else if (use.equals("TMP")) hn.setUse(NameUse.TEMP); else if (use.equals("BAD")) hn.setUse(NameUse.OLD);
/** * @param patientName - * @return fhir human name object for the patient. */ static private HumanName createHumanName( final String patientName ) { final Collection<String> prefixes = Arrays.asList( "Dr. ", "Mr. ", "Mrs. ", "Miss ", "Ms. ", "Sir " ); final HumanName humanName = new HumanName(); humanName.setUse( HumanName.NameUse.USUAL ); String fullName = patientName; for ( String prefix : prefixes ) { if ( patientName.startsWith( prefix ) ) { humanName.addPrefix( prefix ); fullName = patientName.substring( prefix.length() + 1 ); break; } } final int spaceIndex = fullName.indexOf( ' ' ); if ( spaceIndex > 0 ) { humanName.setFamily( fullName.substring( spaceIndex + 1 ) ); humanName.addGiven( fullName.substring( 0, spaceIndex ) ); } else { humanName.addGiven( fullName ); } return humanName; }
/** * @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.HumanName convertHumanName(org.hl7.fhir.instance.model.HumanName src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.HumanName tgt = new org.hl7.fhir.dstu3.model.HumanName(); copyElement(src, tgt); tgt.setUse(convertNameUse(src.getUse())); tgt.setText(src.getText()); for (org.hl7.fhir.instance.model.StringType t : src.getFamily()) tgt.setFamily(t.getValue()); for (org.hl7.fhir.instance.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue()); for (org.hl7.fhir.instance.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue()); for (org.hl7.fhir.instance.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
public static org.hl7.fhir.dstu3.model.HumanName convertHumanName(org.hl7.fhir.dstu2016may.model.HumanName src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.HumanName tgt = new org.hl7.fhir.dstu3.model.HumanName(); copyElement(src, tgt); tgt.setUse(convertNameUse(src.getUse())); if (src.hasText()) tgt.setText(src.getText()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getFamily()) tgt.setFamily(t.getValue()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue()); for (org.hl7.fhir.dstu2016may.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }