Procedure

TChanges.Add

Module

uCore

Last Modified

7/15/2014 3:26:44 PM

Visibility

Public

Owner

TChanges

Declaration

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);

Calls Hierarchy


TChanges.Add
 └TChangeItem.Create

Called-By Hierarchy


                                                            TChanges.Add
                                         TChanges.AddUnsignedToChanges┤ 
                                              TChanges.RequireReview┘ │ 
                                   TfrmFrame.AllowContextChangeAll┤   │ 
                                        TfrmFrame.FormCloseQuery┤ │   │ 
                                      TfrmFrame.mnuFileNextClick┤ │   │ 
                                    TfrmFrame.mnuFileOpenClick┤ │ │   │ 
                                        TfrmFrame.UMInitiate┤ │ │ │   │ 
                               TfrmFrame.mnuFileNextClick...┤ │ │ │   │ 
                               TfrmFrame.mnuFileRefreshClick┤ │ │ │   │ 
                               TfrmOrders.CheckOrderStatus┤ │ │ │ │   │ 
                           TfrmOrders.mnuActChgEvntClick┤ │ │ │ │ │   │ 
                              TfrmOrders.mnuActHoldClick┤ │ │ │ │ │   │ 
                            TfrmOrders.mnuActUnholdClick┤ │ │ │ │ │   │ 
                             TfrmOrders.mnuActRenewClick┤ │ │ │ │ │   │ 
                            TfrmOrders.mnuActChangeClick┤ │ │ │ │ │   │ 
                              TfrmOrders.mnuActCopyClick┘ │ │ │ │ │   │ 
                                    TfrmMeds.mnuActDCClick┤ │ │ │ │   │ 
                                   TfrmMeds.CheckMedStatus┘ │ │ │ │   │ 
                                TfrmMeds.mnuActHoldClick┤   │ │ │ │   │ 
                               TfrmMeds.mnuActRenewClick┤   │ │ │ │   │ 
                              TfrmMeds.mnuActUnholdClick┤   │ │ │ │   │ 
                              TfrmMeds.mnuActChangeClick┤   │ │ │ │   │ 
                                TfrmMeds.mnuActCopyClick┤   │ │ │ │   │ 
                              TfrmMeds.mnuActRefillClick┘   │ │ │ │   │ 
                                          TfrmFrame.ViewInfo┘ │ │ │   │ 
                                       TfrmDCSumm.ViewInfo┤   │ │ │   │ 
                                     TfrmConsults.ViewInfo┤   │ │ │   │ 
                             TfrmFrame.pnlRemindersMouseUp┤   │ │ │   │ 
                              TfrmFrame.RemindersChanged┘ │   │ │ │   │ 
                                  TfrmFrame.FormCreate┘   │   │ │ │   │ 
                                    TfrmFrame.pnlCIRNClick┤   │ │ │   │ 
                              TfrmFrame.pnlVistaWebClick┤ │   │ │ │   │ 
                                   TfrmFrame.FormKeyDown┘ │   │ │ │   │ 
                                 TfrmFrame.pnlPatientClick┤   │ │ │   │ 
                                   TfrmFrame.pnlVisitClick┤   │ │ │   │ 
                             TfrmFrame.pnlPrimaryCareClick┤   │ │ │   │ 
                               TfrmFrame.pnlRemindersClick┤   │ │ │   │ 
                                TfrmFrame.pnlPostingsClick┤   │ │ │   │ 
                                    TfrmFrame.pnlFlagClick┤   │ │ │   │ 
                                      TfrmFrame.laMHVClick┤   │ │ │   │ 
                                     TfrmFrame.laVAA2Click┤   │ │ │   │ 
                                       TfrmOrders.ViewInfo┤   │ │ │   │ 
                                         TfrmMeds.ViewInfo┤   │ │ │   │ 
                                      TfrmSurgery.ViewInfo┤   │ │ │   │ 
                                        TfrmNotes.ViewInfo┤   │ │ │   │ 
                                     TfrmProblems.ViewInfo┘   │ │ │   │ 
                             TfrmFrame.mnuFileNotifRemoveClick┤ │ │   │ 
                                     TfrmFrame.NextButtonClick┘ │ │   │ 
                                   TfrmFrame.SetUpNextButton┘   │ │   │ 
                             TfrmFrame.mnuFileOpenClick...┤     │ │   │ 
                                      TfrmFrame.FormResize┘     │ │   │ 
                                    TfrmFrame.ChangeFont┘       │ │   │ 
                            TfrmFrame.LoadSizesForUser┤         │ │   │ 
                       TfrmFrame.LoadUserPreferences┘ │         │ │   │ 
                              TfrmFrame.UMInitiate┘   │         │ │   │ 
                            TfrmFrame.mnuFontSizeClick┘         │ │   │ 
                                   TfrmFrame.mnuFileOpenClick...┤ │   │ 
                                   TfrmFrame.ctxContextorPending┤ │   │ 
                                  TfrmFrame.StartCCOWContextor┘ │ │   │ 
                                        TfrmFrame.FormCreate┘   │ │   │ 
                                 TfrmFrame.ctxContextorCommitted┤ │   │ 
                               TfrmFrame.StartCCOWContextor...┘ │ │   │ 
                          TfrmFrame.mnuFileResumeContextGetClick┤ │   │ 
                          TfrmFrame.mnuFileResumeContextSetClick┘ │   │ 
                                          TfrmFrame.FormCloseQuery┘   │ 
                                                         TPCEData.Save┤ 
                                                TPCEData.OK2SignNote┤ │ 
                                                         IsOK2Sign┘ │ │ 
                                      TfrmDCSumm.mnuActSignClick┤   │ │ 
                                         TfrmDCSumm.SaveSignItem┤   │ │ 
                                         TfrmReview.cmdOKClick┘ │   │ │ 
                                               ReviewChanges┘   │   │ │ 
                        TfrmFrame.AllowContextChangeAll...┤     │   │ │ 
                                  TfrmFrame.FormCloseQuery┤     │   │ │ 
                              TfrmFrame.mnuFileReviewClick┤     │   │ │ 
                                           UpdateEncounter┘     │   │ │ 
                         TfrmFrame.mnuFileEncounterClick┤       │   │ │ 
                                 TfrmFrame.ViewInfo...┤ │       │   │ │ 
                    TfrmODMedIV.SetValuesFromResponses┤ │       │   │ │ 
                             TfrmODMedIV.SetupDialog┤ │ │       │   │ │ 
                   TfrmODMedIV.cboSolutionMouseClick┘ │ │       │   │ │ 
                       TfrmODMedIV.cboSolutionExit┘   │ │       │   │ │ 
                  TfrmODMedIV.cboSolutionMouseClick...┤ │       │   │ │ 
                     TfrmODMedIV.cboAdditiveMouseClick┤ │       │   │ │ 
                         TfrmODMedIV.cboAdditiveExit┘ │ │       │   │ │ 
                                TfrmODAuto.SetupDialog┤ │       │   │ │ 
                                   ActivateOrderDialog┤ │       │   │ │ 
                           TfrmRemDlg.btnFinishClick┤ │ │       │   │ │ 
           TfrmConsults.mnuActNewConsultRequestClick┤ │ │       │   │ │ 
                   TfrmConsults.cmdNewConsultClick┘ │ │ │       │   │ │ 
                TfrmConsults.mnuActNewProcedureClick┤ │ │       │   │ │ 
                      TfrmConsults.cmdNewProcClick┘ │ │ │       │   │ │ 
                                        ChangeOrders┤ │ │       │   │ │ 
                      TfrmOrders.mnuActChangeClick┤ │ │ │       │   │ │ 
                        TfrmMeds.mnuActChangeClick┘ │ │ │       │   │ │ 
                                     ChangeOrdersEvt┤ │ │       │   │ │ 
                                          CopyOrders┤ │ │       │   │ │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ │       │   │ │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ │       │   │ │ 
                           TfrmODActive.btnOKClick┘ │ │ │       │   │ │ 
                                      TransferOrders┤ │ │       │   │ │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ │       │   │ │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ │       │   │ │ 
                           TfrmODActive.btnOKClick┘ │ │ │       │   │ │ 
                            TfrmOrders.lstWriteClick┤ │ │       │   │ │ 
               TfrmOrders.PlaceOrderForDefaultDialog┤ │ │       │   │ │ 
                  TfrmOrders.DisplayDefaultDlgList┤ │ │ │       │   │ │ 
                       TfrmOrders.ResetOrderPage┘ │ │ │ │       │   │ │ 
               TfrmOrders.btnDelayedOrderClick┘   │ │ │ │       │   │ │ 
                                 DisplayEvntDialog┤ │ │ │       │   │ │ 
                             SetDelayEventForMed┘ │ │ │ │       │   │ │ 
                      TfrmMeds.mnuActCopyClick┘   │ │ │ │       │   │ │ 
                                 DisplayEvntDialog┤ │ │ │       │   │ │ 
                                  SetViewForCopy┘ │ │ │ │       │   │ │ 
                    TfrmOrders.mnuActCopyClick┘   │ │ │ │       │   │ │ 
                                 DisplayEvntDialog┘ │ │ │       │   │ │ 
                                ExecuteChangeEvt┘   │ │ │       │   │ │ 
                 TfrmOrders.mnuActChgEvntClick┘     │ │ │       │   │ │ 
                             TfrmMeds.mnuActNewClick┤ │ │       │   │ │ 
                           TfrmOMNavA.ActivateDialog┤ │ │       │   │ │ 
                         TfrmOMNavA.grdMenuKeyDown┤ │ │ │       │   │ │ 
                         TfrmOMNavA.grdMenuMouseUp┘ │ │ │       │   │ │ 
                                TfrmOMSet.DoNextItem┘ │ │       │   │ │ 
                              TfrmOMSet.InsertList┤   │ │       │   │ │ 
                               ActivateOrderList┘ │   │ │       │   │ │ 
                     TfrmRemDlg.btnFinishClick┤   │   │ │       │   │ │ 
                             ActivateOrderHTML┤   │   │ │       │   │ │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ │       │   │ │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │   │ │       │   │ │ 
                              ActivateOrderSet┤   │   │ │       │   │ │ 
                   TfrmRemDlg.btnFinishClick┤ │   │   │ │       │   │ │ 
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │   │ │       │   │ │ 
     TfrmConsults.mnuActNewProcedureClick...┤ │   │   │ │       │   │ │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ │       │   │ │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │   │ │       │   │ │ 
                     TfrmMeds.mnuActNewClick┤ │   │   │ │       │   │ │ 
                TfrmOMNavA.ActivateDialog...┤ │   │   │ │       │   │ │ 
                     TfrmOMSet.DoNextItem...┘ │   │   │ │       │   │ │ 
                       TfrmOMNavA.DoSelectList┘   │   │ │       │   │ │ 
                     TfrmOMNavA.grdMenuKeyUp┤     │   │ │       │   │ │ 
                   TfrmOMNavA.grdMenuMouseUp┘     │   │ │       │   │ │ 
                                        SkipToNext┤   │ │       │   │ │ 
                         TfrmOMSet.DoNextItem...┘ │   │ │       │   │ │ 
                            TfrmOMSet.UMDelayEvent┘   │ │       │   │ │ 
                               TfrmOMSet.InsertList...┤ │       │   │ │ 
                                TfrmODMeds.SetupDialog┤ │       │   │ │ 
                             TfrmODMeds.btnSelectClick┤ │       │   │ │ 
                             TfrmODMeds.UMDelayClick┘ │ │       │   │ │ 
                                    ExecuteRenewOrders┘ │       │   │ │ 
                         TfrmOrders.mnuActRenewClick┤   │       │   │ │ 
                           TfrmMeds.mnuActRenewClick┘   │       │   │ │ 
                                        EncounterPresent┤       │   │ │ 
                                      ReadyForNewOrder┤ │       │   │ │ 
                           TfrmRemDlg.btnFinishClick┤ │ │       │   │ │ 
        TfrmConsults.mnuActNewConsultRequestClick...┤ │ │       │   │ │ 
             TfrmConsults.mnuActNewProcedureClick...┤ │ │       │   │ │ 
                                     ChangeOrders...┤ │ │       │   │ │ 
                                     ChangeOrdersEvt┤ │ │       │   │ │ 
                                       CopyOrders...┤ │ │       │   │ │ 
                                   TransferOrders...┤ │ │       │   │ │ 
                            TfrmOrders.lstWriteClick┤ │ │       │   │ │ 
                             TfrmMeds.mnuActNewClick┘ │ │       │   │ │ 
                                     ReadyForNewOrder1┤ │       │   │ │ 
            TfrmOrders.PlaceOrderForDefaultDialog...┘ │ │       │   │ │ 
                              TfrmOrders.mnuActDCClick┤ │       │   │ │ 
                             TfrmOrders.mnuActRelClick┤ │       │   │ │ 
                            TfrmOrders.mnuActHoldClick┤ │       │   │ │ 
                          TfrmOrders.mnuActUnholdClick┤ │       │   │ │ 
                           TfrmOrders.mnuActRenewClick┤ │       │   │ │ 
                         TfrmOrders.mnuActReleaseClick┤ │       │   │ │ 
                         TfrmOrders.mnuActOnChartClick┤ │       │   │ │ 
                            TfrmOrders.mnuActSignClick┤ │       │   │ │ 
                                TfrmMeds.mnuActDCClick┤ │       │   │ │ 
                              TfrmMeds.mnuActHoldClick┤ │       │   │ │ 
                             TfrmMeds.mnuActRenewClick┤ │       │   │ │ 
                            TfrmMeds.mnuActUnholdClick┤ │       │   │ │ 
                              TfrmMeds.mnuActCopyClick┤ │       │   │ │ 
                            TfrmMeds.mnuActRefillClick┘ │       │   │ │ 
                                     EncounterPresentEDO┤       │   │ │ 
                                   ReadyForNewOrder...┤ │       │   │ │ 
                         TfrmOrders.mnuActChgEvntClick┤ │       │   │ │ 
                          TfrmOrders.mnuActChangeClick┤ │       │   │ │ 
                            TfrmOrders.mnuActCopyClick┤ │       │   │ │ 
                       TfrmOrders.btnDelayedOrderClick┤ │       │   │ │ 
                            TfrmMeds.mnuActChangeClick┤ │       │   │ │ 
                              TfrmMeds.mnuActCopyClick┘ │       │   │ │ 
                                             UpdateVisit┤       │   │ │ 
                                           EditPCEData┤ │       │   │ │ 
                             TfrmSurgery.cmdPCEClick┤ │ │       │   │ │ 
                                 UpdateEncounterInfo┘ │ │       │   │ │ 
                             TfrmNotes.cmdPCEClick┘   │ │       │   │ │ 
                        TfrmVitals.btnEnterVitalsClick┘ │       │   │ │ 
                                             UpdateVisit┤       │   │ │ 
                                        EncounterPresent┘       │   │ │ 
                         TfrmProblems.lstProbActsClick┘         │   │ │ 
                     TfrmProblems.wgProbDataDblClick┤           │   │ │ 
                           TfrmProblems.lstViewClick┘           │   │ │ 
                   TfrmProblems.HighlightDuplicate┘             │   │ │ 
                         TfrmProblems.AddProblem┤               │   │ │ 
              TfrmProblems.lstProbActsClick...┤ │               │   │ │ 
                 TfrmProblems.lstProbPickClick┤ │               │   │ │ 
              TfrmProblems.lstProbPickDblClick┤ │               │   │ │ 
              TfrmProblems.edProbEntKeyPress┘ │ │               │   │ │ 
                      TfrmProblems.UMPLLexicon┘ │               │   │ │ 
                   TfrmdlgProb.bbChangeProbClick┘               │   │ │ 
                           TfrmConsults.mnuActSignatureSignClick┤   │ │ 
                                       TfrmConsults.SaveSignItem┤   │ │ 
                                      TfrmReview.cmdOKClick...┘ │   │ │ 
                                     TfrmSurgery.mnuActSignClick┤   │ │ 
                                        TfrmSurgery.SaveSignItem┤   │ │ 
                                      TfrmReview.cmdOKClick...┘ │   │ │ 
                                       TfrmNotes.mnuActSignClick┤   │ │ 
                                          TfrmNotes.SaveSignItem┘   │ │ 
                                      TfrmReview.cmdOKClick...┘     │ │ 
                                           TfrmRemDlg.btnFinishClick┤ │ 
                                         TfrmEncounterFrame.SendData┘ │ 
                                 TfrmEncounterFrame.FormCloseQuery┘   │ 
                                                           SaveAllergy┤ 
                                           TfrmARTAllergy.cmdOKClick┘ │ 
                                                  TfrmODBase.ValidSave┤ 
                                           TfrmODBase.cmdAcceptClick┤ │ 
                                            ActivateOrderDialog...┘ │ │ 
                                           TfrmODBase.FormCloseQuery┤ │ 
                                                 TfrmODBase.TabClose┤ │ 
                                        TfrmODAllergy.cmdAcceptClick┘ │ 
                                                         LateTrayOrder┤ 
                                        TfrmODBase.cmdAcceptClick...┤ │ 
                                           TfrmODDiet.cmdAcceptClick┘ │ 
                                        TfrmODDiet.nbkDietChanging┘   │ 
                                              TfrmDCSumm.InsertNewSumm┤ 
                                           TfrmDCSumm.mnuActNewClick┤ │ 
                                        TfrmDCSumm.cmdNewSummClick┘ │ │ 
                                    TfrmDCSumm.mnuActAddIDEntryClick┘ │ 
                                             TfrmDCSumm.InsertAddendum┤ 
                                        TfrmDCSumm.mnuActAddendClick┘ │ 
                                                TfrmDCSumm.LoadForEdit┤ 
                                         TfrmDCSumm.InsertNewSumm...┤ │ 
                                          TfrmDCSumm.mnuActEditClick┘ │ 
                                        TfrmDCSumm.mnuActSignListClick┤ 
                                          TfrmConsults.CompleteConsult┤ 
                                    TfrmConsults.mnuActCompleteClick┤ │ 
                                  TfrmConsults.mnuActAddIDEntryClick┘ │ 
                                           TfrmConsults.InsertAddendum┤ 
                                TfrmConsults.mnuActMakeAddendumClick┘ │ 
                                              TfrmConsults.LoadForEdit┤ 
                                    TfrmConsults.mnuActNoteEditClick┘ │ 
                                  TfrmConsults.mnuActCompleteClick┘   │ 
                                 TfrmConsults.mnuActSignatureListClick┤ 
                                                  AddSelectedToChanges┤ 
                                          TfrmOrders.mnuActHoldClick┤ │ 
                                        TfrmOrders.mnuActUnholdClick┤ │ 
                                         TfrmOrders.mnuActRenewClick┤ │ 
                                            TfrmMeds.mnuActHoldClick┤ │ 
                                           TfrmMeds.mnuActRenewClick┤ │ 
                                          TfrmMeds.mnuActUnholdClick┘ │ 
                                                TfrmOrders.NotifyOrder┤ 
                                                TfrmFrame.UMNewOrder┘ │ 
                                            TfrmChgEvent.updateChanges┤ 
                                                 ExecuteChangeEvt...┘ │ 
                                                       ExecuteDCOrders┤ 
                                            TfrmOrders.mnuActDCClick┤ │ 
                                              TfrmMeds.mnuActDCClick┘ │ 
                                             TfrmSurgery.InsertNewNote┤ 
                                          TfrmSurgery.mnuActNewClick┘ │ 
                                       TfrmSurgery.cmdNewNoteClick┘   │ 
                                            TfrmSurgery.InsertAddendum┤ 
                                       TfrmSurgery.mnuActAddendClick┘ │ 
                                               TfrmSurgery.LoadForEdit┤ 
                                         TfrmSurgery.mnuActEditClick┘ │ 
                                       TfrmSurgery.mnuActSignListClick┤ 
                                               TfrmNotes.InsertNewNote┤ 
                                            TfrmNotes.mnuActNewClick┤ │ 
                                         TfrmNotes.cmdNewNoteClick┘ │ │ 
                                     TfrmNotes.mnuActAddIDEntryClick┘ │ 
                                              TfrmNotes.InsertAddendum┤ 
                                         TfrmNotes.mnuActAddendClick┘ │ 
                                                 TfrmNotes.LoadForEdit┤ 
                                           TfrmNotes.mnuActEditClick┘ │ 
                                         TfrmNotes.mnuActSignListClick┘ 

