Procedure

TfrmDCSumm.DoAttachIDChild

Module

fDCSumm

Last Modified

7/15/2014 3:26:36 PM

Visibility

Private

Owner

TfrmDCSumm

Declaration

procedure DoAttachIDChild(AChild, AParent: TORTreeNode);

Calls Hierarchy


TfrmDCSumm.DoAttachIDChild
 ├CanBeAttached
 ├CanReceiveAttachment
 ├DetachEntryFromParent
 ├AttachEntryToParent
 └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
     ├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
     │   │ │ │ │ ├ClearList
     │   │ │ │ │ ├TPCEProc.Clear
     │   │ │ │ │ │ └TPCEItem.Clear
     │   │ │ │ │ │   └TPCEItem.SetComment
     │   │ │ │ │ └TPCEProviderList.Clear
     │   │ │ │ │   └TPCEProviderList.GetPrimaryIdx
     │   │ │ │ ├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...

Called-By Hierarchy


              TfrmDCSumm.DoAttachIDChild
            TfrmDCSumm.tvSummsDragDrop┤ 
TfrmDCSumm.mnuActAttachtoIDParentClick┘ 

Calls

Name Declaration Comments
AttachEntryToParent function AttachEntryToParent(DocID, ParentDocID: string; var WhyNot: string): boolean; -
CanBeAttached function CanBeAttached(DocID: string; var WhyNot: string): boolean; -
CanReceiveAttachment function CanReceiveAttachment(DocID: string; var WhyNot: string): boolean; -
DetachEntryFromParent function DetachEntryFromParent(DocID: string; var WhyNot: string): boolean; -
TfrmDCSumm.LoadSumms procedure LoadSumms; -

Called-By

Name Declaration Comments
TfrmDCSumm.mnuActAttachtoIDParentClick procedure mnuActAttachtoIDParentClick(Sender: TObject); -
TfrmDCSumm.tvSummsDragDrop procedure tvSummsDragDrop(Sender, Source: TObject; X, Y: Integer); -


Source

3083  procedure TfrmDCSumm.DoAttachIDChild(AChild, AParent: TORTreeNode);
3084  const
3085    TX_ATTACH_CNF     = 'Confirm Attachment';
3086    TX_ATTACH_FAILURE = 'Attachment failed';
3087  var
3088    ErrMsg, WhyNot: string;
3089    SavedDocID: string;
3090  begin
3091    if (AChild = nil) or (AParent = nil) then exit;
3092    ErrMsg := '';
3093    if not CanBeAttached(PDocTreeObject(AChild.Data)^.DocID, WhyNot) then
3094      ErrMsg := ErrMsg + WhyNot + CRLF + CRLF;
3095    if not CanReceiveAttachment(PDocTreeObject(AParent.Data)^.DocID, WhyNot) then
3096      ErrMsg := ErrMsg + WhyNot;
3097    if ErrMsg <> '' then
3098      begin
3099        InfoBox(ErrMsg, TX_ATTACH_FAILURE, MB_OK);
3100        Exit;
3101      end
3102    else
3103      begin
3104        WhyNot := '';
3105        if (InfoBox('ATTACH:   ' + AChild.Text + CRLF + CRLF +
3106                    '    TO:   ' + AParent.Text + CRLF + CRLF +
3107                    'Are you sure?', TX_ATTACH_CNF, MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION) <> IDYES)
3108            then Exit;
3109        SavedDocID := PDocTreeObject(AParent.Data)^.DocID;
3110      end;
3111    if AChild.ImageIndex in [IMG_ID_CHILD, IMG_ID_CHILD_ADD] then
3112      begin
3113        if DetachEntryFromParent(PDocTreeObject(AChild.Data)^.DocID, WhyNot) then
3114          begin
3115            if AttachEntryToParent(PDocTreeObject(AChild.Data)^.DocID, PDocTreeObject(AParent.Data)^.DocID, WhyNot) then
3116              begin
3117                LoadSumms;
3118                with tvSumms do Selected := FindPieceNode(SavedDocID, U, Items.GetFirstNode);
3119                if tvSumms.Selected <> nil then tvSumms.Selected.Expand(False);
3120              end
3121            else
3122              InfoBox(WhyNot, TX_ATTACH_FAILURE, MB_OK);
3123          end
3124        else
3125          begin
3126            WhyNot := StringReplace(WhyNot, 'ATTACH', 'DETACH', [rfIgnoreCase]);
3127            WhyNot := StringReplace(WhyNot, 'to an ID', 'from an ID', [rfIgnoreCase]);
3128            InfoBox(WhyNot, TX_DETACH_FAILURE, MB_OK);
3129            Exit;
3130          end;
3131      end
3132    else
3133      begin
3134        if AttachEntryToParent(PDocTreeObject(AChild.Data)^.DocID, PDocTreeObject(AParent.Data)^.DocID, WhyNot) then
3135          begin
3136            LoadSumms;
3137            with tvSumms do Selected := FindPieceNode(SavedDocID, U, Items.GetFirstNode);
3138            if tvSumms.Selected <> nil then tvSumms.Selected.Expand(False);
3139          end
3140        else
3141          InfoBox(WhyNot, TX_ATTACH_FAILURE, MB_OK);
3142     end;
3143  end;