@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("link")) { this.getLink().add((BundleLinkComponent) value); } else if (name.equals("fullUrl")) { this.fullUrl = castToUri(value); // UriType } else if (name.equals("resource")) { this.resource = castToResource(value); // Resource } else if (name.equals("search")) { this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent } else if (name.equals("request")) { this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent } else if (name.equals("response")) { this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent } else return super.setProperty(name, value); return value; }
/** * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. * If no link is found which matches the given relation, returns <code>null</code>. If more than one * link is found which matches the given relation, returns the first matching BundleLinkComponent. * * @param theRelation * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. * @return Returns a matching BundleLinkComponent, or <code>null</code> * @see IBaseBundle#LINK_NEXT * @see IBaseBundle#LINK_PREV * @see IBaseBundle#LINK_SELF */ public BundleLinkComponent getLink(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; } } return null; }
/** * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. * If no link is found which matches the given relation, creates a new BundleLinkComponent with the * given relation and adds it to this Bundle. If more than one * link is found which matches the given relation, returns the first matching BundleLinkComponent. * * @param theRelation * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. * @return Returns a matching BundleLinkComponent, or <code>null</code> * @see IBaseBundle#LINK_NEXT * @see IBaseBundle#LINK_PREV * @see IBaseBundle#LINK_SELF */ public BundleLinkComponent getLinkOrCreate(String theRelation) { org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); for (BundleLinkComponent next : getLink()) { if (theRelation.equals(next.getRelation())) { return next; } } BundleLinkComponent retVal = new BundleLinkComponent(); retVal.setRelation(theRelation); getLink().add(retVal); return retVal; } protected void listChildren(List<Property> children) {
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 3321850: // link this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent return value; case -511251360: // fullUrl this.fullUrl = castToUri(value); // UriType return value; case -341064690: // resource this.resource = castToResource(value); // Resource return value; case -906336856: // search this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent return value; case 1095692943: // request this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent return value; case -340323263: // response this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent return value; default: return super.setProperty(hash, name, value); } }
public org.hl7.fhir.instance.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; if (advisor.ignoreEntry(src)) return null; org.hl7.fhir.instance.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.instance.model.Bundle.BundleEntryComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); tgt.setFullUrl(src.getFullUrl()); org.hl7.fhir.instance.model.Resource res = advisor.convert(src.getResource()); if (res == null) res = convertResource(src.getResource()); tgt.setResource(res); if (src.hasSearch()) tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); if (src.hasRequest()) tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); if (src.hasResponse()) tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); tgt.setResource(convertResource(src.getResource())); tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); return tgt; }
public org.hl7.fhir.instance.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; if (advisor.ignoreEntry(src)) return null; org.hl7.fhir.instance.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.instance.model.Bundle.BundleEntryComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); tgt.setFullUrl(src.getFullUrl()); org.hl7.fhir.instance.model.Resource res = advisor.convert(src.getResource()); if (res == null) res = convertResource(src.getResource()); tgt.setResource(res); if (src.hasSearch()) tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); if (src.hasRequest()) tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); if (src.hasResponse()) tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); return tgt; }
public static org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent(); copyElement(src, tgt); for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); if (src.hasFullUrl()) tgt.setFullUrl(src.getFullUrl()); tgt.setResource(convertResource(src.getResource())); tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest())); tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse())); return tgt; }