diff --git a/CHANGES.rst b/CHANGES.rst index 09abbbd7aa..bae57a8f3b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -16,6 +16,7 @@ Changelog **Fixed** +- #378 Fix GeneXpert interface does not import results for multiple analyses - #416 Fix inconsistencies with sorting criterias in lists - #418 LabClerks don't have access to AR view after received and before verified - #415 Referencefield JS UID check: Don't remove Profile UIDs diff --git a/bika/lims/exportimport/instruments/genexpert/genexpert.py b/bika/lims/exportimport/instruments/genexpert/genexpert.py index e6be326c02..0ca4c3c2e9 100644 --- a/bika/lims/exportimport/instruments/genexpert/genexpert.py +++ b/bika/lims/exportimport/instruments/genexpert/genexpert.py @@ -127,9 +127,8 @@ def _parseline(self, line): return the code error -1 """ sline = line.split(SEPARATOR) - # If a line has only one column, then it is a Section or Subsection - # header. - if len(sline) == 1: + + if is_header(sline): return self._handle_header(sline) # If it is not an header it contains some data. but we need data only # from the RESULT TABLE section. @@ -249,6 +248,8 @@ def _format_keyword(self, keyword): result = '' if keyword: result = re.sub(r"\W", "", keyword) + # Remove underscores ('_') too. + result = re.sub(r"_", "", result) return result def _convert_result(self, value): @@ -281,3 +282,18 @@ def __init__(self, parser, context, idsearchcriteria, override, allowed_ar_states, allowed_analysis_states, instrument_uid) + + +def is_header(line): + """ + If a line has only one column, then it is a Section or Subsection + header. + :param line: Line to check + :return: boolean -If line is header + """ + if len(line) == 1: + return True + for idx, val in enumerate(line): + if idx > 0 and val: + return False + return True diff --git a/bika/lims/exportimport/instruments/resultsimport.py b/bika/lims/exportimport/instruments/resultsimport.py index 8d2ac3a264..6a9fab6cc9 100644 --- a/bika/lims/exportimport/instruments/resultsimport.py +++ b/bika/lims/exportimport/instruments/resultsimport.py @@ -823,7 +823,6 @@ def _process_analysis(self, objid, analysis, values): analysis.setResult(res) if capturedate: analysis.setResultCaptureDate(capturedate) - doActionFor(analysis, 'submit') resultsaved = True elif resultsaved == False: @@ -833,6 +832,9 @@ def _process_analysis(self, objid, analysis, values): "result":"" }) + if resultsaved or len(interimsout) > 0: + doActionFor(analysis, 'submit') + if (resultsaved or len(interimsout) > 0) \ and values.get('Remarks', '') \ and analysis.portal_type == 'Analysis' \