forked from hapifhir/hapi-fhir-jpaserver-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into rel_7_1_tracking
- Loading branch information
Showing
11 changed files
with
132 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '30 1 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v9 | ||
with: | ||
stale-issue-message: 'This issue is stale because it has been open 730 days with no activity. Remove stale label or comment or this will be closed in 5 days.' | ||
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.' | ||
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' | ||
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.' | ||
days-before-issue-stale: 730 | ||
days-before-pr-stale: 45 | ||
days-before-issue-close: 5 | ||
days-before-pr-close: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dependencies: | ||
- name: postgresql | ||
repository: oci:https://registry-1.docker.io/bitnamicharts | ||
version: 13.2.27 | ||
digest: sha256:6374f6f32d32adbe6763c48e2d817d85ec20a1784b2aea1fb0312c658f8e58e9 | ||
generated: "2024-01-10T17:56:36.521957926+01:00" | ||
version: 14.3.1 | ||
digest: sha256:fb1d56a00b544bb2ad5691553cadf6384f499652acb9ff5ad625ef36a1b8979e | ||
generated: "2024-03-10T14:43:22.395381351+01:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/ca/uhn/fhir/jpa/starter/web/JobController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package ca.uhn.fhir.jpa.starter.web; | ||
|
||
import ca.uhn.fhir.batch2.api.IJobCoordinator; | ||
import ca.uhn.fhir.batch2.api.JobOperationResultJson; | ||
import ca.uhn.fhir.batch2.model.JobInstance; | ||
import ca.uhn.fhir.batch2.model.StatusEnum; | ||
import ca.uhn.fhir.batch2.models.JobInstanceFetchRequest; | ||
import jakarta.validation.constraints.Min; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("control") | ||
public class JobController { | ||
private final IJobCoordinator theJobCoordinator; | ||
|
||
public JobController(IJobCoordinator theJobCoordinator) { | ||
this.theJobCoordinator = theJobCoordinator; | ||
} | ||
|
||
@RequestMapping(value = JobController.JOBS, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) | ||
public List<JobInstance> getAllJobs(@RequestParam(name = "pageStart") @Min(0) int pageStart, @RequestParam(name = "batchSize") int batchSize, @RequestParam(name = "jobStatus", required = false) StatusEnum jobStatus) { | ||
JobInstanceFetchRequest jobInstanceFetchRequest = new JobInstanceFetchRequest(); | ||
jobInstanceFetchRequest.setPageStart(pageStart); | ||
jobInstanceFetchRequest.setBatchSize(batchSize); | ||
jobInstanceFetchRequest.setJobStatus(jobStatus != null ? jobStatus.toString() : ""); | ||
jobInstanceFetchRequest.setSort(Sort.by(Sort.Direction.DESC, JobController.MY_CREATE_TIME)); | ||
|
||
return theJobCoordinator.fetchAllJobInstances(jobInstanceFetchRequest).getContent(); | ||
} | ||
|
||
@RequestMapping(value = JobController.JOBS, method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) | ||
public JobOperationResultJson cancelInstance(@RequestParam(name = "instanceId") String instanceId) { | ||
return theJobCoordinator.cancelInstance(instanceId); | ||
} | ||
|
||
public static final String JOBS = "jobs"; | ||
public static final String MY_CREATE_TIME = "myCreateTime"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters