Package ca.uhn.fhir.rest.api

Examples of ca.uhn.fhir.rest.api.SortSpec


public class SortParameter implements IParameter {

  @Override
  public void translateClientArgumentIntoQueryArgument(FhirContext theContext, Object theSourceClientArgument, Map<String, List<String>> theTargetQueryArguments, BaseHttpClientInvocation theClientInvocation) throws InternalErrorException {
    SortSpec ss = (SortSpec) theSourceClientArgument;
    while (ss != null) {
      String name;
      if (ss.getOrder() == null) {
        name = Constants.PARAM_SORT;
      } else if (ss.getOrder() == SortOrderEnum.ASC) {
        name = Constants.PARAM_SORT_ASC;
      } else {
        name = Constants.PARAM_SORT_DESC;
      }

      if (ss.getParamName() != null) {
        if (!theTargetQueryArguments.containsKey(name)) {
          theTargetQueryArguments.put(name, new ArrayList<String>());
        }
        theTargetQueryArguments.get(name).add(ss.getParamName());
      }
      ss = ss.getChain();
    }
  }
View Full Code Here


          return null;
        }
      }
    }

    SortSpec outerSpec = null;
    SortSpec innerSpec = null;
    for (String nextParamName : theRequest.getParameters().keySet()) {
      SortOrderEnum order;
      if (Constants.PARAM_SORT.equals(nextParamName)) {
        order = null;
      } else if (Constants.PARAM_SORT_ASC.equals(nextParamName)) {
        order = SortOrderEnum.ASC;
      } else if (Constants.PARAM_SORT_DESC.equals(nextParamName)) {
        order = SortOrderEnum.DESC;
      } else {
        continue;
      }

      String[] values = theRequest.getParameters().get(nextParamName);
      if (values != null) {
        for (String nextValue : values) {
          if (isNotBlank(nextValue)) {
            SortSpec spec = new SortSpec();
            spec.setOrder(order);
            spec.setParamName(nextValue);
            if (innerSpec == null) {
              outerSpec = spec;
              innerSpec = spec;
            } else {
              innerSpec.setChain(spec);
View Full Code Here

public class SortParameter implements IParameter {

  @Override
  public void translateClientArgumentIntoQueryArgument(FhirContext theContext, Object theSourceClientArgument, Map<String, List<String>> theTargetQueryArguments, BaseHttpClientInvocation theClientInvocation) throws InternalErrorException {
    SortSpec ss = (SortSpec) theSourceClientArgument;
    while (ss != null) {
      String name;
      if (ss.getOrder() == null) {
        name = Constants.PARAM_SORT;
      } else if (ss.getOrder() == SortOrderEnum.ASC) {
        name = Constants.PARAM_SORT_ASC;
      } else {
        name = Constants.PARAM_SORT_DESC;
      }

      if (ss.getParamName() != null) {
        if (!theTargetQueryArguments.containsKey(name)) {
          theTargetQueryArguments.put(name, new ArrayList<String>());
        }
        theTargetQueryArguments.get(name).add(ss.getParamName());
      }
      ss = ss.getChain();
    }
  }
View Full Code Here

          return null;
        }
      }
    }

    SortSpec outerSpec = null;
    SortSpec innerSpec = null;
    for (String nextParamName : theRequest.getParameters().keySet()) {
      SortOrderEnum order;
      if (Constants.PARAM_SORT.equals(nextParamName)) {
        order = null;
      } else if (Constants.PARAM_SORT_ASC.equals(nextParamName)) {
        order = SortOrderEnum.ASC;
      } else if (Constants.PARAM_SORT_DESC.equals(nextParamName)) {
        order = SortOrderEnum.DESC;
      } else {
        continue;
      }

      String[] values = theRequest.getParameters().get(nextParamName);
      if (values != null) {
        for (String nextValue : values) {
          if (isNotBlank(nextValue)) {
            SortSpec spec = new SortSpec();
            spec.setOrder(order);
            spec.setParamName(nextValue);
            if (innerSpec == null) {
              outerSpec = spec;
              innerSpec = spec;
            } else {
              innerSpec.setChain(spec);
View Full Code Here

public class SortParameter implements IParameter {

  @Override
  public void translateClientArgumentIntoQueryArgument(Object theSourceClientArgument, Map<String, List<String>> theTargetQueryArguments, BaseClientInvocation theClientInvocation) throws InternalErrorException {
    SortSpec ss = (SortSpec) theSourceClientArgument;
    if (ss ==null) {
      return;
    }
    String name;
    if (ss.getOrder()==null) {
      name = Constants.PARAM_SORT;
    }else if (ss.getOrder() == SortOrderEnum.ASC) {
      name = Constants.PARAM_SORT_ASC;
    }else {
      name = Constants.PARAM_SORT_DESC;
    }
   
    if (ss.getFieldName() != null) {
      if (!theTargetQueryArguments.containsKey(name)) {
        // TODO: implement
      }
    }
   
View Full Code Here

public class SortParameter implements IParameter {

  @Override
  public void translateClientArgumentIntoQueryArgument(FhirContext theContext, Object theSourceClientArgument, Map<String, List<String>> theTargetQueryArguments, BaseHttpClientInvocation theClientInvocation) throws InternalErrorException {
    SortSpec ss = (SortSpec) theSourceClientArgument;
    while (ss != null) {
      String name;
      if (ss.getOrder() == null) {
        name = Constants.PARAM_SORT;
      } else if (ss.getOrder() == SortOrderEnum.ASC) {
        name = Constants.PARAM_SORT_ASC;
      } else {
        name = Constants.PARAM_SORT_DESC;
      }

      if (ss.getParamName() != null) {
        if (!theTargetQueryArguments.containsKey(name)) {
          theTargetQueryArguments.put(name, new ArrayList<String>());
        }
        theTargetQueryArguments.get(name).add(ss.getParamName());
      }
      ss = ss.getChain();
    }
  }
View Full Code Here

          return null;
        }
      }
    }

    SortSpec outerSpec = null;
    SortSpec innerSpec = null;
    for (String nextParamName : theRequest.getParameters().keySet()) {
      SortOrderEnum order;
      if (Constants.PARAM_SORT.equals(nextParamName)) {
        order = null;
      } else if (Constants.PARAM_SORT_ASC.equals(nextParamName)) {
        order = SortOrderEnum.ASC;
      } else if (Constants.PARAM_SORT_DESC.equals(nextParamName)) {
        order = SortOrderEnum.DESC;
      } else {
        continue;
      }

      String[] values = theRequest.getParameters().get(nextParamName);
      if (values != null) {
        for (String nextValue : values) {
          if (isNotBlank(nextValue)) {
            SortSpec spec = new SortSpec();
            spec.setOrder(order);
            spec.setParamName(nextValue);
            if (innerSpec == null) {
              outerSpec = spec;
              innerSpec = spec;
            } else {
              innerSpec.setChain(spec);
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.rest.api.SortSpec

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.