private void checkAddress(List<ValidationMessage> errors, String path, Element focus, Address fixed) { checkFixedValue(errors, path + ".use", focus.getNamedChild("use"), fixed.getUseElement(), "use", focus); checkFixedValue(errors, path + ".text", focus.getNamedChild("text"), fixed.getTextElement(), "text", focus); checkFixedValue(errors, path + ".city", focus.getNamedChild("city"), fixed.getCityElement(), "city", focus); checkFixedValue(errors, path + ".state", focus.getNamedChild("state"), fixed.getStateElement(), "state", focus); checkFixedValue(errors, path + ".country", focus.getNamedChild("country"), fixed.getCountryElement(), "country", focus); checkFixedValue(errors, path + ".zip", focus.getNamedChild("zip"), fixed.getPostalCodeElement(), "postalCode", focus); List<Element> lines = new ArrayList<Element>(); focus.getNamedChildren("line", lines); if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, lines.size() == fixed.getLine().size(), "Expected " + Integer.toString(fixed.getLine().size()) + " but found " + Integer.toString(lines.size()) + " line elements")) { for (int i = 0; i < lines.size(); i++) checkFixedValue(errors, path + ".coding", lines.get(i), fixed.getLine().get(i), "coding", focus); } }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("use")) { value = new AddressUseEnumFactory().fromType(castToCode(value)); this.use = (Enumeration) value; // Enumeration<AddressUse> } else if (name.equals("type")) { value = new AddressTypeEnumFactory().fromType(castToCode(value)); this.type = (Enumeration) value; // Enumeration<AddressType> } else if (name.equals("text")) { this.text = castToString(value); // StringType } else if (name.equals("line")) { this.getLine().add(castToString(value)); } else if (name.equals("city")) { this.city = castToString(value); // StringType } else if (name.equals("district")) { this.district = castToString(value); // StringType } else if (name.equals("state")) { this.state = castToString(value); // StringType } else if (name.equals("postalCode")) { this.postalCode = castToString(value); // StringType } else if (name.equals("country")) { this.country = castToString(value); // StringType } else if (name.equals("period")) { this.period = castToPeriod(value); // Period } else return super.setProperty(name, value); return value; }
ArrayList<StringType> allNames = new ArrayList<>(); Address nextAddress = (Address) nextObject; allNames.addAll(nextAddress.getLine()); allNames.add(nextAddress.getCityElement()); allNames.add(nextAddress.getStateElement());
return value; case 3321844: // line this.getLine().add(castToString(value)); // StringType return value; case 3053931: // city
public org.hl7.fhir.instance.model.Address convertAddress(org.hl7.fhir.r4.model.Address src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Address tgt = new org.hl7.fhir.instance.model.Address(); copyElement(src, tgt); tgt.setUse(convertAddressUse(src.getUse())); tgt.setType(convertAddressType(src.getType())); tgt.setText(src.getText()); for (org.hl7.fhir.r4.model.StringType t : src.getLine()) tgt.addLine(t.getValue()); tgt.setCity(src.getCity()); tgt.setDistrict(src.getDistrict()); tgt.setState(src.getState()); tgt.setPostalCode(src.getPostalCode()); tgt.setCountry(src.getCountry()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Address convertAddress(org.hl7.fhir.r4.model.Address src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Address tgt = new org.hl7.fhir.dstu2016may.model.Address(); copyElement(src, tgt); tgt.setUse(convertAddressUse(src.getUse())); tgt.setType(convertAddressType(src.getType())); if (src.hasText()) tgt.setText(src.getText()); for (org.hl7.fhir.r4.model.StringType t : src.getLine()) tgt.addLine(t.getValue()); if (src.hasCity()) tgt.setCity(src.getCity()); if (src.hasDistrict()) tgt.setDistrict(src.getDistrict()); if (src.hasState()) tgt.setState(src.getState()); if (src.hasPostalCode()) tgt.setPostalCode(src.getPostalCode()); if (src.hasCountry()) tgt.setCountry(src.getCountry()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
private void checkAddress(List<ValidationMessage> errors, String path, Element focus, Address fixed) { checkFixedValue(errors, path + ".use", focus.getNamedChild("use"), fixed.getUseElement(), "use", focus); checkFixedValue(errors, path + ".text", focus.getNamedChild("text"), fixed.getTextElement(), "text", focus); checkFixedValue(errors, path + ".city", focus.getNamedChild("city"), fixed.getCityElement(), "city", focus); checkFixedValue(errors, path + ".state", focus.getNamedChild("state"), fixed.getStateElement(), "state", focus); checkFixedValue(errors, path + ".country", focus.getNamedChild("country"), fixed.getCountryElement(), "country", focus); checkFixedValue(errors, path + ".zip", focus.getNamedChild("zip"), fixed.getPostalCodeElement(), "postalCode", focus); List<Element> lines = new ArrayList<Element>(); focus.getNamedChildren("line", lines); if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, lines.size() == fixed.getLine().size(), "Expected " + Integer.toString(fixed.getLine().size()) + " but found " + Integer.toString(lines.size()) + " line elements")) { for (int i = 0; i < lines.size(); i++) checkFixedValue(errors, path + ".coding", lines.get(i), fixed.getLine().get(i), "coding", focus); } }
@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("use")) { value = new AddressUseEnumFactory().fromType(castToCode(value)); this.use = (Enumeration) value; // Enumeration<AddressUse> } else if (name.equals("type")) { value = new AddressTypeEnumFactory().fromType(castToCode(value)); this.type = (Enumeration) value; // Enumeration<AddressType> } else if (name.equals("text")) { this.text = castToString(value); // StringType } else if (name.equals("line")) { this.getLine().add(castToString(value)); } else if (name.equals("city")) { this.city = castToString(value); // StringType } else if (name.equals("district")) { this.district = castToString(value); // StringType } else if (name.equals("state")) { this.state = castToString(value); // StringType } else if (name.equals("postalCode")) { this.postalCode = castToString(value); // StringType } else if (name.equals("country")) { this.country = castToString(value); // StringType } else if (name.equals("period")) { this.period = castToPeriod(value); // Period } else return super.setProperty(name, value); return value; }
return value; case 3321844: // line this.getLine().add(castToString(value)); // StringType return value; case 3053931: // city
public org.hl7.fhir.instance.model.Address convertAddress(org.hl7.fhir.r4.model.Address src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Address tgt = new org.hl7.fhir.instance.model.Address(); copyElement(src, tgt); tgt.setUse(convertAddressUse(src.getUse())); tgt.setType(convertAddressType(src.getType())); tgt.setText(src.getText()); for (org.hl7.fhir.r4.model.StringType t : src.getLine()) tgt.addLine(t.getValue()); tgt.setCity(src.getCity()); tgt.setDistrict(src.getDistrict()); tgt.setState(src.getState()); tgt.setPostalCode(src.getPostalCode()); tgt.setCountry(src.getCountry()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Address convertAddress(org.hl7.fhir.r4.model.Address src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Address tgt = new org.hl7.fhir.dstu2016may.model.Address(); copyElement(src, tgt); tgt.setUse(convertAddressUse(src.getUse())); tgt.setType(convertAddressType(src.getType())); if (src.hasText()) tgt.setText(src.getText()); for (org.hl7.fhir.r4.model.StringType t : src.getLine()) tgt.addLine(t.getValue()); if (src.hasCity()) tgt.setCity(src.getCity()); if (src.hasDistrict()) tgt.setDistrict(src.getDistrict()); if (src.hasState()) tgt.setState(src.getState()); if (src.hasPostalCode()) tgt.setPostalCode(src.getPostalCode()); if (src.hasCountry()) tgt.setCountry(src.getCountry()); tgt.setPeriod(convertPeriod(src.getPeriod())); return tgt; }