Closed Denhai closed 3 years ago
from hl7apy.core import Segment text = "line 1\nline 2" text = text.replace('\n', '\\.br\\') obx = Segment('obx') obx.obx_1 = '1' obx.obx_2 = 'FT' obx.obx_5 = text print(obx.obx_5.to_er7())
# outputs: # line 1\E\.br\E\line 2 # expected: # line 1\.br\line 2
Am I going about this the wrong way?
Hi @Denhai. This is the correct behavior because the "\" is required to be escaped by HL7 with the sequence \E. Your counterpart should understand that that sequence should be interpreted as '\'
Am I going about this the wrong way?