/** * @return The first repetition of repeating field {@link #address}, creating it if it does not already exist */ public Address getAddressFirstRep() { if (getAddress().isEmpty()) { addAddress(); } return getAddress().get(0); }
tgt.setDeceased(convertType(src.getDeceased())); for (org.hl7.fhir.instance.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); tgt.setMaritalStatus(convertCodeableConcept(src.getMaritalStatus())); tgt.setMultipleBirth(convertType(src.getMultipleBirth()));
public static void main(String[] args) { // Create an encounter with an invalid status and no class Patient pat = new Patient(); pat.addName().setFamily("Simpson").addGiven("Homer").addGiven("Jay"); pat.addAddress().addLine("342 Evergreen Terrace").addLine("Springfield"); pat.addIdentifier().setSystem("http://acme.org/mrns").setValue("12345"); // Create a new context and enable the narrative generator FhirContext ctx = FhirContext.forDstu2(); ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); String res = ctx.newJsonParser().setPrettyPrint(true).encodeResourceToString(pat); System.out.println(res); }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return addIdentifier(); case -1422950650: return getActiveElement(); case 3373707: return addName(); case -1429363305: return addTelecom(); case -1249512767: return getGenderElement(); case -1210031859: return getBirthDateElement(); case -1311442804: return getDeceased(); case 561497972: return getDeceased(); case -1147692044: return addAddress(); case 1756919302: return getMaritalStatus(); case -1764672111: return getMultipleBirth(); case -677369713: return getMultipleBirth(); case 106642994: return addPhoto(); case 951526432: return addContact(); case -1413116420: return getAnimal(); case -1035284522: return addCommunication(); case 1488292898: return addGeneralPractitioner(); case -2058947787: return getManagingOrganization(); case 3321850: return addLink(); default: return super.makeProperty(hash, name); } }
tgt.setDeceased(convertType(src.getDeceased())); for (org.hl7.fhir.instance.model.Address t : src.getAddress()) tgt.addAddress(convertAddress(t)); tgt.setMaritalStatus(convertCodeableConcept(src.getMaritalStatus())); tgt.setMultipleBirth(convertType(src.getMultipleBirth()));