Created
March 12, 2018 16:35
-
-
Save jumblies/9557116071ed076eacca3bb75a808e41 to your computer and use it in GitHub Desktop.
counter snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set final initial counters to zero | |
mriFinal, ctHeadFinal, ctAbdFinal, crFinal, usFinal, ctChestFinal = 0, 0, 0, 0, 0, 0 | |
# Set prelim initial counters to zero ****THIS SNIPPET DOES NOT INCLUDE PRELIM PROCESSING | |
mriPrelim, ctHeadPrelim, ctAbdPrelim, crPrelim, usPrelim, ctChestPrelim = 0, 0, 0, 0, 0, 0 | |
prelim, final=0,0 | |
finalExceptions = [] | |
prelimExceptions = [] | |
for line in processFile: | |
if "[Final report]" in line: | |
final +=1 | |
if "MRI" in line: | |
mriFinal += 1 | |
elif "CT ABDOMEN" in line or "CTA ABDOMEN" in line: | |
ctAbdFinal += 1 | |
elif "CT CHEST" in line or "CTA CHEST" in line: | |
ctChestFinal += 1 | |
elif "CT HEAD" in line: | |
ctHeadFinal += 1 | |
elif "CR " in line: | |
crFinal += 1 | |
elif "US " in line: | |
usFinal += 1 | |
else: | |
finalExceptions.append(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment