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 saveReasonForReferral() {
    String rfr = "blah";

    if (reasonforreferralpsychiatricevaluation.isSelected() == true) {
        rfr = "psychiatricevaluation";
    }/*  w  w  w  .  ja v  a2  s .c om*/
    if (reasonforreferralmedicationmanagement.isSelected() == true) {
        rfr = "medicationmanagement";
    }

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

From source file:patientmanagerv1.HomeController.java

public void saveEyeContact() {
    String eC = "blah";

    if (eyecontactgood.isSelected() == true) {
        eC = "good";
    }//  ww w  .  j a  v  a2  s.  co m
    if (eyecontactpoor.isSelected() == true) {
        eC = "poor";
    }
    if (eyecontactvariable.isSelected() == true) {
        eC = "variable";
    }

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

From source file:patientmanagerv1.HomeController.java

public void saveSex() {

    String gender = "blah";

    if (male.isSelected() == true) {
        gender = "male";
    }/*  w ww  .  j a va2s  .co m*/
    if (female.isSelected() == true) {
        gender = "female";
    }

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

}

From source file:patientmanagerv1.HomeController.java

public void saveSubstanceUseHistory() {
    try {//from   w  ww.ja v  a2s  . co m
        File substanceUseHistory = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/substanceusehistory.txt");
        FileWriter writ = new FileWriter(substanceUseHistory, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(substanceusehistory.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveEmployment() {
    String e = " ";

    if (emp.isSelected() == true) {
        e = e + "employed,";
    }// w w w. ja v a2 s  . c  o  m
    if (unemp.isSelected() == true) {
        e = e + "unemployed,";
    }
    if (disabilityincome.isSelected() == true) {
        e = e + "disabilityincome,";
    }

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

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

From source file:patientmanagerv1.HomeController.java

public void saveName() {
    try {/* w ww.  j  a va  2  s . c o  m*/
        File firstNameFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/first.txt");
        FileWriter writ = new FileWriter(firstNameFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(firstName);
        bw.close();
        writ.close();

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

From source file:patientmanagerv1.HomeController.java

public void saveCurrentMedications() {
    try {/*from ww  w . jav  a2s  . co m*/
        File currentMedicationsFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/currentmedications.txt");
        FileWriter writ = new FileWriter(currentMedicationsFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(currentmedications.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveAbstraction() {
    //abstractionintact, abstractionconcrete, abstractionidiosyncratic;

    String abstraction = " ";

    if (abstractionintact.isSelected() == true) {
        abstraction = abstraction + "abstractionintact,";
    }//from   w  w  w .  j  av a2s.c  o  m
    if (abstractionconcrete.isSelected() == true) {
        abstraction = abstraction + "abstractionconcrete,";
    }
    if (abstractionidiosyncratic.isSelected() == true) {
        abstraction = abstraction + "abstractionidiosyncratic,";
    }

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

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

From source file:patientmanagerv1.HomeController.java

public void savePastPsychiatricHistory() {
    try {/*from   w w w .j a  va2 s  .c om*/
        File pastPsychiatricHistoryFile = new File(installationPath + "/userdata/" + firstName.toLowerCase()
                + lastName.toLowerCase() + dob + "/EvaluationForm/pastpsychiatrichistory.txt");
        FileWriter writ = new FileWriter(pastPsychiatricHistoryFile, false); //it is set to false so that it (the current patient) will be overwritten every time
        BufferedWriter bw = new BufferedWriter(writ);
        writ.append(pastpsychiatrichistory.getText());
        bw.close();
        writ.close();
    } catch (IOException e) {
    }
}

From source file:patientmanagerv1.HomeController.java

public void saveOrientation() {
    String orientation = " ";

    if (fullyoriented.isSelected() == true) {
        orientation = orientation + "fullyoriented,";
    }/*from  w w w  .j a  v  a2 s .  c  om*/
    if (disoriented.isSelected() == true) {
        orientation = orientation + "disoriented,";
    }
    if (person.isSelected() == true) {
        orientation = orientation + "person,";
    }
    if (place.isSelected() == true) {
        orientation = orientation + "place,";
    }
    if (time.isSelected() == true) {
        orientation = orientation + "time,";
    }

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

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