/**
   * testAddPatientInstructions
   *
   * @throws Exception
   */
  public void testAddPatientInstructions() throws Exception {
    // Without an Office visit ID, this should throw.
    action = new EditPatientInstructionsAction(factory, 9000000000L, "2");
    try {
      action.addPatientInstructions(bean);
      fail("Expected an exception.");
    } catch (ITrustException e) {
      assertEquals("Cannot perform action.  OfficeVisit is not saved.", e.getMessage());
    }

    // Try adding patient specific instructions.
    action = new EditPatientInstructionsAction(factory, 9000000000L, "2", "952");
    assertEquals(0, action.getPatientInstructions().size());
    bean.setName("This is an instruction name.");
    bean.setComment("This is an instruction comment.");
    bean.setUrl("http://example.com/");
    bean.setVisitID(952);
    bean.setModified(new Date());
    action.addPatientInstructions(bean);
    assertEquals(1, action.getPatientInstructions().size());
    assertEquals("This is an instruction name.", action.getPatientInstructions().get(0).getName());
  }