Skip to content

Commit 27457f5

Browse files
committed
Replace invalid ValueSet with valid value
1 parent fbc1f17 commit 27457f5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
public class EhrResendController {
3131

3232
private static final String OPERATION_OUTCOME_URL = "https://fhir.nhs.uk/STU3/StructureDefinition/GPConnect-OperationOutcome-1";
33-
private static final String CONFLICT = "CONFLICT";
33+
private static final String PRECONDITION_FAILED = "PRECONDITION_FAILED";
3434
private static final String INVALID_IDENTIFIER_VALUE = "INVALID_IDENTIFIER_VALUE";
3535

3636
private EhrExtractStatusRepository ehrExtractStatusRepository;
@@ -58,7 +58,7 @@ public ResponseEntity<String> scheduleEhrExtractResend(@PathVariable String conv
5858

5959
if (hasNoErrorsInEhrReceivedAcknowledgement(ehrExtractStatus) && ehrExtractStatus.getError() == null) {
6060

61-
var details = getCodeableConcept(CONFLICT);
61+
var details = getCodeableConcept(PRECONDITION_FAILED);
6262
var diagnostics = "The current resend operation is still in progress. Please wait for it to complete before retrying";
6363
var operationOutcome = createOperationOutcome(OperationOutcome.IssueType.BUSINESSRULE,
6464
OperationOutcome.IssueSeverity.ERROR,
@@ -78,7 +78,7 @@ public ResponseEntity<String> scheduleEhrExtractResend(@PathVariable String conv
7878

7979
private static CodeableConcept getCodeableConcept(String codeableConceptCode) {
8080
return new CodeableConcept().addCoding(
81-
new Coding("http://fhir.nhs.net/ValueSet/gpconnect-error-or-warning-code-1", codeableConceptCode, null));
81+
new Coding("https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1", codeableConceptCode, null));
8282
}
8383

8484
private static boolean hasNoErrorsInEhrReceivedAcknowledgement(EhrExtractStatus ehrExtractStatus) {

service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class EhrResendControllerTest {
4646
private static final String FROM_ASID_CODE = "test-from-asid";
4747
private static final String INCUMBENT_NACK_CODE = "99";
4848
private static final String INCUMBENT_NACK_DISPLAY = "Unexpected condition.";
49-
private static final String CONFLICT = "CONFLICT";
50-
private static final String GPCONNECT_ERROR_OR_WARNING_CODE = "http://fhir.nhs.net/ValueSet/gpconnect-error-or-warning-code-1";
49+
private static final String PRECONDITION_FAILED = "PRECONDITION_FAILED";
50+
private static final String GPCONNECT_ERROR_OR_WARNING_CODE = "https://fhir.nhs.uk/STU3/ValueSet/Spine-ErrorOrWarningCode-1";
5151
private static final String INVALID_IDENTIFIER_VALUE = "INVALID_IDENTIFIER_VALUE";
5252
public static final String ISSUE_CODE_VALUE = "value";
5353
public static final String ISSUE_CODE_BUSINESS_RULE = "business-rule";
@@ -129,7 +129,7 @@ void When_AnEhrExtractHasFailed_Expect_GetGpcStructuredTaskScheduledAndEhrExtrac
129129
}
130130

131131
@Test
132-
void When_AnEhrExtractHasNotFailedAndAnotherResendRequestArrives_Expect_FailedOperationOutcome() throws JsonProcessingException {
132+
void When_AnEhrExtractIsStillInProgress_Expect_FailedOperationOutcome() throws JsonProcessingException {
133133

134134
final EhrExtractStatus IN_PROGRESS_EXTRACT_STATUS = EhrExtractStatus.builder()
135135
.conversationId(CONVERSATION_ID)
@@ -145,7 +145,7 @@ void When_AnEhrExtractHasNotFailedAndAnotherResendRequestArrives_Expect_FailedOp
145145
JsonNode rootNode = objectMapper.readTree(response.getBody());
146146

147147
assertAll(
148-
() -> assertResponseHasExpectedOperationOutcome(rootNode, CONFLICT, DIAGNOSTICS_MSG, ISSUE_CODE_BUSINESS_RULE),
148+
() -> assertResponseHasExpectedOperationOutcome(rootNode, PRECONDITION_FAILED, DIAGNOSTICS_MSG, ISSUE_CODE_BUSINESS_RULE),
149149
() -> assertEquals(HttpStatus.CONFLICT, response.getStatusCode())
150150
);
151151
}
@@ -181,7 +181,7 @@ void When_AnEhrExtractHasFailed_Expect_RespondsWith202() {
181181
}
182182

183183
@Test
184-
void When_AnEhrExtractHasNotFailed_Expect_RespondsWith403() throws JsonProcessingException {
184+
void When_AnEhrExtractHasAPositiveAcknowledgement_Expect_FailedOperationOutcome() throws JsonProcessingException {
185185

186186
String ehrMessageRef = generateRandomUppercaseUUID();
187187
var ehrExtractStatus = new EhrExtractStatus();
@@ -202,7 +202,7 @@ void When_AnEhrExtractHasNotFailed_Expect_RespondsWith403() throws JsonProcessin
202202
JsonNode rootNode = objectMapper.readTree(response.getBody());
203203

204204
assertAll(
205-
() -> assertResponseHasExpectedOperationOutcome(rootNode, CONFLICT, DIAGNOSTICS_MSG, ISSUE_CODE_BUSINESS_RULE),
205+
() -> assertResponseHasExpectedOperationOutcome(rootNode, PRECONDITION_FAILED, DIAGNOSTICS_MSG, ISSUE_CODE_BUSINESS_RULE),
206206
() -> assertEquals(HttpStatus.CONFLICT, response.getStatusCode())
207207
);
208208
}

0 commit comments

Comments
 (0)