Error: System.NullReferenceException trying to set data type of OBX-5 Message: ``` MSH|^~\&|LCS|LCA|LIS|TEST9999|199807311532||ORU^R01|3629|P|2.7 PID|2|2161348462|20809880170|1614614|20809880170^TESTPAT||19760924|M|||^^^^00000-0000|||||||86427531^^^03|SSN# HERE ORC|NW|8642753100012^LIS|20809880170^LCS||||||19980727000000|||HAVILAND OBR|1|8642753100012^LIS|20809880170^LCS|008342^UPPER RESPIRATORY CULTURE^L|||19980727175800||||||SS#634748641 CH14885 SRC:THROA SRC:PENI|19980727000000||||||20809880170||19980730041800||BN|F OBX|1|ST|008342^UPPER RESPIRATORY CULTURE^L||FINALREPORT|||||N|F||| 19980729160500|BN ORC|NW|8642753100012^LIS|20809880170^LCS||||||19980727000000|||HAVILAND OBR|2|8642753100012^LIS|20809880170^LCS|997602^.^L|||19980727175800||||G|||19980727000000||||||20809880170||19980730041800|||F|997602|||008342 OBX|2|CE|997231^RESULT 1^L||M415|||||N|F|||19980729160500|BN NTE|1|L|MORAXELLA (BRANHAMELLA) CATARRHALIS NTE|2|L| HEAVY GROWTH NTE|3|L| BETA LACTAMASE POSITIVE OBX|3|CE|997232^RESULT 2^L||MR105|||||N|F|||19980729160500|BN NTE|1|L|ROUTINE RESPIRATORY FLORA ```
Activity
gberkheiser commentedon Apr 27, 2017
Since you don't show any of your code, I'll take a guess...
Since OBX-2 is set to ST
obxSeg is a reference to the result segment you are populating.
ST resultValue = new ST(_Put _Your_message_Here) {Value = "The value"};
obxSeg.GetObservationValue(0).Data = resultValue;
milkshakeuk commentedon Jan 26, 2021
I think this is actually the same issue as explained in #133 but in this case on message type ORU^R01.
Add missing constructors to primatives, brought Varies fixOBX5 method…
Merge pull request #136 from nHapiNET/OBX5-Fix