001package org.hl7.fhir.r4.hapi.rest.server.helper;
002
003import ca.uhn.fhir.rest.server.provider.ProviderConstants;
004import jakarta.annotation.Nonnull;
005import org.hl7.fhir.r4.model.DecimalType;
006import org.hl7.fhir.r4.model.Parameters;
007import org.hl7.fhir.r4.model.StringType;
008
009public class BatchHelperR4 {
010
011        @Nonnull
012        public static Long jobIdFromParameters(Parameters response) {
013                DecimalType jobIdDecimal =
014                                (DecimalType) response.getParameterValue(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 =
021                                (StringType) response.getParameterValue(ProviderConstants.OPERATION_BATCH_RESPONSE_JOB_ID);
022                return jobIdString.getValue();
023        }
024}