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; }
public static org.hl7.fhir.dstu3.model.Extension convertExtension(org.hl7.fhir.dstu2016may.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; }
public Extension addModifierExtension() { //3 Extension t = new Extension(); if (this.modifierExtension == null) this.modifierExtension = new ArrayList<Extension>(); this.modifierExtension.add(t); return t; }
public Extension addModifierExtension() { //3 Extension t = new Extension(); if (this.modifierExtension == null) this.modifierExtension = new ArrayList<Extension>(); this.modifierExtension.add(t); return t; }
nextResource.addExtension(new Extension(ExtensionConstants.CONF_RESOURCE_COUNT, new DecimalType(count)));
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; }
/** * @param index coreference chain index. * @return a fhir extension indicating the coreference chain to which an object belongs. */ static public Extension createCorefIndex( final int index ) { return new Extension( createCtakesFhirUrl( COREF_INDEX_EXT ), new UnsignedIntType( index ) ); }
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 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 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 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; }
public static void setStringExtension(DomainResource resource, String uri, String value) { Extension ext = getExtension(resource, uri); if (ext != null) ext.setValue(new StringType(value)); else resource.getExtension().add(new Extension(new UriType(uri)).setValue(new StringType(value))); }
public static void setCodeExtension(DomainResource resource, String uri, String value) { Extension ext = getExtension(resource, uri); if (ext != null) ext.setValue(new CodeType(value)); else resource.getExtension().add(new Extension(new UriType(uri)).setValue(new CodeType(value))); }
public static void setIntegerExtension(DomainResource resource, String uri, int value) { Extension ext = getExtension(resource, uri); if (ext != null) ext.setValue(new IntegerType(value)); else resource.getExtension().add(new Extension(new UriType(uri)).setValue(new IntegerType(value))); }
public static void setStringExtension(Element element, String uri, String value) { Extension ext = getExtension(element, uri); if (ext != null) ext.setValue(new StringType(value)); else element.getExtension().add(new Extension(new UriType(uri)).setValue(new StringType(value))); }
public static org.hl7.fhir.dstu3.model.Extension convertExtension(org.hl7.fhir.dstu2016may.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; }
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 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; }