Skip to content

Commit 830622d

Browse files
committed
small refactoring and adding logging to indicate a resend
1 parent 7a4ab0e commit 830622d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendController.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package uk.nhs.adaptors.gp2gp.ehr;
22

33
import lombok.AllArgsConstructor;
4+
import lombok.extern.slf4j.Slf4j;
45
import org.hl7.fhir.dstu3.model.CodeableConcept;
56
import org.hl7.fhir.dstu3.model.Coding;
67
import org.hl7.fhir.dstu3.model.Meta;
@@ -22,6 +23,7 @@
2223
import java.util.List;
2324
import java.util.Optional;
2425

26+
@Slf4j
2527
@RestController
2628
@AllArgsConstructor(onConstructor = @__(@Autowired))
2729
@RequestMapping(path = "/ehr-resend")
@@ -53,13 +55,17 @@ public ResponseEntity<OperationOutcome> scheduleEhrExtractResend(@PathVariable S
5355
return new ResponseEntity<>(operationOutcome, HttpStatus.NOT_FOUND);
5456
}
5557

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());
5960

6061
return new ResponseEntity<>(HttpStatus.ACCEPTED);
6162
}
6263

64+
private void createGetGpcStructuredTask(EhrExtractStatus ehrExtractStatus) {
65+
var getGpcStructuredTaskDefinition = GetGpcStructuredTaskDefinition.getGetGpcStructuredTaskDefinition(randomIdGeneratorService,
66+
ehrExtractStatus);
67+
taskDispatcher.createTask(getGpcStructuredTaskDefinition);
68+
}
6369

6470
public static OperationOutcome createOperationOutcome(
6571
OperationOutcome.IssueType type, OperationOutcome.IssueSeverity severity, CodeableConcept details, String diagnostics) {

0 commit comments

Comments
 (0)