ISContact.DeleteContactAction

Description

This function deletes the contact action from the contact.

Syntax

object.DeleteContactAction aContactActionLink

Part Attribute Type Description
object Required
The object always implements the ISContact interface
aContactActionLink In, Required
The contact action link

Example

Display some information about the contacts of patient's encounters, including the deleted contact actions.

Dim aPatient        
Dim aFilter              
Dim aEncounters, aEncounter
Dim i, j, k
Dim aMessage
Dim aContact
Dim aLinkCodeForDeleting
Dim aAction, aActions

Set aPatient = Profile.SelectPatient 
set aFilter = Profile.CreateEncounterFilter
aFilter.PatientId = aPatient.ID                 
set aEncounters = aPatient.LoadEncounters(aFilter)
    
aLinkCodeForDeleting = "12"    
                                                                 
aMessage = "Encounters Count = " & aEncounters.Count

for i = 0 to aEncounters.Count - 1
  set aEncounter = aEncounters.Item(i)              
  aMessage = aMessage & vbNewLine & (i + 1) & ". " &_
    "Date: " & aEncounter.Date & vbNewLine &_                            
    "Date Created: " & aEncounter.DateCreated & vbNewLine &_
    "Pos Code: " & aEncounter.PosCode & vbNewLine &_
    "Provider Code: " & aEncounter.ProviderCode & vbNewLine &_
    "Service Code: " & aEncounter.ServiceCode & vbNewLine &_
    "Type Description: " & aEncounter.TypeDescription & vbNewLine

    for j = 0 to aEncounter.Contacts.Count -1
      set aContact = aEncounter.Contacts.Item(j)

      aMessage = aMessage & "      Contact" & vbNewLine &_ 
        "    - Date: " & aContact.Date & vbNewLine &_
        "    - Date Altered: " & aContact.DateAltered & vbNewLine &_
        "    - Date Created: " & aContact.DateCreated & vbNewLine &_
        "    - Date Resolved: " & aContact.DateResolved & vbNewLine &_
        "    - Diagnosis Description: " & aContact.DiagnosisDescription & vbNewLine &_
        "    - Diagnosis Code: " & aContact.DiagnosisCode & vbNewLine &_
        "    - Pos Code: " & aContact.PosCode & vbNewLine &_
        "    - POS Name: " & aContact.POSName & vbNewLine &_
        "    - Provider Code: " & aContact.ProviderCode & vbNewLine &_
        "    - Referral Type: " & aContact.ReferralType & vbNewLine &_
        "    - Service Code: " & aContact.ServiceCode & vbNewLine &_
        "    - Subject: " & aContact.Subject & vbNewLine &_
        "    - Time: " & aContact.Time & vbNewLine &_
        "    - Type Code: " & aContact.TypeCode & vbNewLine
                
      set aActions = aContact.Actions  
      for k = aActions.Count - 1 to 0 step -1
        set aAction = aActions.Item(k)
        if aAction.Code = aLinkCodeForDeleting then
          aMessage = aMessage &_
            "    - Deleted Contact Link: " & aAction.Description &_
            " (" & aAction.Code & ")" & vbNewLine
          aContact.DeleteContactAction(aAction)  
        end if
      next 'k                 
    next 'j                
next 'i 
                                          
Profile.MsgBox(aMessage) 
Note:

In Profile Client v8 on User Interface Contact Actions can be deleted in Clinical > Medical Record > Encounters > Open Encounter > Contact Actions.

See also

Version information

Added in v7.10.3