Procedure

TfrmDCSumm.LoadForEdit

Module

fDCSumm

Last Modified

7/15/2014 3:26:36 PM

Comments

Retrieves an existing Summ and places the data in the fields of pnlWrite

Visibility

Private

Owner

TfrmDCSumm

Declaration

procedure LoadForEdit(PreserveValues: Boolean);

Calls Hierarchy


TfrmDCSumm.LoadForEdit
 ├TfrmDCSumm.ClearEditControls
 │ ├TPCEData.Clear
 │ │ ├ClearList
 │ │ ├TPCEProc.Clear
 │ │ │ └TPCEItem.Clear
 │ │ │   └TPCEItem.SetComment
 │ │ └TPCEProviderList.Clear
 │ │   └TPCEProviderList.GetPrimaryIdx
 │ └TfrmDCSumm.SetEditingIndex
 ├TfrmDCSumm.LockSumm
 │ ├TChanges.Exist
 │ └LockDocument
 ├TfrmDCSumm.SetEditingIndex
 ├TChanges.Add
 │ └TChangeItem.Create
 ├TfrmDCSumm.GetTitleText
 ├GetDCSummForEdit
 │ ├FindInt
 │ ├FindExt
 │ ├FindDT
 │ └FindInt64
 ├MakeDCSummTreeObject
 │ └MakeDCSummDisplayText
 ├MakeDCSummDisplayText
 ├TPCEData.PCEForNote
 │ ├TEncounter.GetVisitStr
 │ │ └TEncounter.GetVisitCategory
 │ ├VisitStrForNote
 │ ├TPCEData.GetVisitString
 │ │ └TPCEData.VisitDateTime
 │ │   └TPCEData.IsSecondaryVisit
 │ ├TPCEData.CopyPCEData
 │ │ ├TPCEData.Clear...
 │ │ ├TPCEProc.CopyProc
 │ │ │ └TPCEItem.SetComment
 │ │ ├TPCEProviderList.Assign
 │ │ └TPCEData.CopyPCEItems
 │ │   └TPCEItem.Assign
 │ │     └TPCEItem.SetComment
 │ ├TPCEData.IsSecondaryVisit
 │ ├GetLocSecondaryVisitCode
 │ ├TPCEData.Clear...
 │ ├LoadPCEDataForNote
 │ ├ListVisitTypeByLoc
 │ ├SetRPCEncLocation
 │ ├SCCValue
 │ ├TPCEProviderList.Add
 │ │ ├TPCEProviderList.GetPrimaryIdx
 │ │ ├TPCEProviderList.IndexOfProvider
 │ │ └TPCEProviderList.SetPrimaryIdx
 │ │   ├TPCEProviderList.GetPrimaryIdx
 │ │   └TPCEProviderList.SetPrimary
 │ ├AppendComment
 │ ├TPCEDiag.SetFromString
 │ │ └TPCEItem.SetFromString
 │ │   └TPCEItem.SetComment
 │ ├TPCEProc.SetFromString
 │ │ └TPCEItem.SetFromString...
 │ ├TPCEImm.SetFromString
 │ │ └TPCEItem.SetFromString...
 │ ├TPCESkin.SetFromString
 │ │ ├TPCEItem.SetFromString...
 │ │ └StrToFMDateTime
 │ ├TPCEPat.SetFromString
 │ │ └TPCEItem.SetFromString...
 │ ├TPCEHealth.SetFromString
 │ │ └TPCEItem.SetFromString...
 │ └TPCEExams.SetFromString
 │   └TPCEItem.SetFromString...
 ├TPCEData.GetCPTRequired
 │ └TPCEData.NeededPCEData
 │   ├FutureEncounter
 │   │ └FMToday
 │   │   └FMNow
 │   ├PromptForWorkload
 │   ├TPCEData.StandAlone
 │   │ └HasVisit
 │   ├TPCEData.GetHasCPTList
 │   │ └AddList
 │   │   └TPCEItem.HasCPTStr
 │   ├DataHasCPTCodes
 │   ├RequireExposures
 │   └EligbleConditions
 ├TfrmDCSumm.cmdChangeClick
 │ ├ExecuteDCSummProperties
 │ │ ├TfrmBase508Form.Create
 │ │ │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ │ │ ├UnfocusableControlEnter
 │ │ │ └AdjustControls
 │ │ │   ├TfrmBase508Form.ModifyUnfocusableControl
 │ │ │   └..(rec)..
 │ │ ├ListDCSummTitlesShort
 │ │ │ └LoadDCSummTitles
 │ │ │   └TDCSummTitles.Create
 │ │ ├LoadDCUrgencies
 │ │ ├TfrmDCSummProperties.ShowAdmissionList
 │ │ │ └ListAdmitAll
 │ │ ├PrintNameForTitle
 │ │ ├StrToFMDateTime
 │ │ ├GetDischargeDate
 │ │ ├FMNow
 │ │ └GetTIUListItem
 │ ├TChanges.ReplaceSignState
 │ ├MakeDCSummDisplayText
 │ ├TChanges.ReplaceText
 │ ├TfrmDCSumm.GetTitleText
 │ └TfrmDCSumm.mnuActLoadBoilerClick
 │   ├TfrmDCSumm.NoSummSelected
 │   ├LoadBoilerPlate
 │   ├GetLinkedTemplate
 │   │ ├GetLinkedTemplateData
 │   │ └AddTemplate
 │   │   ├TTemplate.Create
 │   │   │ └TTemplate.ReminderDialogIEN
 │   │   └TTemplate.AddChild
 │   │     └TTemplate.GetItems
 │   │       └ExpandTemplate
 │   │         ├TTemplate.GetChildren
 │   │         ├GetTemplateChildren
 │   │         ├AddTemplate...
 │   │         └TTemplate.ItemIENs
 │   │           └TTemplate.GetItems...
 │   ├MakeXMLParamTIU
 │   │ └ExternalName
 │   ├AssignBoilerText
 │   │ └QuickCopyWith508Msg
 │   │   └SpeakTextInserted
 │   ├QueryBoilerPlate
 │   │ └TfrmBase508Form.Create...
 │   └QuickAddWith508Msg
 │     └SpeakTextInserted
 └TfrmDCSumm.lstSummsClick
   ├MakeDCSummDisplayText
   ├LoadDocumentText
   ├TfrmDCSumm.DisplayPCE
   │ ├TPCEData.AddStrData
   │ │ ├Add
   │ │ ├TPCEData.StrVisitType
   │ │ │ ├GetPCEDataText
   │ │ │ │ └GetDiagnosisText
   │ │ │ ├TPCEProc.ModText
   │ │ │ │ └ModifierName
   │ │ │ │   └ModifierIdx
   │ │ │ │     ├TPCEData.VisitDateTime...
   │ │ │ │     ├FMToday...
   │ │ │ │     └MixedCaseModifier
   │ │ │ └TPCEData.StrVisitType
   │ │ │   └AddTxt
   │ │ ├TPCEData.StrDiagnoses
   │ │ │ └GetPCEDataText...
   │ │ ├TPCEData.StrProcedures
   │ │ │ ├GetPCEDataText...
   │ │ │ └TPCEProc.ModText...
   │ │ ├TPCEData.StrImmunizations
   │ │ │ └GetPCEDataText...
   │ │ ├TPCEData.StrSkinTests
   │ │ │ └GetPCEDataText...
   │ │ ├TPCEData.StrPatientEds
   │ │ │ └GetPCEDataText...
   │ │ ├TPCEData.StrHealthFactors
   │ │ │ └GetPCEDataText...
   │ │ └TPCEData.StrExams
   │ │   └GetPCEDataText...
   │ ├GetVitalsFromDate
   │ │ ├TPCEData.IsSecondaryVisit
   │ │ └GetVitalsFromEncDateTime
   │ ├TPCEData.AddVitalData
   │ │ └FormatVitalForNote
   │ │   └ConvertVitalData
   │ ├CanEditPCE
   │ │ ├GetAskPCE
   │ │ └FutureEncounter...
   │ ├TfrmDCSumm.ShowPCEControls
   │ ├TfrmDrawers.DisplayDrawers
   │ │ └..(rec)..
   │ ├ActOnDocument
   │ ├TPCEData.PCEForNote...
   │ └GetVitalsFromNote
   │   ├TPCEData.IsSecondaryVisit
   │   ├GetVitalsFromEncDateTime
   │   └GetVitalFromNoteIEN
   └NotifyOtherApps
     ├AppNotificationEnabled
     │ └TNotifyAppsThread.CreateThread
     └TNotifyAppsThread.ResumeIfIdle

