private void btnAddRecordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddRecordActionPerformed
        String patient = (String) jComboPatient.getSelectedItem();
        int pid = patientMap.get(patient);
        int authorId = Session.getInstance().getUserId();
        String policy = jAccessPolicy.getText()+" "+pid+" 1of2";
        String record = jDataRecord.getText();

        if (pid < 0 || authorId < 0 || policy.isEmpty() || record.isEmpty()) {
            JOptionPane.showMessageDialog(null, "All fields are mandatory. Please fill again, and proceed.", "Failure", JOptionPane.ERROR_MESSAGE);
            return;
        }

        WriterH h = new WriterH();
        h.sendSection(record, pid, authorId, policy);

        //clean up
        jAccessPolicy.setText("");
        jDataRecord.setText("");
        
        this.update();

    }//GEN-LAST:event_btnAddRecordActionPerformed