View Javadoc
1   package ca.uhn.hl7v2.conf.spec.message;
2   
3   import ca.uhn.hl7v2.conf.ProfileException;
4   import ca.uhn.hl7v2.conf.spec.MetaData;
5   
6   
7   /**
8    * <p>A "static message profile" (see HL7 2.5 section 2.12).  Message profiles are
9    * a precise method of documenting message constraints, using a standard XML syntax
10   * defined by HL7 (introduced in version 2.5).  XML message profiles define
11   * constraints on message content and structure in a well-defined manner, so that
12   * the conformance of a certain message to a certain profile can be tested automatically.
13   * There are several types of profiles:
14   * <ul><li>HL7 Profiles - the standard messages (relatively loosely constrained)</li>
15   * <li>Implementable Profiles - profiles with additional constraints such that all optionality
16   *      has been removed (e.g. optional fields marked as "required" or "not supported").
17   * <li>Constrainable Profiles - any profile with optionality that can be further constrained.</li></ul>
18   * Thus profiles can constrain other profiles.  A typical case would be for a country to create a
19   * constrainable profile based on an HL7 profile, for a vendor to create a different constrainable
20   * profile based on the same HL7 profile, and for a hospital to create an implementable profile for
21   * a particular implementation that constrains both.  </p>
22   * <p>The MessageProfile class is a parsed object representation of the XML profile.</p>
23   *
24   * @author Bryan Tripp
25   */
26  public class StaticDef extends AbstractSegmentContainer {
27  
28      private MetaData metaData;
29      private String msgType;
30      private String eventType;
31      private String msgStructID;
32      private String orderControl;
33      private String eventDesc;
34      private String identifier;
35      private String role;
36  
37      /**
38       * Utility field used by bound properties.
39       */
40      private final java.beans.PropertyChangeSupport propertyChangeSupport = new java.beans.PropertyChangeSupport(this);
41  
42      /**
43       * Utility field used by constrained properties.
44       */
45      private final java.beans.VetoableChangeSupport vetoableChangeSupport = new java.beans.VetoableChangeSupport(this);
46  
47      /**
48       * Creates a new instance of MessageProfile
49       */
50      public StaticDef() {
51      }
52  
53      /**
54       * Adds a PropertyChangeListener to the listener list.
55       *
56       * @param l The listener to add.
57       */
58      public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
59          propertyChangeSupport.addPropertyChangeListener(l);
60      }
61  
62      /**
63       * Removes a PropertyChangeListener from the listener list.
64       *
65       * @param l The listener to remove.
66       */
67      public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
68          propertyChangeSupport.removePropertyChangeListener(l);
69      }
70  
71      /**
72       * Adds a VetoableChangeListener to the listener list.
73       *
74       * @param l The listener to add.
75       */
76      public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
77          vetoableChangeSupport.addVetoableChangeListener(l);
78      }
79  
80      /**
81       * Removes a VetoableChangeListener from the listener list.
82       *
83       * @param l The listener to remove.
84       */
85      public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
86          vetoableChangeSupport.removeVetoableChangeListener(l);
87      }
88  
89      /**
90       * Getter for property metaData.
91       *
92       * @return Value of property metaData.
93       */
94      public MetaData getMetaData() {
95          return this.metaData;
96      }
97  
98      public void setMetaData(MetaData metaData) throws ProfileException {
99          MetaData oldMetaData = this.metaData;
100         try {
101             vetoableChangeSupport.fireVetoableChange("metaData", oldMetaData, metaData);
102         } catch (Exception e) {
103             throw new ProfileException(null, e);
104         }
105         this.metaData = metaData;
106         propertyChangeSupport.firePropertyChange("metaData", oldMetaData, metaData);
107     }
108 
109     /**
110      * Getter for property msgType.
111      *
112      * @return Value of property msgType.
113      */
114     public String getMsgType() {
115         return this.msgType;
116     }
117 
118     /**
119      * Setter for property msgType.
120      *
121      * @param msgType New value of property msgType.
122      * @throws ProfileException
123      */
124     public void setMsgType(String msgType) throws ProfileException {
125         String oldMsgType = this.msgType;
126         try {
127             vetoableChangeSupport.fireVetoableChange("msgType", oldMsgType, msgType);
128         } catch (Exception e) {
129             throw new ProfileException(null, e);
130         }
131         this.msgType = msgType;
132         propertyChangeSupport.firePropertyChange("msgType", oldMsgType, msgType);
133     }
134 
135     /**
136      * Getter for property eventType.
137      *
138      * @return Value of property eventType.
139      */
140     public String getEventType() {
141         return this.eventType;
142     }
143 
144     /**
145      * Setter for property eventType.
146      *
147      * @param eventType New value of property eventType.
148      * @throws ProfileException
149      */
150     public void setEventType(String eventType) throws ProfileException {
151         String oldEventType = this.eventType;
152         try {
153             vetoableChangeSupport.fireVetoableChange("eventType", oldEventType, eventType);
154         } catch (Exception e) {
155             throw new ProfileException(null, e);
156         }
157         this.eventType = eventType;
158         propertyChangeSupport.firePropertyChange("eventType", oldEventType, eventType);
159     }
160 
161     /**
162      * Getter for property msgStructID.
163      *
164      * @return Value of property msgStructID.
165      */
166     public String getMsgStructID() {
167         return this.msgStructID;
168     }
169 
170     /**
171      * Setter for property msgStructID.
172      *
173      * @param msgStructID New value of property msgStructID.
174      * @throws ProfileException
175      */
176     public void setMsgStructID(String msgStructID) throws ProfileException {
177         String oldMsgStructID = this.msgStructID;
178         try {
179             vetoableChangeSupport.fireVetoableChange("msgStructID", oldMsgStructID, msgStructID);
180         } catch (Exception e) {
181             throw new ProfileException(null, e);
182         }
183         this.msgStructID = msgStructID;
184         propertyChangeSupport.firePropertyChange("msgStructID", oldMsgStructID, msgStructID);
185     }
186 
187     /**
188      * Getter for property orderControl.
189      *
190      * @return Value of property orderControl.
191      */
192     public String getOrderControl() {
193         return this.orderControl;
194     }
195 
196     /**
197      * Setter for property orderControl.
198      *
199      * @param orderControl New value of property orderControl.
200      * @throws ProfileException
201      */
202     public void setOrderControl(String orderControl) throws ProfileException {
203         String oldOrderControl = this.orderControl;
204         try {
205             vetoableChangeSupport.fireVetoableChange("orderControl", oldOrderControl, orderControl);
206         } catch (Exception e) {
207             throw new ProfileException(null, e);
208         }
209         this.orderControl = orderControl;
210         propertyChangeSupport.firePropertyChange("orderControl", oldOrderControl, orderControl);
211     }
212 
213     /**
214      * Getter for property eventDesc.
215      *
216      * @return Value of property eventDesc.
217      */
218     public String getEventDesc() {
219         return this.eventDesc;
220     }
221 
222     /**
223      * Setter for property eventDesc.
224      *
225      * @param eventDesc New value of property eventDesc.
226      * @throws ProfileException
227      */
228     public void setEventDesc(String eventDesc) throws ProfileException {
229         String oldEventDesc = this.eventDesc;
230         try {
231             vetoableChangeSupport.fireVetoableChange("eventDesc", oldEventDesc, eventDesc);
232         } catch (Exception e) {
233             throw new ProfileException(null, e);
234         }
235         this.eventDesc = eventDesc;
236         propertyChangeSupport.firePropertyChange("eventDesc", oldEventDesc, eventDesc);
237     }
238 
239     /**
240      * Getter for property identifier.
241      *
242      * @return Value of property identifier.
243      */
244     public String getIdentifier() {
245         return this.identifier;
246     }
247 
248     /**
249      * Setter for property identifier.
250      *
251      * @param identifier New value of property identifier.
252      * @throws ProfileException
253      */
254     public void setIdentifier(String identifier) throws ProfileException {
255         String oldIdentifier = this.identifier;
256         try {
257             vetoableChangeSupport.fireVetoableChange("identifier", oldIdentifier, identifier);
258         } catch (Exception e) {
259             throw new ProfileException(null, e);
260         }
261         this.identifier = identifier;
262         propertyChangeSupport.firePropertyChange("identifier", oldIdentifier, identifier);
263     }
264 
265     /**
266      * Getter for property role.
267      *
268      * @return Value of property role.
269      */
270     public String getRole() {
271         return this.role;
272     }
273 
274     /**
275      * Setter for property role.
276      *
277      * @param eventDesc New value of property role.
278      * @throws ProfileException
279      */
280     public void setRole(String role) throws ProfileException {
281         String oldRole = this.role;
282         try {
283             vetoableChangeSupport.fireVetoableChange("role", oldRole, role);
284         } catch (Exception e) {
285             throw new ProfileException(null, e);
286         }
287         this.role = role;
288         propertyChangeSupport.firePropertyChange("role", oldRole, role);
289     }
290 
291 }