Procedure

TfrmRemCoverSheet.Init

Module

fRemCoverSheet

Last Modified

7/15/2014 3:26:38 PM

Comments

TfrmRemCoverSheet

Visibility

Public

Owner

TfrmRemCoverSheet

Declaration

procedure Init(AsUser: boolean);

Calls Hierarchy


TfrmRemCoverSheet.Init
 ├GetAllRemindersAndCategories
 ├TfrmRemCoverSheet.GetUserInfo
 │ └UserDivClassInfo
 ├GetPCECodes
 │ ├LoadHistLocations
 │ └CodeSetIndex
 │   ├LoadImmSeriesItems
 │   ├LoadImmReactionItems
 │   ├LoadSkResultsItems
 │   ├LoadPEDLevelItems
 │   ├LoadHFLevelItems
 │   └LoadXAMResultsItems
 ├TfrmRemCoverSheet.GetExternalName
 │ └GetNameFromList
 │   └ExternalName
 ├TfrmRemCoverSheet.UpdateView
 │ └TfrmRemCoverSheet.GetCurrent
 │   └TfrmRemCoverSheet.GetCoverSheetLvlData
 │     └GetCoverSheetLevelData
 └TfrmRemCoverSheet.UpdateButtons
   ├TfrmRemCoverSheet.GetCurrent...
   ├TfrmRemCoverSheet.GetIndex
   └TfrmRemCoverSheet.LockButtonUpdate
     ├TfrmRemCoverSheet.btnLockClick
     │ └TfrmRemCoverSheet.ChangeStatus
     │   ├TfrmRemCoverSheet.GetCurrent...
     │   ├TfrmRemCoverSheet.GetIndex
     │   ├TfrmRemCoverSheet.MarkListAsChanged
     │   │ └TfrmRemCoverSheet.UpdateView...
     │   ├TfrmRemCoverSheet.SetupItem
     │   └TfrmRemCoverSheet.LockButtonUpdate...
     └TfrmRemCoverSheet.btnAddClick
       └TfrmRemCoverSheet.ChangeStatus...

Called-By Hierarchy


                  TfrmRemCoverSheet.Init
            EditCoverSheetReminderList┘ 
 TfrmReminderTree.mnuCoverSheetClick┤   
              DialogOptionsReminders┘   
TfrmOptions.btnCoverRemindersClick┘     

Calls

Name Declaration Comments
GetAllRemindersAndCategories function GetAllRemindersAndCategories: TStrings; -
TfrmRemCoverSheet.GetExternalName function GetExternalName(Level: TRemCoverDataLevel; IEN: Int64): string; -
GetPCECodes procedure GetPCECodes(List: TStrings; CodeType: integer); -
TfrmRemCoverSheet.GetUserInfo procedure GetUserInfo(AUser: Int64); -
TfrmRemCoverSheet.UpdateButtons procedure UpdateButtons; -
TfrmRemCoverSheet.UpdateView procedure UpdateView; -

Called-By

Name Declaration Comments
EditCoverSheetReminderList procedure EditCoverSheetReminderList(AsUser: boolean); -


Source

