Java Code Examples for org.hl7.fhir.dstu3.model.Practitioner#addAddress()
The following examples show how to use
org.hl7.fhir.dstu3.model.Practitioner#addAddress() .
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: FhirStu3.java From synthea with Apache License 2.0 | 5 votes |
/** * Map the clinician into a FHIR Practitioner resource, and add it to the given Bundle. * @param bundle The Bundle to add to * @param clinician The clinician * @return The added Entry */ protected static BundleEntryComponent practitioner(Bundle bundle, Clinician clinician) { Practitioner practitionerResource = new Practitioner(); practitionerResource.addIdentifier().setSystem("http://hl7.org/fhir/sid/us-npi") .setValue("" + clinician.identifier); practitionerResource.setActive(true); practitionerResource.addName().setFamily( (String) clinician.attributes.get(Clinician.LAST_NAME)) .addGiven((String) clinician.attributes.get(Clinician.FIRST_NAME)) .addPrefix((String) clinician.attributes.get(Clinician.NAME_PREFIX)); Address address = new Address() .addLine((String) clinician.attributes.get(Clinician.ADDRESS)) .setCity((String) clinician.attributes.get(Clinician.CITY)) .setPostalCode((String) clinician.attributes.get(Clinician.ZIP)) .setState((String) clinician.attributes.get(Clinician.STATE)); if (COUNTRY_CODE != null) { address.setCountry(COUNTRY_CODE); } practitionerResource.addAddress(address); if (clinician.attributes.get(Person.GENDER).equals("M")) { practitionerResource.setGender(AdministrativeGender.MALE); } else if (clinician.attributes.get(Person.GENDER).equals("F")) { practitionerResource.setGender(AdministrativeGender.FEMALE); } return newEntry(bundle, practitionerResource, clinician.getResourceID()); }
Example 2
Source File: PractitionerEntityToFHIRPractitionerTransformer.java From careconnect-reference-implementation with Apache License 2.0 | 4 votes |
@Override public Practitioner transform(final PractitionerEntity practitionerEntity) { final Practitioner practitioner = new Practitioner(); Meta meta = new Meta().addProfile(CareConnectProfile.Practitioner_1); if (practitionerEntity.getUpdated() != null) { meta.setLastUpdated(practitionerEntity.getUpdated()); } else { if (practitionerEntity.getCreated() != null) { meta.setLastUpdated(practitionerEntity.getCreated()); } } practitioner.setMeta(meta); if (practitionerEntity.getActive() != null) { practitioner.setActive(practitionerEntity.getActive()); } for(PractitionerIdentifier identifier :practitionerEntity.getIdentifiers()) { Identifier ident = practitioner.addIdentifier(); ident = daoutils.getIdentifier(identifier, ident); } practitioner.setId(practitionerEntity.getId().toString()); if (practitionerEntity.getNames().size() > 0) { practitioner.addName() .setFamily(practitionerEntity.getNames().get(0).getFamilyName()) .addGiven(practitionerEntity.getNames().get(0).getGivenName()) .addPrefix(practitionerEntity.getNames().get(0).getPrefix()); } for(int f=0;f<practitionerEntity.getTelecoms().size();f++) { practitioner.addTelecom() .setSystem(practitionerEntity.getTelecoms().get(f).getSystem()) .setValue(practitionerEntity.getTelecoms().get(f).getValue()) .setUse(practitionerEntity.getTelecoms().get(f).getTelecomUse()); } for (PractitionerAddress practitionerAddress : practitionerEntity.getAddresses()){ Address address = addressTransformer.transform(practitionerAddress); practitioner.addAddress(address); } if (practitionerEntity.getGender() !=null) { practitioner.setGender(daoutils.getGender(practitionerEntity.getGender())); } return practitioner; }