Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.extdoc.util
Class MatchPatientToPath

java.lang.Object
  extended by ch.elexis.extdoc.util.MatchPatientToPath

public class MatchPatientToPath
extends java.lang.Object

Author:
Niklaus Giger

Constructor Summary
MatchPatientToPath(Patient patient)
          Constructor: Create a new object for this patient
 
Method Summary
static java.lang.String cleanName(java.lang.String name)
           
static Patient filenameBelongsToSomePatient(java.lang.String fullPathname)
          Global: Checks whether the pathname matches an existing patient
static boolean filenameIsValid(java.lang.String fullPathname, java.lang.String familyName, java.lang.String firstName)
          Global: Checks whether the pathname, first and lastname match our conventions Checks basename and parent directory
static java.lang.String firstToken(java.lang.String fullPathName)
           
static java.lang.String geburtsDatumToCanonical(java.lang.String geburtsDatum)
           
static java.util.List<java.io.File> getAllOldConventionFiles()
          Get all files corresponding to the old convention
static java.lang.Object getFilesForPatient(Patient actPatient, java.lang.String[] activePaths)
          Return a list of files which belong to this patient
static java.lang.String[] getFirstAndFamilyNameFromPathOldConvention(java.lang.String fullPathname)
           
static java.lang.String getSubDirPath(Patient pat)
           
static boolean MoveIntoSubDir(java.lang.String path)
           
 java.lang.String ShouldBeMovedToThisSubDir(java.lang.String oldPathname, java.lang.String geburtsDatum)
          Returns a pathname where the file should be stored according to the new convention
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchPatientToPath

public MatchPatientToPath(Patient patient)
Constructor: Create a new object for this patient

Parameters:
patient -
Method Detail

getFirstAndFamilyNameFromPathOldConvention

public static java.lang.String[] getFirstAndFamilyNameFromPathOldConvention(java.lang.String fullPathname)

MoveIntoSubDir

public static boolean MoveIntoSubDir(java.lang.String path)

filenameIsValid

public static boolean filenameIsValid(java.lang.String fullPathname,
                                      java.lang.String familyName,
                                      java.lang.String firstName)
Global: Checks whether the pathname, first and lastname match our conventions Checks basename and parent directory

Parameters:
fullPathname -
familyName -
firstName -
Returns:

filenameBelongsToSomePatient

public static Patient filenameBelongsToSomePatient(java.lang.String fullPathname)
Global: Checks whether the pathname matches an existing patient

Parameters:
fullPathname -
Returns:
patient or null if not none found

getFilesForPatient

public static java.lang.Object getFilesForPatient(Patient actPatient,
                                                  java.lang.String[] activePaths)
Return a list of files which belong to this patient

Parameters:
actPatient -
activePaths - or null to search on all
Returns:
a list of files or an error String

cleanName

public static java.lang.String cleanName(java.lang.String name)
Parameters:
name -
Returns:
name with dashes, underscores removed

firstToken

public static java.lang.String firstToken(java.lang.String fullPathName)
Parameters:
fullPathName -
Returns:
maximal 6 chars of familyName. Spaces removed

getSubDirPath

public static java.lang.String getSubDirPath(Patient pat)

geburtsDatumToCanonical

public static java.lang.String geburtsDatumToCanonical(java.lang.String geburtsDatum)

ShouldBeMovedToThisSubDir

public java.lang.String ShouldBeMovedToThisSubDir(java.lang.String oldPathname,
                                                  java.lang.String geburtsDatum)
Returns a pathname where the file should be stored according to the new convention

Parameters:
fullPathname -
Returns:
null if already stored in the correct place, else new pathname

getAllOldConventionFiles

public static java.util.List<java.io.File> getAllOldConventionFiles()
Get all files corresponding to the old convention

Returns:
a list of string

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis