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`


Discussion:

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|||||||||||||"