Skip to content

Commit

Permalink
KPMP-5700: Account for blanks
Browse files Browse the repository at this point in the history
  • Loading branch information
rlreamy committed Dec 4, 2024
1 parent 28ae3e2 commit 5140e39
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/org/kpmp/repositoryDataset/RepositoryFileDataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,79 +162,79 @@ public void setPrimaryAdjudicatedCategory(String primaryAdjudicatedCat) {
}

public String getKdigoStage() {
return this.kdigoStage + "(ks)";
return this.kdigoStage.isBlank() ? this.kdigoStage: this.kdigoStage + "(ks)";
}

public void setKdigoStage(String kdigoStage) {
this.kdigoStage = kdigoStage;
}

public String getBaselineEgfr() {
return this.baselineEgfr + "(eGFR)";
return this.baselineEgfr.isBlank() ? this.baselineEgfr: this.baselineEgfr + "(eGFR)";
}

public void setBaselineEgfr(String baselineEgfr) {
this.baselineEgfr = baselineEgfr;
}

public String getProteinuria() {
return this.proteinuria + "(prot)";
return this.proteinuria.isBlank() ? this.proteinuria: this.proteinuria + "(prot)";
}

public void setProteinuria(String proteinuria) {
this.proteinuria = proteinuria;
}

public String getA1c() {
return this.a1c + "(a1c)";
return this.a1c.isBlank() ? this.a1c: this.a1c + "(a1c)";
}

public void setA1c(String a1c) {
this.a1c = a1c;
}

public String getAlbuminuria() {
return this.albuminuria + "(alb)";
return this.albuminuria.isBlank() ? this.albuminuria: this.albuminuria + "(alb)";
}

public void setAlbuminuria(String albuminuria) {
this.albuminuria = albuminuria;
}

public String getDiabetesHistory() {
return this.diabetesHistory + "(dh)";
return this.diabetesHistory.isBlank() ? this.diabetesHistory: this.diabetesHistory + "(dh)";
}

public void setDiabetesHistory(String diabetesHistory) {
this.diabetesHistory = diabetesHistory;
}

public String getDiabetesDuration() {
return this.diabetesDuration + "(dd)";
return this.diabetesDuration.isBlank() ? this.diabetesDuration: this.diabetesDuration + "(dd)";
}

public void setDiabetesDuration(String diabetesDuration) {
this.diabetesDuration = diabetesDuration;
}

public String getHypertensionHistory() {
return this.hypertensionHistory + "(hh)";
return this.hypertensionHistory.isBlank() ? this.hypertensionHistory: this.hypertensionHistory + "(hh)";
}

public void setHypertensionHistory(String hypertensionHistory) {
this.hypertensionHistory = hypertensionHistory;
}

public String getHypertensionDuration() {
return this.hypertensionDuration + "(hd)";
return this.hypertensionDuration.isBlank() ? this.hypertensionDuration: this.hypertensionDuration + "(hd)";
}

public void setHypertensionDuration(String hypertensionDuration) {
this.hypertensionDuration = hypertensionDuration;
}

public String getOnRaasBlockade() {
return this.onRaasBlockade + "(rb)";
return this.onRaasBlockade.isBlank() ? this.onRaasBlockade: this.onRaasBlockade + "(rb)";
}

public void setOnRaasBlockade(String onRaasBlockade) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,58 +123,117 @@ public void setKdigoStage() {
assertEquals("stage 11 (ks)", repositoryDataset.getKdigoStage());
}

@Test
public void setKdigoStage_whenBlank() {
repositoryDataset.setKdigoStage("");
assertEquals("", repositoryDataset.getKdigoStage());
}

@Test
public void setBaselineEgfr() {
repositoryDataset.setBaselineEgfr("13");
assertEquals("13 (eGFR)", repositoryDataset.getBaselineEgfr());
}

@Test
public void setBaselineEgfr_whenBlank() {
repositoryDataset.setBaselineEgfr("");
assertEquals("", repositoryDataset.getBaselineEgfr());
}

@Test
public void setProteinuria() {
repositoryDataset.setProteinuria("1234");
assertEquals("1234 (prot)", repositoryDataset.getProteinuria());
}

@Test
public void setProteinuria_whenBlank() {
repositoryDataset.setProteinuria("");
assertEquals("", repositoryDataset.getProteinuria());
}

@Test
public void setA1c() {
repositoryDataset.setA1c("90%");
assertEquals("90% (a1c)", repositoryDataset.getA1c());
}

@Test
public void setA1c_whenBlank() {
repositoryDataset.setA1c("");
assertEquals("", repositoryDataset.getA1c());
}

@Test
public void setAlbuminuria() {
repositoryDataset.setAlbuminuria("yup");
assertEquals("yup (alb)", repositoryDataset.getAlbuminuria());
}

@Test
public void setAlbuminuria_whenBlank() {
repositoryDataset.setAlbuminuria("");
assertEquals("", repositoryDataset.getAlbuminuria());
}

@Test
public void setDiabetesDuration(){
repositoryDataset.setDiabetesDuration("1 years");
assertEquals("1 years (dd)", repositoryDataset.getDiabetesDuration());
}

@Test
public void setDiabetesDuration_whenBlank() {
repositoryDataset.setDiabetesDuration("");
assertEquals("", repositoryDataset.getDiabetesDuration());
}

@Test
public void setDiabetesHistory() {
repositoryDataset.setDiabetesHistory("no");
assertEquals("no (dh)", repositoryDataset.getDiabetesHistory());
}

@Test
public void setDiabetesHistory_whenBlank() {
repositoryDataset.setDiabetesHistory("");
assertEquals("", repositoryDataset.getDiabetesHistory());
}

@Test
public void setHypertensionDuration() {
repositoryDataset.setHypertensionDuration("1 years");
assertEquals("1 years (hd)", repositoryDataset.getHypertensionDuration());
}

@Test
public void setHypertensionDuration_whenBlank() {
repositoryDataset.setHypertensionDuration("");
assertEquals("", repositoryDataset.getHypertensionDuration());
}

@Test
public void setHypertensionHistory() {
repositoryDataset.setHypertensionHistory("no");
assertEquals("no (hh)", repositoryDataset.getHypertensionHistory());
}

@Test
public void setHypertensionHistory_whenBlank() {
repositoryDataset.getHypertensionHistory();
assertEquals("", repositoryDataset.getHypertensionHistory());
}

@Test
public void setOnRaasBlockade() {
repositoryDataset.setOnRaasBlockade("no");
assertEquals("no (rb)", repositoryDataset.getOnRaasBlockade());
}

@Test
public void setOnRaasBlockade_whenBlank() {
repositoryDataset.setOnRaasBlockade("");
assertEquals("", repositoryDataset.getOnRaasBlockade());
}
}

0 comments on commit 5140e39

Please sign in to comment.