Procedure

TfrmDCSumm.InsertNewSumm

Module

fDCSumm

Last Modified

7/15/2014 3:26:36 PM

Comments

Creates the editing context for a new Discharge Summary & inserts stub into top of view list

Visibility

Private

Owner

TfrmDCSumm

Declaration

procedure InsertNewSumm(IsIDChild: boolean; AnIDParent: integer);

Calls Hierarchy


TfrmDCSumm.InsertNewSumm
 ├TfrmDCSumm.ClearEditControls
 │ ├TPCEData.Clear
 │ │ ├ClearList
 │ │ ├TPCEProc.Clear
 │ │ │ └TPCEItem.Clear
 │ │ │   └TPCEItem.SetComment
 │ │ └TPCEProviderList.Clear
 │ │   └TPCEProviderList.GetPrimaryIdx
 │ └TfrmDCSumm.SetEditingIndex
 ├DfltDCSummTitle
 │ └LoadDCSummTitles
 │   └TDCSummTitles.Create
 ├DfltDCSummTitleName
 │ └LoadDCSummTitles...
 ├CanTitleBeIDChild
 ├FMNow
 ├TfrmDCSumm.LacksRequiredForCreate
 │ ├AskCosignerForDocument
 │ │ └TIUPatch175Installed
 │ │   └ServerHasPatch
 │ └AskCosignerForTitle
 │   └TIUPatch175Installed...
 ├TfrmDCSumm.VerifySummTitle
 │ └GetUserParam
 ├ExecuteDCSummProperties
 │ ├TfrmBase508Form.Create
 │ │ ├TfrmBase508Form.UpdateAccessibilityActions
 │ │ ├UnfocusableControlEnter
 │ │ └AdjustControls
 │ │   ├TfrmBase508Form.ModifyUnfocusableControl
 │ │   └..(rec)..
 │ ├ListDCSummTitlesShort
 │ │ └LoadDCSummTitles...
 │ ├LoadDCUrgencies
 │ ├TfrmDCSummProperties.ShowAdmissionList
 │ │ └ListAdmitAll
 │ ├PrintNameForTitle
 │ ├StrToFMDateTime
 │ ├GetDischargeDate
 │ ├FMNow
 │ └GetTIUListItem
 ├MakeDCSummDisplayText
 ├TfrmDCSumm.SaveCurrentSumm
 │ └TfrmDCSumm.SaveEditedSumm
 │   ├TfrmDCSumm.tvSummsChange
 │   │ ├CanBeAttached
 │   │ ├CanReceiveAttachment
 │   │ ├TraverseTree
 │   │ │ ├ContextMatch
 │   │ │ ├TextFound
 │   │ │ ├AddListViewItem
 │   │ │ └..(rec)..
 │   │ ├TfrmDCSumm.lvSummsSelectItem
 │   │ │ └TfrmDCSumm.lstSummsClick
 │   │ │   ├MakeDCSummDisplayText
 │   │ │   ├LoadDocumentText
 │   │ │   ├TfrmDCSumm.DisplayPCE
 │   │ │   │ ├TPCEData.AddStrData
 │   │ │   │ │ ├Add
 │   │ │   │ │ ├TPCEData.StrVisitType
 │   │ │   │ │ │ ├GetPCEDataText
 │   │ │   │ │ │ │ └GetDiagnosisText
 │   │ │   │ │ │ ├TPCEProc.ModText
 │   │ │   │ │ │ │ └ModifierName
 │   │ │   │ │ │ │   └ModifierIdx
 │   │ │   │ │ │ │     ├TPCEData.VisitDateTime
 │   │ │   │ │ │ │     │ └TPCEData.IsSecondaryVisit
 │   │ │   │ │ │ │     ├FMToday
 │   │ │   │ │ │ │     │ └FMNow
 │   │ │   │ │ │ │     └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
 │   │ │   │ │   └FMToday...
 │   │ │   │ ├TfrmDCSumm.ShowPCEControls
 │   │ │   │ ├TfrmDrawers.DisplayDrawers
 │   │ │   │ │ └..(rec)..
 │   │ │   │ ├ActOnDocument
 │   │ │   │ ├TPCEData.PCEForNote
 │   │ │   │ │ ├TEncounter.GetVisitStr
 │   │ │   │ │ │ └TEncounter.GetVisitCategory
 │   │ │   │ │ ├VisitStrForNote
 │   │ │   │ │ ├TPCEData.GetVisitString
 │   │ │   │ │ │ └TPCEData.VisitDateTime...
 │   │ │   │ │ ├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...
 │   │ │   │ └GetVitalsFromNote
 │   │ │   │   ├TPCEData.IsSecondaryVisit
 │   │ │   │   ├GetVitalsFromEncDateTime
 │   │ │   │   └GetVitalFromNoteIEN
 │   │ │   └NotifyOtherApps
 │   │ │     ├AppNotificationEnabled
 │   │ │     │ └TNotifyAppsThread.CreateThread
 │   │ │     └TNotifyAppsThread.ResumeIfIdle
 │   │ ├TfrmDCSumm.ShowPCEControls
 │   │ └TfrmDCSumm.lstSummsClick...
 │   ├TfrmDCSumm.GetTitleText
 │   ├TfrmDCSumm.mnuActDeleteClick
 │   │ ├TfrmDCSumm.NoSummSelected
 │   │ ├ActOnDocument
 │   │ ├SelectDeleteReason
 │   │ │ ├JustifyDocumentDelete
 │   │ │ └TfrmBase508Form.Create...
 │   │ ├MakeDCSummDisplayText
 │   │ ├TfrmDCSumm.LockSumm
 │   │ │ ├TChanges.Exist
 │   │ │ └LockDocument
 │   │ ├JustifyDocumentDelete
 │   │ ├TfrmDCSumm.SaveCurrentSumm...
 │   │ ├TfrmDCSumm.SetEditingIndex
 │   │ ├VisitStrForNote
 │   │ ├TfrmDCSumm.RemovePCEFromChanges
 │   │ │ ├VisitStrForNote
 │   │ │ └TChanges.Remove
 │   │ │   ├UnlockOrder
 │   │ │   └UnlockDocument
 │   │ ├DeleteDocument
 │   │ ├TChanges.Exist
 │   │ ├UnlockDocument
 │   │ ├TChanges.Remove...
 │   │ ├DeletePCE
 │   │ ├TfrmDCSumm.ClearEditControls...
 │   │ ├TfrmDCSumm.LoadSumms
 │   │ │ ├KillDocTreeObjects
 │   │ │ │ └ResetDocTreeObjectStrings
 │   │ │ ├ListSummsForTree
 │   │ │ ├CreateListItemsForDocumentTree
 │   │ │ ├TfrmDCSumm.UpdateTreeView
 │   │ │ │ └BuildDocumentTree
 │   │ │ │   ├MakeNoteDisplayText
 │   │ │ │   ├MakeConsultNoteDisplayText
 │   │ │ │   ├MakeDCSummDisplayText
 │   │ │ │   ├MakeNoteTreeObject
 │   │ │ │   │ └MakeNoteDisplayText
 │   │ │ │   ├MakeConsultsNoteTreeObject
 │   │ │ │   │ ├MakeConsultNoteDisplayText
 │   │ │ │   │ └GetConsultOrderIEN
 │   │ │ │   ├MakeDCSummTreeObject
 │   │ │ │   │ └MakeDCSummDisplayText
 │   │ │ │   ├SetTreeNodeImagesAndFormatting
 │   │ │ │   │ ├ExternalName
 │   │ │ │   │ ├TextFound
 │   │ │ │   │ └MakeBold
 │   │ │ │   └..(rec)..
 │   │ │ ├RemoveParentsWithNoChildren
 │   │ │ │ └KillDocTreeNode
 │   │ │ │   └ResetDocTreeObjectStrings
 │   │ │ └TfrmDCSumm.tvSummsChange...
 │   │ ├UpdateReminderFinish
 │   │ │ └TfrmRemDlg.UpdateButtons
 │   │ │   ├TfrmRemDlg.BackReminder
 │   │ │   │ └TfrmRemDlg.GetCurReminderList
 │   │ │   │   └TReminderDialog.GetIEN
 │   │ │   └TfrmRemDlg.NextReminder
 │   │ │     └TfrmRemDlg.GetCurReminderList...
 │   │ ├TfrmDCSumm.ShowPCEControls
 │   │ └TfrmDrawers.DisplayDrawers...
 │   ├TfrmDCSumm.cmdChangeClick
 │   │ ├ExecuteDCSummProperties...
 │   │ ├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
 │   ├TPCEData.GetCPTRequired
 │   │ └TPCEData.NeededPCEData
 │   │   ├FutureEncounter...
 │   │   ├PromptForWorkload
 │   │   ├TPCEData.StandAlone
 │   │   │ └HasVisit
 │   │   ├TPCEData.GetHasCPTList
 │   │   │ └AddList
 │   │   │   └TPCEItem.HasCPTStr
 │   │   ├DataHasCPTCodes
 │   │   ├RequireExposures
 │   │   └EligbleConditions
 │   ├RequireMASVerification
 │   ├RequireRelease
 │   ├PutEditedDCSumm
 │   │ └SetText
 │   │   └InitParams
 │   ├TChanges.Remove...
 │   ├UnlockDocument
 │   ├TfrmDCSumm.SetEditingIndex
 │   └TfrmDCSumm.lstSummsClick...
 ├TfrmDCSumm.lstSummsClick...
 ├TfrmDCSumm.LoadForEdit
 │ ├TfrmDCSumm.ClearEditControls...
 │ ├TfrmDCSumm.LockSumm...
 │ ├TfrmDCSumm.SetEditingIndex
 │ ├TChanges.Add
 │ │ └TChangeItem.Create
 │ ├TfrmDCSumm.GetTitleText
 │ ├GetDCSummForEdit
 │ │ ├FindInt
 │ │ ├FindExt
 │ │ ├FindDT
 │ │ └FindInt64
 │ ├MakeDCSummTreeObject...
 │ ├MakeDCSummDisplayText
 │ ├TPCEData.PCEForNote...
 │ ├TPCEData.GetCPTRequired...
 │ ├TfrmDCSumm.cmdChangeClick...
 │ └TfrmDCSumm.lstSummsClick...
 ├TPCEData.SetEncUseCurr
 │ ├TEncounter.GetVisitCategory
 │ ├TPCEProviderList.SetPrimaryIdx...
 │ └SetRPCEncLocation
 ├TPCEData.PCEForNote...
 ├TPCEData.GetCPTRequired...
 ├PutNewDCSumm
 │ └SetText...
 ├LockDocument
 ├MakeDCSummTreeObject...
 ├TChanges.Add...
 ├TfrmDCSumm.GetTitleText
 ├TfrmDCSumm.SetEditingIndex
 ├LoadBoilerPlate
 ├TfrmDCSumm.cmdChangeClick...
 ├MakeXMLParamTIU...
 └QuickCopyWith508Msg...

