Skip to content

Commit

Permalink
clean up rsv feature flag (#6827)
Browse files Browse the repository at this point in the history
* remove rsv from diseases

* clean up testing files

* jk add one test back in
  • Loading branch information
fzhao99 authored Oct 24, 2023
1 parent ec259b7 commit 908d258
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ private boolean validDiseaseTestPerformedLoinc(String testPerformedCode) {
return false;
}
String disease = diseaseSpecificLoincMap.get(testPerformedCode);
return disease != null && (!RSV_NAME.equals(disease) || featureFlagsConfig.isRsvEnabled());
return disease != null;
}

private boolean validModelTestPerformedCombination(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class FeatureFlagsConfig {
private final FeatureFlagRepository _repo;

private boolean hivEnabled;
private boolean rsvEnabled;
private boolean singleEntryRsvEnabled;
private boolean agnosticEnabled;
private boolean agnosticBulkUploadEnabled;
Expand All @@ -40,7 +39,6 @@ private void loadFeatureFlagsFromDB() {
private void flagMapping(String flagName, Boolean flagValue) {
switch (flagName) {
case "hivEnabled" -> setHivEnabled(flagValue);
case "rsvEnabled" -> setRsvEnabled(flagValue);
case "singleEntryRsvEnabled" -> setSingleEntryRsvEnabled(flagValue);
case "agnosticEnabled" -> setAgnosticEnabled(flagValue);
case "agnosticBulkUploadEnabled" -> setAgnosticBulkUploadEnabled(flagValue);
Expand Down
1 change: 0 additions & 1 deletion backend/src/main/resources/application-azure-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ twilio:
from-number: "+14045312484"
features:
hivEnabled: false
rsvEnabled: false
singleEntryRsvEnabled: false
agnosticEnabled: false
testCardRefactorEnabled: false
Expand Down
1 change: 0 additions & 1 deletion backend/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ datahub:
fhir-enabled: true
features:
hivEnabled: true
rsvEnabled: true
singleEntryRsvEnabled: true
agnosticEnabled: true
testCardRefactorEnabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class FeatureFlagsControllerTest {

@BeforeEach
void setup() {
_mockFeatureFlagConfig.setRsvEnabled(true);
this.featureFlagsController = new FeatureFlagsController();
ReflectionTestUtils.setField(
this.featureFlagsController, "featureFlags", _mockFeatureFlagConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,27 +305,13 @@ void testResults_validFile_fluOnly() {
@Test
void testResults_validFile_rsvOnly() {
// GIVEN
when(featureFlagsConfig.isRsvEnabled()).thenReturn(true);
InputStream input = loadCsv("testResultUpload/test-results-upload-valid-rsv-only.csv");
// WHEN
List<FeedbackMessage> errors = testResultFileValidator.validate(input);
// THEN
assertThat(errors).isEmpty();
}

@Test
void testResults_validFile_rsvDisabled() {
// GIVEN
when(featureFlagsConfig.isRsvEnabled()).thenReturn(false);
InputStream input = loadCsv("testResultUpload/test-results-upload-valid-rsv-only.csv");
// WHEN
List<FeedbackMessage> errors = testResultFileValidator.validate(input);
// THEN
assertThat(errors).hasSize(1);
assertThat(errors.get(0).getMessage())
.isEqualTo("Invalid equipment_model_name and test_performed_code combination");
}

@Test
void testResultsFile_invalidHeaders() {
// GIVEN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState } from "react";
import { Navigate } from "react-router-dom";
import { useFeature } from "flagged";

import {
DeviceType,
Expand All @@ -20,7 +19,6 @@ import DeviceForm from "./DeviceForm";

const ManageDeviceTypeFormContainer = () => {
useDocumentTitle(editDevicePageTitle);
const rsvEnabled = useFeature("rsvEnabled");

const [submitted, setSubmitted] = useState(false);
const [activeFacility] = useSelectedFacility();
Expand Down Expand Up @@ -81,10 +79,6 @@ const ManageDeviceTypeFormContainer = () => {
})
);

const supportedDiseaseOptions = rsvEnabled
? supportedDiseaseData
: supportedDiseaseData.filter((d) => d.label !== "RSV");

const devices = Array.from(
deviceTypeResults.deviceTypes.map(
(devicesTypes) => devicesTypes as DeviceType
Expand All @@ -96,7 +90,7 @@ const ManageDeviceTypeFormContainer = () => {
formTitle={editDevicePageTitle}
saveDeviceType={updateDevice}
swabOptions={swabOptions}
supportedDiseaseOptions={supportedDiseaseOptions}
supportedDiseaseOptions={supportedDiseaseData}
deviceOptions={devices}
/>
);
Expand Down

0 comments on commit 908d258

Please sign in to comment.