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 =
015                                (DecimalType) response.getParameterValue(ProviderConstants.OPERATION_BATCH_RESPONSE_JOB_ID);
016                return jobIdDecimal.getValue().longValue();
017        }
018
019        @Nonnull
020        public static String jobIdFromBatch2Parameters(Parameters response) {
021                StringType jobIdString =
022                                (StringType) response.getParameterValue(ProviderConstants.OPERATION_BATCH_RESPONSE_JOB_ID);
023                return jobIdString.getValue();
024        }
025}