Create endpoint for resending an EhrExtract#990
Conversation
f2d4dd5 to
24da3bb
Compare
…quest to resend has arrived
| 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.
really we should be using assertJ here for readability (assertThat(code).isEqualTo(INVALID_IDENTIFIER_VALUE))
There was a problem hiding this comment.
For me it is the other way around, I find "assertEquals" to be short, clean and readable.
|
|
||
| var response = ehrResendController.scheduleEhrExtractResend(CONVERSATION_ID); | ||
|
|
||
| JsonNode rootNode = objectMapper.readTree(response.getBody()); |
There was a problem hiding this comment.
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.
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.
|
|
||
| var response = ehrResendController.scheduleEhrExtractResend(CONVERSATION_ID); | ||
|
|
||
| JsonNode rootNode = objectMapper.readTree(response.getBody()); |
There was a problem hiding this comment.
again, not sure why it is being done this way as not as a concrete type
MartinWheelerMT
left a comment
There was a problem hiding this comment.
Please see the comments left
| 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.
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. |
|



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: