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
+ package fhirengine .translation .hl7 .structures .fhirinventory .group ;
34
+
35
+ import ca .uhn .hl7v2 .HL7Exception ;
36
+ import ca .uhn .hl7v2 .parser .ModelClassFactory ;
37
+ import ca .uhn .hl7v2 .model .*;
38
+ import fhirengine .translation .hl7 .structures .fhirinventory .segment .NTE ;
39
+ import fhirengine .translation .hl7 .structures .fhirinventory .segment .OBX ;
40
+
41
+ /**
42
+ * <p>Represents a ORM_O01_OBSERVATION group structure (a Group object).
43
+ * A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
44
+ * This Group contains the following elements:
45
+ * </p>
46
+ * <ul>
47
+ * <li>1: OBX (Observation/Result) <b> </b></li>
48
+ * <li>2: NTE (Notes and Comments) <b>optional repeating </b></li>
49
+ * </ul>
50
+ */
51
+ //@SuppressWarnings("unused")
52
+ public class ORM_O01_OBSERVATION extends AbstractGroup {
53
+
54
+ /**
55
+ * Creates a new ORM_O01_OBSERVATION group
56
+ */
57
+ public ORM_O01_OBSERVATION (Group parent , ModelClassFactory factory ) {
58
+ super (parent , factory );
59
+ init (factory );
60
+ }
61
+
62
+ private void init (ModelClassFactory factory ) {
63
+ try {
64
+ this .add (OBX .class , true , false , false );
65
+ this .add (NTE .class , false , true , false );
66
+ } catch (HL7Exception e ) {
67
+ log .error ("Unexpected error creating ORM_O01_OBSERVATION - this is probably a bug in the source code generator." , e );
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Returns "2.7"
73
+ */
74
+ public String getVersion () {
75
+ return "2.7" ;
76
+ }
77
+
78
+ /**
79
+ * Returns
80
+ * OBX (Observation/Result) - creates it if necessary
81
+ */
82
+ public OBX getOBX () {
83
+ OBX retVal = getTyped ("OBX" , OBX .class );
84
+ return retVal ;
85
+ }
86
+
87
+ /**
88
+ * Returns
89
+ * the first repetition of
90
+ * NTE (Notes and Comments) - creates it if necessary
91
+ */
92
+ public NTE getNTE () {
93
+ NTE retVal = getTyped ("NTE" , NTE .class );
94
+ return retVal ;
95
+ }
96
+
97
+ /**
98
+ * Returns a specific repetition of
99
+ * NTE (Notes and Comments) - creates it if necessary
100
+ *
101
+ * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
102
+ * @throws HL7Exception if the repetition requested is more than one
103
+ * greater than the number of existing repetitions.
104
+ */
105
+ public NTE getNTE (int rep ) {
106
+ NTE retVal = getTyped ("NTE" , rep , NTE .class );
107
+ return retVal ;
108
+ }
109
+
110
+ /**
111
+ * Returns the number of existing repetitions of NTE
112
+ */
113
+ public int getNTEReps () {
114
+ return getReps ("NTE" );
115
+ }
116
+
117
+ /**
118
+ * <p>
119
+ * Returns a non-modifiable List containing all current existing repetitions of NTE.
120
+ * <p>
121
+ * Note that unlike {@link #getNTE()}, this method will not create any reps
122
+ * if none are already present, so an empty list may be returned.
123
+ * </p>
124
+ */
125
+ public java .util .List <NTE > getNTEAll () throws HL7Exception {
126
+ return getAllAsList ("NTE" , NTE .class );
127
+ }
128
+
129
+ /**
130
+ * Inserts a specific repetition of NTE (Notes and Comments)
131
+ * @see AbstractGroup#insertRepetition(Structure, int)
132
+ */
133
+ public void insertNTE (NTE structure , int rep ) throws HL7Exception {
134
+ super .insertRepetition ("NTE" , structure , rep );
135
+ }
136
+
137
+ /**
138
+ * Inserts a specific repetition of NTE (Notes and Comments)
139
+ * @see AbstractGroup#insertRepetition(Structure, int)
140
+ */
141
+ public NTE insertNTE (int rep ) throws HL7Exception {
142
+ return (NTE )super .insertRepetition ("NTE" , rep );
143
+ }
144
+
145
+ /**
146
+ * Removes a specific repetition of NTE (Notes and Comments)
147
+ * @see AbstractGroup#removeRepetition(String, int)
148
+ */
149
+ public NTE removeNTE (int rep ) throws HL7Exception {
150
+ return (NTE )super .removeRepetition ("NTE" , rep );
151
+ }
152
+ }
0 commit comments