User bio
404 bio not found
Member since Sep 10, 2018
Replies:

Encoding the stream myself using Base64Encode and flags set to 1 fixed my problem.

There is no CRLF anymore in my stream.

Here is my final solution (error handle ommited)

stream=##class(%FileBinaryStream).%New()
stream.Filename = filename
encodedStream = ##class(%GlobalBinaryStream).%New()
while ('stream.AtEnd) {
      d encodedStream.Write(##class(%SYSTEM.Encryption).Base64Encode(stream.Read(12000),1))
}
propertyPath = "PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX:5(1)"
seg=target.GetMutableSegmentAt($P(propertyPath,":",1),.tSC)
tSC = seg.StoreFieldStreamRaw(.encodedStream,$P(propertyPath,":",2))

Thanks Armin for your help.

Second option : An OBX:5 with the value ABCDEFGHIJKL (get rid of all crlf)

[Updated last comment with code]

I need to add a file inside the obx:5(1) segment as a base64 encoded stream.

I'm using the StoreFieldStreamBase64 method from EnsLib.HL7.Segment.

This method add extra escaped CRLF inside my OBX segment and i don't know why.

When i write the hl7 message on disk with the new OBX segment, i can't parse it anymore with an EnsLib.HL7.Service.FileService, the extra crlf character is the problem.

Maybe i'm doing something wrong in my way to process the file.

Certifications & Credly badges:
Kami has no Certifications & Credly badges yet.
Global Masters badges:
Kami has no Global Masters badges yet.
Followers:
Kami has no followers yet.
Following:
Kami has not followed anybody yet.