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 saveMaritalStatus() {

    String maritalStatus = "blah";

    if (single.isSelected() == true) {
        maritalStatus = "Single";
    } else if (married.isSelected() == true) {
        maritalStatus = "Married";
    } else if (seperated.isSelected() == true) {
        maritalStatus = "Seperated";
    } else if (commonlawspouse.isSelected() == true) {
        maritalStatus = "Common Law Spouse";
    } else if (cohabiting.isSelected() == true) {
        maritalStatus = "Cohabiting";
    } else if (divorced.isSelected() == true) {
        maritalStatus = "Divorced";
    } else if (engaged.isSelected() == true) {
        maritalStatus = "Engaged";
    }//from   w  w  w . j  a v  a2s  . c  o m

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

}

From source file:patientmanagerv1.HomeController.java

public void saveMood() {
    //euthymic, depressed, dysphoric, anxious, euphoric, angry, irritable, moodsad;
    String mood = " ";

    if (euthymic.isSelected() == true) {
        mood = mood + "euthymic,";
    }//ww w .j a  v  a 2s  .  c  o  m
    if (depressed.isSelected() == true) {
        mood = mood + "depressed,";
    }
    if (dysphoric.isSelected() == true) {
        mood = mood + "dysphoric,";
    }
    if (anxious.isSelected() == true) {
        mood = mood + "anxious,";
    }
    if (euphoric.isSelected() == true) {
        mood = mood + "euphoric,";
    }
    if (angry.isSelected() == true) {
        mood = mood + "angry,";
    }
    if (irritable.isSelected() == true) {
        mood = mood + "irritable,";
    }
    if (moodsad.isSelected() == true) {
        mood = mood + "moodsad,";
    }

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

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

}

From source file:patientmanagerv1.HomeController.java

