Support Questions

Find answers, ask questions, and share your expertise

Error while storing HL7 attributes in Hbase

avatar
Rising Star

I'm doing HL7 parsing using ExtractHL7Attribute processor. My data flow looks like this -

9194-parsing-error.png

I'm getting above error when storing in Hbase table. i'm storing this message.mdm-t02-x2.txt

I print the flow file using a custom processor attached is the output of AttributeToJson processor -json-output.txt . I can see the generated json in attached file still it does not get store in Hbase table and throw above error.

Can someone please help. Thanks


nifi-hl7-parsing-dataflow-error.png
1 ACCEPTED SOLUTION

avatar

@Ankit Jain In AttributesToJSON do you have the Destination property set to "flowfile-content"? If you don't then what it does is put the JSON in the JSONAttributes attribute and it leaves the FlowFile contents the same, in this case an HL7 document. An HL7 document of course isn't JSON and starts with MSH, so this is the error you'd see if you have Destination set to "flowfile-attribute" (the default) and not "flowfile-content".

View solution in original post

6 REPLIES 6

avatar

@Ankit Jain In AttributesToJSON do you have the Destination property set to "flowfile-content"? If you don't then what it does is put the JSON in the JSONAttributes attribute and it leaves the FlowFile contents the same, in this case an HL7 document. An HL7 document of course isn't JSON and starts with MSH, so this is the error you'd see if you have Destination set to "flowfile-attribute" (the default) and not "flowfile-content".

avatar
Rising Star

Thanks It worked when I changed it to "flowfile-content".

I just have one more question, is it possible to extract single segment from a HL7 message. for example below is my message --

MSH|^~\&|||||20160229002413.415-0500||MDM^T02|7|P|2.3 EVN|T02|201602290024 PID|1||599992601||cunningham^beatrice^||19290611|F PV1|1|O|Burn center^60^71 TXA|1|CN|TX|20150211002413||||||||DOC-ID-10001|||||AU||AV

I want to extract only PID segment from this message. output should be - PID|1||599992601||cunningham^beatrice^||19290611|F

avatar

@Ankit Jain There are a few ways you can do this:

  • ReplaceText with a regex matching lines that start with PID
  • You could SplitText -> RouteText matching lines that start with PID

What you can't do though is extract the PID first and then run it through ExtractHL7Attributes. ExtractHL7Attributes requires a full, valid HL7 message. If you want to do that, you're best bet is to run ExtractHL7Attributes and then (re)create a new message from the created PID attribute values.

avatar
Master Mentor

@Ankit Jain is this sample HL7 dummy data or an actual patient? I am moving this thread to moderation.

avatar
Rising Star

@Artem Ervits it's dummy data.

avatar
Master Guru

In AttributesToJson, is the destination set as flow file content or flow file attribute?

It would need be set as flow file content for it to work with PutHBaseJson.