Skip to content

Commit

Permalink
add support for born_with_cleft_[palate|lip] in medical history
Browse files Browse the repository at this point in the history
  • Loading branch information
slogan621 committed May 20, 2021
1 parent acee24a commit d81a415
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public class MedicalHistory {
private boolean m_heightMetric = true;
private int m_weight = 10;
private boolean m_weightMetric = true;
private boolean m_born_with_cleft_lip = false;
private boolean m_born_with_cleft_palate = false;


public boolean isBirthWeightMetric() {
return m_birthWeightMetric;
Expand Down Expand Up @@ -313,6 +316,22 @@ public void setSiblingsCleft(boolean siblingsCleft) {
m_siblingsCleft = siblingsCleft;
}

public boolean isBornWithCleftLip() {
return m_born_with_cleft_lip;
}

public void setBornWithCleftLip(boolean bornWithCleftLip) {
m_born_with_cleft_lip = bornWithCleftLip;
}

public boolean isBornWithCleftPalate() {
return m_born_with_cleft_palate;
}

public void setBornWithCleftPalate(boolean bornWithCleftPalate) {
m_born_with_cleft_palate = bornWithCleftPalate;
}

public String getMeds() {
return m_meds;
}
Expand Down Expand Up @@ -538,6 +557,14 @@ public boolean equals(Object obj) {
if (this.m_weightMetric != other.m_weightMetric) {
return false;
}

if (this.m_born_with_cleft_lip != other.m_born_with_cleft_lip) {
return false;
}

if (this.m_born_with_cleft_palate != other.m_born_with_cleft_palate) {
return false;
}
return true;
}

Expand Down Expand Up @@ -585,6 +612,8 @@ public int fromJSONObject(JSONObject o)
this.setTuberculosis(o.getBoolean("tuberculosis"));
this.setWeight(o.getInt("weight"));
this.setWeightMetric(o.getBoolean("weight_metric"));
this.setBornWithCleftLip(o.getBoolean("born_with_cleft_lip"));
this.setBornWithCleftPalate(o.getBoolean("born_with_cleft_palate"));
} catch (JSONException e) {
ret = -1;
}
Expand Down Expand Up @@ -636,6 +665,8 @@ public JSONObject toJSONObject(boolean includeId)
data.put("tuberculosis", this.isTuberculosis());
data.put("weight", this.getWeight());
data.put("weight_metric", this.isWeightMetric());
data.put("born_with_cleft_lip", this.isBornWithCleftLip());
data.put("born_with_cleft_palate", this.isBornWithCleftPalate());
} catch(Exception e) {
// not sure this would ever happen, ignore. Continue on with the request with the expectation it fails
// because of the bad JSON sent
Expand Down

0 comments on commit d81a415

Please sign in to comment.