int returnVal = chooser.showSaveDialog(new JFrame());
if (returnVal == JFileChooser.APPROVE_OPTION) {
String curFile = chooser.getSelectedFile().getAbsolutePath();
curFile = curFile.replace('\\', '/');
setIndexFile(curFile);
setGlobalPath(curFile.substring(0, curFile.lastIndexOf("/") + 1));
System.out.println("You choose to save this file: " + curFile);
System.out.println("save index...");
saveHealthRecordIndex(healthRecordIndex);
saveAllHealthRecords(loadedHealthRecords);
System.out.println("healthRecord index saved");