Coverage Report - ca.uhn.hl7v2.conf.spec.message.StaticDef
 
Classes in this File Line Coverage Branch Coverage Complexity
StaticDef
67%
57/84
N/A
1.762
 
 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  19
     private java.beans.PropertyChangeSupport propertyChangeSupport =  new java.beans.PropertyChangeSupport(this);
 38  
     
 39  
     /** Utility field used by constrained properties. */
 40  19
     private java.beans.VetoableChangeSupport vetoableChangeSupport =  new java.beans.VetoableChangeSupport(this);
 41  
     
 42  
     /** Creates a new instance of MessageProfile */
 43  19
     public StaticDef() {
 44  19
     }
 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  0
         propertyChangeSupport.addPropertyChangeListener(l);
 51  0
     }    
 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  0
         propertyChangeSupport.removePropertyChangeListener(l);
 58  0
     }
 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  0
         vetoableChangeSupport.addVetoableChangeListener(l);
 65  0
     }
 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  0
         vetoableChangeSupport.removeVetoableChangeListener(l);
 72  0
     }
 73  
     
 74  
     /** Getter for property metaData.
 75  
      * @return Value of property metaData.
 76  
      */
 77  
     public MetaData getMetaData() {
 78  0
         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  19
         MetaData oldMetaData = this.metaData;
 88  
         try {
 89  19
             vetoableChangeSupport.fireVetoableChange("metaData", oldMetaData, metaData);
 90  0
         } catch (Exception e) {
 91  0
             throw new ProfileException(null, e);
 92  19
         }
 93  19
         this.metaData = metaData;
 94  19
         propertyChangeSupport.firePropertyChange("metaData", oldMetaData, metaData);
 95  19
     }
 96  
     
 97  
     /** Getter for property msgType.
 98  
      * @return Value of property msgType.
 99  
      */
 100  
     public String getMsgType() {
 101  22
         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  19
         String oldMsgType = this.msgType;
 111  
         try {
 112  19
             vetoableChangeSupport.fireVetoableChange("msgType", oldMsgType, msgType);
 113  0
         } catch (Exception e) {
 114  0
             throw new ProfileException(null, e);
 115  19
         }
 116  19
         this.msgType = msgType;
 117  19
         propertyChangeSupport.firePropertyChange("msgType", oldMsgType, msgType);
 118  19
     }
 119  
     
 120  
     /** Getter for property eventType.
 121  
      * @return Value of property eventType.
 122  
      */
 123  
     public String getEventType() {
 124  27
         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  19
         String oldEventType = this.eventType;
 134  
         try {
 135  19
             vetoableChangeSupport.fireVetoableChange("eventType", oldEventType, eventType);
 136  0
         } catch (Exception e) {
 137  0
             throw new ProfileException(null, e);
 138  19
         }
 139  19
         this.eventType = eventType;
 140  19
         propertyChangeSupport.firePropertyChange("eventType", oldEventType, eventType);
 141  19
     }
 142  
     
 143  
     /** Getter for property msgStructID.
 144  
      * @return Value of property msgStructID.
 145  
      */
 146  
     public String getMsgStructID() {
 147  22
         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  19
         String oldMsgStructID = this.msgStructID;
 157  
         try {
 158  19
             vetoableChangeSupport.fireVetoableChange("msgStructID", oldMsgStructID, msgStructID);
 159  0
         } catch (Exception e) {
 160  0
             throw new ProfileException(null, e);
 161  19
         }
 162  19
         this.msgStructID = msgStructID;
 163  19
         propertyChangeSupport.firePropertyChange("msgStructID", oldMsgStructID, msgStructID);
 164  19
     }
 165  
     
 166  
     /** Getter for property orderControl.
 167  
      * @return Value of property orderControl.
 168  
      */
 169  
     public String getOrderControl() {
 170  0
         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  19
         String oldOrderControl = this.orderControl;
 180  
         try {
 181  19
             vetoableChangeSupport.fireVetoableChange("orderControl", oldOrderControl, orderControl);
 182  0
         } catch (Exception e) {
 183  0
             throw new ProfileException(null, e);
 184  19
         }
 185  19
         this.orderControl = orderControl;
 186  19
         propertyChangeSupport.firePropertyChange("orderControl", oldOrderControl, orderControl);
 187  19
     }
 188  
     
 189  
     /** Getter for property eventDesc.
 190  
      * @return Value of property eventDesc.
 191  
      */
 192  
     public String getEventDesc() {
 193  1
         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  19
         String oldEventDesc = this.eventDesc;
 203  
         try {
 204  19
             vetoableChangeSupport.fireVetoableChange("eventDesc", oldEventDesc, eventDesc);
 205  0
         } catch (Exception e) {
 206  0
             throw new ProfileException(null, e);
 207  19
         }
 208  19
         this.eventDesc = eventDesc;
 209  19
         propertyChangeSupport.firePropertyChange("eventDesc", oldEventDesc, eventDesc);
 210  19
     }
 211  
     
 212  
     /** Getter for property identifier.
 213  
      * @return Value of property identifier.
 214  
      */
 215  
     public String getIdentifier() {
 216  21
         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  19
         String oldIdentifier = this.identifier;
 226  
         try {
 227  19
             vetoableChangeSupport.fireVetoableChange("identifier", oldIdentifier, identifier);
 228  0
         } catch (Exception e) {
 229  0
             throw new ProfileException(null, e);
 230  19
         }
 231  19
         this.identifier = identifier;
 232  19
         propertyChangeSupport.firePropertyChange("identifier", oldIdentifier, identifier);
 233  19
     }
 234  
     
 235  
     /** Getter for property role.
 236  
      * @return Value of property role.
 237  
      */
 238  
     public String getRole() {
 239  0
         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  19
         String oldRole = this.role;
 249  
         try {
 250  19
             vetoableChangeSupport.fireVetoableChange("role", oldRole, role);
 251  0
         } catch (Exception e) {
 252  0
             throw new ProfileException(null, e);
 253  19
         }
 254  19
         this.role = role;
 255  19
         propertyChangeSupport.firePropertyChange("role", oldRole, role);
 256  19
     }
 257  
     
 258  
 }