001package org.hl7.fhir.r4.hapi.rest.server.helper;
002
003import ca.uhn.fhir.rest.server.provider.ProviderConstants;
004import org.hl7.fhir.r4.model.DecimalType;
005import org.hl7.fhir.r4.model.Parameters;
006import org.hl7.fhir.r4.model.StringType;
007
008import javax.annotation.Nonnull;
009
010public class BatchHelperR4 {
011
012  @Nonnull
013  public static Long jobIdFromParameters(Parameters response) {
014    DecimalType jobIdDecimal = (DecimalType) response.getParameter(ProviderConstants.OPERATION_BATCH_RESPONSE_JOB_ID);
015    return jobIdDecimal.getValue().longValue();
016  }
017
018  @Nonnull
019  public static String jobIdFromBatch2Parameters(Parameters response) {
020    StringType jobIdString = (StringType) response.getParameter(ProviderConstants.OPERATION_BATCH_RESPONSE_JOB_ID);
021    return jobIdString.getValue();
022  }
023}