コード例 #1
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public void createPassword(PatientDTO dto) throws Exception {
   Patient patient = appDAO.findPatientById(dto.getId());
   String newSalt = UUID.randomUUID().toString();
   String encodedPassword = OneWayPasswordEncoder.getInstance().encode(dto.getPassword(), newSalt);
   patient.getCred().setPassword(encodedPassword);
   appDAO.update(patient.getCred());
 }
コード例 #2
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public boolean getPatientMedicalTestComponents(PatientDTO dto) throws Exception {
   List<PatientMedicalTestComponent> patientMedicalTestComponents =
       appDAO.findPatientMedicalTestComponentByTestId(dto.getPatientMedicalTestId());
   dto.setPatientMedicalTestComponents(patientMedicalTestComponents);
   activityLogService.logViewPatient(
       dto.getId(), null, dto.getId(), "GetPatientMedicalTestComponents");
   return true;
 }
コード例 #3
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
  public void saveNewPatient(PatientDTO dto, HttpServletRequest request) throws Exception {
    Patient patient = dto.getPatient();

    if (dto.isUpdatePassword()) {
      if (testPassword(patient.getCred().getPassword()) == false) {
        dto.setResult(false);
        dto.setErrorMsg("Insufficient Password");
        dto.setReturnCode(RETURN_CODE_INVALID_PASSWORD);
        return;
      }
      String salt = UUID.randomUUID().toString();
      patient.getCred().setSalt(salt);
      String encodedPassword =
          OneWayPasswordEncoder.getInstance().encode(patient.getCred().getPassword(), salt);
      patient.getCred().setPassword(encodedPassword);
    }

    if (dto.isUpdateEmail()) {
      if (appDAO.checkEmail(DataEncryptor.encrypt(patient.getCred().getEmail())) == false) {
        dto.setResult(false);
        dto.setErrorMsg("Email already in system");
        dto.setReturnCode(RETURN_CODE_DUP_EMAIL);
        return;
      }
    }

    Demographics demo = patient.getDemo();
    demo.setEthnicity(appDAO.findEthnicityById(demo.getEthnicity().getId()));
    demo.setMaritalStatus(appDAO.findMaritalStatusById(demo.getMaritalStatus().getId()));
    if (demo.getUsState() != null) {
      demo.setUsState(appDAO.findUSStateById(demo.getUsState().getId()));
    }
    demo.setRace(appDAO.findRaceById(demo.getRace().getId()));
    appDAO.update(patient);
    decrypt(patient);
    String patientFullName =
        patient.getCred().getFirstName() + " " + patient.getCred().getLastName();
    String title = patientFullName + ", welcome to the Pleasantville Medical Patient Portal";
    String templatePath = context.getRealPath("/WEB-INF/email_templates");
    StringTemplateGroup group =
        new StringTemplateGroup("underwebinf", templatePath, DefaultTemplateLexer.class);
    StringTemplate st = group.getInstanceOf("portal_signup_confirmation");
    String from = Core.mailFrom;
    st.setAttribute("patient", patientFullName);
    st.setAttribute("email", patient.getCred().getEmail());
    st.setAttribute("phone", patient.getDemo().getPrimaryPhone());

    MailHandler handler = new MailHandler();
    boolean isHtml = true;
    String stString = st.toString();
    activityLogService.logViewPatient(patient.getId(), null, patient.getId(), "SaveNewPatient");
    handler.sendMimeMessage(patient.getCred().getEmail(), from, stString, title, isHtml);
  }
コード例 #4
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<PatientLetter> getPatientLetters(PatientDTO dto) throws Exception {
   Patient patient = appDAO.findPatientById(dto.getId());
   activityLogService.logViewPatient(patient.getId(), null, patient.getId(), "GetPatientLetters");
   List<PatientLetter> letters = appDAO.getPatientLetters(patient);
   for (PatientLetter pl : letters) {
     decrypt(pl.getPatient());
   }
   return letters;
 }
コード例 #5
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<Appointment> getAppointments(PatientDTO dto, boolean isPast) throws Exception {
   Patient patient = appDAO.findPatientById(dto.getId());
   activityLogService.logViewPatient(patient.getId(), null, patient.getId(), "GetAppointments");
   List<Appointment> appointments = appDAO.getAppointments(patient, isPast);
   for (Appointment a : appointments) {
     decrypt(a.getPatient());
   }
   return appointments;
 }
コード例 #6
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<PatientClinician> getPatientClinicians(PatientDTO dto) throws Exception {
   Patient patient = appDAO.findPatientById(dto.getId());
   activityLogService.logViewPatient(
       patient.getId(), null, patient.getId(), "GetPatientClinicians");
   List<PatientClinician> patientClinicians = appDAO.getPatientClinicians(patient);
   for (PatientClinician patientClinician : patientClinicians) {
     ExcludedObjects.excludeObjects(patientClinician.getPatient());
   }
   return patientClinicians;
 }
コード例 #7
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<PatientMessage> getPatientMessages(PatientDTO dto, Boolean fromClinician)
     throws Exception {
   Patient patient = appDAO.findPatientById(dto.getId());
   activityLogService.logViewPatient(patient.getId(), null, patient.getId(), "GetPatientMessages");
   List<PatientMessage> messages = appDAO.getPatientMessages(patient, fromClinician);
   for (PatientMessage pm : messages) {
     decrypt(pm.getPatient());
   }
   return messages;
 }
コード例 #8
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<PatientHealthTrendReport> getPatientHealthTrendReports(PatientDTO dto)
     throws Exception {
   Integer patientId = dto.getId();
   activityLogService.logViewPatient(patientId, null, patientId, "GetPatientHealthTrendReports");
   return appDAO.getPatientHealthTrendReports(patientId);
 }
コード例 #9
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<PatientMedicalProcedure> getPatientMedicalProcedures(PatientDTO dto)
     throws Exception {
   Integer patientId = dto.getId();
   activityLogService.logViewPatient(patientId, null, patientId, "GetPatientMedicalProcedures");
   return appDAO.getPatientMedicalProcedures(patientId);
 }
コード例 #10
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<PatientImmunization> getPatientImmunizations(PatientDTO dto) throws Exception {
   Integer patientId = dto.getId();
   activityLogService.logViewPatient(patientId, null, patientId, "GetPatientImmunizations");
   return appDAO.getPatientImmunizations(patientId);
 }
コード例 #11
0
ファイル: AppService.java プロジェクト: sayalimp912/portal
 public List<PatientAllergen> getPatientAllergens(PatientDTO dto) throws Exception {
   Patient patient = appDAO.findPatientById(dto.getId());
   activityLogService.logViewPatient(
       patient.getId(), null, patient.getId(), "GetPatientAllergens");
   return appDAO.getPatientAllergens(patient);
 }