Skill Test-01 : Write regular expression, be as general as possible with your regular expression

Question

You started working for a company that needs to scrub identifiers from user uploaded files in order to comply with both EU General Data Protection Regulation (GDPR) and HIPAA (https://www.hhs.gov/hipaa/index.html). A beta version of a piece of de-identification software used in healthcare removed physicians name, patient names and some location names from the note below, but failed to remove dates and all location information.

Write a regular expression/s to replace ALL date and location references with XX/XX/XXXX and XXXXX respectively. Include a “dictionary” or “list of terms” as part of one regular expression for your solution.

Your regular expressions should work for this note, but not be so specific that they are unlikely to be useful on other notes.

 

# Question 1 Solution sample……………………………….

import os;
import re;
fakedoc = “””
XXXXXX, XXXXXXX
##########
Ronald Reagan UCLA Medical Center
XXXXX
XXXXX, CA 90095 4444
Date 06/05/2020

NEUROLOGY AND PAIN MEDICINE
INITIAL OUTPATIENT NOTE

XXXXXX, XXXXXX
PATIENT HISTORY
Ms. XXXXXX is a 40y women seen in consultation at the request of Dr. XXXXXXXXXX. The patient is alert
and orinted to self, place and cirumstance. She self-reports stress due her two pregancies that has
only be reduced somewhat by stepping back from her royal duties in Jan.

Consitution: Well developed, well nourished WF in no apparent distress.

Assessment: Neuropathic pain, stress

TREATMENT/PLAN:
Rx for compounded gel containing ketamine, baclofen, imipramine, gabapentin and tetracaine.
Suggested finding more time for exercise and sleep for stress

REFERRING PHYSICIAN
XXXXXX, XXXXXX, MD

Electronially signed by XXXXXX, XXXXXX DO, PhD on 06/06/2020
“””

0
Ask me anything 3 weeks 0 Answers 8 views 0

Leave an answer