Called-By Hierarchy


              TfrmDCSumm.LoadForEdit
          TfrmDCSumm.InsertNewSumm┤ 
       TfrmDCSumm.mnuActNewClick┤ │ 
    TfrmDCSumm.cmdNewSummClick┘ │ │ 
TfrmDCSumm.mnuActAddIDEntryClick┘ │ 
        TfrmDCSumm.mnuActEditClick┘ 

Calls

Name Declaration Comments
TChanges.Add procedure Add(ItemType: Integer; const AnID, ItemText, GroupName: string; SignState: Integer; AParentID: string = ''; User: int64 = 0; OrderDG: String = ''; DCOrder: Boolean = False; Delay: Boolean = False; ProblemAdded: Boolean = False); -
TfrmDCSumm.ClearEditControls procedure ClearEditControls; -
TfrmDCSumm.cmdChangeClick procedure cmdChangeClick(Sender: TObject); -
TPCEData.GetCPTRequired function GetCPTRequired: Boolean; -
GetDCSummForEdit procedure GetDCSummForEdit(var EditRec: TEditDCSummRec; IEN: Integer); -
TfrmDCSumm.GetTitleText function GetTitleText(AnIndex: Integer): string; -
TfrmDCSumm.LockSumm function LockSumm(AnIEN: Int64): Boolean; -
TfrmDCSumm.lstSummsClick procedure lstSummsClick(Sender: TObject); -
MakeDCSummDisplayText function MakeDCSummDisplayText(RawText: string): string; -
MakeDCSummTreeObject function MakeDCSummTreeObject(x: string): PDocTreeObject; -
TPCEData.PCEForNote procedure PCEForNote(NoteIEN: Integer; EditObj: TPCEData);(* overload; -
TfrmDCSumm.SetEditingIndex procedure SetEditingIndex(const Value: Integer); -

Called-By

Name Declaration Comments
TfrmDCSumm.InsertNewSumm procedure InsertNewSumm(IsIDChild: boolean; AnIDParent: integer); -
TfrmDCSumm.mnuActEditClick procedure mnuActEditClick(Sender: TObject); -


Source

937   procedure TfrmDCSumm.LoadForEdit(PreserveValues: Boolean);
938   { retrieves an existing Summ and places the data in the fields of pnlWrite }
939   var
940     tmpNode: TTreeNode;
941     x: string;
942   begin
943     if not PreserveValues then ClearEditControls;
944     if not LockSumm(lstSumms.ItemIEN) then Exit;
945     EditingIndex := lstSumms.ItemIndex;
946     Changes.Add(CH_SUM, lstSumms.ItemID, GetTitleText(EditingIndex), '', CH_SIGN_YES);
947     if not PreserveValues then GetDCSummForEdit(FEditDCSumm, lstSumms.ItemIEN);
948     if FEditDCSumm.Lines <> nil then memNewSumm.Lines.Assign(FEditDCSumm.Lines);
949     FChanged := False;
950     if FEditDCSumm.Title = TYP_ADDENDUM then
951     begin
952       FEditDCSumm.DocType := TYP_ADDENDUM;
953       FEditDCSumm.TitleName := Piece(lstSumms.Items[lstSumms.ItemIndex], U, 2);
954       if Copy(FEditDCSumm.TitleName,1,1) = '+' then FEditDCSumm.TitleName := Copy(FEditDCSumm.TitleName, 3, 199);
955       if CompareText(Copy(FEditDCSumm.TitleName, 1, 8), 'Addendum') <> 0
956         then FEditDCSumm.TitleName := FEditDCSumm.TitleName + 'Addendum to ';
957     end;
958   
959     uChanging := True;
960     tvSumms.Items.BeginUpdate;
961     tmpNode := tvSumms.FindPieceNode('EDIT', 1, U, nil);
962     if tmpNode = nil then
963       begin
964         tmpNode := tvSumms.Items.AddObjectFirst(tvSumms.Items.GetFirstNode, 'Summary being edited',
965                                                 MakeDCSummTreeObject('EDIT^Summary being edited^^^^^^^^^^^%^0'));
966         TORTreeNode(tmpNode).StringData := 'EDIT^Summary being edited^^^^^^^^^^^%^0';
967       end
968     else
969       tmpNode.DeleteChildren;
970     x := lstSumms.Items[lstSumms.ItemIndex];
971     tmpNode.ImageIndex := IMG_TOP_LEVEL;
972     tmpNode := tvSumms.Items.AddChildObjectFirst(tmpNode, MakeDCSummDisplayText(x), MakeDCSummTreeObject(x));
973     TORTreeNode(tmpNode).StringData := x;
974     if CompareText(Copy(FEditDCSumm.TitleName, 1, 8), 'Addendum') <> 0 then
975       tmpNode.ImageIndex := IMG_SINGLE
976     else
977       tmpNode.ImageIndex := IMG_ADDENDUM;
978     tmpNode.SelectedIndex := tmpNode.ImageIndex;
979     tvSumms.Selected := tmpNode;
980     tvSumms.Items.EndUpdate;
981     uChanging := False;
982   
983     uPCEEdit.NoteDateTime := MakeFMDateTime(Piece(lstSumms.Items[lstSumms.ItemIndex], U, 3));
984     uPCEEdit.PCEForNote(lstSumms.ItemIEN, uPCEShow);
985     FEditDCSumm.NeedCPT := uPCEEdit.CPTRequired;
986     cmdChangeClick(Self); // will set captions, sign state for Changes
987     lstSummsClick(Self);  // will make pnlWrite visible
988     if timAutoSave.Interval <> 0 then timAutoSave.Enabled := True;
989     memNewSumm.SetFocus;
990   end;