@@ -0,0 +1,2535 @@
+package com.example.comprehend.medical;%0A%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.comprehendmedical.ComprehendMedicalClient;%0Aimport software.amazon.awssdk.services.comprehendmedical.model.ComprehendMedicalException;%0Aimport software.amazon.awssdk.services.comprehendmedical.model.DetectPhiRequest;%0Aimport software.amazon.awssdk.services.comprehendmedical.model.DetectPhiResponse;%0Aimport software.amazon.awssdk.services.comprehendmedical.model.Entity;%0A%0Aimport java.util.Iterator;%0Aimport java.util.List;%0A%0Apublic class DetectPHI %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        String text = %22Pt is 87 yo woman, highschool teacher with past medical history that includes%5Cn%22 +%0A                %22   - status post cardiac catheterization in April 2019.%5Cn%22 +%0A                %22She presents today with palpitations and chest pressure.%5Cn%22 +%0A                %22HPI : Sleeping trouble on present dosage of Clonidine. Severe Rash  on face and leg, slightly itchy  %5Cn%22 +%0A                %22Meds : Vyvanse 50 mgs po at breakfast daily, %5Cn%22 +%0A                %22            Clonidine 0.2 mgs -- 1 and 1 / 2 tabs po qhs %5Cn%22 +%0A                %22HEENT : Boggy inferior turbinates, No oropharyngeal lesion %5Cn%22 +%0A                %22Lungs : clear %5Cn%22 +%0A                %22Heart : Regular rhythm %5Cn%22 +%0A                %22Skin :  Mild erythematous eruption to hairline %5Cn%22 +%0A                %22%5Cn%22 +%0A                %22Follow-up as scheduled%22;%0A        Region region = Region.US_EAST_1;%0A        ComprehendMedicalClient medClient = ComprehendMedicalClient.builder()%0A                .region(region)%0A                .build();%0A%0A        System.out.println(%22Calling Detect Medical Entities%22);%0A        detectPHIValues(medClient, text) ;%0A%0A    %7D%0A    public static void detectPHIValues(ComprehendMedicalClient medClient, String text ) %7B%0A%0A        try %7B%0A            DetectPhiRequest detectRequest = DetectPhiRequest.builder()%0A                    .text(text)%0A                    .build();%0A%0A            DetectPhiResponse detectResult = medClient.detectPHI(detectRequest);%0A            List%3CEntity%3E entList = detectResult.entities();%0A            Iterator%3CEntity%3E lanIterator = entList.iterator();%0A%0A            while (lanIterator.hasNext()) %7B%0A                Entity entity = lanIterator.next();%0A                System.out.println(%22Entity text is %22 + entity.text());%0A            %7D%0A%0A        %7D catch (ComprehendMedicalException e) %7B%0A            System.err.println(e.awsErrorDetails().errorMessage());%0A            System.exit(1);%0A        %7D%0A    %7D%0A%7D%0A

Create DetectPHI.java