public void saveSignsSymptoms() {
    String ss = " ";

    if (ocd.isSelected() == true) {
        ss = ss + "ocd,";
    }/*from   w w w .  j  a  v  a 2  s.  co  m*/
    if (bipolardisorder.isSelected() == true) {
        ss = ss + "bipolardisorder,";
    }
    if (socialphobia.isSelected() == true) {
        ss = ss + "socialphobia,";
    }
    if (panicdisorder.isSelected() == true) {
        ss = ss + "panicdisorder,";
    }
    if (eatingdisorder.isSelected() == true) {
        ss = ss + "eatingdisorder,";
    }
    if (majordepressivedisorder.isSelected() == true) {
        ss = ss + "majordepressivedisorder,";
    }
    if (psychosis.isSelected() == true) {
        ss = ss + "psychosis,";
    }

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

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

From source file:patientmanagerv1.HomeController.java

public void saveSuicidality() {
    //suicidalitydenied, suicidalityideation, suicidalityintent, suicidalityplan;
    String suicidality = " ";

    if (suicidalitydenied.isSelected() == true) {
        suicidality = suicidality + "suicidalitydenied,";
    }//  ww w  .j av  a 2  s  . c o  m
    if (suicidalityideation.isSelected() == true) {
        suicidality = suicidality + "suicidalityideation,";
    }
    if (suicidalityintent.isSelected() == true) {
        suicidality = suicidality + "suicidalityintent,";
    }
    if (suicidalityplan.isSelected() == true) {
        suicidality = suicidality + "suicidalityplan,";
    }

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

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

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

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

}

From source file:patientmanagerv1.HomeController.java

public void savePerception() {
    //the bones were easily crushed underfoot... "well...what do we have here?"
    //no longer felt the familiar rush when their bones...
    //She sighed wearily "I'm no longer a monster, Jana. I ceased to be one a long time ago. If I told myself that I'd be "
    //"Well, so much the better for me, then. It looks like I don't have much to worry about! She pulled her close.

    //J trying to cheer her up-
    //"You just seem so tired, angry/b-ed, and well, old."
    //if you're going to blame anyone, blame your teacher. He turned me into this/made me become like this.
    //everything was done with a sense of detachment, she could derive no more joy from the same actions

    //visualhallucinations, auditoryhallucinations, depersonalization, derealization, commandah, delusions2, illusions, perceptionnoimpairment;
    String p = " ";

    if (visualhallucinations.isSelected() == true) {
        p = p + "visualhallucinations,";
    }/*from w w  w.  ja  v a 2 s.  c om*/
    if (auditoryhallucinations.isSelected() == true) {
        p = p + "auditoryhallucinations,";
    }
    if (depersonalization.isSelected() == true) {
        p = p + "depersonalization,";
    }
    if (derealization.isSelected() == true) {
        p = p + "derealization,";
    }
    if (commandah.isSelected() == true) {
        p = p + "commandah,";
    }
    if (delusions2.isSelected() == true) {
        p = p + "delusions,";
    }
    if (illusions.isSelected() == true) {
        p = p + "illusions,";
    }
    if (perceptionnoimpairment.isSelected() == true) {
        p = p + "noimpairment,";
    }

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

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

From source file:patientmanagerv1.HomeController.java

public void saveAffect() {
    //appropriate, labile, expansive, constricted, happy, sad, blunted, flat, masking, affectnormalrange;
    String affect = " ";

    if (appropriate.isSelected() == true) {
        affect = affect + "appropriate,";
    }/*from  w  ww .ja  v  a 2 s  . c  o  m*/
    if (labile.isSelected() == true) {
        affect = affect + "labile,";
    }
    if (expansive.isSelected() == true) {
        affect = affect + "expansive,";
    }
    if (constricted.isSelected() == true) {
        affect = affect + "constricted,";
    }
    if (affecthappy.isSelected() == true) {
        affect = affect + "affecthappy,";
    }
    if (affectsad.isSelected() == true) {
        affect = affect + "affectsad,";
    }
    if (blunted.isSelected() == true) {
        affect = affect + "blunted,";
    }
    if (flat.isSelected() == true) {
        affect = affect + "flat,";
    }
    if (masking.isSelected() == true) {
        affect = affect + "masking,";
    }
    if (affectnormalrange.isSelected() == true) {
        affect = affect + "affectnormalrange,";
    }

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

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

}

From source file:patientmanagerv1.HomeController.java

public void savePastHistoryOf() {
    String pastHist = " ";

    if (sano.isSelected() == true) {
        pastHist = pastHist + "suicideattemptsno,";
    } else if (sayes.isSelected() == true) {
        pastHist = pastHist + "suicideattemptsyes,";
    }//from   ww w. j  a  va 2  s. c  o m
    if (physicalabuseno.isSelected() == true) {
        pastHist = pastHist + "physicalabuseno,";
    } else if (physicalabuseyes.isSelected() == true) {
        pastHist = pastHist + "physicalabuseyes,";
    }
    if (sexualabuseno.isSelected() == true) {
        pastHist = pastHist + "sexualabuseno,";
    } else if (sexualabuseyes.isSelected() == true) {
        pastHist = pastHist + "sexualabuseyes,";
    }
    if (violentaggressivebehaviorsno.isSelected() == true) {
        pastHist = pastHist + "violentaggressivebehaviorsno,";
    } else if (violentaggressivebehaviorsyes.isSelected() == true) {
        pastHist = pastHist + "violentaggressivebehaviorsyes,";
    }
    if (selfinjuriousbehaviorsno.isSelected() == true) {
        pastHist = pastHist + "selfinjuriousbehaviorsno,";
    } else if (selfinjuriousbehaviorsyes.isSelected() == true) {
        pastHist = pastHist + "selfinjuriousbehaviorsyes,";
    }

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

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

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

From source file:patientmanagerv1.HomeController.java

public void saveAppearance() {
    //wellgroomed, casual, disheveled, bizarre, inappropriate, appearanceother;

    String appearance = " ";

    if (wellgroomed.isSelected() == true) {
        appearance = appearance + "wellgroomed,";
    }//  w ww .  j  ava 2s  .c  om
    if (casual.isSelected() == true) {
        appearance = appearance + "casual,";
    }
    if (disheveled.isSelected() == true) {
        appearance = appearance + "disheveled,";
    }
    if (bizarre.isSelected() == true) {
        appearance = appearance + "bizarre,";
    }
    if (inappropriate.isSelected() == true) {
        appearance = appearance + "inappropriate,";
    }
    if (appearanceother.isSelected() == true) {
        appearance = appearance + "other,";
    }

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

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

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

From source file:patientmanagerv1.HomeController.java

public void saveReferredBy() {
    String referredBy = "blah";

    if (insurance.isSelected() == true) {
        referredBy = "Insurance";
    } else if (internet.isSelected() == true) {
        referredBy = "Internet";
    } else if (pcp.isSelected() == true) {
        referredBy = "PCP";
    } else if (cps.isSelected() == true) {
        referredBy = "CPS";
    } else if (therapist.isSelected() == true) {
        referredBy = "Therapist";
    } else if (referredbyother.isSelected() == true) {
        referredBy = "Other";
    }/*w  w  w.  jav  a 2 s.c  o  m*/

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

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

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

From source file:patientmanagerv1.HomeController.java

public void saveReliabilityOfInformation() {
    String rOI = "";

    if (good.isSelected() == true) {
        rOI = "good";
    } else if (fair.isSelected() == true) {
        rOI = "fair";
    } else if (vague.isSelected() == true) {
        rOI = "vague";
    } else if (minimizing.isSelected() == true) {
        rOI = "minimizing";
    } else if (otherreliabilityofinformation.isSelected() == true) {
        rOI = "other";
    }/*w w w.  java 2 s .co m*/

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

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