コード例 #1
0
 private PrivatePatientLocal getPrivatePatient(
     PatientLocal patient, int type, boolean includeStudies)
     throws FinderException, CreateException {
   Collection col =
       privPatHome.findByPatientIdWithIssuer(
           type, patient.getPatientId(), patient.getIssuerOfPatientId());
   PrivatePatientLocal privPat;
   if (col.isEmpty()) {
     privPat = privPatHome.create(type, patient.getAttributes(true));
   } else {
     privPat = (PrivatePatientLocal) col.iterator().next();
   }
   if (includeStudies) {
     for (Iterator iter = patient.getStudies().iterator(); iter.hasNext(); ) {
       getPrivateStudy((StudyLocal) iter.next(), type, privPat, true); // move
       // also
       // all
       // instances
     }
   }
   return privPat;
 }
コード例 #2
0
 /** @ejb.interface-method */
 public Collection movePatientToTrash(long pat_pk) throws RemoteException {
   try {
     PatientLocal patient = patHome.findByPrimaryKey(new Long(pat_pk));
     Collection col = patient.getStudies();
     Collection result = new ArrayList();
     for (Iterator iter = col.iterator(); iter.hasNext(); ) {
       result.add(getStudyMgtDataset((StudyLocal) iter.next(), null));
     }
     Dataset ds = patient.getAttributes(true);
     getPrivatePatient(patient, DELETED, true);
     patient.remove();
     if (result.isEmpty()) result.add(ds);
     return result;
   } catch (CreateException e) {
     throw new RemoteException(e.getMessage());
   } catch (EJBException e) {
     throw new RemoteException(e.getMessage());
   } catch (FinderException e) {
     throw new RemoteException(e.getMessage());
   } catch (RemoveException e) {
     throw new RemoteException(e.getMessage());
   }
 }