Comparing
Specifications
These instructions are intended to explain and to guide
you through the process of comparing one specification to another in the MWB.
They will be most helpful if you have taken the introductory
tour first.
The MWB offers 2 methods of specification comparison. The first to be discussed is an interactive method that allows you to examine specification differences element by element and gives you the opportunity to change them as you go along developing your specification. The other method produces a difference report that shows all of the differences between the 2 specifications in a single report. The report produced is in XML format which permits the application of various style sheets which may be used to enhance visualization of the differences. One such style-sheet is supplied with the MWB installation.
For purposes of illustration, we will be referring to a pair of simple specifications that were created just for this exercise. Later editions of the MWB ship with these 2 specifications as part of the install package. They are located in the \Projects\Examples folder of the MWB application folder. The 2 specification files are:
CompTrialA-ZZZ_ZZZ.mwb and CompTrialB-ZZZ_ZZZ.mwb
They will be referred to as CompA and CompB respectively in the discussion below.
In this exercise we will load CompB, and compare it to CompA. It might help to think of CompB as a specification that you have built, and CompA as a standard that you want to compare it against. Go ahead and load CompB into the MWB using File/Open.
After loading CompB, go to the tool bar and click on the Spec Comparison Options button:
click here
When the sub-menu drops down, click on the Select Comparison Spec Option. This will bring up the standard file selection dialog. For this exercise, select CompTrialA-ZZZ_ZZZ.mwb.
To learn how the interactive comparison works, continue
reading immediately below. To skip over this section and learn how to produce a
Comparison Report, click here.
Notice that the status bar at the bottom of the form displays the name of the comparison specification. Notice also that any differences between the 2 specifications in the upper panel of the form (the specification name in particular) are highlighted in red. In general, the differences are indicated by highlighting the text of the affected parameter in red (Red is the default highlight color it may be changed in Maint/Options).
As you select elements in the Message Tree any differences will be highlighted in the Element Parameters area to the right of the tree. Notice also, that if any differences are detected, the status bar at the bottom of the form will show the word Different in red. If no difference is detected, the word Same will be displayed there.
After selecting an element with one or more differences, draw the mouse over the highlighted element parameter. For the non-list type fields, such as Length notice that the value of the difference is displayed is the status bar if indeed there is a value to display. If the comparison specification has no value to display then the phrase not present will be shown. For the list type parameters such as Optionality you must click in the field to see the value of the difference.
Click once again on the Spec Comparison Options button the tool bar:
Notice the Comparison On is checked. You may click on this option again to toggle comparison off. If you do so, any highlighted fields will be returned to normal, and the status bar will be cleared of any comparison messages. You may toggle comparison on and off as you desire. You may also select a new comparison specification at any time.
Note too, the check next to the Auto Compare option. This option causes differences to be highlighted immediately upon selection in the Message Tree. If this feature is toggled off, then differences will not be highlighted unless the cursor is drawn over the parameter with a difference, or in the case of a list type parameter, the filed must be clicked. Versions of the MWB after the first, default to Auto Compare ON when a Comparison specification is selected. The older version defaulted to Auto Compare OFF. It is recommended that Auto Compare be toggled on for most applications.
In the illustration below notice the following:
Starting from the top; the Specification field is highlighted indicating a difference between specification names. The structure field is highlighted indicating a difference between message structures. In the message tree, BHS-3 Batch Sending Application is selected, and to the right we see that there are differences in the Optionality and in the Length. When this screen shot was taken, the cursor was over the Length field. The value of the Length in the comparison specification for this field (15) as displayed in the status bar. Note too that the status bar displays the comparison specification CompTrialA-ZZZ_ZZZ.mwb.
Comparison Report
Producing a specification Comparison Report is a fairly straightforward procedure. Be sure that you have opened a specification (CompTrialB-ZZZ_ZZZ.mwb for this exercise) and selected a comparison specification (CompTrialA-ZZZ_ZZZ.mwb) as described above for the interactive comparison procedure.
One caveat to consider is that to get the most from this report within the MWB, you must have Microsoft Internet Explorer 5.0 or later installed on your system. The MWB incorporates this browser for viewing the XML produced with stylesheets attached. If you dont have IE 5 installed you may still produce the report, but you will have to view it outside of the MWB with another XML enabled browser.
Click on the Display/Reports tab of the MWB. In the drop down list on the left of the tool bar, select the Specification Comparison Report XML from the list. If you do not have a comparison specification selected, you will get a warning at this point so be sure to have one selected.
Selection of this report from the list causes an XML formatted report to be produced in the editor window. The report may be saved in this format or printed for later processing or for distribution. Use the File menu options for these tasks. If at this point you click on the Browser icon in the toolbar :
here
The default Microsoft XML stylesheet will be applied automatically producing an html file formatted as shown below:
A much more user friendly report may however be produced by applying the style sheet that ships with the MWB. To do that, go to the top menu and select File/Select XSL Translation. In the dialog that is presented, click on the ellipsis to the left of the Active Comparison Report Style sheet field and navigate to the appropriate style sheet to be applied. The style sheet for comparison reports that ships with the MWB is found in the \Lib\XSL Comp\ folder. The file is hl7_conformance_profile_diffs.xsl. Select this file. You may set it as the default style sheet for this report if you wish. Click OK.
After changing style sheets as we have just done, it is necessary to re-run the report, so once again drop down the report list at the left of the tool bar an select Specification Comparison Report XML. The report will run again and the display will look much more readable. The file produced is in html format and may be saved as such for distribution and viewing through standard web browsers.