ISCareTeam.ReplaceCareTeamProvider

Description

This function replaces care team member with the specified properties within the patient's care team.

Syntax

object.ReplaceCareTeamProvider(aProvID, aPPPURoleID = 0, aPayerID = 0)

Part Attribute Type Description
object Required
The object always implements the ISCareTeam interface
aProvID In, Required
int
ID of the provider
aPPPURoleID In, Required
Default value is 0
int
ID of the role when the care team provider type is 'Role'
aPayerID In, Required
Default value is 0
int
ID of the payer

Return Value

ISCareTeam

Returns the care team member with the specified properties.

Example

Display the care team member with the specified properties.

sub main
  Dim aPatient
  Dim aCareTeamFilter
  Dim aCareTeams, aCareTeam
  Dim tr
  Dim i
  Dim aProvToReplace
  Dim aPPPURoleID
  Dim aPayerID
  Dim aProvider
  Dim aRoleShortCode
  Dim aMessage

  set tr = Profile.StartMapTransaction

  Set aPatient = Profile.SelectPatient
  set aCareTeamFilter = Profile.CreateCareTeamFilter

  aCareTeamFilter.Patient = aPatient.Id
  
  set aCareTeams = Profile.LoadCareTeams(aCareTeamFilter)  
  aMessage = "Care Team Members before being replaced: " & vbNewLine &_
    GetCareTemsAsList(aCareTeams) 
   
  set aProvToReplace = Profile.LoadProvider("PROV")
  aPPPURoleID = 0
  aPayerID = 0  
       
  for i = 0 to aCareTeams.Count - 1
    set aCareTeam = aCareTeams.Item(i)
    aCareTeam.ReplaceCareTeamProvider aProvToReplace.Id, aPPPURoleID, aPayerID
  next     

  tr.Commit

  set tr = Profile.StartMapTransaction
  set aCareTeams = Profile.LoadCareTeams(aCareTeamFilter)
   
  aMessage = aMessage & vbNewLine & vbNewLine &_ 
    "Care Team Members after being replaced: " & vbNewLine &_
    GetCareTemsAsList(aCareTeams)
 
  Profile.MsgBox (aMessage)
end sub

function GetCareTemsAsList(aCareTeams)
  Dim aMessage
  Dim aCareTeam
  Dim aRoleShortCode
  Dim aProvider
  Dim i
  aMessage = "Team Member Count = " & aCareTeams.Count & vbNewLine
  for i = 0 to aCareTeams.Count - 1
    set aCareTeam = aCareTeams.Item(i)
  
    set aRoleShortCode = Profile.LoadShortCode(aCareTeam.RoleID)  
    aMessage = aMessage & aRoleShortCode.Description & vbTab
    
    if aCareTeam.PersonId <= 0 then  
      aMessage = aMessage & "Provider: UNASSIGNED" & vbNewLine
    else
      set aProvider = Profile.LoadProviderById(aCareTeam.PersonId)  
      aMessage = aMessage & "Provider: " & aProvider.FullName & vbNewLine
    end if
  next
  GetCareTemsAsList = aMessage
end function
Note:

In Profile Client v8 on User Interface Care Team Members can be found and replaced in Clinical > Care Team or Clinical > Medical Record > Care Team.

Version information

Added in v7.8.0