|
1 | 1 | package uk.nhs.adaptors.gp2gp.ehr; |
2 | 2 |
|
3 | 3 | import lombok.AllArgsConstructor; |
| 4 | +import lombok.extern.slf4j.Slf4j; |
4 | 5 | import org.hl7.fhir.dstu3.model.CodeableConcept; |
5 | 6 | import org.hl7.fhir.dstu3.model.Coding; |
6 | 7 | import org.hl7.fhir.dstu3.model.Meta; |
|
22 | 23 | import java.util.List; |
23 | 24 | import java.util.Optional; |
24 | 25 |
|
| 26 | +@Slf4j |
25 | 27 | @RestController |
26 | 28 | @AllArgsConstructor(onConstructor = @__(@Autowired)) |
27 | 29 | @RequestMapping(path = "/ehr-resend") |
@@ -53,13 +55,17 @@ public ResponseEntity<OperationOutcome> scheduleEhrExtractResend(@PathVariable S |
53 | 55 | return new ResponseEntity<>(operationOutcome, HttpStatus.NOT_FOUND); |
54 | 56 | } |
55 | 57 |
|
56 | | - var taskDefinition = GetGpcStructuredTaskDefinition.getGetGpcStructuredTaskDefinition(randomIdGeneratorService, |
57 | | - ehrExtractStatus.get()); |
58 | | - taskDispatcher.createTask(taskDefinition); |
| 58 | + LOGGER.info("Creating tasks to start the EHR Extract process resend"); |
| 59 | + createGetGpcStructuredTask(ehrExtractStatus.get()); |
59 | 60 |
|
60 | 61 | return new ResponseEntity<>(HttpStatus.ACCEPTED); |
61 | 62 | } |
62 | 63 |
|
| 64 | + private void createGetGpcStructuredTask(EhrExtractStatus ehrExtractStatus) { |
| 65 | + var getGpcStructuredTaskDefinition = GetGpcStructuredTaskDefinition.getGetGpcStructuredTaskDefinition(randomIdGeneratorService, |
| 66 | + ehrExtractStatus); |
| 67 | + taskDispatcher.createTask(getGpcStructuredTaskDefinition); |
| 68 | + } |
63 | 69 |
|
64 | 70 | public static OperationOutcome createOperationOutcome( |
65 | 71 | OperationOutcome.IssueType type, OperationOutcome.IssueSeverity severity, CodeableConcept details, String diagnostics) { |
|
0 commit comments