Skip to content

Commit

Permalink
change default location code in fhir bundle to unknown topography (#7205
Browse files Browse the repository at this point in the history
)

* change tests

* fix ndjson

* one more
  • Loading branch information
fzhao99 authored Jan 29, 2024
1 parent 46d5fe2 commit b641485
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ public TestEventExport(TestEvent testEvent, String processingModeCode) {
}

private String genderUnknown = "U";
public static final String DEFAULT_LOCATION_CODE = "53342003"; // http://snomed.info/id/53342003
// "Internal nose structure"
// values pulled from
public static final String DEFAULT_LOCATION_CODE = "87100004"; // http://snomed.info/id/87100004
// Topography unknown (body structure)
// https://github.com/CDCgov/prime-data-hub/blob/master/prime-router/metadata/valuesets/common.valuesets

public static final String DEFAULT_LOCATION_NAME =
"Internal nose structure (body structure)"; // http://snomed.info/id/53342003
"Topography unknown (body structure)"; // http://snomed.info/id/87100004

private final Map<String, String> genderMap =
Map.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ void convertToSpecimen_Strings_valid() {
ConvertToSpecimenProps.builder()
.specimenCode("258500001")
.specimenName("Nasopharyngeal swab")
.collectionCode("53342003 but not the default one")
.collectionName("Internal nose structure (body structure) but not the default one")
.collectionCode(DEFAULT_LOCATION_CODE + " but not the default one")
.collectionName(DEFAULT_LOCATION_NAME + " but not the default one")
.id("id-123")
.identifier("uuid-123")
.collectionDate(collectionDate)
Expand All @@ -623,9 +623,9 @@ void convertToSpecimen_Strings_valid() {
assertThat(actual.getCollection().getBodySite().getCodingFirstRep().getSystem())
.isEqualTo(snomedCode);
assertThat(actual.getCollection().getBodySite().getCodingFirstRep().getCode())
.isEqualTo("53342003 but not the default one");
.isEqualTo(DEFAULT_LOCATION_CODE + " but not the default one");
assertThat(actual.getCollection().getBodySite().getText())
.isEqualTo("Internal nose structure (body structure) but not the default one");
.isEqualTo(DEFAULT_LOCATION_NAME + " but not the default one");
assertThat(((DateTimeType) actual.getCollection().getCollected()).getValue())
.isEqualTo("2023-06-22T16:38:00Z");
}
Expand All @@ -648,10 +648,7 @@ void convertToSpecimen_Strings_null() {
void convertToSpecimen_SpecimenType_valid() {
var specimenType =
new SpecimenType(
"Nasopharyngeal swab",
"258500001",
"Internal nose structure (body structure)",
"53342003");
"Nasopharyngeal swab", "258500001", DEFAULT_LOCATION_NAME, DEFAULT_LOCATION_CODE);
var internalId = UUID.randomUUID();
ReflectionTestUtils.setField(specimenType, "internalId", internalId);

Expand All @@ -673,9 +670,8 @@ void convertToSpecimen_SpecimenType_valid() {
assertThat(actual.getCollection().getBodySite().getCodingFirstRep().getSystem())
.isEqualTo(snomedCode);
assertThat(actual.getCollection().getBodySite().getCodingFirstRep().getCode())
.isEqualTo("53342003");
assertThat(actual.getCollection().getBodySite().getText())
.isEqualTo("Internal nose structure (body structure)");
.isEqualTo(DEFAULT_LOCATION_CODE);
assertThat(actual.getCollection().getBodySite().getText()).isEqualTo(DEFAULT_LOCATION_NAME);
assertThat(((DateTimeType) actual.getCollection().getCollected()).getValue())
.isEqualTo("2023-06-22T13:16:00.00Z");
assertThat(actual.getReceivedTimeElement().getValueAsString())
Expand Down
4 changes: 2 additions & 2 deletions backend/src/test/resources/fhir/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
},
"collectedDateTime": "2023-07-14T15:45:34+00:00"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down Expand Up @@ -1179,10 +1179,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down Expand Up @@ -1735,10 +1735,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down Expand Up @@ -2335,10 +2335,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down Expand Up @@ -2891,10 +2891,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions backend/src/test/resources/fhir/specimen.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
},
"collectedDateTime": "2023-06-22T11:35:00-04:00"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down Expand Up @@ -1183,10 +1183,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down Expand Up @@ -1183,10 +1183,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53342003"
"code": "87100004"
}
],
"text": "Internal nose structure (body structure)"
"text": "Topography unknown (body structure)"
}
}
}
Expand Down
Loading

0 comments on commit b641485

Please sign in to comment.