Skip to content

Commit

Permalink
Changed opt out flag to share_data (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadibhatla authored Aug 26, 2024
1 parent 9ece158 commit a655698
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/opt-out-export-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:

jobs:
deploy:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
runs-on: self-hosted
environment: test
defaults:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/opt-out-import-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:

jobs:
deploy:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
runs-on: self-hosted
environment: test
defaults:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void copyDataToFile(Connection connection) {
writer.newLine();
long records = 0;
while (rs.next()) {
var line = getResponseLine(rs.getString("mbi"), rs.getDate("effective_date"), rs.getBoolean("opt_out_flag"));
var line = getResponseLine(rs.getString("mbi"), rs.getDate("effective_date"), rs.getBoolean("share_data"));
writer.write(line);
writer.newLine();
records++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void copyDataToFileTest() throws IOException, SQLException {
var rs = new MockResultSet("");
rs.addColumn("mbi", Arrays.asList(MBI_1, MBI_2));
rs.addColumn("effective_date", Arrays.asList("2024-02-26", null));
rs.addColumn("opt_out_flag", Arrays.asList(true, null));
rs.addColumn("share_data", Arrays.asList(true, null));
when(connection.createStatement()).thenReturn(stmt);

when(getExecuteQuery(stmt)).thenReturn(rs);
Expand Down
8 changes: 4 additions & 4 deletions optout/src/main/java/gov/cms/ab2d/optout/OptOutConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public class OptOutConstants {
public static final String CONF_FILE_NAME = "#EFT.ON.AB2D.NGD.CONF.";
public static final String CONF_FILE_NAME_PATTERN = "'D'yyMMdd.'T'HHmmsss";
public static final String UPDATE_STATEMENT = "UPDATE public.current_mbi\n" +
"SET opt_out_flag = ?, effective_date = current_date\n" +
"SET share_data = ?, effective_date = current_date\n" +
"WHERE mbi = ?";
public static final String COUNT_STATEMENT = "SELECT \n"+
"COUNT(CASE WHEN opt_out_flag = 'true' THEN 1 END) AS optin, \n"+
"COUNT(CASE WHEN opt_out_flag = 'false' THEN 1 END) AS optout \n"+
"FROM current_mbi WHERE opt_out_flag IS NOT NULL";
"COUNT(CASE WHEN share_data = 'true' THEN 1 END) AS optin, \n"+
"COUNT(CASE WHEN share_data = 'false' THEN 1 END) AS optout \n"+
"FROM current_mbi WHERE share_data IS NOT NULL";

private OptOutConstants() {}
}

0 comments on commit a655698

Please sign in to comment.