==========
Mirth 1.3.1
Outbound Channel: Database Reader to File Writer
Requirement:
==========
Send ORU^R01 Transcription message for each row in DocumentList table with Status = 0
After sending the message, update the Status column to 1 so that the same document is not sent again.
Valid Status Codes Are:
================
0 - Not Sent
1 - Sent
3 - Error
==================
1. SELECT Statement
SELECT DocumentID, DoccumentText, (plus other fields for PID, PIV, OBR fields)
FROM DocumentList
WHERE Status = 0
2. UPDATE Statement
UPDATE DocumentList
SET Status = 1
WHERE DocumentID = {$documentid} (from the select statement above)
==================
I set the option to "Yes" to run the UPDATE SQL
Problem:
=======
Mirth keeps sending multiple messages for the same document and the Status column is not getting updated to 1.
Any help would be appreciated. Also, I would like to know if there's any "Best practice" to implement this requirement.
Thanks in advance.
Mirth 1.3.1
Outbound Channel: Database Reader to File Writer
Requirement:
==========
Send ORU^R01 Transcription message for each row in DocumentList table with Status = 0
After sending the message, update the Status column to 1 so that the same document is not sent again.
Valid Status Codes Are:
================
0 - Not Sent
1 - Sent
3 - Error
==================
1. SELECT Statement
SELECT DocumentID, DoccumentText, (plus other fields for PID, PIV, OBR fields)
FROM DocumentList
WHERE Status = 0
2. UPDATE Statement
UPDATE DocumentList
SET Status = 1
WHERE DocumentID = {$documentid} (from the select statement above)
==================
I set the option to "Yes" to run the UPDATE SQL
Problem:
=======
Mirth keeps sending multiple messages for the same document and the Status column is not getting updated to 1.
Any help would be appreciated. Also, I would like to know if there's any "Best practice" to implement this requirement.
Thanks in advance.
Comment