ISCareVisit.newAction

Description

This function adds a new action to the intervention template.

Syntax

object.newAction(Code)

Part Attribute Type Description
object Required
The object always implements the ISCareVisit interface
Code In, Required
string
The code of the action

Return Value

ISCareAction

Returns an added action to the intervention template.

Example

Add a new action to the intervention template.

Dim aCarePlan
Dim aMessage
Dim aVisits, aVisit
Dim aNewAction
Dim aActions, aAction
Dim aTrans

set aTrans = Profile.StartMapTransaction

Set aCarePlan = Profile.LoadCarePlanByCode ("FLU") 
set aVisits = aCarePlan.Visits

if aVisits.Count = 0 then
  Profile.MsgBox("There are no care visits!")
  exit sub
end if  
 
for i = 0 to aVisits.Count - 1
  set aVisit = aVisits.Item(i)
  aMessage = aMessage & vbNewLine &_
    "Intervention: " & aVisit.Description 

  set aNewAction = aVisit.NewAction("")
  aNewAction.Description = "NewActionOn_" & Now  
  aTrans.SnapShot

  set aActions = aVisit.Actions
  for j = 0 to aActions.Count - 1    
    set aAction = aActions.Item(j)
    aMessage = aMessage & vbNewLine &  "  Action: " & aAction.Description    
  next 'j    
next 'i
  
Profile.MsgBox (aMessage)  
Note:

In Profile Client v8 on User Interface New Action can be found in Maintain > Care Plans > Open Plan > Interventions.

Version information

Added in v7.8.0