SHARE
TWEET

Untitled

a guest Jul 16th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public List<X> Y(final DateTime treatmentDiscontinueTime,
  2.                                                         final List< P> validPrescribedPrescriptions)
  3.       {
  4.         final List<x> doseWrapperList = new ArrayList<>();
  5.         final int noOfPrescriptions = validPrescribedPrescriptions.size();
  6.  
  7.         for (int prescriptionIndex = 0; prescriptionIndex < noOfPrescriptions; prescriptionIndex++)
  8.         {
  9.           final BasePrescribedPrescription basePrescribedPrescription = validPrescribedPrescriptions.get(prescriptionIndex);
  10.           final String firstDoseText = basePrescribedPrescription.getFirstText();
  11.           final String secondDoseText = basePrescribedPrescription.getSecondText();
  12.           final boolean accordingToSchedule = A.ACCORDING.equals(firstDoseText);
  13.           final boolean specificPrescription = A.SP.equals(firstDoseText);
  14.           final boolean specificVbTypePrescription = A.SPVB.equals(firstDoseText);
  15.  
  16.           List<D> doseDetails = new ArrayList<>(basePrescribedPrescription.getDoseDetails());
  17.  
  18.  
  19.           final DateTime changedDosageEndDate =
  20.             getChangedDoseEndDate(basePrescribedPrescription.getActualTerminateDate(), treatmentDiscontinueTime);
  21.           final int noOfDosages = doseDetails.size();
  22.  
  23.           for (int doseIndex = 0; doseIndex < noOfDosages; doseIndex++)
  24.           {
  25.             final D doseDetail = doseDetails.get(doseIndex);
  26.  
  27.             if ((doseDetail.getStart().getStartDate() != null) && (changedDosageEndDate != null) &&
  28.                 doseDetail.getStart().getStartDate().isAfter(changedDosageEndDate))
  29.             {
  30.               continue;
  31.             }
  32.  
  33.             String previewDoseText;
  34.  
  35.             if (accordingToSchedule)
  36.             {
  37.               previewDoseText = X
  38.             }
  39.             else if (specificPrescription)
  40.             {
  41.               previewDoseText = Y;
  42.             }
  43.             else if (specificVbTypePrescription)
  44.             {
  45.               previewDoseText = Z;
  46.             }
  47.             else if (noOfDosages == 2)
  48.             {
  49.  
  50.               previewDoseText = ((doseIndex == 0) ? secondDoseText : firstDoseText);
  51.             }
  52.             else
  53.             {
  54.               previewDoseText = firstDoseText;
  55.             }
  56.  
  57.             final boolean isUnplanned =isuNplaned()
  58.  
  59.  
  60.  
  61.             if (!isUnplanned)
  62.             {
  63.               doseStart = getStartDate();
  64.               doseEnd = getEndDate();
  65.             }
  66.  
  67.  
  68.             doseWrapperList.add(new DoseInfoLiteDTOWrapper(previewDoseText, doseStart, doseEnd, doseDetail));
  69.  
  70.           }
  71.         }
  72.         return doseWrapperList;
  73.       }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top