Example #1
0
    @Override
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean isFocused, int row, int col) {

      NLaboImportSummary summary = (NLaboImportSummary) tableModel.getObject(row);

      if (isSelected) {
        this.setBackground(table.getSelectionBackground());
        this.setForeground(table.getSelectionForeground());

      } else {
        if (summary != null && summary.getKarteId() == null) {

          this.setBackground(UNCONSTRAINED_COLOR);

        } else {

          if ((row & (1)) == 0) {
            this.setBackground(EVEN_COLOR);
          } else {
            this.setBackground(ODD_COLOR);
          }
        }

        this.setForeground(table.getForeground());
      }

      if (value != null && value instanceof String) {
        this.setText((String) value);
      } else {
        this.setText(value == null ? "" : value.toString());
      }
      return this;
    }
Example #2
0
  public void openKarte() {

    boolean showReceiptMessage = Project.getBoolean("showReceiptMessage", true);
    if (showReceiptMessage) {
      JLabel msg1 = new JLabel("受付リストからオープンしないと診療データをレセコンに");
      JLabel msg2 = new JLabel("送信することができません。続けますか?");
      final JCheckBox cb = new JCheckBox("今後このメッセージを表示しない");
      cb.setFont(new Font("Dialog", Font.PLAIN, 10));
      cb.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              Project.setBoolean("showReceiptMessage", !cb.isSelected());
            }
          });
      JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3));
      p1.add(msg1);
      JPanel p2 = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3));
      p2.add(msg2);
      JPanel p3 = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3));
      p3.add(cb);
      JPanel box = new JPanel();
      box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS));
      box.add(p1);
      box.add(p2);
      box.add(p3);
      box.setBorder(BorderFactory.createEmptyBorder(0, 0, 11, 11));

      int option =
          JOptionPane.showConfirmDialog(
              SwingUtilities.getWindowAncestor(getUI()),
              new Object[] {box},
              ClientContext.getFrameTitle(getName()),
              JOptionPane.YES_NO_OPTION,
              JOptionPane.QUESTION_MESSAGE,
              ClientContext.getImageIcon("about_32.gif"));

      if (option != JOptionPane.YES_OPTION) {
        return;
      }
    }

    PatientModel patient = selectedLabo.getPatient();
    PatientVisitModel pvt = new PatientVisitModel();
    pvt.setNumber(number++);
    pvt.setPatientModel(patient);

    // 受け付けを通していないので診療科はユーザ登録してあるものを使用する
    // 診療科名、診療科コード、医師名、医師コード、JMARI
    // 2.0
    pvt.setDeptName(Project.getUserModel().getDepartmentModel().getDepartmentDesc());
    pvt.setDeptCode(Project.getUserModel().getDepartmentModel().getDepartment());
    pvt.setDoctorName(Project.getUserModel().getCommonName());
    if (Project.getUserModel().getOrcaId() != null) {
      pvt.setDoctorId(Project.getUserModel().getOrcaId());
    } else {
      pvt.setDoctorId(Project.getUserModel().getUserId());
    }
    pvt.setJmariNumber(Project.getString(Project.JMARI_CODE));

    // カルテコンテナを生成する
    getContext().openKarte(pvt);
  }