rawFilterPatientsByWithHttpInfo method

Future<Response> rawFilterPatientsByWithHttpInfo(
  1. FilterChain<PatientDto> filterChainPatient, {
  2. String? startKey,
  3. String? startDocumentId,
  4. int? limit,
  5. int? skip,
  6. String? sort,
  7. bool? desc,
})

Filter patients for the current user (HcParty)

Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.

Note: This method returns the HTTP Response.

Parameters:

  • FilterChain<PatientDto> filterChainPatient (required):

  • String startKey: The start key for pagination, depends on the filters used

  • String startDocumentId: A patient document ID

  • int limit: Number of rows

  • int skip: Skip rows

  • String sort: Sort key

  • bool desc: Descending

Implementation

Future<Response> rawFilterPatientsByWithHttpInfo(FilterChain<PatientDto> filterChainPatient, { String? startKey, String? startDocumentId, int? limit, int? skip, String? sort, bool? desc, }) async {
  // ignore: prefer_const_declarations
  final path = r'/rest/v1/patient/filter';

  // ignore: prefer_final_locals
  Object? postBody = filterChainPatient;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (startKey != null) {
    queryParams.addAll(_queryParams('', 'startKey', startKey));
  }
  if (startDocumentId != null) {
    queryParams.addAll(_queryParams('', 'startDocumentId', startDocumentId));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (skip != null) {
    queryParams.addAll(_queryParams('', 'skip', skip));
  }
  if (sort != null) {
    queryParams.addAll(_queryParams('', 'sort', sort));
  }
  if (desc != null) {
    queryParams.addAll(_queryParams('', 'desc', desc));
  }

  const authNames = <String>[r'basicSchema'];
  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    authNames,
  );
}