-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create endpoint for resending an EhrExtract #990
Conversation
f2d4dd5
to
24da3bb
Compare
…quest to resend has arrived
service/src/main/java/uk/nhs/adaptors/gp2gp/common/service/FhirParseService.java
Show resolved
Hide resolved
service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendController.java
Outdated
Show resolved
Hide resolved
service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendController.java
Outdated
Show resolved
Hide resolved
service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendController.java
Outdated
Show resolved
Hide resolved
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Outdated
Show resolved
Hide resolved
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Outdated
Show resolved
Hide resolved
String operationOutcomeUrl = rootNode.path("meta").path("profile").get(0).asText(); | ||
|
||
assertEquals(INVALID_IDENTIFIER_VALUE, code); | ||
assertEquals(OPERATION_OUTCOME_URL, operationOutcomeUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really we should be using assertJ here for readability (assertThat(code).isEqualTo(INVALID_IDENTIFIER_VALUE))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it is the other way around, I find "assertEquals" to be short, clean and readable.
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Outdated
Show resolved
Hide resolved
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Show resolved
Hide resolved
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Outdated
Show resolved
Hide resolved
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Outdated
Show resolved
Hide resolved
|
||
var response = ehrResendController.scheduleEhrExtractResend(CONVERSATION_ID); | ||
|
||
JsonNode rootNode = objectMapper.readTree(response.getBody()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really not sure what is going on with this? Why are we using a JsonTree and navigating it, rather than just reading the value into an object? The rootNode makes it a whole less readable
var operationOutcome = objectMapper.readValue(response.getBody(), OperationOutcome.class);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose to work with JSON and assess via the prism of JSON as it is what we get in the end when "scheduleEhrExtractResend" returns a result.
They are all comparable technique (assessing JSON or operationOutcome object), just thought it would be more concise to do it that way via JSON because before I had to create an expected boilerplate operationOutcome objects etc.
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Outdated
Show resolved
Hide resolved
service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendControllerTest.java
Outdated
Show resolved
Hide resolved
|
||
var response = ehrResendController.scheduleEhrExtractResend(CONVERSATION_ID); | ||
|
||
JsonNode rootNode = objectMapper.readTree(response.getBody()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, not sure why it is being done this way as not as a concrete type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the comments left
service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendController.java
Outdated
Show resolved
Hide resolved
service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendController.java
Outdated
Show resolved
Hide resolved
service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/EhrResendController.java
Outdated
Show resolved
Hide resolved
new Coding("http://fhir.nhs.net/ValueSet/gpconnect-error-or-warning-code-1", codeableConceptCode, null)); | ||
} | ||
|
||
private static boolean hasNoErrorsInEhrReceivedAcknowledgement(EhrExtractStatus ehrExtractStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, but this doesn't really feel like it belongs in the Controller. Can refactor this in a later PR though.
This will remain as the original incoming request time, so that the NME has a record of when the original EHRRequest arrived.
Paired with @ole4ryb reviewing this change, and we're both happy with this change. |
Quality Gate passedIssues Measures |
What
Please include a summary of the changes and the related issue
Why
Please include details of the reasoning for these changes
Type of change
Please delete options that are not relevant.
Checklist: