Skip to content

Commit 27a98e6

Browse files
committed
Fix typo in parse_plan error message
1 parent 387d457 commit 27a98e6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

hl7/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def create_parse_plan(strmsg, factory=Factory):
345345
# Extract the rest of the separators. Defaults used if not present.
346346
if strmsg[:3] not in ("MSH", "FHS", "BHS"):
347347
raise ParseException(
348-
"First segment is {}, must be one of MHS, FHS or BHS".format(strmsg[:3])
348+
"First segment is {}, must be one of MSH, FHS or BHS".format(strmsg[:3])
349349
)
350350
sep0 = strmsg[3]
351351
seps = list(strmsg[3 : strmsg.find(sep0, 4)])

tests/test_parse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,3 +451,8 @@ def test_parse_plan_next(self):
451451

452452
n5 = n4.next()
453453
self.assertTrue(n5 is None)
454+
455+
def test_create_parse_plan_invalid_segment(self):
456+
with self.assertRaises(ParseException) as cm:
457+
hl7.parser.create_parse_plan("PID|^~\\&|GHH LAB")
458+
self.assertIn("must be one of MSH, FHS or BHS", cm.exception.args[0])

0 commit comments

Comments
 (0)