How to $export patient data using partition, how to enable partition?

how to $export patient data using partition, how to enable partition

Can you explain further?

Enabled partition and bulk export from application.yaml, Then send request as below

curl --location --request POST 'http://localhost:8888/fhir/DEFAULT/$export' \

--header 'Prefer: respond-async' \

--header 'Content-Type: application/json' \

--data-raw '{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "_outputFormat",
      "valueString": "application/fhir+ndjson"
    },
    {
      "name": "_type",
      "valueString": "Patient"
    },
    {
      "name": "_since",
      "valueInstant": "2019-10-25T11:01:45.660-04:00"
    }
  ]
}

'

In response it shows status code 201, and return an url “http://localhost:8888/fhir/DEFAULT/$export-poll-status?_jobId=ff6452c6-6575-4ddc-b6ec-c290d5927013
And getting 500 server error while sending request to the above url, with response as below
"ca.uhn.fhir.rest.server.exceptions.InternalErrorException: No interceptor provided a value for pointcut: STORAGE_PARTITION_IDENTIFY_CREATE\r\n\tat ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.validateRequestPartitionNotNull(RequestPartitionHelperSvc.java:285)\r\n\tat ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.validateSinglePartitionForCreate(RequestPartitionHelperSvc.java:263)\r\n\tat ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.determineCreatePartitionForRequest(RequestPartitionHe"

And it throw below exception inside console

2021-03-30 13:09:34.910 [JobLauncher-1] ERROR o.s.batch.core.step.AbstractStep [AbstractStep.java:237] Encountered an error executing step bulkExportGenerateResourceFilesStep in job bulkExportJob
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: No interceptor provided a value for pointcut: STORAGE_PARTITION_IDENTIFY_CREATE
	at ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.validateRequestPartitionNotNull(RequestPartitionHelperSvc.java:285)
	at ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.validateSinglePartitionForCreate(RequestPartitionHelperSvc.java:263)
	at ca.uhn.fhir.jpa.partition.RequestPartitionHelperSvc.determineCreatePartitionForRequest(RequestPartitionHelperSvc.java:144)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.doCreateForPost(BaseHapiFhirResourceDao.java:251)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.lambda$create$0(BaseHapiFhirResourceDao.java:224)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
	at ca.uhn.fhir.jpa.dao.tx.HapiTransactionService.execute(HapiTransactionService.java:65)
	at ca.uhn.fhir.jpa.dao.tx.HapiTransactionService.execute(HapiTransactionService.java:56)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.create(BaseHapiFhirResourceDao.java:224)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.create(BaseHapiFhirResourceDao.java:204)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at com.sun.proxy.$Proxy249.create(Unknown Source)
	at ca.uhn.fhir.jpa.bulk.job.ResourceToFileWriter.createBinaryFromOutputStream(ResourceToFileWriter.java:104)
	at ca.uhn.fhir.jpa.bulk.job.ResourceToFileWriter.flushToFiles(ResourceToFileWriter.java:85)
	at ca.uhn.fhir.jpa.bulk.job.ResourceToFileWriter.write(ResourceToFileWriter.java:125)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:137)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at com.sun.proxy.$Proxy236.write(Unknown Source)
	at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:193)
	at org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:159)
	at org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:294)
	at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:217)
	at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:77)
	at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:407)
	at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:331)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
	at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273)
	at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)
	at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375)
	at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
	at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145)
	at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258)
	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
	at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:138)
	at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler$1.call(TaskExecutorPartitionHandler.java:135)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
	at org.springframework.batch.core.partition.support.TaskExecutorPartitionHandler.doHandle(TaskExecutorPartitionHandler.java:103)
	at org.springframework.batch.core.partition.support.AbstractPartitionHandler.handle(AbstractPartitionHandler.java:61)
	at org.springframework.batch.core.partition.support.PartitionStep.doExecute(PartitionStep.java:106)
	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
	at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
	at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:410)
	at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:136)
	at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:319)
	at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:147)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
2021-03-30 13:09:34.921 [JobLauncher-1] INFO  c.u.f.jpa.bulk.svc.BulkExportDaoSvc [BulkExportDaoSvc.java:99] Setting job with UUID ff6452c6-6575-4ddc-b6ec-c290d5927013 to ERROR
2021-03-30 13:09:34.942 [JobLauncher-1] INFO  o.s.batch.core.step.AbstractStep [AbstractStep.java:272] Step: [bulkExportGenerateResourceFilesStep:Patient] executed in 452ms
2021-03-30 13:09:34.946 [JobLauncher-1] ERROR o.s.batch.core.step.AbstractStep [AbstractStep.java:237] Encountered an error executing step partitionStep in job bulkExportJob
org.springframework.batch.core.JobExecutionException: Partition handler returned an unsuccessful step
	at org.springframework.batch.core.partition.support.PartitionStep.doExecute(PartitionStep.java:112)
	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
	at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
	at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:410)
	at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:136)
	at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:319)
	at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:147)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)]

Hi @rahul_thoughti

Per your post in the HAPI-FHIR google group, “Unfortunately bulk export is not yet supported in partitioned servers…it’s definitely planned, but not yet scheduled.”

https://groups.google.com/g/hapi-fhir/c/WtrbVWGy_ms