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   * @author Bryan Tripp
24   */
25  public class StaticDef extends AbstractSegmentContainer {
26      
27      private MetaData metaData; 
28      private String msgType;
29      private String eventType;
30      private String msgStructID;
31      private String orderControl;
32      private String eventDesc;
33      private String identifier;
34      private String role;
35      
36      /** Utility field used by bound properties. */
37      private java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
38      
39      /** Utility field used by constrained properties. */
40      private java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
41      
42      /** Creates a new instance of MessageProfile */
43      public StaticDef() {
44      }
45      
46      /** Adds a PropertyChangeListener to the listener list.
47       * @param l The listener to add.
48       */
49      public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
50          propertyChangeSupport.addPropertyChangeListener(l);
51      }    
52      
53      /** Removes a PropertyChangeListener from the listener list.
54       * @param l The listener to remove.
55       */
56      public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
57          propertyChangeSupport.removePropertyChangeListener(l);
58      }
59      
60      /** Adds a VetoableChangeListener to the listener list.
61       * @param l The listener to add.
62       */
63      public void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
64          vetoableChangeSupport.addVetoableChangeListener(l);
65      }
66      
67      /** Removes a VetoableChangeListener from the listener list.
68       * @param l The listener to remove.
69       */
70      public void removeVetoableChangeListener(java.beans.VetoableChangeListener l) {
71          vetoableChangeSupport.removeVetoableChangeListener(l);
72      }
73      
74      /** Getter for property metaData.
75       * @return Value of property metaData.
76       */
77      public MetaData getMetaData() {
78          return this.metaData;
79      }
80      
81      /** Setter for property metaData.
82       * @param msgType New value of property metaData.
83       *
84       * @throws ProfileException
85       */
86      public void setMetaData(MetaData metaData) throws ProfileException {
87          MetaData oldMetaData = this.metaData;
88          try {
89              vetoableChangeSupport.fireVetoableChange("metaData", oldMetaData, metaData);
90          } catch (Exception e) {
91              throw new ProfileException(null, e);
92          }
93          this.metaData = metaData;
94          propertyChangeSupport.firePropertyChange("metaData", oldMetaData, metaData);
95      }
96      
97      /** Getter for property msgType.
98       * @return Value of property msgType.
99       */
100     public String getMsgType() {
101         return this.msgType;
102     }
103     
104     /** Setter for property msgType.
105      * @param msgType New value of property msgType.
106      *
107      * @throws ProfileException
108      */
109     public void setMsgType(String msgType) throws ProfileException {
110         String oldMsgType = this.msgType;
111         try {
112             vetoableChangeSupport.fireVetoableChange("msgType", oldMsgType, msgType);
113         } catch (Exception e) {
114             throw new ProfileException(null, e);
115         }
116         this.msgType = msgType;
117         propertyChangeSupport.firePropertyChange("msgType", oldMsgType, msgType);
118     }
119     
120     /** Getter for property eventType.
121      * @return Value of property eventType.
122      */
123     public String getEventType() {
124         return this.eventType;
125     }
126     
127     /** Setter for property eventType.
128      * @param eventType New value of property eventType.
129      *
130      * @throws ProfileException
131      */
132     public void setEventType(String eventType) throws ProfileException {
133         String oldEventType = this.eventType;
134         try {
135             vetoableChangeSupport.fireVetoableChange("eventType", oldEventType, eventType);
136         } catch (Exception e) {
137             throw new ProfileException(null, e);
138         }
139         this.eventType = eventType;
140         propertyChangeSupport.firePropertyChange("eventType", oldEventType, eventType);
141     }
142     
143     /** Getter for property msgStructID.
144      * @return Value of property msgStructID.
145      */
146     public String getMsgStructID() {
147         return this.msgStructID;
148     }
149     
150     /** Setter for property msgStructID.
151      * @param msgStructID New value of property msgStructID.
152      *
153      * @throws ProfileException
154      */
155     public void setMsgStructID(String msgStructID) throws ProfileException {
156         String oldMsgStructID = this.msgStructID;
157         try {
158             vetoableChangeSupport.fireVetoableChange("msgStructID", oldMsgStructID, msgStructID);
159         } catch (Exception e) {
160             throw new ProfileException(null, e);
161         }
162         this.msgStructID = msgStructID;
163         propertyChangeSupport.firePropertyChange("msgStructID", oldMsgStructID, msgStructID);
164     }
165     
166     /** Getter for property orderControl.
167      * @return Value of property orderControl.
168      */
169     public String getOrderControl() {
170         return this.orderControl;
171     }
172     
173     /** Setter for property orderControl.
174      * @param orderControl New value of property orderControl.
175      *
176      * @throws ProfileException
177      */
178     public void setOrderControl(String orderControl) throws ProfileException {
179         String oldOrderControl = this.orderControl;
180         try {
181             vetoableChangeSupport.fireVetoableChange("orderControl", oldOrderControl, orderControl);
182         } catch (Exception e) {
183             throw new ProfileException(null, e);
184         }
185         this.orderControl = orderControl;
186         propertyChangeSupport.firePropertyChange("orderControl", oldOrderControl, orderControl);
187     }
188     
189     /** Getter for property eventDesc.
190      * @return Value of property eventDesc.
191      */
192     public String getEventDesc() {
193         return this.eventDesc;
194     }
195     
196     /** Setter for property eventDesc.
197      * @param eventDesc New value of property eventDesc.
198      *
199      * @throws ProfileException
200      */
201     public void setEventDesc(String eventDesc) throws ProfileException {
202         String oldEventDesc = this.eventDesc;
203         try {
204             vetoableChangeSupport.fireVetoableChange("eventDesc", oldEventDesc, eventDesc);
205         } catch (Exception e) {
206             throw new ProfileException(null, e);
207         }
208         this.eventDesc = eventDesc;
209         propertyChangeSupport.firePropertyChange("eventDesc", oldEventDesc, eventDesc);
210     }
211     
212     /** Getter for property identifier.
213      * @return Value of property identifier.
214      */
215     public String getIdentifier() {
216         return this.identifier;
217     }
218     
219     /** Setter for property identifier.
220      * @param eventDesc New value of property identifier.
221      *
222      * @throws ProfileException
223      */
224     public void setIdentifier(String identifier) throws ProfileException {
225         String oldIdentifier = this.identifier;
226         try {
227             vetoableChangeSupport.fireVetoableChange("identifier", oldIdentifier, identifier);
228         } catch (Exception e) {
229             throw new ProfileException(null, e);
230         }
231         this.identifier = identifier;
232         propertyChangeSupport.firePropertyChange("identifier", oldIdentifier, identifier);
233     }
234     
235     /** Getter for property role.
236      * @return Value of property role.
237      */
238     public String getRole() {
239         return this.role;
240     }
241     
242     /** Setter for property role.
243      * @param eventDesc New value of property role.
244      *
245      * @throws ProfileException
246      */
247     public void setRole(String role) throws ProfileException {
248         String oldRole = this.role;
249         try {
250             vetoableChangeSupport.fireVetoableChange("role", oldRole, role);
251         } catch (Exception e) {
252             throw new ProfileException(null, e);
253         }
254         this.role = role;
255         propertyChangeSupport.firePropertyChange("role", oldRole, role);
256     }
257     
258 }