Called-By Hierarchy


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

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); -
CanTitleBeIDChild function CanTitleBeIDChild(Title: integer; var WhyNot: string): boolean; -
TfrmDCSumm.ClearEditControls procedure ClearEditControls; -
TfrmDCSumm.cmdChangeClick procedure cmdChangeClick(Sender: TObject); -
DfltDCSummTitle function DfltDCSummTitle: Integer; -
DfltDCSummTitleName function DfltDCSummTitleName: string; -
ExecuteDCSummProperties function ExecuteDCSummProperties(var ASumm: TEditDCSummRec; var ListBoxItem: string; ShowAdmissions, IDNoteTitlesOnly: boolean): Boolean; -
FMNow function FMNow: TFMDateTime; -
TPCEData.GetCPTRequired function GetCPTRequired: Boolean; -
TfrmDCSumm.GetTitleText function GetTitleText(AnIndex: Integer): string; -
TfrmDCSumm.LacksRequiredForCreate function LacksRequiredForCreate: Boolean; -
LoadBoilerPlate procedure LoadBoilerPlate(Dest: TStrings; Title: Integer); -
TfrmDCSumm.LoadForEdit procedure LoadForEdit(PreserveValues: Boolean); -
LockDocument procedure LockDocument(IEN: Int64; var AnErrMsg: string); -
TfrmDCSumm.lstSummsClick procedure lstSummsClick(Sender: TObject); -
MakeDCSummDisplayText function MakeDCSummDisplayText(RawText: string): string; -
MakeDCSummTreeObject function MakeDCSummTreeObject(x: string): PDocTreeObject; -
MakeXMLParamTIU function MakeXMLParamTIU(ADCSummID: string; ADCSummRec: TEditDCSummRec): string; overload; -
TPCEData.PCEForNote procedure PCEForNote(NoteIEN: Integer; EditObj: TPCEData);(* overload; -
PutNewDCSumm procedure PutNewDCSumm(var CreatedDoc: TCreatedDoc; const DCSummRec: TDCSummRec); -
QuickCopyWith508Msg procedure QuickCopyWith508Msg(AFrom, ATo: TObject; docType: string = ''); -
TfrmDCSumm.SaveCurrentSumm procedure SaveCurrentSumm(var Saved: Boolean); -
TfrmDCSumm.SetEditingIndex procedure SetEditingIndex(const Value: Integer); -
TPCEData.SetEncUseCurr procedure SetEncUseCurr(Value: Boolean); -
TfrmDCSumm.VerifySummTitle function VerifySummTitle: Boolean; -

Called-By

Name Declaration Comments
TfrmDCSumm.mnuActAddIDEntryClick procedure mnuActAddIDEntryClick(Sender: TObject); -
TfrmDCSumm.mnuActNewClick procedure mnuActNewClick(Sender: TObject); -


Source

703   procedure TfrmDCSumm.InsertNewSumm(IsIDChild: boolean; AnIDParent: integer);
704   { creates the editing context for a new Discharge Summary & inserts stub into top of view list}
705   const
706     USE_CURRENT_VISITSTR = -2;
707   var
708     EnableAutosave, HaveRequired, Saved: Boolean;
709     CreatedSumm: TCreatedDoc;
710     ListItemForEdit: string;
711     TmpBoilerPlate: TStringList;
712     tmpNode: TTreeNode;
713     x, WhyNot: string;
714     DocInfo: string;
715   begin
716     EnableAutosave := FALSE;
717     TmpBoilerPlate := nil;
718     try
719       ClearEditControls;
720       FShowAdmissions := True;
721       FillChar(FEditDCSumm, SizeOf(FEditDCSumm), 0);  //v15.7
722       with FEditDCSumm do
723       begin
724         EditIEN               := 0;
725         DocType               := TYP_DC_SUMM;
726         Title                 := DfltDCSummTitle;
727         TitleName             := DfltDCSummTitleName;
728         if IsIDChild and (not CanTitleBeIDChild(Title, WhyNot)) then
729           begin
730             Title := 0;
731             TitleName := '';
732           end;
733         DictDateTime          := FMNow;
734         Dictator              := User.DUZ;
735         DictatorName          := User.Name;
736         if IsIDChild then
737           IDParent            := AnIDParent
738         else
739           IDParent   := 0;
740       end;
741       // check to see if interaction necessary to get required fields
742       if LacksRequiredForCreate or VerifySummTitle
743         then HaveRequired := ExecuteDCSummProperties(FEditDCSumm, ListItemForEdit, FShowAdmissions, IsIDChild)
744         else HaveRequired := True;
745       if HaveRequired then
746       begin
747         if ListItemForEdit <> '' then
748           begin
749             lstSumms.ItemIndex := -1;
750             lstSumms.SelectByID(Piece(ListItemForEdit, U, 1));
751             if lstSumms.ItemIndex < 0 then
752               begin
753                 lstSumms.Items.Insert(0, ListItemForEdit);
754                 lstSumms.ItemIndex := 0;
755               end;
756             if lstSumms.ItemIndex = EditingIndex then Exit;
757             if EditingIndex > -1 then
758               begin
759                 if InfoBox(TX_NEW_SAVE1 + MakeDCSummDisplayText(lstSumms.Items[EditingIndex]) + TX_NEW_SAVE2,
760                            TC_NEW_SAVE2, MB_YESNO) = IDNO then exit
761                 else
762                   begin
763                     SaveCurrentSumm(Saved);
764                     if not Saved then exit;
765                   end;
766               end;
767             //if not StartNewEdit then Exit;
768             lstSummsClick(Self);
769             LoadForEdit(True);
770             Exit;
771           end
772         else
773           begin
774             // set up uPCEEdit for entry of new note
775             uPCEEdit.UseEncounter := True;
776             uPCEEdit.NoteDateTime := FEditDCSumm.DischargeDateTime;
777             uPCEEdit.PCEForNote(USE_CURRENT_VISITSTR, uPCEShow);
778             FEditDCSumm.NeedCPT  := uPCEEdit.CPTRequired;
779              // create the note
780             PutNewDCSumm(CreatedSumm, FEditDCSumm);
781             uPCEEdit.NoteIEN := CreatedSumm.IEN;
782             if CreatedSumm.IEN > 0 then LockDocument(CreatedSumm.IEN, CreatedSumm.ErrorText);
783             if CreatedSumm.ErrorText = '' then
784             begin
785               //x := $$RESOLVE^TIUSRVLO formatted string
786               //7348^Discharge Summary^3000913^NERD, YOURA  (N0165)^1329;Rich Vertigan;VERTIGAN,RICH^8E REHAB MED^unverified^Adm: 11/05/98;2981105.095547^        ;^^0^^^2
787               with FEditDCSumm do
788                 begin
789                   x := IntToStr(CreatedSumm.IEN) + U + TitleName + U + FloatToStr(DischargeDateTime) + U +
790                        Patient.Name + U + IntToStr(Dictator) + ';' + DictatorName + U + LocationName + U + 'new' + U +
791                        'Adm: ' + FormatFMDateTime('mmm dd,yyyy', AdmitDateTime) + ';' + FloatToStr(AdmitDateTime) + U +
792                        'Dis: ' + FormatFMDateTime('mmm dd,yyyy', DischargeDateTime) + ';' + FloatToStr(DischargeDateTime) +
793                        U + U + U + U + U + U;
794                 end;
795               lstSumms.Items.Insert(0, x);
796               uChanging := True;
797               tvSumms.Items.BeginUpdate;
798               if IsIDChild then
799                 begin
800                   tmpNode := tvSumms.FindPieceNode(IntToStr(AnIDParent), 1, U, tvSumms.Items.GetFirstNode);
801                   tmpNode.ImageIndex := IMG_IDNOTE_OPEN;
802                   tmpNode.SelectedIndex := IMG_IDNOTE_OPEN;
803                   tmpNode := tvSumms.Items.AddChildObjectFirst(tmpNode, MakeDCSummDisplayText(x), MakeDCSummTreeObject(x));
804                   tmpNode.ImageIndex := IMG_ID_CHILD;
805                   tmpNode.SelectedIndex := IMG_ID_CHILD;
806                 end
807               else
808                 begin
809                   tmpNode := tvSumms.Items.AddObjectFirst(tvSumms.Items.GetFirstNode, 'New Summary in Progress',
810                                                           MakeDCSummTreeObject('NEW^New Summary in Progress^^^^^^^^^^^%^0'));
811                   TORTreeNode(tmpNode).StringData := 'NEW^New Summary in Progress^^^^^^^^^^^%^0';
812                   tmpNode.ImageIndex := IMG_TOP_LEVEL;
813                   tmpNode := tvSumms.Items.AddChildObjectFirst(tmpNode, MakeDCSummDisplayText(x), MakeDCSummTreeObject(x));
814                   tmpNode.ImageIndex := IMG_SINGLE;
815                   tmpNode.SelectedIndex := IMG_SINGLE;
816                 end;
817               TORTreeNode(tmpNode).StringData := x;
818               tvSumms.Selected := tmpNode;
819               tvSumms.Items.EndUpdate;
820               uChanging := False;
821               Changes.Add(CH_SUM, IntToStr(CreatedSumm.IEN), GetTitleText(0), '', CH_SIGN_YES);
822               lstSumms.ItemIndex := 0;
823               EditingIndex := 0;
824               if not assigned(TmpBoilerPlate) then
825                 TmpBoilerPlate := TStringList.Create;
826               LoadBoilerPlate(TmpBoilerPlate, FEditDCSumm.Title);
827               FChanged := False;
828               cmdChangeClick(Self); // will set captions, sign state for Changes
829               lstSummsClick(Self);  // will make pnlWrite visible
830               if timAutoSave.Interval <> 0 then EnableAutosave := TRUE;
831               memNewSumm.SetFocus;
832             end else
833             begin
834               InfoBox(CreatedSumm.ErrorText, TX_CREATE_ERR, MB_OK);
835               HaveRequired := False;
836             end; {if CreatedSumm.IEN}
837           end; {loaded for edit}
838       end; {if HaveRequired}
839       if not HaveRequired then ClearEditControls;
840     finally
841       if assigned(TmpBoilerPlate) then
842       begin
843         DocInfo := MakeXMLParamTIU(IntToStr(CreatedSumm.IEN), FEditDCSumm);
844         ExecuteTemplateOrBoilerPlate(TmpBoilerPlate, FEditDCSumm.Title, ltTitle, Self, 'Title: ' + FEditDCSumm.TitleName, DocInfo);
845         QuickCopyWith508Msg(TmpBoilerPlate, memNewSumm);
846         TmpBoilerPlate.Free;
847       end;
848       if EnableAutosave then // Don't enable autosave until after dialog fields have been resolved
849         timAutoSave.Enabled := True;
850     end;
851   end;