private Map<String, String> convertChannelExtensionsDstu3(org.hl7.fhir.dstu3.model.Subscription theSubscription) { Map<String, String> retval = new HashMap<>(); for (org.hl7.fhir.dstu3.model.Extension extension : theSubscription.getChannel().getExtension()) { String url = extension.getUrl(); if (isNotBlank(url)) { String value = extractExtension(theSubscription, url); if (isNotBlank(value)) { retval.put(url, value); } } } return retval; }
public static org.hl7.fhir.dstu2016may.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu2016may.model.Extension tgt = new org.hl7.fhir.dstu2016may.model.Extension(); copyElement(src, tgt); tgt.setUrl(src.getUrl()); tgt.setValue(convertType(src.getValue())); return tgt; }
public org.hl7.fhir.instance.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Extension tgt = new org.hl7.fhir.instance.model.Extension(); copyElement(src, tgt); tgt.setUrl(src.getUrl()); tgt.setValue(convertType(src.getValue())); return tgt; }
public static void removeExtension(DomainResource focus, String url) { Iterator<Extension> i = focus.getExtension().iterator(); while (i.hasNext()) { Extension e = i.next(); // must be called before you can call i.remove() if (e.getUrl().equals(url)) { i.remove(); } } }
public static List<Extension> getExtensions(Element element, String url) { List<Extension> results = new ArrayList<Extension>(); for (Extension ex : element.getExtension()) if (ex.getUrl().equals(url)) results.add(ex); return results; }
static public boolean hasExtension( final String extension, final List<Extension> extensions ) { final String url = createCtakesFhirUrl( extension ); return extensions.stream() .anyMatch( e -> e.getUrl() .equals( url ) ); }
public static List<Extension> getExtensions(DomainResource resource, String url) { List<Extension> results = new ArrayList<Extension>(); for (Extension ex : resource.getExtension()) if (ex.getUrl().equals(url)) results.add(ex); return results; }
public static void removeExtension(Element focus, String url) { Iterator<Extension> i = focus.getExtension().iterator(); while (i.hasNext()) { Extension e = i.next(); // must be called before you can call i.remove() if (e.getUrl().equals(url)) { i.remove(); } } }
public static List<CodeType> getSubsumes(ConceptDefinitionComponent c) { List<CodeType> res = new ArrayList<CodeType>(); for (Extension e : c.getExtension()) { if (EXT_SUBSUMES.equals(e.getUrl())) res.add((CodeType) e.getValue()); } return res; }
public static Extension getExtension(Element el, String name) { if (name == null) return null; if (!el.hasExtension()) return null; for (Extension e : el.getExtension()) { if (name.equals(e.getUrl())) return e; } return null; }
public static Type getAllowedUnits(ElementDefinition eld) { for (Extension e : eld.getExtension()) if (e.getUrl().equals(EXT_ALLOWABLE_UNITS)) return e.getValue(); return null; }
static public int parseInteger( final Extension extension ) { IPrimitiveType primitiveType = extension.getValueAsPrimitive(); final Object value = primitiveType.getValue(); if ( value instanceof Integer ) { return (int) value; } LOGGER.error( "Could not parse integer for " + extension.getUrl() + " from " + value ); return -1; }
/** * @param name the identity of the extension of interest * @return The extension, if on this element, else null. will check modifier extensions too, if appropriate */ public static Extension getExtension(DomainResource resource, String name) { if (name == null || resource == null || !resource.hasExtension()) return null; for (Extension e : resource.getExtension()) { if (name.equals(e.getUrl())) return e; } return null; }
"Extensions count mismatch: expected " + Integer.toString(fixed.getExtension().size()) + " but found " + Integer.toString(extensions.size()))) { for (Extension e : fixed.getExtension()) { Element ex = getExtensionByUrl(extensions, e.getUrl()); if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, ex != null, "Extension count mismatch: unable to find extension: " + e.getUrl())) { checkFixedValue(errors, path, ex.getNamedChild("extension").getNamedChild("value"), e.getValue(), "extension.value", ex.getNamedChild("extension"));
public static boolean hasLanguageTranslation(Element element, String lang) { for (Extension e : element.getExtension()) { if (e.getUrl().equals(EXT_TRANSLATION)) { Extension e1 = ExtensionHelper.getExtension(e, "lang"); if (e1 != null && e1.getValue() instanceof CodeType && ((CodeType) e.getValue()).getValue().equals(lang)) return true; } } return false; }
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 String getLanguageTranslation(Element element, String lang) { for (Extension e : element.getExtension()) { if (e.getUrl().equals(EXT_TRANSLATION)) { Extension e1 = ExtensionHelper.getExtension(e, "lang"); if (e1 != null && e1.getValue() instanceof CodeType && ((CodeType) e.getValue()).getValue().equals(lang)) { e1 = ExtensionHelper.getExtension(e, "content"); return ((StringType) e.getValue()).getValue(); } } } return null; }
public static void addDEReference(DataElement de, String value) { for (Extension e : de.getExtension()) if (e.getUrl().equals(EXT_CIMI_REFERENCE)) { e.setValue(new UriType(value)); return; } de.getExtension().add(new Extension().setUrl(EXT_CIMI_REFERENCE).setValue(new UriType(value))); }
public org.hl7.fhir.instance.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.instance.model.Extension tgt = new org.hl7.fhir.instance.model.Extension(); copyElement(src, tgt); tgt.setUrl(src.getUrl()); tgt.setValue(convertType(src.getValue())); return tgt; }