From c1e3d1586f53984e38f8c125b0165e03fc3c2db5 Mon Sep 17 00:00:00 2001 From: Sagar S Date: Mon, 18 Nov 2019 12:29:21 +0530 Subject: [PATCH] Removed #726 & #557 implementation --- .../QuestionNodeActivity.java | 91 +------------------ .../VisitSummaryActivity.java | 30 +----- .../client/database/dao/ImagesDAO.java | 3 - 3 files changed, 6 insertions(+), 118 deletions(-) diff --git a/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java b/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java index 751fe93bf2..8fdf63b0e8 100644 --- a/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/questionNodeActivity/QuestionNodeActivity.java @@ -77,11 +77,6 @@ public class QuestionNodeActivity extends AppCompatActivity { private String encounterVitals; private String encounterAdultIntials; - private List optionsList = new ArrayList<>(); - Node assoSympNode; - private JSONObject assoSympObj = new JSONObject(); - private JSONArray assoSympArr = new JSONArray(); - private JSONObject finalAssoSympObj = new JSONObject(); @Override protected void onCreate(Bundle savedInstanceState) { @@ -290,10 +285,6 @@ private void fabClick() { complaintNumber++; setupQuestions(complaintNumber); complaintConfirmed = false; - } else if (complaints.size() > 1 && complaintNumber == complaints.size() - 1) { - complaintNumber++; - removeDuplicateSymptoms(); - complaintConfirmed = false; } else { if (intentTag != null && intentTag.equals("edit")) { Log.i(TAG, "fabClick: update" + insertion); @@ -407,93 +398,13 @@ private void updateDatabase(String string) { */ private void setupQuestions(int complaintIndex) { nodeComplete = false; - - if (complaints.size() > 1) { - getAssociatedSymptoms(complaintIndex); - } else { - currentNode = complaintsNodes.get(complaintIndex); - } - + currentNode = complaintsNodes.get(complaintIndex); adapter = new CustomExpandableListAdapter(this, currentNode, this.getClass().getSimpleName()); questionListView.setAdapter(adapter); questionListView.setChoiceMode(ExpandableListView.CHOICE_MODE_MULTIPLE); questionListView.expandGroup(0); setTitle(patientName + ": " + currentNode.findDisplay()); } - - private void getAssociatedSymptoms(int complaintIndex) { - - List assoComplaintsNodes = new ArrayList<>(); - assoComplaintsNodes.addAll(complaintsNodes); - - for (int i = 0; i < complaintsNodes.get(complaintIndex).size(); i++) { - - if (complaintsNodes.get(complaintIndex).getOptionsList().get(i).getText() - .equalsIgnoreCase("Associated symptoms")) { - - optionsList.addAll(complaintsNodes.get(complaintIndex).getOptionsList().get(i).getOptionsList()); - - assoComplaintsNodes.get(complaintIndex).getOptionsList().remove(i); - currentNode = assoComplaintsNodes.get(complaintIndex); - Log.e("CurrentNode", "" + currentNode); - - } - } - } - - private void removeDuplicateSymptoms() { - - nodeComplete = false; - - HashSet hashSet = new HashSet<>(); - - List finalOptionsList = new ArrayList<>(optionsList); - - if (optionsList.size() != 0) { - - for (int i = 0; i < optionsList.size(); i++) { - - if (hashSet.contains(optionsList.get(i).getText())) { - - finalOptionsList.remove(optionsList.get(i)); - - } else { - hashSet.add(optionsList.get(i).getText()); - } - } - - try { - assoSympObj.put("id", "ID_294177528"); - assoSympObj.put("text", "Associated symptoms"); - assoSympObj.put("display", "Do you have the following symptom(s)?"); - assoSympObj.put("display-or", "ତମର ଏହି ଲକ୍ଷଣ ସବୁ ଅଛି କି?"); - assoSympObj.put("pos-condition", "c."); - assoSympObj.put("neg-condition", "s."); - assoSympArr.put(0, assoSympObj); - finalAssoSympObj.put("id", "ID_844006222"); - finalAssoSympObj.put("text", "Associated symptoms"); - finalAssoSympObj.put("display-or", "ପେଟଯନ୍ତ୍ରଣା"); - finalAssoSympObj.put("perform-physical-exam", ""); - finalAssoSympObj.put("options", assoSympArr); - - } catch (JSONException e) { - e.printStackTrace(); - } - - assoSympNode = new Node(finalAssoSympObj); - assoSympNode.getOptionsList().get(0).setOptionsList(finalOptionsList); - assoSympNode.getOptionsList().get(0).setTerminal(false); - - currentNode = assoSympNode; - adapter = new CustomExpandableListAdapter(this, currentNode, this.getClass().getSimpleName()); - questionListView.setAdapter(adapter); - questionListView.setChoiceMode(ExpandableListView.CHOICE_MODE_MULTIPLE); - questionListView.expandGroup(0); - setTitle(patientName + ": " + currentNode.getText()); - - } - } - //Dialog Alert forcing user to answer all questions. //Can be removed if necessary //TODO: Add setting to allow for all questions unrequired..addAll(Arrays.asList(splitExams)) diff --git a/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java b/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java index 720db4ea7b..6dc91587d3 100644 --- a/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java +++ b/app/src/main/java/io/intelehealth/client/activities/visitSummaryActivity/VisitSummaryActivity.java @@ -699,11 +699,7 @@ public void run() { respiratory.setText(resp.getValue()); spO2View.setText(spO2.getValue()); if (complaint.getValue() != null) - complaintView.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); + complaintView.setText(Html.fromHtml(complaint.getValue())); if (famHistory.getValue() != null) famHistView.setText(Html.fromHtml(famHistory.getValue())); if (patHistory.getValue() != null) @@ -825,11 +821,7 @@ public void onClick(View v) { final TextView complaintText = convertView.findViewById(R.id.textView_entry); if (complaint.getValue() != null) { - complaintText.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); + complaintText.setText(Html.fromHtml(complaint.getValue())); } complaintText.setEnabled(false); @@ -840,11 +832,7 @@ public void onClick(DialogInterface dialogInterface, int i) { textInput.setTitle(R.string.question_text_input); final EditText dialogEditText = new EditText(VisitSummaryActivity.this); if (complaint.getValue() != null) { - dialogEditText.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); + dialogEditText.setText(Html.fromHtml(complaint.getValue())); } else { dialogEditText.setText(""); } @@ -854,16 +842,8 @@ public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialog, int which) { complaint.setValue(dialogEditText.getText().toString().replace("\n", "
")); if (complaint.getValue() != null) { - complaintText.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); - complaintView.setText(Html.fromHtml(complaint.getValue().replace("○ c.", "
○ " + getResources().getString(R.string.patient_reports) + " ") - .replace("○ s.", "
○ " + getResources().getString(R.string.patient_denies) + " ") - .replace("c.", "") - .replace("s.", "") - .replace("
• Associated symptoms -", ""))); + complaintText.setText(Html.fromHtml(complaint.getValue())); + complaintView.setText(Html.fromHtml(complaint.getValue())); } updateDatabase(complaint.getValue(), UuidDictionary.CURRENT_COMPLAINT); dialog.dismiss(); diff --git a/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java b/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java index 7bc613afa8..cc08a8bc33 100755 --- a/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java +++ b/app/src/main/java/io/intelehealth/client/database/dao/ImagesDAO.java @@ -363,9 +363,6 @@ public List getImages(String encounterUUid, String ConceptUuid) throws D } } idCursor.close(); - localdb.setTransactionSuccessful(); - localdb.endTransaction(); - localdb.close(); } catch (SQLiteException e) { throw new DAOException(e); } finally {