Ignore:
Timestamp:
May 9, 2015, 7:38:52 AM (9 years ago)
Author:
healthsevak
Message:

updated this file to version 28 and Implemented the OpenSource based spell check feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/HealthSevak-CPRS/CPRS-Chart/fNotes.pas

    r830 r1703  
    99  uPCE, ORClasses, fDrawers, ImgList, rTIU, uTIU, uDocTree, fRptBox, fPrintList,
    1010  fNoteST, ORNet, fNoteSTStop, fBase508Form, VA508AccessibilityManager,
    11   VA508ImageListLabeler;
     11  VA508ImageListLabeler, RichEdit;
    1212
    1313type
     
    153153    imgLblNotes: TVA508ImageListLabeler;
    154154    imgLblImages: TVA508ImageListLabeler;
     155    popNoteMemoSpellOpenSource: TMenuItem; //WordVisTA@SK_Arora@HealthSevak to implement OpenSource SpellCheck Engine
    155156    procedure mnuChartTabClick(Sender: TObject);
    156157    procedure lstNotesClick(Sender: TObject);
     
    416417  uChanging: Boolean;
    417418  uIDNotesActive: Boolean;
     419  NoteTotal: string;
    418420
    419421
     
    453455                 frmRemDlg.btnCancelClick(Self);
    454456               end;
     457             //agp fix for a problem with reminders not clearing out when switching patients
     458             if WhyNot = '' then
     459                begin
     460                 frmRemDlg.btnCancelClick(Self);
     461                 if assigned(frmRemDlg) then
     462                   begin
     463                     result := false;
     464                     exit;
     465                   end;
     466                end;
    455467           end;
    456468    end;
     
    466478      '0': begin
    467479             if WhyNot = 'COMMIT' then FSilent := True;
    468              SaveCurrentNote(Result)
     480             SaveCurrentNote(Result);
    469481           end;
    470482    end;
     
    529541  uPCEEdit.Clear;
    530542  frmDrawers.ResetTemplates;
     543  NoteTotal := sCallV('ORCNOTE GET TOTAL', [Patient.DFN]);
    531544end;
    532545
     
    546559    FCurrentContext := FDefaultContext;
    547560    popNoteMemoSpell.Visible   := SpellCheckAvailable;
     561    popNoteMemoSpellOpenSource.Visible   := SpellCheckAvailable;  //WordVisTA@SK_Arora@HealthSevak to implement OpenSource SpellCheck Engine
    548562    popNoteMemoGrammar.Visible := popNoteMemoSpell.Visible;
    549563    Z11.Visible                := popNoteMemoSpell.Visible;
     
    592606begin
    593607  with AForm.lbIDParents do
    594   for i := 0 to Items.Count - 1 do
    595   if Selected[i] then
    596   begin
    597     NoteIEN := StrToInt64def(Piece(Items[i], U, 1), 0);
    598     if NoteIEN > 0 then PrintNote(NoteIEN, DisplayText[i], TRUE)
    599     else if NoteIEN = 0 then InfoBox(TX_NONOTE, TX_NONOTE_CAP, MB_OK)
    600     else InfoBox(TX_NOPRT_NEW, TX_NOPRT_NEW_CAP, MB_OK);
    601   end;
     608  begin
     609    for i := 0 to Items.Count - 1 do
     610     begin
     611       if Selected[i] then
     612        begin
     613         AForm.lbIDParents.ItemIndex := i;
     614         NoteIEN := ItemIEN;  //StrToInt64def(Piece(TStringList(Items.Objects[i])[0],U,1),0);
     615         if NoteIEN > 0 then PrintNote(NoteIEN, DisplayText[i], TRUE) else
     616         begin
     617           if NoteIEN = 0 then InfoBox(TX_NONOTE, TX_NONOTE_CAP, MB_OK);
     618           if NoteIEN < 0 then InfoBox(TX_NOPRT_NEW, TX_NOPRT_NEW_CAP, MB_OK);
     619         end;
     620        end; {if selected}
     621     end; {for}
     622  end; {with}
    602623end;
    603624
     
    649670  // clear the editing controls (also clear the new labels?)
    650671  txtSubject.Text := '';
    651   //lblNotes.Caption := '';
     672  lblNotes.Caption := '';
    652673  SearchTextStopFlag := false;
    653674  if memNewNote <> nil then memNewNote.Clear; //CQ7012 Added test for nil
     
    703724          EnableList := [odTemplates]
    704725        else
    705           EnableList := [odTemplates, odReminders];
    706         ShowList := [odTemplates, odReminders];
     726          if FutureEncounter(uPCEEdit) then
     727            begin
     728              EnableList := [odTemplates];
     729              ShowList := [odTemplates];
     730            end
     731          else
     732            begin
     733              EnableList := [odTemplates, odReminders];
     734              ShowList := [odTemplates, odReminders];
     735            end;
    707736      end
    708737      else
     
    13591388  if(assigned(frmReminderTree)) then
    13601389    frmReminderTree.EnableActions;
    1361   DisplayPCE; 
     1390  DisplayPCE;
    13621391  pnlRight.Refresh;
    13631392  memNewNote.Repaint;
     
    13731402  inherited;
    13741403  mnuActNewClick(Self);
    1375  end;
     1404end;
    13761405
    13771406procedure TfrmNotes.cmdPCEClick(Sender: TObject);
     
    14841513          if not NoteEmpty then
    14851514//            if not FChanged and (InfoBox(TX_BLR_CLEAR, TC_BLR_CLEAR, MB_YESNO) = ID_YES)
    1486             if (InfoBox(TX_BLR_CLEAR, TC_BLR_CLEAR, MB_YESNO) = ID_YES)
     1515            if (InfoBox(TX_BLR_CLEAR, TC_BLR_CLEAR,
     1516                        MB_ICONQUESTION or MB_YESNO or MB_DEFBUTTON2) = ID_YES)
    14871517              then memNewNote.Lines.Clear;
    14881518        end;
     
    16591689  NC_SEARCHTEXT: begin;
    16601690                   SearchTextStopFlag := False;
    1661                    SelectSearchText(Font.Size, FCurrentContext.SearchString, SearchCtxt );
     1691                   SelectSearchText(Font.Size, FCurrentContext.SearchString, SearchCtxt, StringReplace(TMenuItem(Sender).Caption, '&', '', [rfReplaceAll]) );
    16621692                   with SearchCtxt do if Changed then
    16631693                   begin
     
    17431773    lblNotes.Caption := 'Search for "'+FCurrentContext.SearchString+'" was stopped!';
    17441774  end;
     1775  //Clear the search text. We are done searching
     1776  FCurrentContext.SearchString := '';
    17451777  frmSearchStop.Hide;
    17461778  // Text Search CQ: HDS00002856 --------------------
     1779  lblNotes.Caption := lblNotes.Caption + ' (Total: ' + NoteTotal + ')';
    17471780  lblNotes.hint := lblNotes.Caption;
    17481781  tvNotes.Caption := lblNotes.Caption;
     
    19842017  inherited;
    19852018  if lstNotes.ItemIEN = 0 then Exit;
     2019  if assigned(frmRemDlg) then
     2020    begin
     2021       frmRemDlg.btnCancelClick(Self);
     2022       if assigned(frmRemDlg) then exit;
     2023    end;
    19862024  ActOnDocument(ActionSts, lstNotes.ItemIEN, 'DELETE RECORD');
    19872025  if ShowMsgOn(not ActionSts.Success, ActionSts.Reason, TX_IN_AUTH) then Exit;
     
    23222360  begin
    23232361    popNoteMemoSpell.Enabled    := True;
     2362    popNoteMemoSpellOpenSource.Enabled   := True;  //WordVisTA@SK_Arora@HealthSevak to implement OpenSource SpellCheck Engine
    23242363    popNoteMemoGrammar.Enabled  := True;
    23252364    popNoteMemoReformat.Enabled := True;
     
    23312370  begin
    23322371    popNoteMemoSpell.Enabled    := False;
     2372    popNoteMemoSpellOpenSource.Enabled    := False; //WordVisTA@SK_Arora@HealthSevak to implement OpenSource SpellCheck Engine
    23332373    popNoteMemoGrammar.Enabled  := False;
    23342374    popNoteMemoReformat.Enabled := False;
     
    23552395begin
    23562396  inherited;
    2357   FEditCtrl.SelText := Clipboard.AsText; {*KCM*}
     2397  Sendmessage(FEditCtrl.Handle,EM_PASTESPECIAL,CF_TEXT,0);
    23582398  frmNotes.pnlWriteResize(Self);
    23592399  //FEditCtrl.PasteFromClipboard;        // use AsText to prevent formatting
     
    24372477  timAutoSave.Enabled := False;
    24382478  try
    2439     SpellCheckForControl(memNewNote);
     2479    SpellCheckForControl(memNewNote, Sender = popNoteMemoSpellOpenSource);  //WordVisTA@SK_Arora@HealthSevak to implement OpenSource SpellCheck Engine
    24402480  finally
    24412481    FChanged := True;
     
    29452985              end;
    29462986            Dest.Free;
    2947           end;
     2987          end else
     2988          //Reset the caption
     2989          lblNotes.Caption := SetNoteTreeLabel(FCurrentContext);
     2990
    29482991        // Text Search CQ: HDS00002856 ---------------------------------------
    29492992
Note: See TracChangeset for help on using the changeset viewer.