Data Type Library Maintenance
The Add/Edit Data Type File feature allows creation of new
data type files, and maintenance of existing ones. It is accessed from the Maint/Datatypes/Add/Edit
Data type File option on the main menu. Selecting this option brings up a
form entitled MWB Data type Maintenance with its own main menu.

View of the MWB data type
library maintenance form
To start a new data type file:
Select File/New from the menu. Enter the appropriate
HL7 (or other) version identifier in the HL7 Version field. When
finished entering new data types (procedure described below), select File/Save, and save your new data type file to the
MWB’s Lib folder. Alternatively you may select File/SaveAs
to create a new version of the data type library, leaving the original library
as it was.
To add data types to a data type library:
- Select
the Data Type/New option from the main menu.
- Fill
in the Mnemonic field (e.g. CE, TS, etc) and the name of the
data type (e.g. Coded Entry or Time Stamp respectively).
- For
simple data types you should fill in the Max Length field. For
complex data types you may elect to fill in the Max Length field,
or you may elect to have it automatically computed from the lengths of its
constituent elements by checking the Auto Adjust Lengths box.
- Use
the Usage Notes field to describe any peculiarities or special
considerations that pertain to the data type as a whole (you may double
click on this field to bring up a larger text editor if desired).

Entering a new data type
If this is a primitive or simple data type, once you have
filled in the Mnemonic and Name fields, you may elect to save it.
Do so by clicking on the Save Data Type icon
at the bottom of the form.
Assuming that you have saved a primitive data type at this
point, select Data Type/Edit from the main menu. A list will be
displayed showing all of the data types defined so far (one in this case). If
you were actually starting a new data type file de novo, you would proceed to
define all of your known primitive data types before proceeding to define the
complex data types (discussed in the next section). The reason for this is that
you need primitive data types defined before you can combine them to create the
more complex data types.

Selecting a data type to
edit
To add components to an existing data type:
Before continuing, open up an existing data type file so
that there are existing data types to work with. Select File/Open from
the main menu, and select a data type file (*.mdf) to work with –
preferably the HL7 Datatypes.mdf file, which is not recommended for use
any longer. Alternatively, you may copy any of the .mdf files, and work
through this discussion with a clone of the original file. In any event, know
that as long as you don’t select File/Save at the conclusion of your
editing session, no changes will persist in the originally selected library.
- Once
the data type file is loaded Select Data Type/New from the main
menu. Enter a mnemonic ‘ZZZ’ for this discussion and
a name ‘XXXXXXX’ is fine.
- Check
the Auto Adjust Length box.
- In the
Available Data Types drop down list, select the CE data
type. Note the DT Root display box and the large blank box beneath
it. This large blank box is where the tree structure of your complex data
types will be displayed.

Selecting an available data
type
- Click
the Add Data Type button
at the bottom of the tree display. Note
that the DT Root changes to display the data type mnemonic ‘ZZZ’,
and the CE element is added to the tree. The default name assigned
to the element in the tree is that of the CE i.e. coded element.
- Highlight
the element in the tree, and note that under Component Parameters
area to the left of the tree, the parameters defined for the CE appear
in the Name, Optionality, Length etc. fields.
- In the
Name field, change the name of the first component to YYYY.
Note that the name also changes in the tree view.
- Change
the parameters to meet the requirements of your particular implementation
of the CE for this new data type (e.g. Change the Optionality
to Required, then Length to 120
etc.).

Editing component parameters
for ‘YYYY’ data type
- Go
back to the tree view and click the plus sign to the left of the YYYY
component. Notice that the sub-components of the new data type are
displayed. Select each of these elements in the tree in turn, and note
that although the element parameters display in the fields, they are not
editable. Sub-components may only be edited as part of their parent data
type in which they are at the component level. So for example, if you
wanted the parameters for the identifier sub-component to be
different, you would have to edit the ST data type. Keep in mind
however that any such changes to the ST data type would be reflected
in all components that contain sub-components of ST data type.
- Again
select YYYY in the tree view, scroll to the AD
data type in the Available Data Types list. Again click the Add
Data Type button. Note that the AD data type is added after the
YYYY. Data types are added to the tree immediately
after the component selected in the tree view. So if you select YYYY
again, scroll to the CD data type and add it, it will be inserted
between YYYY and the AD data type added above.
- Component’s
positions within the tree may be adjusted using the Move Element Up
and Move Element Down
buttons. To see how this works, again
select the YYYY component and click the Move
Element Down button, which moves the YYYY
component to a position between the other 2.
- Highlight
one of the components in the tree view, and press the Delete Element
button
to remove it from the tree view and the
definition. You can only remove elements at the component level (i.e. not
sub-component level) since removing sub components would in effect be
creating new ill-defined data types.
- Once
you are satisfied with the data type definition, you must click on the Save
Data Type button
to make the data type part of the data
type library.
-
If you start to edit a data type, but decide to abandon the
effort, you may press the Clear Definition button
which will clear the display. You may then
select another data type to edit, or define a new one as described above.

Data type maintenance tool
buttons
To make
you additions/changes permanent within the library you must use the File/Save or File/SaveAs options on the main menu. It is
recommended that you make back up copies of the data type libraries that were
installed with the MWB before making any changes.
Note:
In this proces, when editing an existing data type file, you
are really working on a copy of the file. All the changes that you make during
an edit session are made to the copy of the data type library file, not to the
original. When you are finished with an editing session, you must select File/Save
or File/SaveAs to commit your changes to the data type library file and
thus make the changes permanent. If you elect to end the session without saving
the file, all the changes made during the edit session will be abandoned, and
the data type library file will remain as it was before the session was
started.