Inserting an HL7 message example
This is an example of inserting an HL7 message and its patient ID into Table2’s columns Hl7content and patientID.
- Create Table2, including the columns patientID and Hl7content, where patientID is the primary key.
- Click the Table Schema button and import Table2 for the Database Outbound protocol.
-
Write a Tcl script to generate a new message:
$patientID $fieldSeparator $originalMessage
-
$patientID
is retrieving from the$originalMessage
. -
$fieldSeparator
is the field separator defined in Table Schema format. Field separators can conflict with the message content, so you can set an appropriate field separator in Table Schema to avoid conflicts. -
$originalMessage
is the raw message.
-
- Apply the Tcl script to the pre-outbound TPS.
-
Run insert sql statement:
INSERT INTO Table2(Table2.patientID, Table2.Hl7content) VALUES (Table2.patientID,Table2.Hl7content)
-
Run
update sql statement
:UPDATE Table2 set Table2.Hl7content=Table2.Hl7content WHERE Table2.patientID=Table2.patientID