nHapiNET/nHapi

Mindray Datetime Format

Opened this issue · 3 comments

Hi,

I am getting HL7 data from the Mindray V9 device and the dateTime looks like 20230211140114.0000+0800. The HL7 version is 2.6 latest nuget. When trying to parse oru.MSH.DateTimeOfMessage.GetAsDate() and error is thrown. Is this a non standard HL7 date time?

MSH|^~\&|MINDRAY_^00B0353000000^EUI-64|MINDRAY|||20230211140114.0000+0800||ORU^R01^ORU_R01|10|P|2.6|||AL|NE||UNICODE UTF-8|||IHE_PCD_001^IHE PCD^1.3.6.1.4.1.19376.1.6.1.1.1^ISO
PID|||1234^^^Hospital^PI||Uui^Kki^^^^^L|||M
PV1||I|ED^^RED VS9
OBR|1|10^MINDRAY_^00B0353000000^EUI-64|10^MINDRAY_^00A037000000^EUI-64|182777000^monitoring of patient^SCT|||20230211134735.0000+0800
OBX|1|NM|150456^MDC_PULS_OXIM_SAT_O2^MDC|1.3.1.150456|97|262688^MDC_DIM_PERCENT^MDC|||||R|||20230211134735.0000+0800||||00A037000000^^00A037000000^EUI-64

image
https://hl7-definition.caristix.com/v2/HL7v2.6/DataTypes/DTM

Seems like correct date time.

I think I had similar problems with it too.

Yeah I was fixing similar problem in 2020:
https://github.com/nHapiNET/nHapi/pull/118/files
#104

But that only fixed the fraction, but not the offset, which is in the H7 standard.

Yeah, the TsComponentOne.cs has problem with this.
And I don't see any parsing on CommonTM.cs and CommonTS.cs

=> So I am positive that this is a bug.

Thank you for confirming that it is a bug. I am a bit surprise that nobody has stumbled upon the bug. It was the first thing that hit me when trying to parse the HL7.

@alberk8 @jakubsuchybio thanks for this, not sure when I'll get to pick this up, but open for Pull Requests.