Skip to content

Commit

Permalink
Merge branch 'main' into diag-report-duplicated-identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWheelerMT authored Apr 19, 2024
2 parents 8472b09 + 09e94a4 commit 1e5a9c5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

* Prevent duplicate `Laboratory` observation categories being added when mapping a `SpecimenCompound`.

## [2.1.0] - 2024-04-17

### Added

* SystmOne send a problem over GP2GP as two `ObservationStatement`s, where one is truncated and one isn't.
Expand Down Expand Up @@ -134,9 +136,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

</details>

* When Filing comment `NarrativeStatements` are located within the `BATTERY` of a `Filed Report` and not located
at `DiagnosticReport` level now creates a new filing comment `Observation` and reference this in the results
of the parent `DiagnosticReport`.
* When a `CommentType: USER COMMENT` `NarrativeStatement` is located within the `BATTERY` of a `Filed Report`,
the adaptor now generates a new [filing comment][filing-comment] `Observation` and [references this][diagnostic-report-result]
in the result property of the parent `DiagnosticReport`.
This change makes the adaptor more closely resemble the GP Connect specification for DiagnosticReport and filing
comments.
The generated `Observation` filing comment will have the `status` of `unknown`.

[filing-comment]: https://developer.nhs.uk/apis/gpconnect-1-6-0/accessrecord_structured_development_observation_filingComments.html
[diagnostic-report-result]: https://developer.nhs.uk/apis/gpconnect-1-6-0/accessrecord_structured_development_DiagnosticReport.html#result

## [2.0.0] - 2024-04-12

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15076,7 +15076,7 @@
"system": "https://PSSAdaptor/B83002",
"value": "00000000-0000-0000-0000-000000000005"
} ],
"status": "final",
"status": "unknown",
"code": {
"coding": [ {
"system": "http://snomed.info/sct",
Expand Down Expand Up @@ -15107,7 +15107,7 @@
"system": "https://PSSAdaptor/B83002",
"value": "00000000-0000-0000-0000-000000000006"
} ],
"status": "final",
"status": "unknown",
"code": {
"coding": [ {
"system": "http://snomed.info/sct",
Expand Down Expand Up @@ -15138,7 +15138,7 @@
"system": "https://PSSAdaptor/B83002",
"value": "00000000-0000-0000-0000-000000000007"
} ],
"status": "final",
"status": "unknown",
"code": {
"coding": [ {
"system": "http://snomed.info/sct",
Expand Down Expand Up @@ -15169,7 +15169,7 @@
"system": "https://PSSAdaptor/B83002",
"value": "00000000-0000-0000-0000-000000000008"
} ],
"status": "final",
"status": "unknown",
"code": {
"coding": [ {
"system": "http://snomed.info/sct",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static java.util.stream.Collectors.toCollection;

import static org.hl7.fhir.dstu3.model.Observation.ObservationStatus.UNKNOWN;
import static uk.nhs.adaptors.pss.translator.util.CompoundStatementResourceExtractors.extractAllCompoundStatements;
import static uk.nhs.adaptors.pss.translator.util.DateFormatUtil.parseToInstantType;
import static uk.nhs.adaptors.pss.translator.util.ResourceUtil.buildIdentifier;
Expand Down Expand Up @@ -199,6 +200,7 @@ private Observation buildFilingComment(Observation existingObservationComment) {
filingCommentObservation.setId(filingCommentObservationId);
filingCommentObservation.getIdentifierFirstRep().setValue(filingCommentObservationId);
filingCommentObservation.setComment(null);
filingCommentObservation.setStatus(UNKNOWN);

return filingCommentObservation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import lombok.SneakyThrows;
import uk.nhs.adaptors.pss.translator.service.IdGeneratorService;
import uk.nhs.adaptors.pss.translator.util.DateFormatUtil;
import static org.hl7.fhir.dstu3.model.Observation.ObservationStatus.UNKNOWN;

@ExtendWith(MockitoExtension.class)
public class DiagnosticReportMapperTest {
Expand Down Expand Up @@ -506,7 +507,8 @@ public void When_MappingWithUserCommentInBattery_Expect_NewFilingCommentObservat
.isEqualTo(NEW_OBSERVATION_ID),
() -> assertThat(observationComments.get(1).getEffectiveDateTimeType().getValueAsString())
.isEqualTo("2024-01-01"),
() -> assertThat(observationComments.get(1).getComment()).isNull()
() -> assertThat(observationComments.get(1).getComment()).isNull(),
() -> assertThat(observationComments.get(1).getStatus()).isEqualTo(UNKNOWN)
);
}

Expand Down
2 changes: 1 addition & 1 deletion smoke-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.assertj:assertj-core:3.25.1'
testImplementation 'org.assertj:assertj-core:3.25.3'
testImplementation 'org.apache.httpcomponents.client5:httpclient5:5.3'
testImplementation 'org.postgresql:postgresql:42.3.6'
testImplementation ('org.apache.qpid:qpid-jms-client:1.6.0') {
Expand Down

0 comments on commit 1e5a9c5

Please sign in to comment.