Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.util
Class GenderService

java.lang.Object
  extended by ch.elexis.util.GenderService
All Implemented Interfaces:
IGenderService

public class GenderService
extends java.lang.Object
implements IGenderService

This rudimentary Plugin for the GenderService simply calls the method isFemale() to test if a name is probably male or female. This is the old method used in Elexis.

Author:
Harald Marlovits

Field Summary
 
Fields inherited from interface ch.elexis.util.IGenderService
dbFemaleString, dbMaleString, FEMALE, FEMALE_STR, FIRSTNAME_SEXES_STR, GENDERUNDEFINED, GENDERUNDEFINED_STR, MALE, MALE_STR, UNISEX, UNISEX_STR
 
Constructor Summary
GenderService()
           
 
Method Summary
 java.lang.Boolean addFirstname(java.lang.String firstname, java.lang.String sex)
          Adds a first name to the table.
 java.lang.Boolean addFirstname(java.lang.String firstname, java.lang.String sex, boolean userRecord)
          Adds a first name to the table.
 int getGender(java.lang.String firstName)
          Return the gender of the first name for param firstname.
 int getGender(java.lang.String firstName, boolean userRecord)
          Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only.
 java.lang.String getGenderString(java.lang.String firstName)
          Return the gender of the first name for param firstname.
 java.lang.String getGenderString(java.lang.String firstname, boolean userRecord)
          Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only.
 void setInitializationData(IConfigurationElement config, java.lang.String propertyName, java.lang.Object data)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenderService

public GenderService()
Method Detail

setInitializationData

public void setInitializationData(IConfigurationElement config,
                                  java.lang.String propertyName,
                                  java.lang.Object data)
                           throws CoreException
Throws:
CoreException

getGender

public int getGender(java.lang.String firstName)
Description copied from interface: IGenderService
Return the gender of the first name for param firstname. First we look for the firstname in the user records. If there are no user records for firstname then we try to find the fitting record inside the imported records.

Specified by:
getGender in interface IGenderService
Returns:
int: 1=male, 2=female, 3=both genders, 0=not filled in or not found

getGender

public int getGender(java.lang.String firstName,
                     boolean userRecord)
Description copied from interface: IGenderService
Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only. If userRecord is false, then we try to find the fitting record inside the imported records.

Specified by:
getGender in interface IGenderService
Parameters:
firstName - first name
userRecord - boolean, true if we should look for a user record, else we look for an imported record
Returns:
int: 1=male, 2=female, 3=both genders, 0=not filled in or not found

getGenderString

public java.lang.String getGenderString(java.lang.String firstName)
Description copied from interface: IGenderService
Return the gender of the first name for param firstname. First we look for the firstname in the user records. If there are no user records for firstname then we try to find the fitting record inside the imported records.

Specified by:
getGenderString in interface IGenderService
Returns:
String: "m"=male, "w"=female, "b"=both genders, ""=not filled in or not found

getGenderString

public java.lang.String getGenderString(java.lang.String firstname,
                                        boolean userRecord)
Description copied from interface: IGenderService
Return the gender of the first name for param firstname. if userRecord is true then we look for the firstname in the user records only. If userRecord is false, then we try to find the fitting record inside the imported records.

Specified by:
getGenderString in interface IGenderService
Parameters:
firstname - = first name
userRecord - boolean, true if we should look for a user record, else we look for an imported record
Returns:
String: "m"=male, "w"=female, "b"=both genders, ""=not filled in or not found

addFirstname

public java.lang.Boolean addFirstname(java.lang.String firstname,
                                      java.lang.String sex)
Description copied from interface: IGenderService
Adds a first name to the table. Only "m", "w", "b" are allowed, all others are ignored/not added. the names are all saved in lowercase. No duplicates are created. If you add a firstname with a gender in opposite to one that is already saved in the db, then the gender is set to "b" for "both genders".

Specified by:
addFirstname in interface IGenderService
Parameters:
firstname - = first name
sex - = gender, String, "m", "w", "b" (both male AND female), all others are not added to the db
Returns:
true if the name is added or changed, false if not

addFirstname

public java.lang.Boolean addFirstname(java.lang.String firstname,
                                      java.lang.String sex,
                                      boolean userRecord)
Description copied from interface: IGenderService
Adds a first name to the table. Only "m", "w", "b" are allowed, all others are ignored/not added. the names are all saved in lowercase. No duplicates are created. If you add a firstname with a gender in opposite to one that is already saved in the db, then the gender is set to "b" for "both genders".

Specified by:
addFirstname in interface IGenderService
Parameters:
firstname - first name
sex - gender, String, "m", "w", "b" (both male AND female), all others are not added to the db
userRecord - true if add to user records (alphanumeric id's), false if add to imported records (numeric id's)
Returns:
true if the name is added or changed, false if not

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis