@SuppressWarnings("unchecked") private ExtensionDt createEmptyExtensionDt(IBaseExtension theBaseExtension, boolean theIsModifier, String theUrl) { ExtensionDt retVal = new ExtensionDt(theIsModifier, theUrl); theBaseExtension.getExtension().add(retVal); return retVal; }
@Override public ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl, IBaseDatatype theValue) { Validate.notEmpty(theUrl, "URL must be populated"); Validate.notNull(theValue, "Value must not be null"); ExtensionDt retVal = new ExtensionDt(theIsModifier, theUrl, theValue); if (theIsModifier) { getUndeclaredModifierExtensions(); myUndeclaredModifierExtensions.add(retVal); } else { getUndeclaredExtensions(); myUndeclaredExtensions.add(retVal); } return retVal; }
@Override public ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl) { Validate.notEmpty(theUrl, "URL must be populated"); ExtensionDt retVal = new ExtensionDt(theIsModifier, theUrl); if (theIsModifier) { getUndeclaredModifierExtensions(); myUndeclaredModifierExtensions.add(retVal); } else { getUndeclaredExtensions(); myUndeclaredExtensions.add(retVal); } return retVal; }
private void addExtensionMetadata(RuntimeResourceDefinition theResDef, IBaseResource theResource, boolean theContainedResource, boolean theSubResource, List<Map.Entry<ResourceMetadataKeyEnum<?>, Object>> extensionMetadataKeys, RuntimeResourceDefinition resDef, JsonLikeWriter theEventWriter) throws IOException { if (extensionMetadataKeys.isEmpty()) { return; } ExtensionDt metaResource = new ExtensionDt(); for (Map.Entry<ResourceMetadataKeyEnum<?>, Object> entry : extensionMetadataKeys) { metaResource.addUndeclaredExtension((ExtensionDt) entry.getValue()); } encodeCompositeElementToStreamWriter(theResDef, theResource, metaResource, theEventWriter, theContainedResource, theSubResource, new CompositeChildElement(resDef, theSubResource)); }
public void foo() { //START SNIPPET: subExtension Patient patient = new Patient(); ExtensionDt parent = new ExtensionDt(false, "http://example.com#parent"); patient.addUndeclaredExtension(parent); ExtensionDt child1 = new ExtensionDt(false, "http://example.com#childOne", new StringDt("value1")); parent.addUndeclaredExtension(child1); ExtensionDt child2 = new ExtensionDt(false, "http://example.com#childTwo", new StringDt("value1")); parent.addUndeclaredExtension(child2); //END SNIPPET: subExtension }
public void foo() { //START SNIPPET: subExtension Patient patient = new Patient(); // Add an extension (initially with no contents) to the resource ExtensionDt parent = new ExtensionDt(false, "http://example.com#parent"); patient.addUndeclaredExtension(parent); // Add two extensions as children to the parent extension ExtensionDt child1 = new ExtensionDt(false, "http://example.com#childOne", new StringDt("value1")); parent.addUndeclaredExtension(child1); ExtensionDt child2 = new ExtensionDt(false, "http://example.com#childTwo", new StringDt("value1")); parent.addUndeclaredExtension(child2); //END SNIPPET: subExtension }
item.setText("Hello"); ExtensionDt extension = new ExtensionDt(false, "http://hl7.org/fhir/StructureDefinition/translation"); item.getTextElement().addUndeclaredExtension(extension); extension.addUndeclaredExtension(new ExtensionDt(false, "lang", new CodeDt("es"))); extension.addUndeclaredExtension(new ExtensionDt(false, "cont", new StringDt("hola"))); ExtensionDt ext = new ExtensionDt(); ext.setModifier(false); ext.setUrl("http://example.com/extensions#someext"); ExtensionDt givenExt = new ExtensionDt(false, "http://examples.com#moreext", new StringDt("Hello")); given.addUndeclaredExtension(givenExt);
ExtensionDt ext = new ExtensionDt(); ext.setModifier(false); ext.setUrl("http://example.com/extensions#someext"); StringDt given = name.addGiven(); given.setValue("Joe"); ExtensionDt ext2 = new ExtensionDt(false, "http://examples.com#moreext", new StringDt("Hello")); given.addUndeclaredExtension(ext2);
@SuppressWarnings("unchecked") private ExtensionDt createEmptyExtensionDt(IBaseExtension theBaseExtension, boolean theIsModifier, String theUrl) { ExtensionDt retVal = new ExtensionDt(theIsModifier, theUrl); theBaseExtension.getExtension().add(retVal); return retVal; }
/** * Adds and returns a new value for <b>next</b> (To get next page (if paged)) * * <p> * <b>Definition:</b> * * </p> */ public ExtensionDt addNext() { ExtensionDt newType = new ExtensionDt(); getNext().add(newType); return newType; }
/** * Adds and returns a new value for <b>last</b> (To get last page (if paged)) * * <p> * <b>Definition:</b> * * </p> */ public ExtensionDt addLast() { ExtensionDt newType = new ExtensionDt(); getLast().add(newType); return newType; }
/** * Adds and returns a new value for <b>parameter</b> (Set of query parameters with values) * * <p> * <b>Definition:</b> * * </p> */ public ExtensionDt addParameter() { ExtensionDt newType = new ExtensionDt(); getParameter().add(newType); return newType; }
/** * Adds and returns a new value for <b>first</b> (To get first page (if paged)) * * <p> * <b>Definition:</b> * * </p> */ public ExtensionDt addFirst() { ExtensionDt newType = new ExtensionDt(); getFirst().add(newType); return newType; }
/** * Adds and returns a new value for <b>previous</b> (To get previous page (if paged)) * * <p> * <b>Definition:</b> * * </p> */ public ExtensionDt addPrevious() { ExtensionDt newType = new ExtensionDt(); getPrevious().add(newType); return newType; }
/** * Adds and returns a new value for <b>parameter</b> (Parameters server used) * * <p> * <b>Definition:</b> * * </p> */ public ExtensionDt addParameter() { ExtensionDt newType = new ExtensionDt(); getParameter().add(newType); return newType; }
@Override public ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl, IBaseDatatype theValue) { Validate.notEmpty(theUrl, "URL must be populated"); Validate.notNull(theValue, "Value must not be null"); ExtensionDt retVal = new ExtensionDt(theIsModifier, theUrl, theValue); if (theIsModifier) { getUndeclaredModifierExtensions(); myUndeclaredModifierExtensions.add(retVal); } else { getUndeclaredExtensions(); myUndeclaredExtensions.add(retVal); } return retVal; }
@Override public ExtensionDt addUndeclaredExtension(boolean theIsModifier, String theUrl) { Validate.notEmpty(theUrl, "URL must be populated"); ExtensionDt retVal = new ExtensionDt(theIsModifier, theUrl); if (theIsModifier) { getUndeclaredModifierExtensions(); myUndeclaredModifierExtensions.add(retVal); } else { getUndeclaredExtensions(); myUndeclaredExtensions.add(retVal); } return retVal; }
private void addExtensionMetadata(RuntimeResourceDefinition theResDef, IBaseResource theResource, boolean theContainedResource, List<Map.Entry<ResourceMetadataKeyEnum<?>, Object>> extensionMetadataKeys, RuntimeResourceDefinition resDef, JsonLikeWriter theEventWriter, EncodeContext theEncodeContext) throws IOException { if (extensionMetadataKeys.isEmpty()) { return; } ExtensionDt metaResource = new ExtensionDt(); for (Map.Entry<ResourceMetadataKeyEnum<?>, Object> entry : extensionMetadataKeys) { metaResource.addUndeclaredExtension((ExtensionDt) entry.getValue()); } encodeCompositeElementToStreamWriter(theResDef, theResource, metaResource, theEventWriter, theContainedResource, new CompositeChildElement(resDef, theEncodeContext), theEncodeContext); }
public Conformance addConformance(Conformance conformance){ List<Conformance.Rest> restList = conformance.getRest(); Conformance.Rest rest = restList.get(0); Conformance.RestSecurity restSecurity = rest.getSecurity(); ExtensionDt conformanceExtension = new ExtensionDt(false, this.urisEndpointExtensionUrl); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "authorize", new UriDt( this.authorizationEndpointUri))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "token", new UriDt( this.tokenEndpointUri))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "register", new UriDt( this.registrationEndpointUri))); restSecurity.addUndeclaredExtension(conformanceExtension); return conformance; }
@SuppressWarnings("Duplicates") @Override public Conformance addConformance(Conformance conformance){ if (metadataRepositoryConfig.isSecured()) { List<Conformance.Rest> restList = conformance.getRest(); Conformance.Rest rest = restList.get(0); Conformance.RestSecurity restSecurity = rest.getSecurity(); ExtensionDt conformanceExtension = new ExtensionDt(false, metadataRepositoryConfig.getUrisEndpointExtensionUrl()); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "authorize", new UriDt(metadataRepositoryConfig.getAuthorizeUrl()))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "token", new UriDt(metadataRepositoryConfig.getTokenUrl()))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "register", new UriDt(metadataRepositoryConfig.getRegistrationEndpointUrl()))); conformanceExtension.addUndeclaredExtension(new ExtensionDt(false, "launch-registration", new UriDt(metadataRepositoryConfig.getLaunchRegistrationUrl()))); restSecurity.addUndeclaredExtension(conformanceExtension); BoundCodeableConceptDt<RestfulSecurityServiceEnum> boundCodeableConceptDt = new BoundCodeableConceptDt<>( RestfulSecurityServiceEnum.VALUESET_BINDER, RestfulSecurityServiceEnum.SMART_ON_FHIR); boundCodeableConceptDt.setText("OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)"); restSecurity.getService().add(boundCodeableConceptDt); } return conformance; } }