001 package org.vmdb.hl7;
002
003 import java.util.*;
004
005 /**
006 * <p><Title:> Identifier Type Constants and Lists. </p>
007 * <p>Description: HL7 Network Connectivity For VMDB. </p>
008 * <p>Copyright: Copyright (c) 2002-2003. </p>
009 * <p>Company: Veterinary Medical Database (VMDB). </p>
010 * @author Michael K. Martin
011 * @version 1.0
012 */
013
014 public class Identifiers {
015 private final static Vector vChipTypes;
016 private final static Vector vEarTagTypes;
017 private final static Vector vTattooTypes;
018
019 // To have other chips recognized by setMicrochip and getMicrochip
020 // logic, add the chip type string here. Case Sensitive.
021 static {
022 vChipTypes = new Vector();
023 vChipTypes.add( "AVID" );
024 vChipTypes.add( "Home Again" );
025 vChipTypes.add( "Joes Chips" );
026
027 vEarTagTypes = new Vector();
028 vEarTagTypes.add( "Ear Tag" );
029
030 vTattooTypes = new Vector();
031 vTattooTypes.add( "Tattoo" );
032 }
033
034 /**
035 * Is the supplied String a known microchip type?
036 * @param sChipType String with case sensitive chip type name.
037 * @return boolean true if found in list of known types.
038 */
039 public static boolean isChipType( String sChipType ) {
040 if( sChipType == null || sChipType.length() == 0 )
041 return false;
042 if( vChipTypes.contains( sChipType ) )
043 return true;
044 else
045 return false;
046 }
047
048 /**
049 * Get an Iterator over all known chip types.<br>
050 * This method should be used to populate pick lists. If new chip types
051 * are needed, they should be added to the sequence of add statements
052 * above. (Someday may want to read this list in from an XML file, etc.,
053 * but really the list needs to be universal among all applications and users.
054 * @return Iterator over String chip types.
055 */
056 public static Iterator listChipTypes() {
057 return vChipTypes.iterator();
058 }
059
060 // Add any other chip logic here.
061
062 /**
063 * Is the supplied String a known ear tag type?
064 * @param sEarTagType String with case sensitive ear tag type name.
065 * @return boolean true if found in list of known types.
066 */
067 public static boolean isEarTagType( String sEarTagType ) {
068 if( sEarTagType == null || sEarTagType.length() == 0 )
069 return false;
070 if( vEarTagTypes.contains( sEarTagType ) )
071 return true;
072 else
073 return false;
074 }
075
076 /**
077 * Get an Iterator over all known ear tag types.<br>
078 * This method should be used to populate pick lists. If new ear tag types
079 * are needed, they should be added to the sequence of add statements
080 * above. (Someday may want to read this list in from an XML file, etc.,
081 * but really the list needs to be universal among all applications and users.
082 * @return Iterator over String ear tag types.
083 */
084 public static Iterator listEarTagTypes() {
085 return vEarTagTypes.iterator();
086 }
087
088 // Add any other ear tag logic here.
089
090 /**
091 * Is the supplied String a known tattoo type?
092 * @param sTattooType String with case sensitive tattoo type name.
093 * @return boolean true if found in list of known types.
094 */
095 public static boolean isTattooType( String sTattooType ) {
096 if( sTattooType == null || sTattooType.length() == 0 )
097 return false;
098 if( vTattooTypes.contains( sTattooType ) )
099 return true;
100 else
101 return false;
102 }
103
104 /**
105 * Get an Iterator over all known tattoo types.<br>
106 * This method should be used to populate pick lists. If new tattoo types
107 * are needed, they should be added to the sequence of add statements
108 * above. (Someday may want to read this list in from an XML file, etc.,
109 * but really the list needs to be universal among all applications and users.
110 * @return Iterator over String tattoo types.
111 */
112 public static Iterator listTattooTypes() {
113 return vTattooTypes.iterator();
114 }
115
116 // Add any other tattoo logic here.
117
118 }