/** * Constructor */ public Extension(String theUrl) { setUrl(theUrl); }
/** * Constructor */ public Extension(String theUrl, IBaseDatatype theValue) { setUrl(theUrl); setValue(theValue); }
public void addExtension(String url, Type value) { if (disallowExtensions) throw new Error("Extensions are not allowed in this context"); Extension ex = new Extension(); ex.setUrl(url); ex.setValue(value); getExtension().add(ex); }
public void addExtension(String url, Type value) { Extension ex = new Extension(); ex.setUrl(url); ex.setValue(value); getExtension().add(ex); }
public static void addLanguageTranslation(Element element, String lang, String value) { if (Utilities.noString(lang) || Utilities.noString(value)) return; Extension extension = new Extension().setUrl(EXT_TRANSLATION); extension.addExtension().setUrl("lang").setValue(new StringType(lang)); extension.addExtension().setUrl("content").setValue(new StringType(value)); element.getExtension().add(extension); }
public static Extension newExtension(String uri, Type value, boolean evenIfNull) { if (!evenIfNull && (value == null || value.isEmpty())) return null; Extension e = new Extension(); e.setUrl(uri); e.setValue(value); return e; }
public static void setAllowableUnits(ElementDefinition eld, CodeableConcept cc) { for (Extension e : eld.getExtension()) if (e.getUrl().equals(EXT_ALLOWABLE_UNITS)) { e.setValue(cc); return; } eld.getExtension().add(new Extension().setUrl(EXT_ALLOWABLE_UNITS).setValue(cc)); }
public static void setExtension(Element focus, String url, Coding c) { for (Extension e : focus.getExtension()) if (e.getUrl().equals(url)) { e.setValue(c); return; } focus.getExtension().add(new Extension().setUrl(url).setValue(c)); }
public static Extension makeIssueSource(Source source) { Extension ex = new Extension(); // todo: write this up and get it published with the pack (and handle the redirect?) ex.setUrl(ToolingExtensions.EXT_ISSUE_SOURCE); CodeType c = new CodeType(); c.setValue(source.toString()); ex.setValue(c); return ex; }
Extension ex = new Extension().setUrl(uri).setValue(value); if (modifier) { if (!(element instanceof BackboneElement))
public static org.hl7.fhir.r4.model.Extension convertExtension(org.hl7.fhir.dstu2016may.model.Extension src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Extension tgt = new org.hl7.fhir.r4.model.Extension(); copyElement(src, tgt); tgt.setUrl(src.getUrl()); if (src.hasValue()) if (CANONICAL_URLS.contains(src.getUrl()) && src.getValue() instanceof org.hl7.fhir.dstu2016may.model.Reference) tgt.setValue(convertReferenceToCanonical((Reference)src.getValue())); else tgt.setValue(convertType(src.getValue())); return tgt; }
public org.hl7.fhir.r4.model.Extension convertExtension(org.hl7.fhir.instance.model.Extension src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Extension tgt = new org.hl7.fhir.r4.model.Extension(); copyElement(src, tgt); tgt.setUrl(src.getUrl()); if (src.hasValue()) if (CANONICAL_URLS.contains(src.getUrl()) && src.getValue() instanceof org.hl7.fhir.instance.model.Reference) tgt.setValue(convertReferenceToCanonical((Reference)src.getValue())); else tgt.setValue(convertType(src.getValue())); return tgt; }
public org.hl7.fhir.r4.model.Extension convertAnimalComponent(org.hl7.fhir.instance.model.Patient.AnimalComponent src) throws FHIRException { if (src == null) return null; org.hl7.fhir.r4.model.Extension tgt = new org.hl7.fhir.r4.model.Extension(); tgt.setUrl("http://hl7.org/fhir/StructureDefinition/patient-animal"); copyElement(src, tgt); if (src.hasSpecies()) tgt.addExtension("species", convertCodeableConcept(src.getSpecies())); if (src.hasBreed()) tgt.addExtension("breed", convertCodeableConcept(src.getBreed())); if (src.hasGenderStatus()) tgt.addExtension("genderStatus", convertCodeableConcept(src.getGenderStatus())); return tgt; }
/** * Constructor */ public Extension(String theUrl, IBaseDatatype theValue) { setUrl(theUrl); setValue(theValue); }
public void addExtension(String url, Type value) { Extension ex = new Extension(); ex.setUrl(url); ex.setValue(value); getExtension().add(ex); }
public static void addLanguageTranslation(Element element, String lang, String value) { if (Utilities.noString(lang) || Utilities.noString(value)) return; Extension extension = new Extension().setUrl(EXT_TRANSLATION); extension.addExtension().setUrl("lang").setValue(new StringType(lang)); extension.addExtension().setUrl("content").setValue(new StringType(value)); element.getExtension().add(extension); }
public static Extension newExtension(String uri, Type value, boolean evenIfNull) { if (!evenIfNull && (value == null || value.isEmpty())) return null; Extension e = new Extension(); e.setUrl(uri); e.setValue(value); return e; }
public static void setExtension(Element focus, String url, Coding c) { for (Extension e : focus.getExtension()) if (e.getUrl().equals(url)) { e.setValue(c); return; } focus.getExtension().add(new Extension().setUrl(url).setValue(c)); }
public static void setAllowableUnits(ElementDefinition eld, CodeableConcept cc) { for (Extension e : eld.getExtension()) if (e.getUrl().equals(EXT_ALLOWABLE_UNITS)) { e.setValue(cc); return; } eld.getExtension().add(new Extension().setUrl(EXT_ALLOWABLE_UNITS).setValue(cc)); }
public static org.hl7.fhir.r4.model.Extension convertExtension(org.hl7.fhir.dstu2016may.model.Extension src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Extension tgt = new org.hl7.fhir.r4.model.Extension(); copyElement(src, tgt); tgt.setUrl(src.getUrl()); if (src.hasValue()) if (CANONICAL_URLS.contains(src.getUrl()) && src.getValue() instanceof org.hl7.fhir.dstu2016may.model.Reference) tgt.setValue(convertReferenceToCanonical((Reference)src.getValue())); else tgt.setValue(convertType(src.getValue())); return tgt; }