I'd like to create a C# program that generate the HL7 messages foramt by rooping through the table in database.I have two tables: Patient and lab result.
I am trying to looping through these tables and generate the HL7 messages. some fields are default and some fields are comming from the database.Please see the comments
For example,
Here is the data in the tables:PId lastname firstname19191919 John Rick
Test Result nameURR 79 John, rickHGB 11.2 John, rick
and the HL 7 message that generate by the program should look like:
MSH|^&\~|NAPPY|||4|20060705003913||DFT^P03|0|P|2.2EVN|P03|20060705003913||OVRPID|||19191919||John^Rick -- -----------> Patient Id 19191919 , and last and first name John^Rick comes from the dataabseOBX||ST|URR^URR||11||||||R ------------>Lab value: 11 comes from the databaseOBX||ST|HCT^HGB||79.2||||||R ----------------->Lab value:79.2 comes from the databaseFT1||||20060601||C|ZZ^Load Lab Results^^N^N|||1|||A230||||||586.6 ----------------> A230 comes from the databaseBTS|1 -------------------> count of message in fileFTS|1
what is the best way to do this? can you show me some examples?