This function completes all the care plan objectives linked to the patient's care plan.
object.CompleteAll
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISRecallObjective interface |
Complete all the care plan objectives linked to the patient's care plan.
sub main
Dim aPatient
Dim aRecallPlans
Dim aMessage
Dim aPlan
Dim i
Dim aObjectives
Dim aObjective
Set aPatient = Profile.SelectPatient
set aRecallPlans = aPatient.RecallPlans
if aRecallPlans.Count = 0 then
Profile.MsgBox("The patient has no care plans!")
exit sub
end if
for each aPlan in aRecallPlans
set aObjectives = aPlan.RecallObjectives
aMessage = aMessage & "PLAN: '" & aPlan.Description & "'" & vbNewLine
if aObjectives.Count = 0 then
aMessage = aMessage & " NO OBJECTIVES" & vbNewLine
end if
for i = 0 to aObjectives.Count - 1
set aObjective = aObjectives.Item(i)
aMessage = aMessage & vbNewLine & " --- " & aObjective.Name
aMessage = aMessage & vbNewLine & "Objective Comment " &_
"BEFORE completing: '" & aObjective.Comment & "' " &_
"(Incomplete Visits count = " & GetIncompleteVisitsCount(aObjective) & ") "
aObjective.CompleteAll
aMessage = aMessage & vbNewLine & "Objective Comment " &_
" AFTER completing: '" & aObjective.Comment & "' " &_
"(Incomplete Visits count = " & GetIncompleteVisitsCount(aObjective) & ") "
next ' i
next ' aPlan
Profile.MsgBox(aMessage)
end sub
function GetIncompleteVisitsCount(aObjective)
Dim aCount
aCount = 0
set aVisits = aObjective.Visits
for each aVisit in aVisits
if aVisit.Status = 1 then aCount = aCount + 1
next
GetIncompleteVisitsCount = aCount
end function
In Profile Client v8 on User Interface Objectives can be found and completed in
or .