@Override
 public PatientQuantificationLineItem instantiate(
     PropertyLookup<PatientQuantificationLineItem> lookup) {
   PatientQuantificationLineItem patientQuantificationLineItem =
       new PatientQuantificationLineItem();
   patientQuantificationLineItem.setCategory(lookup.valueOf(category, DEFAULT_CATEGORY));
   patientQuantificationLineItem.setTotal(lookup.valueOf(total, DEFAULT_TOTAL));
   return patientQuantificationLineItem;
 }
Пример #2
0
 public RecordedResponse instantiate(final PropertyLookup<RecordedResponse> lookup) {
   ClientHttpResponse response =
       make(
           a(
               HttpResponseMaker.ClientHttpResponse,
               with(HttpResponseMaker.statusCode, lookup.valueOf(statusCode, "OK")),
               with(HttpResponseMaker.body, lookup.valueOf(body, "RESPONSE"))));
   try {
     return RecordedResponse.of(response);
   } catch (IOException e) {
     e.printStackTrace();
   }
   return null;
 }
 @Override
 public ProcessingPeriod instantiate(PropertyLookup<ProcessingPeriod> lookup) {
   Long nullLong = null;
   ProcessingPeriod period = new ProcessingPeriod();
   period.setName(lookup.valueOf(name, PERIOD_NAME));
   period.setDescription(lookup.valueOf(description, PERIOD_DESC));
   period.setStartDate(lookup.valueOf(startDate, START_DATE));
   period.setEndDate(lookup.valueOf(endDate, END_DATE));
   period.setNumberOfMonths(lookup.valueOf(numberOfMonths, NUMBER_OF_MONTHS));
   period.setModifiedBy(lookup.valueOf(modifiedBy, MODIFIED_BY));
   period.setScheduleId(lookup.valueOf(scheduleId, SCHEDULE_ID));
   period.setId(lookup.valueOf(id, nullLong));
   return period;
 }
Пример #4
0
        @Override
        public RnrLineItem instantiate(PropertyLookup<RnrLineItem> lookup) {
          RnrLineItem rnrLineItem = new RnrLineItem();
          rnrLineItem.setProductCode(lookup.valueOf(productCode, PRODUCT_CODE));
          rnrLineItem.setProductCategory(lookup.valueOf(productCategory, PRODUCT_CATEGORY));
          rnrLineItem.setBeginningBalance(
              lookup.valueOf(beginningBalance, DEFAULT_BEGINNING_BALANCE));
          rnrLineItem.setQuantityReceived(lookup.valueOf(quantityReceived, QUANTITY_RECEIVED));

          rnrLineItem.addLossesAndAdjustments(lookup.valueOf(lossesAndAdjustments, ONE_LOSS));
          rnrLineItem.setTotalLossesAndAdjustments(
              lookup.valueOf(totalLossesAndAdjustments, TOTAL_LOSSES_AND_ADJUSTMENTS));
          rnrLineItem.setStockInHand(lookup.valueOf(stockInHand, DEFAULT_STOCK_IN_HAND));
          rnrLineItem.setQuantityDispensed(
              lookup.valueOf(quantityDispensed, DEFAULT_QUANTITY_DISPENSED));

          rnrLineItem.setDispensingUnit("tablet");
          rnrLineItem.setMaxMonthsOfStock(1);
          rnrLineItem.setPrice(new Money("2"));
          rnrLineItem.setQuantityApproved(lookup.valueOf(quantityApproved, QUANTITY_APPROVED));

          rnrLineItem.setFullSupply(lookup.valueOf(fullSupply, true));
          rnrLineItem.setStockOutDays(lookup.valueOf(stockOutDays, STOCK_OUT_DAYS));
          rnrLineItem.setNewPatientCount(lookup.valueOf(newPatientCount, NEW_PATIENT_COUNT));
          rnrLineItem.setDosesPerMonth(30);
          rnrLineItem.setDosesPerDispensingUnit(10);
          rnrLineItem.setNormalizedConsumption(37);
          rnrLineItem.setAmc(37);
          rnrLineItem.setMaxMonthsOfStock(2);
          rnrLineItem.setMaxStockQuantity(74);
          rnrLineItem.setCalculatedOrderQuantity(70);
          rnrLineItem.setPackSize(lookup.valueOf(packSize, 6));
          rnrLineItem.setPacksToShip(12);
          rnrLineItem.setPackRoundingThreshold(lookup.valueOf(packRoundingThreshold, 3));
          rnrLineItem.setRoundToZero(lookup.valueOf(roundToZero, ROUND_To_ZERO));
          rnrLineItem.setPrice(new Money("4"));
          rnrLineItem.setQuantityRequested(lookup.valueOf(quantityRequested, QUANTITY_REQUESTED));
          rnrLineItem.setReasonForRequestedQuantity(
              lookup.valueOf(reasonForRequestedQuantity, REASON_FOR_REQUESTED_QUANTITY));
          rnrLineItem.setPacksToShip(lookup.valueOf(packsToShip, PACKS_TO_SHIP));
          rnrLineItem.setRemarks(lookup.valueOf(remarks, REMARKS));
          rnrLineItem.setProductCategoryDisplayOrder(
              lookup.valueOf(productCategoryDisplayOrder, PRODUCT_CATEGORY_DISPLAY_ORDER));
          rnrLineItem.setProductDisplayOrder(
              lookup.valueOf(productDisplayOrder, PRODUCT_DISPLAY_ORDER));
          rnrLineItem.setSkipped(lookup.valueOf(skipped, SKIPPED));
          return rnrLineItem;
        }