def parse_dicom_datetime(dts: str, tms: str=None) -> datetime:
    if tms:
        dts = (dts + tms)
    try:
        ts = datetime.strptime(dts, '%Y%m%d%H%M%S')
        return ts
    except ValueError:
        pass
    try:
        ts = datetime.strptime(dts, '%Y%m%d%H%M%S.%f')
        return ts
    except ValueError:
        pass
    try:
        dts = dts.split('.')[0]
        ts = DatetimeParser.parse(dts)
        return ts
    except ValueError:
        pass
    logger = logging.getLogger('DcmStrings')
    logger.error(f'Failed to parse date time string: {dts}')
def parse_dicom_datetime(dts: str, tms: str=None) -> datetime:
    if tms:
        dts = (dts + tms)
    try:
        ts = datetime.strptime(dts, '%Y%m%d%H%M%S')
        return ts
    except ValueError:
        pass
    try:
        ts = datetime.strptime(dts, '%Y%m%d%H%M%S.%f')
        return ts
    except ValueError:
        pass
    try:
        dts = dts.split('.')[0]
        ts = DatetimeParser.parse(dts)
        return ts
    except ValueError:
        pass
    logger = logging.getLogger('DcmStrings')
    logger.error(f'Failed to parse date time string: {dts}')