Package ca.uhn.fhir.model.api

Examples of ca.uhn.fhir.model.api.ExtensionDt


  @Override
  public IMutator getMutator() {
    return new IMutator() {
      @Override
      public void addValue(Object theTarget, IElement theValue) {
        ExtensionDt target = (ExtensionDt) theTarget;
        if (theValue instanceof IDatatype) {
          target.setValue((IDatatype) theTarget);
        } else {
          target.getUndeclaredExtensions().add((ExtensionDt) theValue);
        }
      }
    };
  }
View Full Code Here


     * <b>Definition:</b>
     *
     * </p>
   */
  public ExtensionDt addParameter() {
    ExtensionDt newType = new ExtensionDt();
    getParameter().add(newType);
    return newType;
  }
View Full Code Here

     * <b>Definition:</b>
     *
     * </p>
   */
  public ExtensionDt addParameter() {
    ExtensionDt newType = new ExtensionDt();
    getParameter().add(newType);
    return newType;
  }
View Full Code Here

     * <b>Definition:</b>
     *
     * </p>
   */
  public ExtensionDt addFirst() {
    ExtensionDt newType = new ExtensionDt();
    getFirst().add(newType);
    return newType;
  }
View Full Code Here

     * <b>Definition:</b>
     *
     * </p>
   */
  public ExtensionDt addPrevious() {
    ExtensionDt newType = new ExtensionDt();
    getPrevious().add(newType);
    return newType;
  }
View Full Code Here

     * <b>Definition:</b>
     *
     * </p>
   */
  public ExtensionDt addNext() {
    ExtensionDt newType = new ExtensionDt();
    getNext().add(newType);
    return newType;
  }
View Full Code Here

     * <b>Definition:</b>
     *
     * </p>
   */
  public ExtensionDt addLast() {
    ExtensionDt newType = new ExtensionDt();
    getLast().add(newType);
    return newType;
  }
View Full Code Here

     * Default implementation just handles undeclared extensions
     */
    @SuppressWarnings("unused")
    public void enteringNewElementExtension(StartElement theElement, String theUrlAttr, boolean theIsModifier) {
      if (myPreResourceState != null && getCurrentElement() instanceof ISupportsUndeclaredExtensions) {
        ExtensionDt newExtension = new ExtensionDt(theIsModifier, theUrlAttr);
        ISupportsUndeclaredExtensions elem = (ISupportsUndeclaredExtensions) getCurrentElement();
        elem.addUndeclaredExtension(newExtension);
        ExtensionState newState = new ExtensionState(myPreResourceState, newExtension);
        push(newState);
      } else {
View Full Code Here

          List<IParameter> params = ((SearchMethodBinding) nextMethodBinding).getParameters();
          // TODO: this would probably work best if we sorted these by
          // required first, then optional

          RestResourceSearchParam searchParam = null;
          ExtensionDt searchParamChain = null;
          for (IParameter nextParameterObj : params) {
            if (!(nextParameterObj instanceof SearchParameter)) {
              continue;
            }

            SearchParameter nextParameter = (SearchParameter) nextParameterObj;

            if (searchParam == null) {
              if (!nameToSearchParam.containsKey(nextParameter.getName())) {
                RestResourceSearchParam param = resource.addSearchParam();
                param.setName(nextParameter.getName());
                param.setDocumentation(nextParameter.getDescription());
                param.setType(nextParameter.getParamType());
                searchParam = param;
              } else {
                searchParam = nameToSearchParam.get(nextParameter.getName());
              }

              if (searchParam != null) {
                searchParam.setType(nextParameter.getParamType());
              }

            } else {

              searchParamChain = searchParam.addUndeclaredExtension(false, ExtensionConstants.CONF_ADDITIONAL_PARAM);
             
//              if (searchParamChain == null) {
//              } else {
//                searchParamChain = searchParamChain.addUndeclaredExtension(false, ExtensionConstants.CONF_ADDITIONAL_PARAM);
//              }

              ExtensionDt ext = new ExtensionDt();
              ext.setUrl(ExtensionConstants.CONF_ADDITIONAL_PARAM_NAME);
              ext.setValue(new StringDt(nextParameter.getName()));
              searchParamChain.getUndeclaredExtensions().add(ext);

              ext = new ExtensionDt();
              ext.setUrl(ExtensionConstants.CONF_ADDITIONAL_PARAM_DESCRIPTION);
              ext.setValue(new StringDt(nextParameter.getDescription()));
              searchParamChain.getUndeclaredExtensions().add(ext);

              ext = new ExtensionDt();
              ext.setUrl(ExtensionConstants.CONF_ADDITIONAL_PARAM_TYPE);
              if (nextParameter.getParamType() != null) {
                ext.setValue(new CodeDt(nextParameter.getParamType().getCode()));
              }
              searchParamChain.getUndeclaredExtensions().add(ext);

              ext = new ExtensionDt();
              ext.setUrl(ExtensionConstants.CONF_ADDITIONAL_PARAM_REQUIRED);
              ext.setValue(new BooleanDt(nextParameter.isRequired()));
              searchParamChain.getUndeclaredExtensions().add(ext);

            }

          }
View Full Code Here

     * <b>Definition:</b>
     *
     * </p>
   */
  public ExtensionDt addParameter() {
    ExtensionDt newType = new ExtensionDt();
    getParameter().add(newType);
    return newType;
  }
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.api.ExtensionDt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.