Ignore:
Timestamp:
May 7, 2015, 12:34:29 PM (9 years ago)
Author:
healthsevak
Message:

Updating the working copy to CPRS version 28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/fMeds.pas

    r830 r1679  
    1 unit fMeds;
     1                                                                       unit fMeds;
    22
    33{$OPTIMIZATION OFF}                              // REMOVE AFTER UNIT IS DEBUGGED
     
    8989    pnlView: TPanel;
    9090    txtView: TVA508StaticText;
     91    mnuActUnhold: TMenuItem;
    9192    procedure mnuChartTabClick(Sender: TObject);
    9293    procedure FormCreate(Sender: TObject);
     
    157158    procedure SortbyDrugalphabeticallystatusactivestatusrecentexpired1Click(
    158159      Sender: TObject);
     160    procedure mnuActUnholdClick(Sender: TObject);
    159161  private
    160162    FIterating: Boolean;
     
    238240implementation
    239241
    240 uses uCore, rCore, fFrame, fRptBox, uOrders, fODBase, fOrdersDC, fOrdersHold,
     242uses uCore, rCore, fFrame, fRptBox, uOrders, fODBase, fOrdersDC, fOrdersHold, fOrdersUnhold,
    241243     fOrdersRenew, fOMNavA, fOrdersRefill, fMedCopy, fOrders, fODChild, rODBase,
    242244     StrUtils, fActivateDeactivate, VA2006Utils, VA508AccessibilityRouter,
     
    268270  TC_NO_RENEW   = 'Unable to Renew Order';
    269271  TX_NO_HOLD    = CRLF + CRLF + '- cannot be placed on hold.' + CRLF + CRLF + 'Reason:  ';
    270   TC_NO_HOLD    = 'Unable to Hold';
     272  TC_NO_HOLD    = 'Unable to Hold'; 
     273  TX_NO_UNHOLD  = CRLF + CRLF + '- cannot be released from hold.' + CRLF + CRLF + 'Reason: ';
     274  TC_NO_UNHOLD  = 'Unable to Release from Hold';
    271275  TX_NO_COPY    = CRLF + CRLF + '- cannot be copied.' + CRLF + CRLF + 'Reason: ';
    272276  TC_NO_COPY    = 'Unable to Copy Order';
     
    729733procedure TfrmMeds.RefreshMedLists;
    730734var
    731   i,view: Integer;
     735  i, view: Integer;
    732736  AMed: TMedListRec;
    733 begin
     737  DateRange: string;
     738begin
     739  if frmFrame.TimedOut then Exit; 
    734740  lstMedsIn.Clear;
    735741  lstMedsOut.Clear;
    736742  lstMedsNonVA.Clear;
     743  DateRange := '';
    737744  StatusText('Retrieving active medications...');
    738745  view := self.FSortView;
    739746  //AGP Fix for CQ 10410 added view arguement to control Meds Tab sort criteria
    740   LoadActiveMedLists(uMedListIn, uMedListOut, uMedListNonVA, view);
    741   if view <> self.FSortView then
    742     begin
     747  LoadActiveMedLists(uMedListIn, uMedListOut, uMedListNonVA, view, DateRange);
    743748      self.FSortView := view;
    744749      if view = 1 then
    745750        begin
    746751          self.SortbyStatusthenLocation1.Checked := True;
    747           SetViewCaption(SortbyStatusthenLocation1.Caption);
     752          SetViewCaption(SortbyStatusthenLocation1.Caption + ' ' + DateRange);
    748753          self.SortbyClinicOrderthenStatusthenStopDate1.Checked := False;
    749754          self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.checked := false;
     
    753758          self.SortbyStatusthenLocation1.Checked := False;
    754759          self.SortbyClinicOrderthenStatusthenStopDate1.Checked := True;
    755           SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption);
     760          SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption + ' ' + DateRange);
    756761          self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false;
    757762        end
     
    761766          self.SortbyClinicOrderthenStatusthenStopDate1.Checked := false;
    762767          self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := true;
    763           SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption);
    764         end
    765     end;
     768          SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption + ' ' + DateRange);
     769        end;
    766770  uPharmacyOrdersIn.Clear;
    767771  uPharmacyOrdersOut.Clear;
     
    808812    else if Abbreviation = 'DL' then result := 'Deleted'
    809813    else if Abbreviation = 'DC' then result := 'DC'
     814    else if Abbreviation = 'UH' then result := 'Unhold'
     815         
    810816    else result := Abbreviation;
    811817  end;
     
    11471153      if ExecuteDCOrders(SelectedList,DelEvt) then
    11481154      begin
    1149         if frmFrame.TimedOut = true then  exit;
    11501155        ResetSelectedForList(ActiveList);
    11511156        SynchListToOrders(ActiveList, SelectedList);
     
    11811186      if ExecuteHoldOrders(SelectedList) then
    11821187      begin
    1183         if frmFrame.TimedOut = true then  exit;
    11841188        AddSelectedToChanges(SelectedList);
    11851189        ResetSelectedForList(ActiveList);
     
    11881192    end;
    11891193  finally
    1190     if frmFrame.TimedOut = false then ActiveList.SetFocus;
     1194    ActiveList.SetFocus;
    11911195    FIterating := False;
    11921196    SelectedList.Free;
     
    12261230      if ExecuteRenewOrders(SelectedList) then
    12271231      begin
    1228         if frmFrame.TimedOut = true then  exit;
    12291232        AddSelectedToChanges(SelectedList);
    12301233        ResetSelectedForList(ActiveList);
     
    12331236   end;
    12341237  finally
    1235     if frmFrame.TimedOut = false then ActiveList.SetFocus;
     1238    ActiveList.SetFocus;
     1239    FIterating := False;
     1240    SelectedList.Free;
     1241    UnlockIfAble;
     1242  end;
     1243end;
     1244
     1245procedure TfrmMeds.mnuActUnholdClick(Sender: TObject);
     1246var   
     1247  ActiveList: TListBox;
     1248  SelectedList: TList;
     1249begin
     1250  inherited;
     1251  ActiveList := ListSelected(TX_NOSEL);
     1252  if ActiveList = nil then Exit;
     1253  if not AuthorizedUser then Exit;
     1254  if not EncounterPresent then Exit;
     1255  if not LockedForOrdering then Exit;
     1256  SelectedList := TList.Create;
     1257  try
     1258    if CheckMedStatus(ActiveList) = True then Exit;
     1259    ValidateSelected(ActiveList, OA_UNHOLD, TX_NO_UNHOLD, TC_NO_UNHOLD);  // validate release hold action
     1260    MakeSelectedList(ActiveList, SelectedList);                           // build list of selected orders
     1261    if ExecuteUnholdOrders(SelectedList) then
     1262    begin
     1263      AddSelectedToChanges(SelectedList);   
     1264      ResetSelectedForList(ActiveList);
     1265      SynchListToOrders(ActiveList, SelectedList);
     1266    end;
     1267  finally 
     1268    ActiveList.SetFocus;
    12361269    FIterating := False;
    12371270    SelectedList.Free;
     
    12681301    if not ShowMsgOn(ChangeIFNList.Count = 0, TX_NOSEL, TC_NOSEL)
    12691302      then ChangeOrders(ChangeIFNList, DelayEvent);
    1270     if frmFrame.TimedOut = true then  exit;
    12711303    SynchListToOrders(ActiveList, SelectedList);    // rehighlights
    12721304    Activelist.SetFocus;
     
    12821314const
    12831315  CP_TXT = 'copied';
    1284   XF_TXT = 'transfered';
     1316  XF_TXT = 'transferred';
    12851317var
    12861318  i: Integer;
     
    14201452      end;
    14211453    end;
    1422     if frmFrame.TimedOut = true then  exit;
    14231454    SynchListToOrders(ActiveList, SelectedList);    // rehighlights
    14241455    if IsTransferAction then
     
    14301461    frmOrders.PtEvtCompleted(TempEvent.PtEventIFN,TempEvent.EventName,True);
    14311462  finally
    1432     if frmFrame.TimedOut = false then  ActiveList.SetFocus;
     1463    ActiveList.SetFocus;
    14331464    FActionOnMedsTab := False;
    14341465    uAutoAC := False;
     
    14891520      if ExecuteRefillOrders(SelectedList) then
    14901521      begin
    1491         if frmFrame.TimedOut = true then  exit;
    14921522        ResetSelectedForList(ActiveList);
    14931523        SynchListToOrders(ActiveList, SelectedList);
     
    14951525    end;
    14961526  finally
    1497     if frmFrame.TimedOut = false then ActiveList.SetFocus;
     1527    ActiveList.SetFocus;
    14981528    FIterating := False;
    14991529    SelectedList.Free;
     
    15901620        if (AnOrder.DGroup = ClinDisp) then                          //imo
    15911621        begin
    1592           x := AnOrder.Text +  #13#10 + 'Clinic medication orders can not be transfered';
     1622          x := AnOrder.Text +  #13#10 + 'Clinic medication orders can not be transferred';
    15931623          if ShowMsgOn(Length(x) > 0, x, 'Unable to transfer.') then
    15941624          begin
     
    21502180  inherited;
    21512181  self.FSortView := 1;
    2152   self.SortbyStatusthenLocation1.Checked := True;
    2153   SetViewCaption(SortbyStatusthenLocation1.Caption);
    2154   self.SortbyClinicOrderthenStatusthenStopDate1.Checked := False;
    2155   self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false;
    21562182  self.RefreshMedLists;
    21572183end;
     
    21622188  inherited;
    21632189  self.FSortView := 2;
    2164   self.SortbyStatusthenLocation1.Checked := False;
    2165   self.SortbyClinicOrderthenStatusthenStopDate1.Checked := True;
    2166   SetViewCaption(SortbyClinicOrderthenStatusthenStopDate1.Caption);
    2167   self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := false;
    21682190  self.RefreshMedLists;
    21692191end;
     
    21742196  inherited;
    21752197  self.FSortView := 3;
    2176   self.SortbyStatusthenLocation1.Checked := False;
    2177   self.SortbyClinicOrderthenStatusthenStopDate1.Checked := false;
    2178   self.SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Checked := true;
    2179   SetViewCaption(SortbyDrugalphabeticallystatusactivestatusrecentexpired1.Caption);
    21802198  self.RefreshMedLists;
    21812199end;
Note: See TracChangeset for help on using the changeset viewer.