public void TestWipeoutPeriod()
 {
     RedactionDictionary.ResetInstance();
     Add("\\.+");
     Assert.Null(Wipeout("."));
     Assert.Null(Wipeout(".........."));
     Assert.Null(Wipeout("......"));
 }
Beispiel #2
0
        public BoilerPlateTests(ITestOutputHelper output)
        {
            _output = output;
            //CRIS
            const string marker = @"\*\*\* This exam record has been migrated from the 'old CRIS'.+\*\*\*";

            RedactionDictionary.GetInstance().AddToBoilerPlate(marker);
            // Radiology
            RedactionDictionary.GetInstance().AddToBoilerPlate(@"^Radiology Report(\n.+)+\nReferring Consultant:.+");
            RedactionDictionary.GetInstance().AddToBoilerPlate(@"\nReporting Consultant:\s*(\n.+){3}\n?$");
            // Dexa
            RedactionDictionary.GetInstance()
            .AddToBoilerPlate(
                "\n((Name|Patient ID|Age|Indication|Referring Physician|Study|Accession number|Referring Provider|Clinical Indications|NHS):.+\n+)+");
        }
        public void TestWipeoutText()
        {
            RedactionDictionary.ResetInstance();
            Add("^CT\\s\\w+\\s:\\s*\n*.?$");

            Assert.Null(Wipeout("CT Chest :"));
            Assert.Null(Wipeout(@"CT Chest :

                ."));
            Assert.Null(Wipeout(@"CT Chest :
                ."));
            Assert.Null(Wipeout(@"CT Chest : ."));
            Assert.Null(Wipeout(@"CT Chest : 1"));
            Assert.Null(Wipeout(@"CT Head :"));
            Assert.Null(Wipeout(@"CT Head : 
                ."));
            Assert.Null(Wipeout(@"CT Head : ."));
        }
Beispiel #4
0
        public void TestFailsCleaned()
        {
            RedactionDictionary.ResetInstance();
            foreach (var word in Regexes)
            {
                RedactionDictionary.GetInstance().AddToReportRemoval(word);
            }

            Assert.NotNull(WipeoutReports(@"Name of the Procedure: CT Head

Exam Date: [REDACTED]

Title/Technique: CT head

Clinical Indication: 10 days post expressive dysphasia followed by headache

Findings: bilateral basal ganglia calcification. Symmetrical ventricles cisterns and sulci. No intracranial mass lesion or recent haemorrhage.

Comment: no evidence of a recent focal event."));
        }
 private static void Add(string regex)
 {
     RedactionDictionary.GetInstance().AddToReportRemoval(regex);
 }
Beispiel #6
0
        public void TestAllCleaned()
        {
            RedactionDictionary.ResetInstance();
            foreach (var word in Regexes)
            {
                RedactionDictionary.GetInstance().AddToReportRemoval(word);
            }

            var needToClean = new List <string>
            {
                "",
                "'",
                "-",
                "(As above)",
                "****",
                ",",
                ",.",
                ".",
                ". A",
                ". of",
                ". The",
                ". There is",
                @".
.",
                "..",
                ".. is",
                "...",
                "....",
                ".....",
                "......",
                ".......",
                "........",
                ".........",
                "..........",
                "...........",
                "../......",
                "/",
                "[REDACTED]",
                "[REDACTED] report in notes",
                "[REDACTED]5.",
                "~I.~i",
                ">",
                "0.",
                "5531",
                "A",
                "ADDITIONAL",
                "Angio  Cerebral :",
                "As above",
                "as above.",
                "As below",
                "As below.",
                "Auto reported",
                "Conclusion :",
                "CT Abdomen :",
                "CT Angiogram :",
                "CT Ankle Lt :",
                "CT Ankle Rt :",
                "CT Chest :",
                @"CT Chest : 

.",
                @"CT Chest : 
.",
                "CT Chest : .",
                "CT Chest : 1",
                "CT Face :",
                "CT Face : .",
                "CT Foot Rt :",
                "CT Head :",
                @"CT Head : 
.",
                "CT Head : .",
                "CT Head :.",
                "CT Hip Rt : .",
                "CT Knee Lt :",
                "CT Knee Lt : .",
                "CT Knee Rt :",
                "CT Knee Rt : ,",
                "CT Liver :",
                "CT Mandible :",
                "CT Neck :",
                "CT Orbits :",
                @"CT Orbits : 
.",
                "CT Pancreas :",
                "CT Pelvis :",
                "CT Sinuses :",
                "CT Sinuses : .",
                "CT Urogram : .",
                "CT Venogram :",
                // "DR NC COWAN",
                // "DR NIGEL COWAN",
                "F:",
                "Findings.",
                "Findings:",
                //  "GA Dr Speirs",
                "Impression:",
                "MRA Head :",
                @"MRA Head : 
.",
                "MRA Head : .",
                "MRA Head : The",
                "MRA Head :.",
                "MRCP :",
                "MRI Abdomen :",
                "MRI Ankle Rt :",
                "MRI cancelled",
                "MRI consultation :",
                "MRI Elbow Lt :",
                "MRI Femur Lt :",
                "MRI Femur Rt :",
                "MRI Foot Lt :",
                "MRI Foot Rt :",
                "MRI Foot Rt :.",
                "MRI Head",
                "MRI Head :",
                @"MRI Head : 
.",
                "MRI Head : .",
                "MRI Head : and",
                "MRI Head : See above.",
                "MRI Head : The",
                "MRI Head :.",
                "MRI Head.",
                "MRI Hip Both :",
                "MRI Hip Lt :",
                "MRI Hip Rt :",
                "MRI Knee Rt :",
                "MRI Marrow :",
                "MRI Neck :",
                @"MRI Neck : 
.",
                "MRI Neck : .",
                "MRI Orbits :",
                "MRI Orbits : .",
                "MRI Pancreas :",
                "MRI Pelvis :",
                "MRI Pelvis : .",
                "MRI Pituitary",
                "MRI Renal :",
                "MRI Sinuses :",
                "MRI Sinuses.",
                "MRI Spine Cervical : see above",
                "MRI Thorax :",
                "MRI Thorax : .",
                "MRI Wrist Lt :",
                "MRI Wrist Rt :",
                "Need to delete",
                "no gad given",
                "no images",
                //"Norma brain CT",
                "not repeated",
                "Not scanned.",
                "Open MRI",
                "Please see above report.",
                "please see below report",
                "PRIVATE REPORT",
                "PROTOCOL 1",
                "r",
                "Research MRI",
                "Research Scan",
                "se above",
                "se ct colon",
                "see",
                "see above",
                "See above .",
                "See above&",
                "see above.",
                "see below",
                "See below.",
                "see Ct colon",
                "See CT Head.",
                "See CT report",
                "See CT Urogram",
                "See MRI neck",
                "See patient's notes for procedure details.",
                "see report",
                "See report.",
                "see right",
                "see the report",
                "seen below",
                "She above",
                "SOLUS report in medical notes",
                "solus report in notes",
                "The",
                "This report has been reprinted as part of Radiology housekeeping measures - there have been no changes to the body of the report",
                "v",
                "X",
                ".CT Pancreas : .",
                @".
For MDT discussion",
                @".
MRI Pelvis with Gadolinium :",
                "incorrect booking.",
                "XR Skeletal Survey General :",
                "XR Skeletal Survey Myeloma :"
            };

            foreach (var report in needToClean)
            {
                var wiped = WipeoutReports(report);
                Assert.Null(wiped);
            }
        }