public static void main(String[] args) throws DataFormatException, IOException { //START SNIPPET: example1 Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:foo").setValue("7000135"); patient.addName().addFamily("Smith").addGiven("John").addGiven("Edward"); patient.addAddress().addLine("742 Evergreen Terrace").setCity("Springfield").setState("ZZ"); FhirContext ctx = FhirContext.forDstu2(); // Use the narrative generator ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); // Encode the output, including the narrative String output = ctx.newJsonParser().setPrettyPrint(true).encodeResourceToString(patient); System.out.println(output); //END SNIPPET: example1 }
ArrayList<StringDt> allNames = new ArrayList<StringDt>(); AddressDt nextAddress = (AddressDt) nextObject; allNames.addAll(nextAddress.getLine()); allNames.add(nextAddress.getCityElement()); allNames.add(nextAddress.getStateElement()); allNames.add(nextAddress.getCountryElement()); allNames.add(nextAddress.getPostalCodeElement()); for (StringDt nextName : allNames) { addSearchTerm(theEntity, retVal, nextSpName, nextName.getValue());
/** * Gets the value(s) for <b>address</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * Address for the contact person * </p> */ public AddressDt getAddress() { if (myAddress == null) { myAddress = new AddressDt(); } return myAddress; }
/** * Gets the first repetition for <b>line</b> (), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information * </p> */ public StringDt getLineFirstRep() { if (getLine().isEmpty()) { return addLine(); } return getLine().get(0); } /**
/** * Adds a given new value for <b>line</b> () * * <p> * <b>Definition:</b> * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information * </p> * @param theValue The line to add (must not be <code>null</code>) */ public AddressDt addLine(StringDt theValue) { if (theValue == null) { throw new NullPointerException("theValue must not be null"); } getLine().add(theValue); return this; }
/** * Gets the value(s) for <b>state</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes) * </p> */ public String getState() { return getStateElement().getValue(); }
/** * Gets the value(s) for <b>postalCode</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * A postal code designating a region defined by the postal service * </p> */ public String getPostalCode() { return getPostalCodeElement().getValue(); }
/** * Gets the value(s) for <b>city</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The name of the city, town, village or other community or delivery center * </p> */ public String getCity() { return getCityElement().getValue(); }
/** * Gets the value(s) for <b>country</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * Country - a nation as commonly understood or generally accepted * </p> */ public String getCountry() { return getCountryElement().getValue(); }
/** * Gets the value(s) for <b>text</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * A full text representation of the address * </p> */ public String getText() { return getTextElement().getValue(); }
/** * Gets the value(s) for <b>district</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The name of the administrative area (county) * </p> */ public String getDistrict() { return getDistrictElement().getValue(); }
/** * Gets the value(s) for <b>type</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both * </p> */ public String getType() { return getTypeElement().getValue(); }
/** * Adds and returns a new value for <b>line</b> () * * <p> * <b>Definition:</b> * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information * </p> */ public StringDt addLine() { StringDt newType = new StringDt(); getLine().add(newType); return newType; }
/** * Gets the value(s) for <b>address</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * * </p> */ public AddressDt getAddress() { if (myAddress == null) { myAddress = new AddressDt(); } return myAddress; }
/** * Gets the value(s) for <b>address</b> (). * creating it if it does * not exist. Will not return <code>null</code>. * * <p> * <b>Definition:</b> * Visiting or postal addresses for the contact * </p> */ public AddressDt getAddress() { if (myAddress == null) { myAddress = new AddressDt(); } return myAddress; }
/** * Adds and returns a new value for <b>address</b> () * * <p> * <b>Definition:</b> * Addresses for the individual * </p> */ public AddressDt addAddress() { AddressDt newType = new AddressDt(); getAddress().add(newType); return newType; }
/** * Adds and returns a new value for <b>address</b> () * * <p> * <b>Definition:</b> * Address where the related person can be contacted or visited * </p> */ public AddressDt addAddress() { AddressDt newType = new AddressDt(); getAddress().add(newType); return newType; }
/** * Adds and returns a new value for <b>address</b> () * * <p> * <b>Definition:</b> * An address for the organization * </p> */ public AddressDt addAddress() { AddressDt newType = new AddressDt(); getAddress().add(newType); return newType; }
/** * Adds and returns a new value for <b>address</b> () * * <p> * <b>Definition:</b> * One or more addresses for the person * </p> */ public AddressDt addAddress() { AddressDt newType = new AddressDt(); getAddress().add(newType); return newType; }
/** * Adds and returns a new value for <b>address</b> () * * <p> * <b>Definition:</b> * The postal address where the practitioner can be found or visited or to which mail can be delivered * </p> */ public AddressDt addAddress() { AddressDt newType = new AddressDt(); getAddress().add(newType); return newType; }