HL7 Conformance Testing With Message Maker
HL7 Conformance Testing With Message Maker
HL7 Conformance Testing With Message Maker
Message Maker
Robert Snelick
National Institute of Standards &
Technology (NIST)
rsnelick@nist.gov
http://www.nist.gov/messagemaker
Overview
HL7
HL7
Standard
Standard
Message Profile
MSH
EVN
PID
NK1NK1 NK1NK1 NK1 ...
PV1
MSH
EVN
PID
NK1 NK1 NK1NK1NK1 ...
PV1
...
Universal design
Riddled with optionality
Implementation chaos
Interoperability difficult
HL7
System
PV2
OBX
AL1
...
PV2
OBX
AL1
...
...
Agreement
Define constraints
Messaging
Workbench
Test
System
Test
Harness
Conforms?
Message Profile
MSH|^~\&|
REGAEVN|A05|
199901PID|1||
191919^NK1|1|
MASSIE^ENK1|2|
MASSIE^I
<?xml version="1.0"?>
<HL7v2xConformanceProfile H
<MetaData Name="CALINX" Or
<Encodings>
<Encoding>ER7</Encoding>
</Encodings>
<DynamicDef AccAck="NE" Ap
<HL7MsgType=ADT"
EventType=A01
<MetaData Name="CALINX" >
<Segment Name="MSH" LongN
<Field Name="Field Separator" Us
</Field>
<Field Name="Encoding Characters"
<Reference>2.16.9.2</Reference
</Field>
<Field Name="Sending Application"
Message
Maker
Tools to build messages
Message Maker (NIST)
Automated and adaptable
What is HL7
ADT
Lab order
Lab results
Cardiology
X12
Billing
HL7
DICOM
RIS
Hospital
Firewall
Scheduling
Rx
HIS
Diet
Nursing
LAB
HL7
L1
ASTM
L2
L3
NCPDP
L4
HL7
Groups
Groups
Segments
Message Definition
ADT^A04^ADT_A01
MSH
Segment
PID
[ PD1 ]
[{ ROL }]
[{ NK1 }]
PV1
[ PV2 ]
Group
[{ GT1 } ]
[{
IN1
[ IN2 ]
[{ IN3 }]
[{ ROL }]
}]
[ ACC ]
EVN
..
.
LEN
DT
OPT
SI
20
RP/#
TBL#
ITEM#
ELEMENT NAME
00104
Set ID - PID
CX
00105
Patient ID
250
CX
00106
20
CX
00107
250
XPN
00108
Patient Name
250
XPN
00109
26
TS
00110
Date/Time of Birth
IS
00111
Administrative Sex
250
XPN
00112
Patient Alias
10
250
CE
00113
Race
11
250
XAD
00114
Patient Address
12
IS
00115
County Code
13
250
XTN
00116
14
250
XTN
00117
37
80
ST
01541
Strain
38
250
CE
01542
0001
0005
0289
0429
Usage
Cardinality
Length
The Problem
The Solution
Conformance SIG
Trading Partner Agreement
Eliminate optionality (implementation
Specification)
Add specificity to existing messages and
identify specific scenarios/use cases
Identify, document, and bridge semantic
differences
Conformance through Message Profiles
Static Definition
Building a Message Profile
ADT^A01
Message Profile
MSH
EVN
EVN
PID
NK1
PID
NK1
NK1
NK1
NK1
...
PV1
NK1
NK1
NK1
NK1
NK1
...
PV1
...
...
PV2
PV2
OBX
OBX
AL1
AL1
...
Segments/Segment Groups:
Usage (optionality)
Cardinality (min, max)
...
Fields/Components:
Field Usage (Optinality: R, RE, C, CE, X)
Cardinality (min, max)
Value Sets/Coding system
Descriptions
Length
Value needs
to be in
table 0333
SSN not
supported
License is required
and must appear
exactly one time
<Field Name="SSN Number - Patient" Usage="X" Min="0" Max="*" Datatype="ST" Length="16" ItemNo="00122">
<Reference>3.4.2.19</Reference>
</Field>
<Field Name="Driver's License Number - Patient" Usage="R" Min="1" Max="1" Datatype="DLN" Length="250"
ItemNo="00123">
<Reference>3.4.2.20</Reference>
Value must
<Component Name="Driver's License Number" Usage="R" Datatype="ST" Length="100">
be a valid
</Component>
date
<Component Name="Issuing State, province, country" Usage="R" Datatype="IS" Length="10"
Table="0333">
</Component>
<Component Name="expiration date" Usage="R" Datatype="DT" Length="30">
</Component>
</Field>
<Field Name="Mother's Identifier" Usage=X" Min="0" Max="*" Datatype="CX" Length="250" ItemNo="00124">
<Reference>3.4.2.21</Reference>
<Component Name="ID" Usage="X" Datatype="ST" Length="3">
</Component>
<Component Name="Check digit" Usage="X" Datatype="ST">
</Component>
<Component Name="code identifying the check digit scheme employed" Usage="X" Datatype="ID"
Length="3" Table="0061">
</Component>
Conformance Testing
Implementation
Conformance Tests
PPR
PPT
PPV
PRM
PRR
PTR
QBP
QCK
QCN
QRY
QSB
QSX
QVR
RAR
RAS
RCI
RCL
RDE
RDR
RDS
RDY
REF
RER
RGV
ROR
RPA
RPI
RPL
RPR
RQA
RQC
RQI
RQP
RQQ
RRA
RRD
RRE
RRG
RRI
RSP
SIU
SPQ
SQM
SRM
SSR
SSU
SUR
TBR
TCR
TCU
UDM
VQQ
VXQ
VXR
VXU
VXX
Message
Events
A01
A02
A03
A04
A05
A06
A07
A08
A09
A10
A11
A12
A13
A14
A15
A16
A17
A18
A19
A20
A21
A22
A23
A24
A25
A26
A27
A28
A29
A30
A31
A32
A33
A34
A35
A36
A37
A38
A38
A39
A40
A41
A42
A43
A44
A45
A46
A47
A48
A49
A50
A51
ADT^A01
Message Profile
Message Profile
MSH
EVN
PID
NK1NK1NK1NK1 NK1 ...
PV1
MSH
EVN
PID
NK1 NK1 NK1NK1NK1 ...
PV1
...
PV2
OBX
AL1
...
...
PV2
OBX
AL1
...
Profile
N
Message
Profile
Message Profile
Message defines
Profile
explicitly
Message
Profile
explicitly
defines
<?xml
version="1.0"?>
Message
Profile at
explicitly
defines
message
components
Message
Profile at H
explicitly
defines
message
components
<HL7v2xConformanceProfile
explicitly
defines at
message
components
each
level
<MetaData
Name="CALINX"
explicitly
defines at Or
message
components
eachmessage
level
components at
eachmessage
level
implementable
<Encodings>
each level components at
implementable
each<Encoding>ER7</Encoding>
level
implementable
specification
implementable
each
level
specification
</Encodings>
sites
implementable
specification
still
definedAccAck="NE"
their
sites
implementable
specification
still
<DynamicDef
defined their Ap
specification
still
sites
defined
their
own
profiles
(many)
<HL7MsgType=ADT"
still
specification
sites(many)
defined their
own
profiles
still
sites(many)
defined their
own
profiles
EventType=A01
nature
of
the
beast
defined their
own still
profiles
nature
of sites
the (many)
beast
>
own<MetaData
profiles
(many)
nature
of theName="CALINX"
beast
own
profiles
(many)
nature
<Segment
Name="MSH"
LongN
of
the
nature of thebeast
beast
<Field Name="Field
Separator" Us
nature
of the beast
</Field>
MSH|^~\&|
REGAEVN|A05|
199901PID|1||
191919^NK1|1|
MASSIE^ENK1|2|
MASSIE^I
MSH|^~\&|
REGAEVN|A05|
199901PID|1||
191919^NK1|1|
MASSIE^ENK1|2|
MASSIE^I
MSH|^~\&|
REGAEVN|A05|
199901PID|1||
191919^NK1|1|
MASSIE^ENK1|2|
MASSIE^I
explicitly
defines at
message
components
eachmessage
level
level
<MetaData
Name="CALINX"
explicitly
defines at Or
components
eachmessage
components
at
eachmessage
level
implementable
each <Encodings>
level components at
implementable
each<Encoding>ER7</Encoding>
level
implementable
specification
implementable
each
level
specification
</Encodings>
sites
implementable
specification
still
definedAccAck="NE"
their
sites
implementable
specification
still
<DynamicDef
defined their Ap
specification
still
sites
defined their
own
profiles
(many)
<HL7MsgType=ADT"
specification
still
sites
defined
their
own profiles
(many)
sites
defined their
ownstill
profiles
(many)
EventType=A01
nature
of
the
beast
still
sites
defined
their
own
profiles
(many)
nature
of the Name="CALINX"
beast
>
own<MetaData
profiles
nature
of the (many)
beast
own
profiles
(many)
nature
<Segment
Name="MSH"
LongN
of
the
beast
nature of the beast
<Field Name="Field
Separator" Us
nature
of the beast
</Field>
Development:
Capabilities:
Message Variation
structure
constraint attributes
data content
validity
message density
specific test location and type
Data Configuration
Methods to automatically determine test suite
Multiple encodings (XML, ER7)
Test Descriptions
HL7
Standard
DB
NIST HL7
Reference
Database
Table
Values
Example
Values
from Profile
Default
Values
HL7 V2
Profile (XML)
Message
Maker
Message
Factory
(XSLT)
NIST Data
Repository
(XML)
Testing Options
Usage
Cardinality
Volume
Data Content
Length
etc.
HL7 Test
Messages
Profile based
Structurally correct
Validated
Varied
Descriptive
Suitable basis for
conformance testing
Testing
Framework
HL7 Test
Driver
simulates application
controls testing
transmits HL7 messages
to the IUT
simulates application
controlled by Test Driver
receives and delivers
messages with IUT
HL7 Message
HL7 Implementation
Under Test (IUT)