We are getting inbound ORU messages where the line length is too long for our system which causes issues sending back out to md office systems.
Vendor sends:
OBX|37|TX|ZC0000031^Findings^CMORECUI||Findings:||||||S|||202408060718
OBX|38|TX|ZC0000031^Findings^CMORECUI|| – The perianal examination was normal.||||||S|||202408060718
OBX|39|TX|ZC0000032^Findings^CMORECUI|| – A 3 mm polyp was found in the ascending colon. The polyp was sessile. The||||||S|||202408060718
OBX|40|TX|ZC0000033^Findings^CMORECUI|| polyp was removed with a cold snare. Resection and retrieval were complete.||||||S|||202408060718
OBX|41|TX|ZC0000034^Findings^CMORECUI|| The pathology specimen was placed into bottle A.||||||S|||202408060718
OBX|42|TX|ZC0000035^Findings^CMORECUI|| – Multiple diverticula were found in the entire colon.||||||S|||202408060718
I would like this:
OBX|37|TX|ZC0000031^Findings^CMORECUI||Findings:||||||S|||202408060718
OBX|38|TX|ZC0000031^Findings^CMORECUI||- The perianal examination was normal.||||||S|||202408060718
OBX|39|TX|ZC0000032^Findings^CMORECUI||- A 3 mm polyp was found in the ascending colon. The polyp was sessile. The||||||S|||202408060718
OBX|40|TX|ZC0000033^Findings^CMORECUI|| polyp was removed with a cold snare. Resection and retrieval were complete.||||||S|||202408060718
OBX|41|TX|ZC0000034^Findings^CMORECUI|| The pathology specimen was placed into bottle A.||||||S|||202408060718
OBX|42|TX|ZC0000035^Findings^CMORECUI||- Multiple diverticula were found in the entire colon.||||||S|||202408060718
Our outbound ends up looking like this:
OBX|57|TX||| Findings: |||||| |
OBX|58|TX||| – The perianal examination was normal. |||||| |
OBX|59|TX||| – A 3 mm polyp was found in the ascending colon. The polyp was |||||| |
OBX|60|TX|||sessile. The |||||| |
OBX|61|TX||| polyp was removed with a cold snare. Resection and retrieval were|||||| |
OBX|62|TX|||complete. |||||| |
OBX|63|TX||| The pathology specimen was placed into bottle A. |||||| |
OBX|64|TX||| – Multiple diverticula were found in the entire colon. |||||| |
Unless there is a way to save off the original message and reformat to a shorter line length?
Any help would be appreciated.
~Patti
I tried this which removed every space in the line. *I am not clear on what the substring(0,6) part means. I thought it was setting the search to only lines containing spaces at in the first characters.
for each(seg in msg.children()) {
if(seg.name() == “OBX” && seg[‘OBX.5’][‘OBX.5.1’].toString().substring(0,6) == ‘ ‘) {
seg[‘OBX.5’][‘OBX.5.1’] = seg[‘OBX.5’][‘OBX.5.1’].toString().replace(/s/g,”);
}
}
PattiM is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.