From d47fb61f30f34bfe35b48c04e419dfdaa4442dfd Mon Sep 17 00:00:00 2001 From: michael-weinstein Date: Mon, 20 Jul 2020 18:32:48 -0700 Subject: [PATCH] Prioritize accession number over specimen ID in CDPH records as requested. --- zymoTransmitSupport/inputOutput/caResultReader.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zymoTransmitSupport/inputOutput/caResultReader.py b/zymoTransmitSupport/inputOutput/caResultReader.py index 210eabd..da11e10 100644 --- a/zymoTransmitSupport/inputOutput/caResultReader.py +++ b/zymoTransmitSupport/inputOutput/caResultReader.py @@ -87,8 +87,13 @@ def __init__(self, rawLine: [str, collections.Iterable], delimiter: str = "\t"): self.resultCode, self.unused ) = self.elementArray - if not self.specimenID: - self.specimenID = self.accession + if self.accession: + if self.specimenID: + holder = self.specimenID + self.specimenID = self.accession + self.accession = holder + else: + self.specimenID = self.accession self.patientDateOfBirth = self.processDateAndTime(patientDateOfBirth, "") self.collectionDateTime = self.processDateAndTime(collectionDate, "") self.reportedDateTime = self.processDateAndTime(reportedDateAndTime, "")