nebius/SWE-bench-extra huggingface dataset:
Repository: mps-gmbh/hl7-parser

Issue:
Parser fails if a datetime is provided in extended composite id block
The following message part contains an extended composite id block but can not be parsed
```
IN1|1:1|McDH|123456789^^^^^^^^^McDonalds Health|McDonalds Health||||||
```

This causes the parser to fail with a `TypeError`


Comments:

Patch:
diff --git a/hl7parser/hl7_data_types.py b/hl7parser/hl7_data_types.py
index a0a4726..2a8ba81 100644
--- a/hl7parser/hl7_data_types.py
+++ b/hl7parser/hl7_data_types.py
@@ -173,7 +173,7 @@ class HL7Datetime(HL7DataType):
     """
     component_map = ['datetime']
 
-    def __init__(self, composite, delimiter):
+    def __init__(self, composite, delimiter, use_delimiter="subcomponent_separator"):
         if len(composite) == 0:
             self.datetime = ""
             self.isNull = True


Test patch:
diff --git a/tests/test_parse.py b/tests/test_parse.py
index d13898b..9ed57c6 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -64,7 +64,7 @@ class TestParsing(unittest.TestCase):
     msg_mrg = (
         "MSH|^~\&|HNAM_PM|HNA500|AIG||20131016140148||ADT^A34|Q150084042T145948315C489644\n"
         "PID|1||3790333^^^MSH_MRN^MRN^MTSN~2175611^^^MSH_EMPI^CMRN^UPLOAD|195511^^^IID^DONOR ID^MTSN~Q3790333^^^MSQ_MRN^KMRN|EVERYMAN^ADAM^J^^^^CURRENT||19580321|M|||77 CRANFORD COURT^^NEW YORK^NY^10038^USA^HOME^^040|040|(212)555-1212^HOM\n"
-        "MRG|3150123^^^MSH_MRN^MRN^MTSN|Q3150123"
+        "MRG|3150123^^^MSH_MRN^MRN^MTSN^20131016140148^^^^|Q3150123"
     )
 
     successful_query_result = "\n".join((
@@ -269,7 +269,7 @@ class TestParsing(unittest.TestCase):
 
 def test_in1_segment():
     message_data = (
-        "IN1|1:1|McDH||McDonalds Health||||||"
+        "IN1|1:1|McDH|123456789^^^^^^^^^McDonalds Health|McDonalds Health||||||"
         "|||||||||"
         "||||||||||"
         "||||||1|12345|||||||||||||"
Repository: mps-gmbh/hl7-parser

Issue:
Wrong index for IN1 cell `policy_number`
Introduced by #26 

The index for IN1 cell `policy_number` had unfortunately been changed from 35 to 36. Correct is 35. 

Comments:

Patch:
diff --git a/hl7parser/hl7_segments.py b/hl7parser/hl7_segments.py
index 096da68..7effa36 100644
--- a/hl7parser/hl7_segments.py
+++ b/hl7parser/hl7_segments.py
@@ -251,7 +251,7 @@ segment_maps = {
             "insureds_address",
             options={"type": HL7_ExtendedAddress, "required": False, "repeats": False},
         ),
-        make_cell_type("policy_number", index=36)
+        make_cell_type("policy_number", index=35)
         # NOTE: standard defines more fields which can be added if needed in
         # the future
     ],


Test patch:
diff --git a/tests/test_parse.py b/tests/test_parse.py
index 8b285fb..e0ae193 100644
--- a/tests/test_parse.py
+++ b/tests/test_parse.py
@@ -288,7 +288,7 @@ def test_in1_segment():
         "IN1|1:1|McDH|123456789^^^^^^^^^McDonalds Health|McDonalds Health||||||"
         "||||||Musterfrau^Gertrud^^^^Dr.^L^A^|SEL|19700101|Königstr. 1B^^Stuttgart^^70173|"
         "||||||||||"
-        "||||||1|12345|||||||||||||"
+        "|||||1|12345||||||||||||||"
     )
 
     in1 = HL7Segment(message_data)
@@ -302,9 +302,9 @@ def test_in1_segment():
     assert str(name_of_insured) == "Musterfrau^Gertrud^^^^Dr.^L^A^"
     assert str(name_of_insured.family_name) == "Musterfrau"
     assert str(name_of_insured.given_name) == "Gertrud"
-    assert str(name_of_insured.middle_name) == ''
-    assert str(name_of_insured.suffix) == ''
-    assert str(name_of_insured.prefix) == ''
+    assert str(name_of_insured.middle_name) == ""
+    assert str(name_of_insured.suffix) == ""
+    assert str(name_of_insured.prefix) == ""
     assert str(name_of_insured.degree) == "Dr."
     assert str(name_of_insured.name_type_code) == "L"
     assert str(name_of_insured.name_representation_code) == "A"