Calls

Name Declaration Comments
TChangeItem.Create constructor Create(AnItemType: Integer; const AnID, AText, AGroupName: string; ASignState: Integer; AParentID: string = ''; User: int64 = 0; OrderDG: string = ''; DCOrder: Boolean = False; Delay: Boolean = False); -

Called-By

Name Declaration Comments
AddSelectedToChanges procedure AddSelectedToChanges(AList: TList); -
TChanges.AddUnsignedToChanges procedure AddUnsignedToChanges; -
TfrmConsults.CompleteConsult procedure CompleteConsult(IsIDChild: boolean; AnIDParent: integer; UseClinProcTitles: boolean); -
ExecuteDCOrders function ExecuteDCOrders(SelectedList: TList; var DelEvt: boolean): Boolean; -
TfrmDCSumm.InsertAddendum procedure InsertAddendum; -
TfrmConsults.InsertAddendum procedure InsertAddendum; -
TfrmSurgery.InsertAddendum procedure InsertAddendum; -
TfrmNotes.InsertAddendum procedure InsertAddendum; -
TfrmSurgery.InsertNewNote procedure InsertNewNote(IsIDChild: boolean; AnIDParent: integer); -
TfrmNotes.InsertNewNote procedure InsertNewNote(IsIDChild: boolean; AnIDParent: integer); -
TfrmDCSumm.InsertNewSumm procedure InsertNewSumm(IsIDChild: boolean; AnIDParent: integer); -
LateTrayOrder procedure LateTrayOrder(LateTrayFields: TLateTrayFields; IsInpatient: boolean); -
TfrmDCSumm.LoadForEdit procedure LoadForEdit(PreserveValues: Boolean); -
TfrmConsults.LoadForEdit procedure LoadForEdit ; -
TfrmSurgery.LoadForEdit procedure LoadForEdit; -
TfrmNotes.LoadForEdit procedure LoadForEdit; -
TfrmConsults.mnuActSignatureListClick procedure mnuActSignatureListClick(Sender: TObject); -
TfrmDCSumm.mnuActSignListClick procedure mnuActSignListClick(Sender: TObject); -
TfrmSurgery.mnuActSignListClick procedure mnuActSignListClick(Sender: TObject); -
TfrmNotes.mnuActSignListClick procedure mnuActSignListClick(Sender: TObject); -
TfrmOrders.NotifyOrder procedure NotifyOrder(OrderAction: Integer; AnOrder: TOrder); override; -
TPCEData.Save procedure Save; -
SaveAllergy function SaveAllergy(EditRec: TAllergyRec): string; -
TfrmChgEvent.updateChanges procedure updateChanges(Const AnOrderIDList: TStringList; Const AnEventName: String); -
TfrmODBase.ValidSave function ValidSave: Boolean; -


