-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #267 from nhsconnect/PRMP-534
PRMP-534 ORC IN NACK POC
- Loading branch information
Showing
11 changed files
with
161 additions
and
36 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...ehrtransferservice/exceptions/acknowledgement/NegativeAcknowledgementFailedException.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,14 @@ | ||
package uk.nhs.prm.repo.ehrtransferservice.exceptions.acknowledgement; | ||
|
||
import uk.nhs.prm.repo.ehrtransferservice.exceptions.base.AcknowledgementException; | ||
|
||
import java.util.UUID; | ||
|
||
public class NegativeAcknowledgementFailedException extends AcknowledgementException { | ||
private static final String EXCEPTION_MESSAGE = | ||
"Failed to send a Negative Acknowledgement with error code %s for Inbound Conversation ID %s"; | ||
|
||
public NegativeAcknowledgementFailedException(String errorCode, UUID inboundConversationId, Throwable cause) { | ||
super(EXCEPTION_MESSAGE.formatted(errorCode, inboundConversationId.toString().toUpperCase()), cause); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...epo/ehrtransferservice/gp2gp_message_models/Gp2gpMessengerAcknowledgementRequestBody.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,25 @@ | ||
package uk.nhs.prm.repo.ehrtransferservice.gp2gp_message_models; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Data; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public abstract class Gp2gpMessengerAcknowledgementRequestBody { | ||
protected final String repositoryAsid; | ||
protected final String odsCode; | ||
protected final String conversationId; | ||
protected final String messageId; | ||
|
||
protected Gp2gpMessengerAcknowledgementRequestBody( | ||
@JsonProperty("repositoryAsid") String repositoryAsid, | ||
@JsonProperty("odsCode") String odsCode, | ||
@JsonProperty("conversationId") String conversationId, | ||
@JsonProperty("messageId") String messageId | ||
) { | ||
this.repositoryAsid = repositoryAsid; | ||
this.odsCode = odsCode; | ||
this.conversationId = conversationId; | ||
this.messageId = messageId; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ransferservice/gp2gp_message_models/Gp2gpMessengerNegativeAcknowledgementRequestBody.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,22 @@ | ||
package uk.nhs.prm.repo.ehrtransferservice.gp2gp_message_models; | ||
|
||
import lombok.Getter; | ||
import uk.nhs.prm.repo.ehrtransferservice.models.enums.AcknowledgementErrorCode; | ||
|
||
@Getter | ||
public class Gp2gpMessengerNegativeAcknowledgementRequestBody extends Gp2gpMessengerAcknowledgementRequestBody { | ||
private final String errorCode; | ||
private final String errorDisplayName; | ||
|
||
public Gp2gpMessengerNegativeAcknowledgementRequestBody( | ||
String repositoryAsid, | ||
String odsCode, | ||
String conversationId, | ||
String messageId, | ||
AcknowledgementErrorCode acknowledgementErrorCode | ||
) { | ||
super(repositoryAsid, odsCode, conversationId, messageId); | ||
this.errorCode = acknowledgementErrorCode.errorCode; | ||
this.errorDisplayName = acknowledgementErrorCode.displayName; | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/uk/nhs/prm/repo/ehrtransferservice/models/enums/AcknowledgementErrorCode.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,14 @@ | ||
package uk.nhs.prm.repo.ehrtransferservice.models.enums; | ||
|
||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public enum AcknowledgementErrorCode { | ||
ERROR_CODE_06("06", "Patient not at surgery"), | ||
ERROR_CODE_09("09", "EHR Extract received without corresponding request"), | ||
ERROR_CODE_10("10", "Failed to successfully generate EHR Extract"), | ||
ERROR_CODE_12("12", "Duplicate EHR Extract received"); | ||
|
||
public final String errorCode; | ||
public final String displayName; | ||
} |
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
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