private Reference readAsReference(Element item) { Reference r = new Reference(); r.setDisplay(item.getNamedChildValue("display")); r.setReference(item.getNamedChildValue("reference")); List<Element> identifier = item.getChildrenByName("identifier"); if (identifier.isEmpty() == false) { r.setIdentifier(readAsIdentifier(identifier.get(0))); } return r; } private Identifier readAsIdentifier(Element item) {
public org.hl7.fhir.dstu3.model.Reference convertReference(org.hl7.fhir.instance.model.Reference src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Reference tgt = new org.hl7.fhir.dstu3.model.Reference(); copyElement(src, tgt); tgt.setReference(src.getReference()); tgt.setDisplay(src.getDisplay()); return tgt; }
public static org.hl7.fhir.dstu3.model.Reference convertReference(org.hl7.fhir.dstu2016may.model.Reference src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Reference tgt = new org.hl7.fhir.dstu3.model.Reference(); copyElement(src, tgt); if (src.hasReference()) tgt.setReference(src.getReference()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); return tgt; }
public org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.instance.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent(); copyElement(src, tgt); tgt.setRole(convertProvenanceEntityRole(src.getRole())); if (src.hasReference()) tgt.setWhat(new org.hl7.fhir.dstu3.model.Reference().setReference(src.getReference())); tgt.addAgent(convertProvenanceAgentComponent(src.getAgent())); return tgt; }
/** * Convenience setter which sets the reference to the complete {@link IIdType#getValue() value} of the given * reference. * * @param theReference The reference, or <code>null</code> * @return * @return Returns a reference to this */ public Reference setReferenceElement(IIdType theReference) { if (theReference != null) { setReference(theReference.getValue()); } else { setReference(null); } return this; } protected void listChildren(List<Property> children) {
public static Reference makeReference(String url) { Reference rr = new Reference(); rr.setReference(url); return rr; }
public static Reference makeReference(String url, String text) { Reference rr = new Reference(); rr.setReference(url); if (!Utilities.noString(text)) rr.setDisplay(text); return rr; }
public Reference castToReference(Base b) throws FHIRException { if (b instanceof Reference) return (Reference) b; else if (b.isPrimitive() && Utilities.isURL(b.primitiveValue())) return new Reference().setReference(b.primitiveValue()); else if (b instanceof org.hl7.fhir.dstu3.elementmodel.Element && b.fhirType().equals("Reference")) { org.hl7.fhir.dstu3.elementmodel.Element e = (org.hl7.fhir.dstu3.elementmodel.Element) b; return new Reference().setReference(e.getChildValue("reference")).setDisplay(e.getChildValue("display")); } else throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Reference"); }
private Reference readAsReference(Element item) { Reference r = new Reference(); r.setDisplay(item.getNamedChildValue("display")); r.setReference(item.getNamedChildValue("reference")); List<Element> identifier = item.getChildrenByName("identifier"); if (identifier.isEmpty() == false) { r.setIdentifier(readAsIdentifier(identifier.get(0))); } return r; } private Identifier readAsIdentifier(Element item) {
public static Reference readAsReference(Element item) { Reference r = new Reference(); r.setDisplay(item.getNamedChildValue("display")); r.setReference(item.getNamedChildValue("reference")); List<Element> identifier = item.getChildrenByName("identifier"); if (identifier.isEmpty() == false) { r.setIdentifier(readAsIdentifier(identifier.get(0))); } return r; }
public org.hl7.fhir.dstu3.model.Reference convertReference(org.hl7.fhir.instance.model.Reference src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Reference tgt = new org.hl7.fhir.dstu3.model.Reference(); copyElement(src, tgt); tgt.setReference(src.getReference()); tgt.setDisplay(src.getDisplay()); return tgt; }
public static org.hl7.fhir.dstu3.model.Reference convertReference(org.hl7.fhir.dstu2016may.model.Reference src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Reference tgt = new org.hl7.fhir.dstu3.model.Reference(); copyElement(src, tgt); if (src.hasReference()) tgt.setReference(src.getReference()); if (src.hasDisplay()) tgt.setDisplay(src.getDisplay()); return tgt; }
b.setIdBase(id); return new Reference().setReference(b.fhirType()+"/"+id);
/** * Finds internal references in an Element's Binding and StructureDefinition references (in TypeRef) and bases them on the given url * @param url - the base url to use to turn internal references into absolute references * @param element - the Element to update * @return - the updated Element */ private ElementDefinition updateURLs(String url, ElementDefinition element) { if (element != null) { ElementDefinition defn = element; if (defn.hasBinding() && defn.getBinding().getValueSet() instanceof Reference && ((Reference)defn.getBinding().getValueSet()).getReference().startsWith("#")) ((Reference)defn.getBinding().getValueSet()).setReference(url+((Reference)defn.getBinding().getValueSet()).getReference()); for (TypeRefComponent t : defn.getType()) { if (t.hasProfile()) { if (t.getProfile().startsWith("#")) t.setProfile(url+t.getProfile()); } if (t.hasTargetProfile()) { if (t.getTargetProfile().startsWith("#")) t.setTargetProfile(url+t.getTargetProfile()); } } } return element; }
public org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.instance.model.Provenance.ProvenanceEntityComponent src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent tgt = new org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent(); copyElement(src, tgt); tgt.setRole(convertProvenanceEntityRole(src.getRole())); if (src.hasReference()) tgt.setWhat(new org.hl7.fhir.dstu3.model.Reference().setReference(src.getReference())); tgt.addAgent(convertProvenanceAgentComponent(src.getAgent())); return tgt; }
RuntimeResourceDefinition def = getServerConfiguration().getFhirContext().getResourceDefinition(resourceName); resource.getTypeElement().setValue(def.getName()); resource.getProfile().setReference((def.getResourceProfile(serverBase)));