Source

1108  procedure TChanges.Add(ItemType: Integer; const AnID, ItemText, GroupName: string;
1109    SignState: Integer; AParentID: string; User: int64; OrderDG: String;
1110    DCOrder, Delay, ProblemAdded: Boolean);
1111  var
1112    i: Integer;
1113    Found: Boolean;
1114    ChangeList: TList;
1115    NewChangeItem: TChangeItem;
1116  begin
1117    ChangeList := nil;
1118    case ItemType of
1119    CH_DOC: ChangeList := FDocuments;
1120    CH_SUM: ChangeList := FDocuments;  {*REV*}
1121    CH_CON: ChangeList := FDocuments;
1122    CH_SUR: ChangeList := FDocuments;
1123    CH_ORD: ChangeList := fOrders;
1124    CH_PCE: ChangeList := FPCE;
1125    end;
1126    FRefreshCoverPL := ProblemAdded;
1127    FRefreshProblemList := ProblemAdded;
1128    Found := False;
1129    if ChangeList <> nil then with ChangeList do for i := 0 to Count - 1 do
1130      with TChangeItem(Items[i]) do if ID = AnID then
1131      begin
1132        Found := True;
1133        // can't change ItemType, ID, or GroupName, must call Remove first
1134        FText := ItemText;
1135        FSignState := SignState;
1136      end;
1137    if not Found then
1138    begin
1139      NewChangeItem := TChangeItem.Create(ItemType, AnID, ItemText, GroupName, SignState, AParentID, User, OrderDG, DCOrder, Delay);
1140      case ItemType of
1141      CH_DOC: begin
1142                FDocuments.Add(NewChangeItem);
1143              end;
1144      CH_SUM: begin     {*REV*}
1145                FDocuments.Add(NewChangeItem);
1146              end;
1147      CH_CON: begin
1148                FDocuments.Add(NewChangeItem);
1149              end;
1150      CH_SUR: begin
1151                FDocuments.Add(NewChangeItem);
1152              end;
1153      CH_ORD: begin
1154                fOrders.Add(NewChangeItem);
1155                with FOrderGrp do if IndexOf(GroupName) < 0 then Add(GroupName);
1156              end;
1157      CH_PCE: begin
1158                FPCE.Add(NewChangeItem);
1159                with FPCEGrp do if IndexOf(GroupName) < 0 then Add(GroupName);
1160              end;
1161      end;
1162      Inc(FCount);
1163    end;
1164  end;