Package ca.uhn.fhir.model.dstu.resource.Conformance

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.RestQuery


          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
          }

          for (SearchParameter nextParameter : searchParameters) {

            String nextParamName = nextParameter.getName();
            String chain = null;
            if (nextParamName.contains(".")) {
              chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
              nextParamName = nextParamName.substring(0, nextParamName.indexOf('.'));
            }

            String nextParamDescription = nextParameter.getDescription();

            /*
             * If the parameter has no description, default to the one from the resource
             */
            if (StringUtils.isBlank(nextParamDescription)) {
              RuntimeSearchParam paramDef = def.getSearchParam(nextParamName);
              if (paramDef != null) {
                nextParamDescription = paramDef.getDescription();
              }
            }

            RestResourceSearchParam param;
            if (query == null) {
              param = resource.addSearchParam();
            } else {
              param = query.addParameter();
              param.addUndeclaredExtension(false, ExtensionConstants.PARAM_IS_REQUIRED, new BooleanDt(nextParameter.isRequired()));
            }

            param.setName(nextParamName);
            if (StringUtils.isNotBlank(chain)) {
View Full Code Here


          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
          }

          for (SearchParameter nextParameter : searchParameters) {

            String nextParamName = nextParameter.getName();

//            String chain = null;
            String nextParamUnchainedName = nextParamName;
            if (nextParamName.contains(".")) {
//              chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
              nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.'));
            }

            String nextParamDescription = nextParameter.getDescription();

            /*
             * If the parameter has no description, default to the one from the resource
             */
            if (StringUtils.isBlank(nextParamDescription)) {
              RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName);
              if (paramDef != null) {
                nextParamDescription = paramDef.getDescription();
              }
            }

            RestResourceSearchParam param;
            if (query == null) {
              param = resource.addSearchParam();
            } else {
              param = query.addParameter();
              param.addUndeclaredExtension(false, ExtensionConstants.PARAM_IS_REQUIRED, new BooleanDt(nextParameter.isRequired()));
            }

            param.setName(nextParamName);
//            if (StringUtils.isNotBlank(chain)) {
View Full Code Here

          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
          }

          for (SearchParameter nextParameter : searchParameters) {

            String nextParamName = nextParameter.getName();

//            String chain = null;
            String nextParamUnchainedName = nextParamName;
            if (nextParamName.contains(".")) {
//              chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
              nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.'));
            }

            String nextParamDescription = nextParameter.getDescription();

            /*
             * If the parameter has no description, default to the one from the resource
             */
            if (StringUtils.isBlank(nextParamDescription)) {
              RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName);
              if (paramDef != null) {
                nextParamDescription = paramDef.getDescription();
              }
            }

            RestResourceSearchParam param;
            if (query == null) {
              param = resource.addSearchParam();
            } else {
              param = query.addParameter();
              param.addUndeclaredExtension(false, ExtensionConstants.PARAM_IS_REQUIRED, new BooleanDt(nextParameter.isRequired()));
            }

            param.setName(nextParamName);
//            if (StringUtils.isNotBlank(chain)) {
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.dstu.resource.Conformance.RestQuery

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.