-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting exceptions when trying to parse hl7 messages containing large data in obx-5 #594
Comments
hi @AlexFJaxFL do you have any example code? |
also @AlexFJaxFL might be worth checking #105 to see if this issue is similar or not? |
Public Shared Function ParseHL7Messages(HL7Messages As String, FType As FeedType) As Boolean
|
i can see there is certain correlation between my issue and discussion that took place in #105, |
maybe this structure does not match what your engine parser is expecting .. |
Hi @AlexFJaxFL we have some unit tests showing how it should look,
There is also this blog which might help. http://healthbase.info/blog/?p=376 |
Ok, this information is very helpful indeed and will be used for .pdf related feeds which we have plenty. |
@AlexFJaxFL I think you can use a similar approach to the pdf for rtf files. |
ok, data does not come in to us in the same format so i will have to do some custom programming to adjust accordingly and then will go from there |
it appears other data types in OBX-2 (like ST, TX and ED which is used in your example above) work with nhapi parser just fine, data comes in like this: OBX|1|FT|^EDIE_VISIT_HISTORY||{\rtf1{\info{\ planning to override FT and make it ST or TX unless perhaps you might provide some other recommendations |
@AlexFJaxFL do you have some sample code? I suspect it could be something to do with special character escaping etc |
Public Shared Function TryParseMessage(HL7Message As String) As String 'Steve K. - 20210503
Dim imsg As Model.IMessage = Nothing
Dim prsr As New Parser.PipeParser()
Dim ret As String = ""
Try
If Not HL7Message.StartsWith("MSH") Then
If blnInService = True Then 'if running in the service
WriteEventLog("Error in TryParseMessage: does not start with MSH " & vbCrLf & HL7Message, EventLogEntryType.Error)
Else
Dim ex As New Exception("Error in TryParseMessage: does not start with MSH " & vbCrLf & HL7Message)
Throw ex
End If
End If
Try
HL7Message = SetOBX2DataType(HL7Message) 'Steve K. - 20210504
imsg = prsr.Parse(HL7Message)
Catch ex As Exception
Try
EPDnHapi.SetPtrnFindReplace(HL7Message)
imsg = prsr.Parse(HL7Message)
Catch ex1 As Exception
If HL7Message.Contains("ORU^R01") OrElse HL7Message.Contains("ORM^O01") Then ' for IB ORU/ORM clearing OBR-13 since not needed
EPDnHapi.ClearField(HL7Message, "OBR|", 13) ' and causing problems for parser (AF)
Try
imsg = prsr.Parse(HL7Message)
Catch ex2 As Exception
imsg = prsr.Parse(HL7Message, "2.4")
End Try
End If
End Try
End Try
If imsg Is Nothing Then
ret = $"Can't parse HL7Message: {vbCrLf}{EPDnHapi.GetCleanHeaderString(HL7Message)}"
End If
Catch ex As Exception
imsg = Nothing
ret = ex.ToString 'If error return error messsage.
End Try
Return ret
End Function client that had this issue decided to use another vendor next year so this issue does not seem as critical |
@AlexFJaxFL do you have an example message? |
getting the following exception when parsing files containing large embedded images:
Parse error in DoEDieIn: NHapi.Base.DataTypeException: Failed validation rule: Maxumim size <= 65536 characters
at NHapi.Base.Model.Varies.fixOBX5(ISegment segment, IModelClassFactory factory)
at NHapi.Base.Parser.PipeParser.Parse(ISegment destination, String segment, EncodingCharacters encodingChars)
at NHapi.Base.Parser.PipeParser.DoParse(String message, String version)
at NHapi.Base.Parser.ParserBase.Parse(String message, String version)
at EPDHL7ListenerSvc2.EPDHL7ListenerSvc2.TryParseMessage(String HL7Message).
not sure if this limitation is to be expected or maybe it will be resolved in future versions
Regards,
Alex
The text was updated successfully, but these errors were encountered: