importMedicationSchemeWithHttpInfo method

Future<Response> importMedicationSchemeWithHttpInfo(
  1. String documentId, {
  2. String? documentKey,
  3. bool? dryRun,
  4. String? patientId,
  5. String? language,
  6. Map<String, List<ImportMapping>>? requestBody,
})

Import MedicationScheme into patient(s) using existing document

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> importMedicationSchemeWithHttpInfo(String documentId, { String? documentKey, bool? dryRun, String? patientId, String? language, Map<String, List<ImportMapping>>? requestBody, }) async {
  // ignore: prefer_const_declarations
  final path = r'/rest/v1/be_kmehr/medicationscheme/{documentId}/import'.replaceAll('{documentId}', documentId);

  // ignore: prefer_final_locals
  Object? postBody = requestBody;

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

  if (documentKey != null) {
    queryParams.addAll(_queryParams('', 'documentKey', documentKey));
  }
  if (dryRun != null) {
    queryParams.addAll(_queryParams('', 'dryRun', dryRun));
  }
  if (patientId != null) {
    queryParams.addAll(_queryParams('', 'patientId', patientId));
  }
  if (language != null) {
    queryParams.addAll(_queryParams('', 'language', language));
  }

  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,
  );
}