Skip to content

Commit

Permalink
Add LOINC long names to DeviceTypeDisease
Browse files Browse the repository at this point in the history
  • Loading branch information
emyl3 committed Jan 22, 2024
1 parent 37f25f7 commit 75cdf8f
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
public class SupportedDiseaseTestPerformedInput {
UUID supportedDisease;
String testPerformedLoincCode;
String testPerformedLoincLongName;
String equipmentUid;
String equipmentUidType;
String testkitNameId;
String testOrderedLoincCode;
String testOrderedLoincLongName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public class DeviceTypeDisease extends IdentifiedEntity {
private SupportedDisease supportedDisease;

@Column private String testPerformedLoincCode;
@Column private String testPerformedLoincLongName;
@Column private String equipmentUid;
@Column private String equipmentUidType;
@Column private String testkitNameId;
@Column private String testOrderedLoincCode;
@Column private String testOrderedLoincLongName;

@Override
public boolean equals(Object o) {
Expand All @@ -47,7 +49,9 @@ public boolean equals(Object o) {
&& Objects.equals(testOrderedLoincCode, that.testOrderedLoincCode)
&& Objects.equals(equipmentUid, that.equipmentUid)
&& Objects.equals(equipmentUidType, that.equipmentUidType)
&& Objects.equals(testkitNameId, that.testkitNameId);
&& Objects.equals(testkitNameId, that.testkitNameId)
&& Objects.equals(testPerformedLoincLongName, that.testPerformedLoincLongName)
&& Objects.equals(testOrderedLoincLongName, that.testOrderedLoincLongName);
}

@Override
Expand All @@ -59,6 +63,8 @@ public int hashCode() {
testOrderedLoincCode,
equipmentUid,
equipmentUidType,
testkitNameId);
testkitNameId,
testPerformedLoincLongName,
testOrderedLoincLongName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ public List<DeviceTypeDisease> createDeviceTypeDiseaseList(
.deviceTypeId(device.getInternalId())
.supportedDisease(disease)
.testPerformedLoincCode(input.getTestPerformedLoincCode())
.testPerformedLoincLongName(input.getTestPerformedLoincLongName())
.testOrderedLoincCode(input.getTestOrderedLoincCode())
.testOrderedLoincLongName(input.getTestOrderedLoincLongName())
.equipmentUid(input.getEquipmentUid())
.equipmentUidType(input.getEquipmentUidType())
.testkitNameId(input.getTestkitNameId())
.testOrderedLoincCode(input.getTestOrderedLoincCode())
.build()));
});
return deviceTypeDiseaseList;
Expand Down
18 changes: 17 additions & 1 deletion backend/src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5218,4 +5218,20 @@ databaseChangeLog:
referencedTableName: supported_disease
referencedColumnNames: internal_id
- dropTable:
tableName: upload_disease_details
tableName: upload_disease_details
- changeSet:
id: add-loinc-long-names-to-device-type-disease
author: [email protected]
comment: Add the LOINC long names for the test performed and test ordered LOINC codes to Device Type Disease
changes:
- addColumn:
tableName: device_type_disease
columns:
- column:
name: test_performed_loinc_long_name
type: text
remarks: testPerformedLoincLongName from LIVD API
- column:
name: test_ordered_loinc_long_name
type: text
remarks: testOrderedLoincLongName from LIVD API
4 changes: 4 additions & 0 deletions backend/src/main/resources/graphql/main.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ input UpdateDeviceType {
input SupportedDiseaseTestPerformedInput {
supportedDisease: ID!
testPerformedLoincCode: String!
testPerformedLoincLongName: String
equipmentUid: String
equipmentUidType: String
testkitNameId: String
testOrderedLoincCode: String
testOrderedLoincLongName: String
}

type DeviceType {
Expand All @@ -98,10 +100,12 @@ type DeviceType {
type SupportedDiseaseTestPerformed {
supportedDisease: SupportedDisease!
testPerformedLoincCode: String!
testPerformedLoincLongName: String
equipmentUid: String
equipmentUidType: String
testkitNameId: String
testOrderedLoincCode: String
testOrderedLoincLongName: String
}

type SupportedDisease {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,19 +853,23 @@ void convertToObservation_Result_matchesJson() throws IOException {
null,
covidDisease,
"94500-6",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0");
"94500-0",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection");
var fluDiseaseTestPerformedCode =
new DeviceTypeDisease(
null,
fluDisease,
"85477-8",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"fluEquipmentUID",
"fluEquipmentUidType",
"fluTestkitNameId",
"85477-0");
"85477-0",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection");
ReflectionTestUtils.setField(
device,
"supportedDiseaseTestPerformed",
Expand Down Expand Up @@ -923,10 +927,12 @@ void convertToObservation_Result_correctionMatchesJson() throws IOException {
null,
covidDisease,
"94500-6",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0");
"94500-0",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection");

ReflectionTestUtils.setField(result, "internalId", UUID.fromString(id));
ReflectionTestUtils.setField(
Expand Down Expand Up @@ -1674,26 +1680,32 @@ void createFhirBundle_TestEvent_matchesJson() throws IOException {
deviceTypeId,
covidDisease,
"333-123",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"equipmentUID1",
"equipmentUIDType1",
"testkitNameId1",
null),
null,
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection"),
new DeviceTypeDisease(
deviceTypeId,
fluADisease,
"444-123",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"equipmentUID2",
"equipmentUIDType2",
"testkitNameId2",
"95422-2"),
"95422-2",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection"),
new DeviceTypeDisease(
deviceTypeId,
fluBDisease,
"444-456",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"equipmentUID3",
"equipmentUIDType3",
"testkitNameId3",
"95422-2"));
"95422-2",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection"));

ReflectionTestUtils.setField(provider, "internalId", providerId);
ReflectionTestUtils.setField(facility, "internalId", facilityId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ void getSupportedDiseases_happyPath() {
String equipmentUidType = "testEquipmentUidType";
String testkitNameId = "testkitNameId";
String testOrderedLoinc = "test123OrderedLoinc";
String testPerformedLoincLongName =
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection";
String testOrderedLoincLongName =
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection";

SupportedDisease supportedDisease1 = mock(SupportedDisease.class);
SupportedDisease supportedDisease2 = mock(SupportedDisease.class);
Expand All @@ -67,26 +71,32 @@ void getSupportedDiseases_happyPath() {
device1Id,
supportedDisease1,
testPerformedLoinc,
testPerformedLoincLongName,
equipmentUid,
equipmentUidType,
testkitNameId,
testOrderedLoinc),
testOrderedLoinc,
testOrderedLoincLongName),
new DeviceTypeDisease(
device2Id,
supportedDisease1,
testPerformedLoinc,
testPerformedLoincLongName,
equipmentUid,
equipmentUidType,
testkitNameId,
testOrderedLoinc),
testOrderedLoinc,
testOrderedLoincLongName),
new DeviceTypeDisease(
device2Id,
supportedDisease2,
testPerformedLoinc,
testPerformedLoincLongName,
equipmentUid,
equipmentUidType,
testkitNameId,
testOrderedLoinc)));
testOrderedLoinc,
testOrderedLoincLongName)));

// WHEN
Map<UUID, List<SupportedDisease>> supportedDiseases =
Expand Down Expand Up @@ -150,28 +160,40 @@ void getDeviceTypeDisease() {
DeviceTypeDisease.builder()
.deviceTypeId(device1Id)
.testPerformedLoincCode("123")
.testPerformedLoincLongName(
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection")
.supportedDisease(new SupportedDisease())
.equipmentUid("111")
.testkitNameId("222")
.testOrderedLoincCode("234")
.testOrderedLoincLongName(
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection")
.build();
var deviceTypeDisease2 =
DeviceTypeDisease.builder()
.deviceTypeId(device1Id)
.testPerformedLoincCode("456")
.testPerformedLoincLongName(
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection")
.supportedDisease(new SupportedDisease())
.equipmentUid("333")
.testkitNameId("444")
.testOrderedLoincCode("345")
.testOrderedLoincLongName(
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection")
.build();
var deviceTypeDisease3 =
DeviceTypeDisease.builder()
.deviceTypeId(device2Id)
.testPerformedLoincCode("123")
.testPerformedLoincLongName(
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection")
.supportedDisease(new SupportedDisease())
.equipmentUid("555")
.testkitNameId("666")
.testOrderedLoincCode("244")
.testOrderedLoincLongName(
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection")
.build();

when(deviceTypeDiseaseRepository.findAllByDeviceTypeIdIn(deviceIdSet))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ private Map<String, Object> getCreateDeviceTypeInput() {
.equipmentUidType("equipmentUid1Type")
.testkitNameId("testkitNameId1")
.testOrderedLoincCode("loinc3")
.testPerformedLoincLongName(
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection")
.testOrderedLoincLongName(
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection")
.build()))
.build();

Expand Down Expand Up @@ -157,6 +161,10 @@ private Map<String, Object> getUpdateDeviceTypeInput(UUID internalId) {
.equipmentUidType("equipmentUidType1")
.testkitNameId("testkitNameId1")
.testOrderedLoincCode("loinc3")
.testPerformedLoincLongName(
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection")
.testOrderedLoincLongName(
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection")
.build()))
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,37 +272,45 @@ void sendPatientInfoWithCommonDeviceDiseaseInfo() {
deviceType1.getInternalId(),
dataFactory.getCovidDisease(),
"94500-6",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId1",
"94500-0"),
"94500-0",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection"),
new DeviceTypeDisease(
deviceType1.getInternalId(),
dataFactory.getCovidDisease(),
"94500-6",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"covidEquipmentUID",
"covidEquipmentUIDType",
"covidTestkitNameId2",
"94500-0")));
"94500-0",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection")));
dataFactory.addDiseasesToDevice(
deviceType2,
List.of(
new DeviceTypeDisease(
deviceType2.getInternalId(),
dataFactory.getCovidDisease(),
"94500-6",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"covidEquipmentUID1",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0"),
"94500-0",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection"),
new DeviceTypeDisease(
deviceType2.getInternalId(),
dataFactory.getCovidDisease(),
"94500-6",
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"covidEquipmentUID2",
"covidEquipmentUIDType",
"covidTestkitNameId",
"94500-0")));
"94500-0",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection")));

Person person = dataFactory.createFullPerson(org);
TestOrder testOrder1 = dataFactory.createTestOrder(person, facility);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ public static DeviceTypeDisease createDeviceTypeDisease(SupportedDisease support
UUID.randomUUID(),
supportedDisease,
supportedDisease.getLoinc(),
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"543212134",
"MNI",
"BOOMX2",
"95422-2");
"95422-2",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection");
}

public static DeviceTypeDisease createDeviceTypeDiseaseForBulkUpload(
Expand All @@ -133,10 +135,12 @@ public static DeviceTypeDisease createDeviceTypeDiseaseForBulkUpload(
UUID.randomUUID(),
supportedDisease,
supportedDisease.getLoinc(),
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"543212134",
"MNI",
"BOOMX2",
"94534-5");
"94534-5",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection");
}

public static DeviceTypeDisease createDeviceTypeDisease() {
Expand All @@ -145,10 +149,12 @@ public static DeviceTypeDisease createDeviceTypeDisease() {
UUID.randomUUID(),
supportedDisease,
supportedDisease.getLoinc(),
"SARS coronavirus 2 RNA [Presence] in Respiratory specimen by NAA with probe detection",
"543212134",
"MNI",
"BOOMX2",
"98670-3");
"98670-3",
"SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection");
}

public static DeviceType createDeviceType() {
Expand Down
Loading

0 comments on commit 75cdf8f

Please sign in to comment.