Coverage Report - ca.uhn.hl7v2.test.singledt.conf.segment.DB1
 
Classes in this File Line Coverage Branch Coverage Complexity
DB1
20%
14/67
0%
0/9
1.63
 
 1  
 /*
 2  
  * This class is an auto-generated source file for a HAPI
 3  
  * HL7 v2.x standard structure class.
 4  
  *
 5  
  * For more information, visit: http://hl7api.sourceforge.net/
 6  
  * 
 7  
  * The contents of this file are subject to the Mozilla Public License Version 1.1 
 8  
  * (the "License"); you may not use this file except in compliance with the License. 
 9  
  * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
 10  
  * Software distributed under the License is distributed on an "AS IS" basis, 
 11  
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
 12  
  * specific language governing rights and limitations under the License. 
 13  
  * 
 14  
  * The Original Code is "[file_name]".  Description: 
 15  
  * "[one_line_description]" 
 16  
  * 
 17  
  * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
 18  
  * 2012.  All Rights Reserved. 
 19  
  * 
 20  
  * Contributor(s): ______________________________________. 
 21  
  * 
 22  
  * Alternatively, the contents of this file may be used under the terms of the 
 23  
  * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
 24  
  * applicable instead of those above.  If you wish to allow use of your version of this 
 25  
  * file only under the terms of the GPL and not to allow others to use your version 
 26  
  * of this file under the MPL, indicate your decision by deleting  the provisions above 
 27  
  * and replace  them with the notice and other provisions required by the GPL License.  
 28  
  * If you do not delete the provisions above, a recipient may use your version of 
 29  
  * this file under either the MPL or the GPL. 
 30  
  * 
 31  
  */
 32  
 
 33  
 
 34  
 package ca.uhn.hl7v2.test.singledt.conf.segment;
 35  
 
 36  
 // import ca.uhn.hl7v2.test.singledt.conf.group.*;
 37  
 import ca.uhn.hl7v2.model.v25.datatype.*;
 38  
 import ca.uhn.hl7v2.HL7Exception;
 39  
 import ca.uhn.hl7v2.parser.ModelClassFactory;
 40  
 import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
 41  
 import ca.uhn.hl7v2.model.AbstractMessage;
 42  
 import ca.uhn.hl7v2.model.Group;
 43  
 import ca.uhn.hl7v2.model.Type;
 44  
 import ca.uhn.hl7v2.model.AbstractSegment;
 45  
 import ca.uhn.hl7v2.model.Varies;
 46  
 
 47  
 
 48  
 /**
 49  
  *<p>Represents an HL7 DB1 message segment (Disability). 
 50  
  * This segment has the following fields:</p>
 51  
  * <ul>
 52  
      * <li>DB1-1: Set ID - DB1 (SI) <b> </b>
 53  
      * <li>DB1-2: Disabled Person Code (IS) <b>optional </b>
 54  
      * <li>DB1-3: Disabled Person Identifier (CX) <b>optional repeating</b>
 55  
      * <li>DB1-4: Disabled Indicator (ID) <b>optional </b>
 56  
      * <li>DB1-5: Disability Start Date (DT) <b>optional </b>
 57  
      * <li>DB1-6: Disability End Date (DT) <b>optional </b>
 58  
      * <li>DB1-7: Disability Return to Work Date (DT) <b>optional </b>
 59  
      * <li>DB1-8: Disability Unable to Work Date (DT) <b>optional </b>
 60  
  * </ul>
 61  
  */
 62  
 @SuppressWarnings("unused")
 63  
 public class DB1 extends AbstractSegment {
 64  
 
 65  
     /** 
 66  
      * Creates a new DB1 segment
 67  
      */
 68  
     public DB1(Group parent, ModelClassFactory factory) {
 69  1
        super(parent, factory);
 70  1
        init(factory);
 71  1
     }
 72  
 
 73  
     private void init(ModelClassFactory factory) {
 74  
        try {
 75  1
                                   this.add(SI.class, true, 1, 4, new Object[]{ getMessage() }, "Set ID - DB1");
 76  1
                                               this.add(IS.class, false, 1, 2, new Object[]{ getMessage(), new Integer(334) }, "Disabled Person Code");
 77  1
                                   this.add(CX.class, false, -1, 250, new Object[]{ getMessage() }, "Disabled Person Identifier");
 78  1
                                               this.add(ID.class, false, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Disabled Indicator");
 79  1
                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Disability Start Date");
 80  1
                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Disability End Date");
 81  1
                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Disability Return to Work Date");
 82  1
                                   this.add(DT.class, false, 1, 8, new Object[]{ getMessage() }, "Disability Unable to Work Date");
 83  0
        } catch(HL7Exception e) {
 84  0
           log.error("Unexpected error creating DB1 - this is probably a bug in the source code generator.", e);
 85  1
        }
 86  1
     }
 87  
 
 88  
 
 89  
 
 90  
     /**
 91  
      * Returns
 92  
      * DB1-1: "Set ID - DB1" - creates it if necessary
 93  
      */
 94  
     public SI getSetIDDB1() { 
 95  0
                 SI retVal = this.getTypedField(1, 0);
 96  0
                 return retVal;
 97  
     }
 98  
     
 99  
     /**
 100  
      * Returns
 101  
      * DB1-1: "Set ID - DB1" - creates it if necessary
 102  
      */
 103  
     public SI getDb11_SetIDDB1() { 
 104  0
                 SI retVal = this.getTypedField(1, 0);
 105  0
                 return retVal;
 106  
     }
 107  
 
 108  
 
 109  
 
 110  
     /**
 111  
      * Returns
 112  
      * DB1-2: "Disabled Person Code" - creates it if necessary
 113  
      */
 114  
     public IS getDisabledPersonCode() { 
 115  0
                 IS retVal = this.getTypedField(2, 0);
 116  0
                 return retVal;
 117  
     }
 118  
     
 119  
     /**
 120  
      * Returns
 121  
      * DB1-2: "Disabled Person Code" - creates it if necessary
 122  
      */
 123  
     public IS getDb12_DisabledPersonCode() { 
 124  0
                 IS retVal = this.getTypedField(2, 0);
 125  0
                 return retVal;
 126  
     }
 127  
 
 128  
 
 129  
     /**
 130  
      * Returns all repetitions of Disabled Person Identifier (DB1-3).
 131  
      */
 132  
     public CX[] getDisabledPersonIdentifier() {
 133  0
             CX[] retVal = this.getTypedField(3, new CX[0]);
 134  0
             return retVal;
 135  
     }
 136  
 
 137  
 
 138  
     /**
 139  
      * Returns all repetitions of Disabled Person Identifier (DB1-3).
 140  
      */
 141  
     public CX[] getDb13_DisabledPersonIdentifier() {
 142  0
             CX[] retVal = this.getTypedField(3, new CX[0]);
 143  0
             return retVal;
 144  
     }
 145  
 
 146  
 
 147  
     /**
 148  
      * Returns a count of the current number of repetitions of Disabled Person Identifier (DB1-3).
 149  
      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
 150  
      * it will return zero.
 151  
      */
 152  
     public int getDisabledPersonIdentifierReps() {
 153  0
             return this.getReps(3);
 154  
     }
 155  
 
 156  
 
 157  
     /**
 158  
      * Returns a specific repetition of
 159  
      * DB1-3: "Disabled Person Identifier" - creates it if necessary
 160  
      *
 161  
      * @param rep The repetition index (0-indexed)
 162  
      */
 163  
     public CX getDisabledPersonIdentifier(int rep) { 
 164  0
                 CX retVal = this.getTypedField(3, rep);
 165  0
                 return retVal;
 166  
     }
 167  
 
 168  
     /**
 169  
      * Returns a specific repetition of
 170  
      * DB1-3: "Disabled Person Identifier" - creates it if necessary
 171  
      *
 172  
      * @param rep The repetition index (0-indexed)
 173  
      */
 174  
     public CX getDb13_DisabledPersonIdentifier(int rep) { 
 175  0
                 CX retVal = this.getTypedField(3, rep);
 176  0
                 return retVal;
 177  
     }
 178  
 
 179  
     /**
 180  
      * Returns a count of the current number of repetitions of Disabled Person Identifier (DB1-3).
 181  
      * This method does not create a repetition, so if no repetitions have currently been defined or accessed,
 182  
      * it will return zero.
 183  
      */
 184  
     public int getDb13_DisabledPersonIdentifierReps() {
 185  1
             return this.getReps(3);
 186  
     }
 187  
 
 188  
 
 189  
     /**
 190  
      * Inserts a repetition of
 191  
      * DB1-3: "Disabled Person Identifier" at a specific index
 192  
      *
 193  
      * @param rep The repetition index (0-indexed)
 194  
      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
 195  
      */
 196  
     public CX insertDisabledPersonIdentifier(int rep) throws HL7Exception { 
 197  0
         return (CX) super.insertRepetition(3, rep);
 198  
     }
 199  
 
 200  
 
 201  
     /**
 202  
      * Inserts a repetition of
 203  
      * DB1-3: "Disabled Person Identifier" at a specific index
 204  
      *
 205  
      * @param rep The repetition index (0-indexed)
 206  
      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
 207  
      */
 208  
     public CX insertDb13_DisabledPersonIdentifier(int rep) throws HL7Exception { 
 209  0
         return (CX) super.insertRepetition(3, rep);
 210  
     }
 211  
 
 212  
 
 213  
     /**
 214  
      * Removes a repetition of
 215  
      * DB1-3: "Disabled Person Identifier" at a specific index
 216  
      *
 217  
      * @param rep The repetition index (0-indexed)
 218  
      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
 219  
      */
 220  
     public CX removeDisabledPersonIdentifier(int rep) throws HL7Exception { 
 221  0
         return (CX) super.removeRepetition(3, rep);
 222  
     }
 223  
 
 224  
 
 225  
     /**
 226  
      * Removes a repetition of
 227  
      * DB1-3: "Disabled Person Identifier" at a specific index
 228  
      *
 229  
      * @param rep The repetition index (0-indexed)
 230  
      * @throws HL7Exception If the rep is invalid (below 0, or too high for the allowable repetitions)
 231  
      */
 232  
     public CX removeDb13_DisabledPersonIdentifier(int rep) throws HL7Exception { 
 233  0
         return (CX) super.removeRepetition(3, rep);
 234  
     }
 235  
 
 236  
 
 237  
 
 238  
 
 239  
     /**
 240  
      * Returns
 241  
      * DB1-4: "Disabled Indicator" - creates it if necessary
 242  
      */
 243  
     public ID getDisabledIndicator() { 
 244  0
                 ID retVal = this.getTypedField(4, 0);
 245  0
                 return retVal;
 246  
     }
 247  
     
 248  
     /**
 249  
      * Returns
 250  
      * DB1-4: "Disabled Indicator" - creates it if necessary
 251  
      */
 252  
     public ID getDb14_DisabledIndicator() { 
 253  0
                 ID retVal = this.getTypedField(4, 0);
 254  0
                 return retVal;
 255  
     }
 256  
 
 257  
 
 258  
 
 259  
     /**
 260  
      * Returns
 261  
      * DB1-5: "Disability Start Date" - creates it if necessary
 262  
      */
 263  
     public DT getDisabilityStartDate() { 
 264  0
                 DT retVal = this.getTypedField(5, 0);
 265  0
                 return retVal;
 266  
     }
 267  
     
 268  
     /**
 269  
      * Returns
 270  
      * DB1-5: "Disability Start Date" - creates it if necessary
 271  
      */
 272  
     public DT getDb15_DisabilityStartDate() { 
 273  0
                 DT retVal = this.getTypedField(5, 0);
 274  0
                 return retVal;
 275  
     }
 276  
 
 277  
 
 278  
 
 279  
     /**
 280  
      * Returns
 281  
      * DB1-6: "Disability End Date" - creates it if necessary
 282  
      */
 283  
     public DT getDisabilityEndDate() { 
 284  0
                 DT retVal = this.getTypedField(6, 0);
 285  0
                 return retVal;
 286  
     }
 287  
     
 288  
     /**
 289  
      * Returns
 290  
      * DB1-6: "Disability End Date" - creates it if necessary
 291  
      */
 292  
     public DT getDb16_DisabilityEndDate() { 
 293  0
                 DT retVal = this.getTypedField(6, 0);
 294  0
                 return retVal;
 295  
     }
 296  
 
 297  
 
 298  
 
 299  
     /**
 300  
      * Returns
 301  
      * DB1-7: "Disability Return to Work Date" - creates it if necessary
 302  
      */
 303  
     public DT getDisabilityReturnToWorkDate() { 
 304  0
                 DT retVal = this.getTypedField(7, 0);
 305  0
                 return retVal;
 306  
     }
 307  
     
 308  
     /**
 309  
      * Returns
 310  
      * DB1-7: "Disability Return to Work Date" - creates it if necessary
 311  
      */
 312  
     public DT getDb17_DisabilityReturnToWorkDate() { 
 313  0
                 DT retVal = this.getTypedField(7, 0);
 314  0
                 return retVal;
 315  
     }
 316  
 
 317  
 
 318  
 
 319  
     /**
 320  
      * Returns
 321  
      * DB1-8: "Disability Unable to Work Date" - creates it if necessary
 322  
      */
 323  
     public DT getDisabilityUnableToWorkDate() { 
 324  0
                 DT retVal = this.getTypedField(8, 0);
 325  0
                 return retVal;
 326  
     }
 327  
     
 328  
     /**
 329  
      * Returns
 330  
      * DB1-8: "Disability Unable to Work Date" - creates it if necessary
 331  
      */
 332  
     public DT getDb18_DisabilityUnableToWorkDate() { 
 333  0
                 DT retVal = this.getTypedField(8, 0);
 334  0
                 return retVal;
 335  
     }
 336  
 
 337  
 
 338  
 
 339  
 
 340  
 
 341  
     /** {@inheritDoc} */   
 342  
     protected Type createNewTypeWithoutReflection(int field) {
 343  0
        switch (field) {
 344  0
           case 0: return new SI(getMessage());
 345  0
           case 1: return new IS(getMessage(), new Integer( 334 ));
 346  0
           case 2: return new CX(getMessage());
 347  0
           case 3: return new ID(getMessage(), new Integer( 136 ));
 348  0
           case 4: return new DT(getMessage());
 349  0
           case 5: return new DT(getMessage());
 350  0
           case 6: return new DT(getMessage());
 351  0
           case 7: return new DT(getMessage());
 352  0
           default: return null;
 353  
        }
 354  
    }
 355  
 
 356  
 
 357  
 }
 358