Example usage for java.io FileWriter append

List of usage examples for java.io FileWriter append

Introduction

In this page you can find the example usage for java.io FileWriter append.

Prototype

@Override
    public Writer append(CharSequence csq) throws IOException 

Source Link

Usage

From source file:patientmanagerv1.HomeController.java

public void saveThoughtProcess() {
    //intact, circumstantial, loa, tangential, foi, logicalgoaldirected, thoughtblocking, ruminating, racingthoughts, thoughtinsertionwithdrawalbroadcast;
    String thoughtProcess = " ";

    if (intact.isSelected() == true) {
        thoughtProcess = thoughtProcess + "intact,";
    }/* w  w  w . j  ava  2s .c  o m*/
    if (circumstantial.isSelected() == true) {
        thoughtProcess = thoughtProcess + "circumstantial,";
    }
    if (loa.isSelected() == true) {
        thoughtProcess = thoughtProcess + "loa,";
    }
    if (tangential.isSelected() == true) {
        thoughtProcess = thoughtProcess + "tangential,";
    }
    if (foi.isSelected() == true) {
        thoughtProcess = thoughtProcess + "foi,";
    }
    if (logicalgoaldirected.isSelected() == true) {
        thoughtProcess = thoughtProcess + "logicalgoaldirected,";
    }
    if (thoughtblocking.isSelected() == true) {
        thoughtProcess = thoughtProcess + "thoughtblocking,";
    }
    if (ruminating.isSelected() == true) {
        thoughtProcess = thoughtProcess + "ruminating,";
    }
    if (racingthoughts.isSelected() == true) {
        thoughtProcess = thoughtProcess + "racingthoughts,";
    }
    if (thoughtinsertionwithdrawalbroadcast.isSelected() == true) {
        thoughtProcess = thoughtProcess + "thoughtinsertionwithdrawalbroadcast,";
    }

    thoughtProcess = thoughtProcess.substring(0, thoughtProcess.length() - 1);
    thoughtProcess = thoughtProcess.trim();

    try {
        File thoughtprocessFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/thoughtprocess.txt");
        FileWriter writ = new FileWriter(thoughtprocessFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(thoughtProcess.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException exception) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveAttitude() {
    //cooperative, guarded, suspicious, withdrawn, uncooperative, hostile, defensive, attitudeother;

    String attitude = " ";

    if (cooperative.isSelected() == true) {
        attitude = attitude + "cooperative,";
    }/*  ww w  .j  a v  a  2  s  . com*/
    if (guarded.isSelected() == true) {
        attitude = attitude + "guarded,";
    }
    if (suspicious.isSelected() == true) {
        attitude = attitude + "suspicious,";
    }
    if (withdrawn.isSelected() == true) {
        attitude = attitude + "withdrawn,";
    }
    if (uncooperative.isSelected() == true) {
        attitude = attitude + "uncooperative,";
    }
    if (hostile.isSelected() == true) {
        attitude = attitude + "hostile,";
    }
    if (defensive.isSelected() == true) {
        attitude = attitude + "defensive,";
    }
    if (attitudeother.isSelected() == true) {
        attitude = attitude + "attitudeother,";
    }

    attitude = attitude.substring(0, attitude.length() - 1);
    attitude = attitude.trim();

    try {
        File attitudeFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/attitude.txt");
        FileWriter writ = new FileWriter(attitudeFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(attitude.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException exception) {
    }

    try {
        File attitudeBox = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/attitudebox.txt");
        FileWriter writ = new FileWriter(attitudeBox, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(attitudeotherbox.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveDOB() {
    try {/*www.j  a  va  2s .  co m*/
        File dobFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + "/EvaluationForm/dateofbirth.txt");
        FileWriter writ = new FileWriter(dobFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        //writ.append(dobText.getText());
        writ.append(dob);
        bw.close();
        writ.close();

    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveEthnicity() {

    String ethnicity = " ";

    if (caucasian.isSelected() == true) {
        ethnicity = ethnicity + "caucasian,";
    }/* ww  w. j a  v a  2 s . c om*/
    if (africanamerican.isSelected() == true) {
        ethnicity = ethnicity + "africanamerican,";
    }
    if (nativeamerican.isSelected() == true) {
        ethnicity = ethnicity + "nativeamerican,";
    }
    if (hispanic.isSelected() == true) {
        ethnicity = ethnicity + "hispanic,";
    }
    if (asian.isSelected() == true) {
        ethnicity = ethnicity + "asian,";
    }
    if (ethnicityother.isSelected() == true) {
        ethnicity = ethnicity + "other,";
    }

    ethnicity = ethnicity.substring(0, ethnicity.length() - 1);
    ethnicity = ethnicity.trim();

    try {
        File ethnicityOtherFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/ethnicity-other.txt");
        FileWriter writ = new FileWriter(ethnicityOtherFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(ethnicityothertext.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }

    try {
        File ethnicityFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/ethnicity.txt");
        FileWriter writ = new FileWriter(ethnicityFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(ethnicity.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }

}

From source file:patientmanagerv1.HomeController.java

public void saveSourceOfInformation() {
    String sOI = " ";

    if (patient.isSelected() == true) {
        sOI = sOI + "patient,";
    }//from   ww w .  ja v a  2s . com
    if (mother.isSelected() == true) {
        sOI = sOI + "mother,";
    }
    if (father.isSelected() == true) {
        sOI = sOI + "father,";
    }
    if (spouse.isSelected() == true) {
        sOI = sOI + "spouse,";
    }
    if (othersourceofinformation.isSelected() == true) {
        sOI = sOI + "other,";
    }

    sOI = sOI.substring(0, sOI.length() - 1);
    sOI = sOI.trim();

    try {
        File sourceofinformationfile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/sourceofinformation.txt");
        FileWriter writ = new FileWriter(sourceofinformationfile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(sOI.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }

    try {
        File sourceofinformationotherfile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/sourceofinformation-other.txt");
        FileWriter writ = new FileWriter(sourceofinformationotherfile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(othersourceofinformationbox.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveSpeech() {
    //normal2, delayed, soft, loud, slurred, excessive, pressured, perseverating, rapid, rambling, incoherent, disorganized, decreasedproductivity;
    String speech = " ";

    if (normal2.isSelected() == true) {
        speech = speech + "normal2,";
    }/*from  w w w . j  a  va  2s. c  o  m*/
    if (delayed.isSelected() == true) {
        speech = speech + "delayed,";
    }
    if (soft.isSelected() == true) {
        speech = speech + "soft,";
    }
    if (loud.isSelected() == true) {
        speech = speech + "loud,";
    }
    if (slurred.isSelected() == true) {
        speech = speech + "slurred,";
    }
    if (excessive.isSelected() == true) {
        speech = speech + "excessive,";
    }
    if (pressured.isSelected() == true) {
        speech = speech + "pressured,";
    }
    if (perseverating.isSelected() == true) {
        speech = speech + "perseverating,";
    }
    if (rapid.isSelected() == true) {
        speech = speech + "rapid,";
    }
    if (rambling.isSelected() == true) {
        speech = speech + "rambling,";
    }
    if (incoherent.isSelected() == true) {
        speech = speech + "incoherent,";
    }
    if (disorganized.isSelected() == true) {
        speech = speech + "disorganized,";
    }
    if (decreasedproductivity.isSelected() == true) {
        speech = speech + "decreasedproductivity,";
    }

    speech = speech.substring(0, speech.length() - 1);
    speech = speech.trim();

    try {
        File speechFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/speech.txt");
        FileWriter writ = new FileWriter(speechFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(speech.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException exception) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveMotorActivity() {
    //normal, agitated, motorretardation, hyperactive, catatonia, tremorstics, motoractivityother;
    String motoractivity = " ";

    if (normal.isSelected() == true) {
        motoractivity = motoractivity + "normal,";
    }//from   ww w  .ja v a  2s. c  o  m
    if (agitated.isSelected() == true) {
        motoractivity = motoractivity + "agitated,";
    }
    if (motorretardation.isSelected() == true) {
        motoractivity = motoractivity + "motorretardation,";
    }
    if (hyperactive.isSelected() == true) {
        motoractivity = motoractivity + "hyperactive,";
    }
    if (catatonia.isSelected() == true) {
        motoractivity = motoractivity + "catatonia,";
    }
    if (tremorstics.isSelected() == true) {
        motoractivity = motoractivity + "tremorstics,";
    }
    if (motoractivityother.isSelected() == true) {
        motoractivity = motoractivity + "motoractivityother,";
    }

    motoractivity = motoractivity.substring(0, motoractivity.length() - 1);
    motoractivity = motoractivity.trim();

    try {
        File motoractivityFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/motoractivity.txt");
        FileWriter writ = new FileWriter(motoractivityFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(motoractivity.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException exception) {
    }

    try {
        File maBox = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase()
                + dob + "/EvaluationForm/motoractivitybox.txt");
        FileWriter writ = new FileWriter(maBox, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(motoractivityotherbox.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveTreatmentPlan() {
    try {//from ww w  . j  a v  a2s  . c  om
        File cFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase()
                + dob + "/EvaluationForm/treatmentplantextfield.txt");
        FileWriter writ = new FileWriter(cFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(treatmentplantextfield.getText());
        bw.close();
        writ.close();

    } catch (IOException e) {
        //    System.out.println("reached here");
    }

    //TextArea treatmentplanbox1, treatmentplanbox2;
    try {
        File axis = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase()
                + dob + "/EvaluationForm/treatmentplanbox1.txt");
        FileWriter writ = new FileWriter(axis, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(treatmentplanbox1.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
    try {
        File axis = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase()
                + dob + "/EvaluationForm/treatmentplanbox2.txt");
        FileWriter writ = new FileWriter(axis, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(treatmentplanbox2.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }

    //CheckBox treatmentplancheckbox1, treatmentplancheckbox2, treatmentplancheckbox3;
    String checkboxes = " ";

    if (treatmentplancheckbox1.isSelected() == true) {
        checkboxes = checkboxes + "treatmentplancheckbox1,";
    }
    if (treatmentplancheckbox2.isSelected() == true) {
        checkboxes = checkboxes + "treatmentplancheckbox2,";
    }
    if (treatmentplancheckbox3.isSelected() == true) {
        checkboxes = checkboxes + "treatmentplancheckbox3,";
    }

    checkboxes = checkboxes.substring(0, checkboxes.length() - 1);
    checkboxes = checkboxes.trim();

    try {
        File hFile = new File(installationPath + "/userdata/" + firstName.toLowerCase() + lastName.toLowerCase()
                + dob + "/EvaluationForm/treatmentplancheckboxes.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(checkboxes.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException exception) {
        //    System.out.println(exception);
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveDeniesHistoryOf() {
    //CheckBox significantwithdrawals, dts, withdrawalseizures, historyofdetox, outpatient, inpatient, na, aa, substancetreatmentprogram;

    //TextField inpatientbox;

    String denies = " ";

    if (significantwithdrawals.isSelected() == true) {
        denies = denies + "significantwithdrawals,";
    }/*w ww  . j  a  v a 2 s  .  c  om*/
    if (dts.isSelected() == true) {
        denies = denies + "dts,";
    }
    if (withdrawalseizures.isSelected() == true) {
        denies = denies + "withdrawalseizures,";
    }
    if (historyofdetox.isSelected() == true) {
        denies = denies + "historyofdetox,";
    }
    if (outpatient.isSelected() == true) {
        denies = denies + "outpatient,";
    }
    if (inpatient.isSelected() == true) {
        denies = denies + "inpatient,";
    }
    if (na.isSelected() == true) {
        denies = denies + "na,";
    }
    if (aa.isSelected() == true) {
        denies = denies + "aa,";
    }
    if (substancetreatmentprogram.isSelected() == true) {
        denies = denies + "substancetreatmentprogram,";
    }

    denies = denies.substring(0, denies.length() - 1);
    denies = denies.trim();

    try {
        File inpatientBox = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/inpatientbox.txt");
        FileWriter writ = new FileWriter(inpatientBox, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(inpatientbox.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }

    try {
        File deniesFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/denieshistoryof.txt");
        FileWriter writ = new FileWriter(deniesFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(denies.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveThoughtContent() {
    //keywords to search: "and offer no apologies"
    //logicalcoherent, povertyofcontent, ideasofreference, delusions, obsessions, phobias, paranoidideation;
    // /Reordered Chaos  XDD

    String thoughtContent = " ";
    //hummus/tahini, "steak", p seeds/walnuts, k p + sm papr; curry, hazelnut meal + a fig + 1tsp pb + 1tsp white flour + a few drops of maple syrup
    //get some (pepper) A1!!!
    //bbq sauce//www  .j av  a 2 s. com
    if (logicalcoherent.isSelected() == true) {
        thoughtContent = thoughtContent + "logicalcoherent,";
    }
    if (povertyofcontent.isSelected() == true) {
        thoughtContent = thoughtContent + "povertyofcontent,";
    }
    if (ideasofreference.isSelected() == true) {
        thoughtContent = thoughtContent + "ideasofreference,";
    }
    if (delusions.isSelected() == true) {
        thoughtContent = thoughtContent + "delusions,";
    }
    if (obsessions.isSelected() == true) {
        thoughtContent = thoughtContent + "obsessions,";
    }
    if (phobias.isSelected() == true) {
        thoughtContent = thoughtContent + "phobias,";
    }
    if (paranoidideation.isSelected() == true) {
        thoughtContent = thoughtContent + "paranoidideation,";
    }

    thoughtContent = thoughtContent.substring(0, thoughtContent.length() - 1);
    thoughtContent = thoughtContent.trim();

    try {
        File thoughtContentFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/thoughtcontent.txt");
        FileWriter writ = new FileWriter(thoughtContentFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(thoughtContent.toLowerCase());
        bw.close();
        writ.close();
    } catch (IOException exception) {
    }

    try {
        File tcdBox = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/thoughtcontentdelusionsbox.txt");
        FileWriter writ = new FileWriter(tcdBox, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(delusionsbox.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}