public RnRForm.STATUS getRnrFormStatus() {
   if (rnRForm != null) {
     return rnRForm.getStatus();
   } else {
     return RnRForm.STATUS.DRAFT;
   }
 }
  @Test
  public void shouldGetSignatureByRnrForm() throws LMISException {
    Program program = new Program();

    RnRForm form =
        new RnRFormBuilder()
            .setComments("Submitted Form")
            .setStatus(RnRForm.STATUS.SUBMITTED)
            .setProgram(program)
            .build();
    form.getSignaturesWrapper()
        .add(new RnRFormSignature(form, "Submitter Signature", RnRFormSignature.TYPE.SUBMITTER));
    form.getSignaturesWrapper()
        .add(new RnRFormSignature(form, "Approver Signature", RnRFormSignature.TYPE.APPROVER));
    rnrFormRepository.createAndRefresh(form);
    rnrFormRepository.createOrUpdateWithItems(form);

    List<RnRFormSignature> signatures = signatureRepository.queryByRnrFormId(form.getId());

    assertThat(signatures.size(), is(2));
    assertThat(signatures.get(0).getSignature(), is("Submitter Signature"));
    assertThat(signatures.get(1).getSignature(), is("Approver Signature"));
  }
 public void processSign(String signature) {
   // Main Thread!!
   if (rnRForm.isDraft()) {
     rnRForm
         .getSignaturesWrapper()
         .add(new RnRFormSignature(rnRForm, signature, RnRFormSignature.TYPE.SUBMITTER));
     rnRForm.setStatus(
         rnRForm.isMissed() ? RnRForm.STATUS.SUBMITTED_MISSED : RnRForm.STATUS.SUBMITTED);
     submitRequisition();
     view.showMessageNotifyDialog();
   } else {
     rnRForm
         .getSignaturesWrapper()
         .add(new RnRFormSignature(rnRForm, signature, RnRFormSignature.TYPE.APPROVER));
     rnRForm.setStatus(RnRForm.STATUS.AUTHORIZED);
     rnRForm.setSubmittedTime(DateUtil.today());
     createStockCardsOrUnarchiveAndAddToFormForAdditionalRnrItems();
     authoriseRequisition();
   }
 }
 public boolean isDraft() {
   return rnRForm.isDraft();
 }
 public void loadAlertDialogIsFormStatusIsDraft() {
   if (rnRForm.isSubmitted()) {
     view.showMessageNotifyDialog();
   }
 }
 private boolean validateTotalsMatch(RnRForm form) {
   return RnRForm.calculateTotalRegimenAmount(form.getRegimenItemListWrapper())
       == mmiaRepository.getTotalPatients(form);
 }