285   procedure TfrmRemCoverSheet.Init(AsUser: boolean);
286   const
287     RemClsCode = ' NVL';
288     RemClsText:array[1..4] of string = ('','National','VISN','Local');
289   
290   var
291     LocCombo: TORComboBox;
292     i, idx: integer;
293     tmp, tmp2, tmp3: string;
294     Node: TORTreeNode;
295   
296   begin
297     FTopSortTag := 3;
298     FTopSortUp  := TRUE;
299     FBottomSortTag := 2;
300     FBottomSortUp := TRUE;
301     FEditingLevel := dlPackage;
302   
303     ResizeAnchoredFormToFont(self);
304     pnlBtns.Top := pnlBottom.Top + pnlBottom.Height;
305   
306     FCatInfo := TORStringList.Create;
307     FData := TORStringList.Create;
308     FUserInfo := TORStringList.Create;
309     FDivisions := TORStringList.Create;
310     FServices := TORStringList.Create;
311     FLocations := TORStringList.Create;
312     FClasses := TORStringList.Create;
313     FUsers := TORStringList.Create;
314     FMasterList := TORStringList.Create;
315     //FMasterList.Assign(GetAllRemindersAndCategories);
316     FastAssign(GetAllRemindersAndCategories, FMasterList);
317     for i := 0 to FMasterList.Count-1 do
318     begin
319       tmp := FMasterList[i];
320       tmp2 := piece(tmp,U,4);
321       if tmp2 = piece(tmp,U,3) then
322         tmp2 := '';
323       tmp3 := piece(tmp,U,5);
324       if tmp3 = '' then tmp3 := ' ';
325       idx := pos(tmp3,RemClsCode);
326       if idx > 0 then
327         tmp3 := RemClsText[idx]
328       else
329         tmp3 := '';
330       if tmp3 <> '' then
331       begin
332         if tmp2 <> '' then
333           tmp2 := tmp2 + ' - ';
334         tmp2 := tmp2 + tmp3;
335       end;
336       if tmp2 <> '' then
337         tmp2 := ' (' + tmp2 + ')';
338       tmp := Piece(tmp,U,1) + Pieces(tmp,U,2,3) + tmp2 + U + tmp2;
339       FMasterList[i] := tmp;
340     end;
341   
342     FUserMode := AsUser;
343     FCurUser := User.DUZ;
344     GetUserInfo(User.DUZ);
345     FCurLoc := Encounter.Location;
346     idx := FUserInfo.IndexOfPiece(DivisionCode);
347     if idx >= 0 then
348       FCurDiv := StrToIntDef(Piece(FUserInfo[idx],U,2),0)
349     else
350       FCurDiv := 0;
351     idx := FUserInfo.IndexOfPiece(ServiceCode);
352     if idx >= 0 then
353       FCurSer := StrToIntDef(Piece(FUserInfo[idx],U,2),0)
354     else
355       FCurSer := User.Service;
356     cbxUser.InitLongList(User.Name);
357     cbxUser.SelectByIEN(FCurUser);
358     GetPCECodes(FDivisions, TAG_HISTLOC);
359     FDivisions.Delete(0);
360     FCurClass := 0;
361     if AsUser then
362     begin
363       pnlCAC.Visible := FALSE;
364       LocCombo := cbxUserLoc;
365       btnLock.Visible := FALSE;
366     end
367     else
368     begin
369       pnlUser.Visible := FALSE;
370       LocCombo := cbxLocation;
371       //cbxDivision.Items.Assign(FDivisions);
372       FastAssign(Fdivisions, cbxDivision.Items);
373       cbxDivision.SelectByIEN(FCurDiv);
374       cbxService.InitLongList(GetExternalName(dlService, FCurSer));
375       cbxService.SelectByIEN(FCurSer);
376       cbxClass.InitLongList('');
377       if FCurClass <> 0 then
378         cbxClass.SelectByIEN(FCurClass);
379     end;
380     LocCombo.InitLongList(Encounter.LocationName);
381     LocCombo.SelectByIEN(FCurLoc);
382     if AsUser then
383       cbUser.Checked := TRUE;
384   
385     tvAll.Items.BeginUpdate;
386     try
387       for i := 0 to FMasterList.Count-1 do
388       begin
389         Node := TORTreeNode(tvAll.Items.Add(nil,''));
390         Node.StringData := FMasterList[i];
391         if copy(FMasterList[i],1,1) = CVCatCode then
392         begin
393           idx := 1;
394           tvAll.Items.AddChild(Node, DummyNode);
395         end
396         else
397           idx := 0;
398         Node.ImageIndex := idx;
399         Node.SelectedIndex := idx;
400       end;
401     finally
402       tvAll.Items.EndUpdate;
403     end;
404     
405     FInitialized := TRUE;
406     UpdateView;
407     UpdateButtons;
408   end;