public static org.hl7.fhir.dstu2016may.model.Address convertAddress(org.hl7.fhir.dstu3.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.dstu3.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); } }
public org.hl7.fhir.instance.model.Address convertAddress(org.hl7.fhir.dstu3.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.dstu3.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; }
String type = address.hasType() ? address.getType().getDisplay() : ""; String use = address.hasUse() ? address.getUse().getDisplay() : ""; for (StringType line : address.getLine()) { addDetail(line.getValue(), null); line.append(address.getCity()).append(", "); line.append(address.getState()).append(" "); line.append(address.getPostalCode()); addDetail(line.toString(), null);
ArrayList<StringType> allNames = new ArrayList<StringType>(); Address nextAddress = (Address) nextObject; allNames.addAll(nextAddress.getLine()); allNames.add(nextAddress.getCityElement()); allNames.add(nextAddress.getStateElement()); allNames.add(nextAddress.getCountryElement()); allNames.add(nextAddress.getPostalCodeElement()); for (StringType nextName : allNames) { addSearchTerm(theEntity, retVal, nextSpName, nextName.getValue());
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 116103: return getUseElement(); case 3575610: return getTypeElement(); case 3556653: return getTextElement(); case 3321844: return addLineElement(); case 3053931: return getCityElement(); case 288961422: return getDistrictElement(); case 109757585: return getStateElement(); case 2011152728: return getPostalCodeElement(); case 957831062: return getCountryElement(); case -991726143: return getPeriod(); default: return super.makeProperty(hash, name); } }
public Address makeAddressFromAD(Element e) { if (e == null) return null; Address a = new Address(); String use = e.getAttribute("use"); if (use != null) { if (use.equals("H") || use.equals("HP") || use.equals("HV")) a.setUse(AddressUse.HOME); else if (use.equals("WP") || use.equals("DIR") || use.equals("PUB")) a.setUse(AddressUse.WORK); else if (use.equals("TMP")) a.setUse(AddressUse.TEMP); else if (use.equals("BAD")) a.setUse(AddressUse.OLD); String v = n.getTextContent(); if (n.getLocalName().equals("additionalLocator")) a.getLine().add(makeString(v)); a.getLine().add(makeString(v)); a.getLine().add(makeString(v)); a.getLine().add(makeString(v)); else if (n.getLocalName().equals("careOf")) a.getLine().add(makeString(v)); a.setCountry(v); a.setCity(v);
root.addChild(new Div()); for (StringType line : address.getLine()) { addDemographic(root, null, line.getValue()); String city = StringUtils.defaultString(address.getCity()); String state = StringUtils.defaultString(address.getState()); String zip = StringUtils.defaultString(address.getPostalCode()); String sep = city.isEmpty() || state.isEmpty() ? "" : ", "; addDemographic(root, null, city + sep + state + " " + zip);
switch (hash) { case 116103: // use value = new AddressUseEnumFactory().fromType(castToCode(value)); this.use = (Enumeration) value; // Enumeration<AddressUse> return value; case 3575610: // type value = new AddressTypeEnumFactory().fromType(castToCode(value)); this.type = (Enumeration) value; // Enumeration<AddressType> return value; case 3556653: // text this.text = castToString(value); // StringType return value; case 3321844: // line this.getLine().add(castToString(value)); // StringType return value; case 3053931: // city this.city = castToString(value); // StringType return value; case 288961422: // district this.district = castToString(value); // StringType return value; case 109757585: // state this.state = castToString(value); // StringType return value; case 2011152728: // postalCode this.postalCode = castToString(value); // StringType return value; case 957831062: // country this.country = castToString(value); // StringType
public org.hl7.fhir.instance.model.Address convertAddress(org.hl7.fhir.dstu3.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.dstu3.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; }
String type = address.hasType() ? address.getType().getDisplay() : ""; String use = address.hasUse() ? address.getUse().getDisplay() : ""; for (StringType line : address.getLine()) { addDetail(line.getValue(), null); line.append(address.getCity()).append(", "); line.append(address.getState()).append(" "); line.append(address.getPostalCode()); addDetail(line.toString(), null);
public Address makeAddressFromAD(Element e) { if (e == null) return null; Address a = new Address(); String use = e.getAttribute("use"); if (use != null) { if (use.equals("H") || use.equals("HP") || use.equals("HV")) a.setUse(AddressUse.HOME); else if (use.equals("WP") || use.equals("DIR") || use.equals("PUB")) a.setUse(AddressUse.WORK); else if (use.equals("TMP")) a.setUse(AddressUse.TEMP); else if (use.equals("BAD")) a.setUse(AddressUse.OLD); String v = n.getTextContent(); if (n.getLocalName().equals("additionalLocator")) a.getLine().add(makeString(v)); a.getLine().add(makeString(v)); a.getLine().add(makeString(v)); a.getLine().add(makeString(v)); else if (n.getLocalName().equals("careOf")) a.getLine().add(makeString(v)); a.setCountry(v); a.setCity(v);
@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; }
public static org.hl7.fhir.dstu2016may.model.Address convertAddress(org.hl7.fhir.dstu3.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.dstu3.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); } }