@Test public void shouldAnonymisePartiallyMatchingAddress() { Patient patient = new Patient(); patient.addForeName("rich"); patient.addForeName("richard"); patient.addSurname("Jack"); patient.addSurname("Jackson"); patient.addNhsNumber("11122"); PatientAddress patientAddress1 = new PatientAddress(); patientAddress1.setAddress("Kidderpore Avenue Hampstead, London"); patientAddress1.setPostCode("cb4 2za"); patient.addAddress(patientAddress1); patient.addPhoneNumber("50090051234"); patient.addPhoneNumber("11090051234"); String anonymisedText = anonymisationService.pseudonymisePersonPlainText(patient, "\n" + "\n" + "Richard RICH Jackson\n" + "\n" + "Ism MrK\n" + "\n" + "\n" + "11122\n" + "(0500) 9005 1234 " + "Some random text that shouldn't be anonymised." + "" + "Address is Kidderpore Ave, (Hampstead, London."); System.out.println(anonymisedText); assertTrue(anonymisedText.contains("HHHHH")); assertTrue(anonymisedText.contains("FFFFF")); assertTrue(anonymisedText.contains("XXXXX XXXXX XXXXX")); assertTrue(anonymisedText.contains("Some random text that shouldn't be anonymised.")); assertFalse(anonymisedText.contains("XXXXX XXXXX XXXXXson")); assertTrue(anonymisedText.contains("Address is AAAAA")); }
public String pseudonymisePersonPlainText(Patient patient, String text) { return pseudonymiseAll(patient, text); }
AnonymisationService { public String pseudonymisePersonPlainText(Patient patient, String text) { return pseudonymiseAll(patient, text); } }
AnonymisationService { public String pseudonymisePersonPlainText(Patient patient, String text) { return pseudonymiseAll(patient, text); }  }
AnonymisationService { public String pseudonymisePersonPlainText(Patient patient, String text) { return pseudonymiseAll(patient, text); }  String pseudonymisePersonHTML(Patient patient, String text); String pseudonymisePersonPlainText(Patient patient, String text); void setNamePseudonymiser(NamePseudonymiser namePseudonymiser); void setPhonePseudonymiser(PhonePseudonymiser phonePseudonymiser); void setDateOfBirthPseudonymiser(DateOfBirthPseudonymiser dateOfBirthPseudonymiser); void setNhsNumberPseudonymiser(NHSNumberPseudonymiser nhsNumberPseudonymiser); void setAddressPseudonymiser(AddressPseudonymiser addressPseudonymiser); }
AnonymisationService { public String pseudonymisePersonPlainText(Patient patient, String text) { return pseudonymiseAll(patient, text); }  String pseudonymisePersonHTML(Patient patient, String text); String pseudonymisePersonPlainText(Patient patient, String text); void setNamePseudonymiser(NamePseudonymiser namePseudonymiser); void setPhonePseudonymiser(PhonePseudonymiser phonePseudonymiser); void setDateOfBirthPseudonymiser(DateOfBirthPseudonymiser dateOfBirthPseudonymiser); void setNhsNumberPseudonymiser(NHSNumberPseudonymiser nhsNumberPseudonymiser); void setAddressPseudonymiser(AddressPseudonymiser addressPseudonymiser);  }