List of usage examples for java.io FileWriter append
@Override public Writer append(CharSequence csq) throws IOException
From source file:patientmanagerv1.HomeController.java
public void saveHistoryOfPresentIllness() { try {/*w w w .ja v a 2s . c om*/ File historyofpresentillnessfile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/historyofpresentillness.txt"); FileWriter writ = new FileWriter(historyofpresentillnessfile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(historyofpresentillness.getText()); bw.close(); writ.close(); } catch (IOException e) { } }
From source file:patientmanagerv1.HomeController.java
public void saveFamilyHistoryOfMentalIllness() { String faHist = "blah"; if (fhomiNO.isSelected() == true) { faHist = "no"; } else {/* w ww .j a v a 2s.co m*/ faHist = "yes"; } try { File fhomiFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/familyhistoryofmentalillnessyesno.txt"); FileWriter writ = new FileWriter(fhomiFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(faHist); bw.close(); writ.close(); } catch (IOException e) { } try { File familyHistory = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/familyhistoryofmentalillness.txt"); FileWriter writ = new FileWriter(familyHistory, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(familyhistoryofmentalillness.getText()); bw.close(); writ.close(); } catch (IOException e) { } }
From source file:patientmanagerv1.HomeController.java
public void saveHistoryOfMedicationTrialsInThePast() { try {// www.j a va2 s . c o m File medicationTrials = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/historyofmedicationtrialsinthepasttable.txt"); FileWriter writ = new FileWriter(medicationTrials, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(historyofmedicationtrialsinthepasttable.getText()); bw.close(); writ.close(); } catch (IOException e) { } try { File medicationTrials = new File( installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/historyofmedicationtrialsinthepastcomments.txt"); FileWriter writ = new FileWriter(medicationTrials, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(historyofmedicationtrialsinthepastcomments.getText()); bw.close(); writ.close(); } catch (IOException e) { } }
From source file:patientmanagerv1.HomeController.java
public void saveGeneralFundOfKnowledge() { String gfok = " "; //shorttermmemorywithinnormallimits, shorttermmermorydeficits, longtermmemorywithinnormallimits,longtermmemorydeficits, shorttermmemorydeficitsbox, longtermmemorydeficitsbox if (generalfundofknowledgewithinnormallimits.isSelected() == true) { gfok = gfok + "generalfundofknowledgewithinnormallimits,"; }/*from w w w. j av a2 s. c om*/ if (generalfundofknowledgedeficits.isSelected() == true) { gfok = gfok + "generalfundofknowledgedeficits,"; } gfok = gfok.substring(0, gfok.length() - 1); gfok = gfok.trim(); try { File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/generalfundofknowledge.txt"); FileWriter writ = new FileWriter(hFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(gfok.toLowerCase()); bw.close(); writ.close(); } catch (IOException exception) { // System.out.println(exception); } try { File bFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/generalfundofknowledgebox.txt"); FileWriter writ = new FileWriter(bFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(generalfundofknowledgedeficitsbox.getText()); bw.close(); writ.close(); } catch (IOException ex) { //System.out.println(ex); } }
From source file:patientmanagerv1.HomeController.java
public void saveLongTermMemory() { String ltm = " "; //shorttermmemorywithinnormallimits, shorttermmermorydeficits, longtermmemorywithinnormallimits,longtermmemorydeficits, shorttermmemorydeficitsbox, longtermmemorydeficitsbox if (longtermmemorywithinnormallimits.isSelected() == true) { ltm = ltm + "longtermmemorywithinnormallimits,"; }/*from w w w. jav a2 s . co m*/ if (longtermmemorydeficits.isSelected() == true) { ltm = ltm + "longtermmemorydeficits,"; } ltm = ltm.substring(0, ltm.length() - 1); ltm = ltm.trim(); try { File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/longtermmemory.txt"); FileWriter writ = new FileWriter(hFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(ltm.toLowerCase()); bw.close(); writ.close(); } catch (IOException exception) { // System.out.println(exception); } try { File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/longtermmemorydeficitsbox.txt"); FileWriter writ = new FileWriter(hFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(longtermmemorydeficitsbox.getText()); bw.close(); writ.close(); } catch (IOException ex) { // System.out.println(ex); } }
From source file:patientmanagerv1.HomeController.java
public void saveShortTermMemory() { String stm = " "; //shorttermmemorywithinnormallimits, shorttermmermorydeficits, longtermmemorywithinnormallimits,longtermmemorydeficits, shorttermmemorydeficitsbox, longtermmemorydeficitsbox if (shorttermmemorywithinnormallimits.isSelected() == true) { stm = stm + "shorttermmemorywithinnormallimits,"; }/* w w w.j a va 2 s.co m*/ if (shorttermmemorydeficits.isSelected() == true) { stm = stm + "shorttermmemorydeficits,"; } stm = stm.substring(0, stm.length() - 1); stm = stm.trim(); try { File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/shorttermmemory.txt"); FileWriter writ = new FileWriter(hFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(stm.toLowerCase()); bw.close(); writ.close(); } catch (IOException exception) { // System.out.println(exception); } try { File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/shorttermmemorydeficitsbox.txt"); FileWriter writ = new FileWriter(hFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(shorttermmemorydeficitsbox.getText()); bw.close(); writ.close(); } catch (IOException exception) { // System.out.println(exception); } }
From source file:patientmanagerv1.HomeController.java
public void saveParentsSiblingsChildren() { try {//from w ww. j a v a 2s .c o m File parentsFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/parents.txt"); FileWriter writ = new FileWriter(parentsFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(parents.getText()); bw.close(); writ.close(); } catch (IOException e) { } try { File siblingsFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/siblings.txt"); FileWriter writ = new FileWriter(siblingsFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(siblings.getText()); bw.close(); writ.close(); } catch (IOException e) { } try { File childrenFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/children.txt"); FileWriter writ = new FileWriter(childrenFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(children.getText()); bw.close(); writ.close(); } catch (IOException e) { } }
From source file:patientmanagerv1.HomeController.java
public void saveIntellect() { String intellect = " "; //shorttermmemorywithinnormallimits, shorttermmermorydeficits, longtermmemorywithinnormallimits,longtermmemorydeficits, shorttermmemorydeficitsbox, longtermmemorydeficitsbox if (intellectaboveaverage.isSelected() == true) { intellect = intellect + "intellectaboveaverage,"; }/*from w w w . ja v a 2s . co m*/ if (intellectaverage.isSelected() == true) { intellect = intellect + "intellectaverage,"; } if (intellectbelowaverage.isSelected() == true) { intellect = intellect + "intellectbelowaverage,"; } intellect = intellect.substring(0, intellect.length() - 1); intellect = intellect.trim(); try { File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/intellect.txt"); FileWriter writ = new FileWriter(hFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(intellect.toLowerCase()); bw.close(); writ.close(); } catch (IOException exception) { // System.out.println(exception); } try { File bFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/intellectbox.txt"); FileWriter writ = new FileWriter(bFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(intellectbelowaveragebox.getText()); bw.close(); writ.close(); } catch (IOException ex) { // System.out.println(ex); } }
From source file:patientmanagerv1.HomeController.java
public void saveHomicidality() { //homicidalitydenied, homicidalityideation, homicidalityintent, homicidalityplan String homicidality = " "; if (homicidalitydenied.isSelected() == true) { homicidality = homicidality + "homicidalitydenied,"; }//w w w. j av a 2 s . c o m if (homicidalityideation.isSelected() == true) { homicidality = homicidality + "homicidalityideation,"; } if (homicidalityintent.isSelected() == true) { homicidality = homicidality + "homicidalityintent,"; } if (homicidalityplan.isSelected() == true) { homicidality = homicidality + "homicidalityplan,"; } homicidality = homicidality.substring(0, homicidality.length() - 1); homicidality = homicidality.trim(); try { File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/homicidality.txt"); FileWriter writ = new FileWriter(hFile, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(homicidality.toLowerCase()); bw.close(); writ.close(); } catch (IOException exception) { } try { File hBox = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/homicidalitybox.txt"); FileWriter writ = new FileWriter(hBox, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(homicidalityplanbox.getText()); bw.close(); writ.close(); } catch (IOException e) { } }
From source file:patientmanagerv1.HomeController.java
public void saveAllergies() { String allergies = " "; if (nkda.isSelected() == true) { allergies = allergies + "nkda,"; }// w w w .j a v a2s. co m if (environmental.isSelected() == true) { allergies = allergies + "environmental,"; } allergies = allergies.substring(0, allergies.length() - 1); allergies = allergies.trim(); try { File allergiesTypes = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/allergiestype.txt"); FileWriter writ = new FileWriter(allergiesTypes, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(allergies.toLowerCase()); bw.close(); writ.close(); } catch (IOException exception) { } try { File allergiesDescriptions = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase() + dob + "/EvaluationForm/allergiesdescription.txt"); FileWriter writ = new FileWriter(allergiesDescriptions, false); //it is set to false so that it (the current patient) will be overwritten every time BufferedWriter bw = new BufferedWriter(writ); writ.append(allergiesdescriptionbox.getText()); bw.close(); writ.close(); } catch (IOException e) { } }