@Test public void generatePatientGUID() { PatientDemographics patientDemographics = TestPLCEntityFactory.createPatientDemographics(); String guid = encodingUtils.generatePatientGUID(patientDemographics); assertTrue(StringUtils.isNotEmpty(guid)); assertEquals(EXPECTED_HASHED_LENGTH, guid.length()); assertEquals(guid, encodingUtils.generatePatientGUID(patientDemographics)); PatientDemographics differentPatientData = TestPLCEntityFactory.createPatientDemographics(); differentPatientData.setBirthDate(DateUtils.addDays(new Date(), 1)); String differentGuid = encodingUtils.generatePatientGUID(differentPatientData); assertTrue(StringUtils.isNotEmpty(differentGuid)); assertEquals(EXPECTED_HASHED_LENGTH, differentGuid.length()); assertFalse(StringUtils.equals(guid, differentGuid)); }
public String generatePatientGUID(PatientDemographics patientDemographics) { SimpleDateFormat sdf = new SimpleDateFormat(appResources.getStringResource(DATE_FORMAT_KEY), Locale.getDefault()); String dob = sdf.format(patientDemographics.getBirthDate()); StringBuilder builder = new StringBuilder().append(patientDemographics.getFirstName()).append("_") .append(patientDemographics.getBirthName()).append("_").append(dob).append("_") .append(patientDemographics.getBirthPlace()).append("_") .append(patientDemographics.getBirthCountry()); String stringToHash = StringUtils.strip(builder.toString().replace("\\s+", " ")); return hashString(stringToHash); }
EncodingUtils { public String generatePatientGUID(PatientDemographics patientDemographics) { SimpleDateFormat sdf = new SimpleDateFormat(appResources.getStringResource(DATE_FORMAT_KEY), Locale.getDefault()); String dob = sdf.format(patientDemographics.getBirthDate()); StringBuilder builder = new StringBuilder().append(patientDemographics.getFirstName()).append("_") .append(patientDemographics.getBirthName()).append("_").append(dob).append("_") .append(patientDemographics.getBirthPlace()).append("_") .append(patientDemographics.getBirthCountry()); String stringToHash = StringUtils.strip(builder.toString().replace("\\s+", " ")); return hashString(stringToHash); } }
EncodingUtils { public String generatePatientGUID(PatientDemographics patientDemographics) { SimpleDateFormat sdf = new SimpleDateFormat(appResources.getStringResource(DATE_FORMAT_KEY), Locale.getDefault()); String dob = sdf.format(patientDemographics.getBirthDate()); StringBuilder builder = new StringBuilder().append(patientDemographics.getFirstName()).append("_") .append(patientDemographics.getBirthName()).append("_").append(dob).append("_") .append(patientDemographics.getBirthPlace()).append("_") .append(patientDemographics.getBirthCountry()); String stringToHash = StringUtils.strip(builder.toString().replace("\\s+", " ")); return hashString(stringToHash); } EncodingUtils(PLCApplicationResources appResources); }
EncodingUtils { public String generatePatientGUID(PatientDemographics patientDemographics) { SimpleDateFormat sdf = new SimpleDateFormat(appResources.getStringResource(DATE_FORMAT_KEY), Locale.getDefault()); String dob = sdf.format(patientDemographics.getBirthDate()); StringBuilder builder = new StringBuilder().append(patientDemographics.getFirstName()).append("_") .append(patientDemographics.getBirthName()).append("_").append(dob).append("_") .append(patientDemographics.getBirthPlace()).append("_") .append(patientDemographics.getBirthCountry()); String stringToHash = StringUtils.strip(builder.toString().replace("\\s+", " ")); return hashString(stringToHash); } EncodingUtils(PLCApplicationResources appResources); String generatePatientGUID(PatientDemographics patientDemographics); String hashString(String input); }
EncodingUtils { public String generatePatientGUID(PatientDemographics patientDemographics) { SimpleDateFormat sdf = new SimpleDateFormat(appResources.getStringResource(DATE_FORMAT_KEY), Locale.getDefault()); String dob = sdf.format(patientDemographics.getBirthDate()); StringBuilder builder = new StringBuilder().append(patientDemographics.getFirstName()).append("_") .append(patientDemographics.getBirthName()).append("_").append(dob).append("_") .append(patientDemographics.getBirthPlace()).append("_") .append(patientDemographics.getBirthCountry()); String stringToHash = StringUtils.strip(builder.toString().replace("\\s+", " ")); return hashString(stringToHash); } EncodingUtils(PLCApplicationResources appResources); String generatePatientGUID(PatientDemographics patientDemographics); String hashString(String input);  }