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 static void addLanguageTranslation(Element element, String lang, String value) { 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 void foo() { //START SNIPPET: subExtension Patient patient = new Patient(); // Add an extension (initially with no contents) to the resource Extension parent = new Extension("http://example.com#parent"); patient.addExtension(parent); // Add two extensions as children to the parent extension Extension child1 = new Extension("http://example.com#childOne", new StringType("value1")); parent.addExtension(child1); Extension child2 = new Extension("http://example.com#chilwo", new StringType("value1")); parent.addExtension(child2); //END SNIPPET: subExtension }
public org.hl7.fhir.dstu3.model.Extension convertExtension(org.hl7.fhir.instance.model.Extension src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.dstu3.model.Extension tgt = new org.hl7.fhir.dstu3.model.Extension(); copyElement(src, tgt); tgt.setUrl(src.getUrl()); tgt.setValue(convertType(src.getValue())); return tgt; }
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 Extension addModifierExtension() { //3 Extension t = new Extension(); if (this.modifierExtension == null) this.modifierExtension = new ArrayList<Extension>(); this.modifierExtension.add(t); return t; }
/** * Override parent because we're using FHIRPath here */ @Override protected List<Object> extractValues(String thePaths, IBaseResource theResource) { FHIRPathEngine fp = new FHIRPathEngine(myWorkerContext); List<Object> values = new ArrayList<>(); String[] nextPathsSplit = SPLIT.split(thePaths); for (String nextPath : nextPathsSplit) { List<Base> allValues; try { allValues = fp.evaluate((Base) theResource, trim(nextPath)); } catch (FHIRException e) { String msg = getContext().getLocalizer().getMessage(BaseSearchParamExtractor.class, "failedToExtractPaths", nextPath, e.toString()); throw new InternalErrorException(msg, e); } if (allValues.isEmpty() == false) { values.addAll(allValues); } } for (int i = 0; i < values.size(); i++) { Object nextObject = values.get(i); if (nextObject instanceof Extension) { Extension nextExtension = (Extension) nextObject; nextObject = nextExtension.getValue(); values.set(i, nextObject); } } return values; }
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; }
String userInfoEndpoint = null; for (Extension extension : extensions) { if (extension.getUrl().equalsIgnoreCase(URIS_ENDPOINT_EXTENSION)) { List<Extension> urisExtensions = extension.getExtension(); for (Extension uriExtensionDt : urisExtensions) { if (uriExtensionDt.getUrl().equalsIgnoreCase("authorize")) { authEndpoint = uriExtensionDt.getValueAsPrimitive().getValueAsString(); } else if (uriExtensionDt.getUrl().equalsIgnoreCase("token")) { tokenEndpoint = uriExtensionDt.getValueAsPrimitive().getValueAsString(); userInfoEndpoint = tokenEndpoint.replaceFirst("token", "userinfo");
public Extension copy() { Extension dst = new Extension(); copyValues(dst); dst.url = url == null ? null : url.copy(); dst.value = value == null ? null : value.copy(); return dst; }
public static void addStringExtension(Element e, String url, String content) { if (!StringUtils.isBlank(content)) { Extension ex = getExtension(e, url); if (ex != null) ex.setValue(new StringType(content)); else e.getExtension().add(Factory.newExtension(url, new StringType(content), true)); } }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case 116079: return getUrlElement(); case -1410166417: return getValue(); case 111972721: return getValue(); default: return super.makeProperty(hash, name); } }
/** * Constructor */ public Extension(String theUrl) { setUrl(theUrl); }
IPrimitiveType<?> uniqueExtsValuePrimitive = uniqueExts.get(0).getValueAsPrimitive(); if (uniqueExtsValuePrimitive != null) { if ("true".equalsIgnoreCase(uniqueExtsValuePrimitive.getValueAsString())) {
public boolean hasExtension() { if (this.extension == null) return false; for (Extension item : this.extension) if (!item.isEmpty()) return true; return false; }
n.getExtension().add(Factory.newExtension("http://www.healthintersections.com.au/fhir/extensions/procedure-instructions-type", convert.makeCodeableConceptFromCD(cda.getChild(a, "code")), false)); n.getExtension().add(Factory.newExtension("http://www.healthintersections.com.au/fhir/extensions/procedure-instructions-text", convert.makeStringFromED(cda.getChild(a, "text")), false)); p.getExtension().add(n); } else if (cda.hasTemplateId(a, "2.16.840.1.113883.10.20.22.4.19")) {