Saturday, February 11, 2017

CONVERT HL7 MESSAGE INTO JSON USING MS .NET C#

This is pretty straight forward and fast way to parse HL7 message into JSON string then can be uses as their needs as in Mobile APP or Web App or Automation services at any part of healthcare.

It is fast because, it uses C# 4.5 async and await feature and neat, slick and smooth WPF windows APP.

How to Use :

1) Select or Browse HL7 Message file with only .hl7 extension from drive

2) Then just click on Convert button and within a second corresponding output with JSON format will be ready.





to view formatted JSON just go to the JSONLINT and paste Json output and click on validate Json, after json validation results will be like below :

{
"hl7": {
"@xml-space": "preserved",
"MSH": {
"@fieldDelimiter": "|",
"@componentDelimiter": "^",
"@repeatDelimiter": "~",
"@escapeDelimiter": "\\",
"@subcomponentDelimiter": "&",
"field": ["CERNER", null, "PriorityHealth", null, null, null, {
"#text": "ORU",
"component": "R01"
}, "Q479004375T431430612", "P", "2.3", null]
},
"PID": {
"field": [null, null, "001677980", null, {
"#text": "SMITH",
"component": "CURTIS"
}, null, "19680219", "M", null, null, null, null, null, null, null, null, null, "929645156318", "123456789", null]
},
"PD1": {
"field": [null, null, null, {
"#text": "1234567890",
"component": ["LAST", "FIRST", "M", null, null, null, null, "NPI"]
}, null]
},
"OBR": {
"field": ["1", {
"#text": "341856649",
"component": "HNAM_ORDERID"
}, "000002006326002362", {
"#text": "648088",
"component": "Basic Metabolic Panel"
}, null, null, "20061122151600", null, null, null, null, null, null, null, null, {
"#text": "1620",
"component": ["Hooker", "Robert", "L"]
}, null, null, null, null, null, "20061122154733", null, null, "F", null, null, null, null, null, null, null, null, null, null, "20061122140000", null]
},
"OBX": {
"field": ["1", "NM", {
"#text": "GLU",
"component": "Glucose Lvl"
}, "59", "mg/dL", {
"#text": "65-99",
"component": ["65", "99"]
}, "L", null, null, "F", null, null, "20061122154733", null]
}
}
}

Further information about HL7 messaging can be found on http://www.hl7.org.

PS: HL7 sample picked from http://www.priorityhealth.com/provider/manual/office-mgmt/data-exchange/hl7/hl7-samples

if anyone required to use this app or source code please let me know, I also would like welcome feedback and suggestions on this how improve and make more generic.

Thanks
Aifaz

No comments:

Post a Comment