Debbie,

I also used windows to run this using python 3.6.0 which caused additional 
issues. Some issues I ran into are python version differences some encoding 
issues and a conversion issue. I had to modify the obfuscate portion. Here is 
what I did to make it work. I have comments next to the lines I changes. I 
don't know if it will help your specific issue or not though, but might be 
worth a shot. I did not hit the error with having an A at the end of HIC.

def obfuscate(key, rows_in, writerow):
    header = rows_in.__next__() #had to add __ on both sides to next due to 
being version 3.6.0 of python.
    pcol = [n.lower() for n in header].index('patient_num')
    writerow(header + ['PATIENT_NUM_HASH'])
    for row in rows_in:
        patient_num = row[pcol].encode('utf-8') # had to add .encode('utf-8') 
on windows
        hm = hmac.new(b'key', patient_num, hashlib.sha1) # had to add b'key' 
instead of key
        writerow(row + [hm.hexdigest()])

Todd McNeeley
Programmer, Information Management Team Development
[email protected]  | 573-884-3297 direct | 573-219-8341 mobile  
Tiger Institute for Health Innovation | www.tiger-institute.org
 PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL

-----Original Message-----
From: Gpc-dev [mailto:[email protected]] On Behalf Of 
[email protected]
Sent: Thursday, January 26, 2017 10:15 AM
To: [email protected]
Subject: Gpc-dev Digest, Vol 35, Issue 72

Send Gpc-dev mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://listserv.kumc.edu/mailman/listinfo/gpc-dev
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific than "Re: 
Contents of Gpc-dev digest..."


Today's Topics:

   1. Where is the grouse/obfuscate.py file? (Debbie Yoshihara)
   2. RE: Where is the grouse/obfuscate.py file? (Verhagen, Laurel A)
   3. Re: Where is the grouse/obfuscate.py file? (Debbie Yoshihara)
   4. running obfuscate.py errors (Debbie Yoshihara)


----------------------------------------------------------------------

Message: 1
Date: Thu, 26 Jan 2017 14:12:00 +0000
From: Debbie Yoshihara <[email protected]>
To: gpc-dev <[email protected]>
Subject: Where is the grouse/obfuscate.py file?
Message-ID:
        
<bn6pr06mb259406d7d715f4d3511dd111aa...@bn6pr06mb2594.namprd06.prod.outlook.com>
        
Content-Type: text/plain; charset="us-ascii"

Hi,


I looked in TRAC #526 but I didn't find it.

Where can I find this file to make the PATIENT_NUM_HASH?


-- Debbie Yoshihara


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://listserv.kumc.edu/pipermail/gpc-dev/attachments/20170126/aef46320/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 26 Jan 2017 14:16:06 +0000
From: "Verhagen, Laurel A" <[email protected]>
To: Debbie Yoshihara <[email protected]>, gpc-dev
        <[email protected]>
Subject: RE: Where is the grouse/obfuscate.py file?
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Debbie,

It's on ticket 401: 
https://informatics.gpcnetwork.org/trac/Project/ticket/401#comment:6

Thanks,
Laurel

From: Gpc-dev [mailto:[email protected]] On Behalf Of Debbie 
Yoshihara
Sent: Thursday, January 26, 2017 8:12 AM
To: gpc-dev
Subject: Where is the grouse/obfuscate.py file?


Hi,



I looked in TRAC #526 but I didn't find it.

Where can I find this file to make the PATIENT_NUM_HASH?



-- Debbie Yoshihara


______________________________________________________________________
The contents of this message may contain private, protected and/or privileged 
information.  If you received this message in error, you should destroy the 
e-mail message and any attachments or copies, and you are prohibited from 
retaining, distributing, disclosing or using any information contained within.  
Please contact the sender and advise of the erroneous delivery by return e-mail 
or telephone.  Thank you for your cooperation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://listserv.kumc.edu/pipermail/gpc-dev/attachments/20170126/e50ff6a4/attachment-0001.html>

------------------------------

Message: 3
Date: Thu, 26 Jan 2017 14:17:33 +0000
From: Debbie Yoshihara <[email protected]>
To: "Verhagen, Laurel A" <[email protected]>, gpc-dev
        <[email protected]>
Subject: Re: Where is the grouse/obfuscate.py file?
Message-ID:
        
<bn6pr06mb259439af9f21de7de3bff82caa...@bn6pr06mb2594.namprd06.prod.outlook.com>
        
Content-Type: text/plain; charset="us-ascii"

Thanks Laurel!

________________________________
From: Verhagen, Laurel A <[email protected]>
Sent: Thursday, January 26, 2017 8:16:06 AM
To: Debbie Yoshihara; gpc-dev
Subject: RE: Where is the grouse/obfuscate.py file?

Hi Debbie,

It's on ticket 401: 
https://informatics.gpcnetwork.org/trac/Project/ticket/401#comment:6

Thanks,
Laurel

From: Gpc-dev [mailto:[email protected]] On Behalf Of Debbie 
Yoshihara
Sent: Thursday, January 26, 2017 8:12 AM
To: gpc-dev
Subject: Where is the grouse/obfuscate.py file?


Hi,



I looked in TRAC #526 but I didn't find it.

Where can I find this file to make the PATIENT_NUM_HASH?



-- Debbie Yoshihara



________________________________
The contents of this message may contain private, protected and/or privileged 
information. If you received this message in error, you should destroy the 
e-mail message and any attachments or copies, and you are prohibited from 
retaining, distributing, disclosing or using any information contained within. 
Please contact the sender and advise of the erroneous delivery by return e-mail 
or telephone. Thank you for your cooperation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://listserv.kumc.edu/pipermail/gpc-dev/attachments/20170126/7f8e025f/attachment-0001.html>

------------------------------

Message: 4
Date: Thu, 26 Jan 2017 16:14:51 +0000
From: Debbie Yoshihara <[email protected]>
To: gpc-dev <[email protected]>
Subject: running obfuscate.py errors
Message-ID:
        
<bn6pr06mb259472707efd9addd2c89050aa...@bn6pr06mb2594.namprd06.prod.outlook.com>
        
Content-Type: text/plain; charset="us-ascii"

Hi,


I'm on a windows machine.

set HASH_KEY=...

python < WISC_FINDER.txt> WISC_FINDER_W_HAS.csv

  File "<stdin>", lin 11

  111111111,111111111,F,01/01/1964,111111111A

SyntaxError: invalid syntax


not the actual numbers.


Everytime the HIC number ends in A instead of a number, it stops.


How do I change this so I can get past the HIC numbers?


--- Debbie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://listserv.kumc.edu/pipermail/gpc-dev/attachments/20170126/c41935e0/attachment.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Gpc-dev mailing list
[email protected]
http://listserv.kumc.edu/mailman/listinfo/gpc-dev


------------------------------

End of Gpc-dev Digest, Vol 35, Issue 72
***************************************
_______________________________________________
Gpc-dev mailing list
[email protected]
http://listserv.kumc.edu/mailman/listinfo/gpc-dev

Reply via email to