ISContact.CreateProblemLink

Description

This function adds the link to the problem into the contact.

Syntax

object.CreateProblemLink(aProblem)

Part Attribute Type Description
object Required
The object always implements the ISContact interface
aProblem In, Required
The problem that is added to the contact

Return Value

ISContactLink

Returns the added link.

Example

Add the link to the problem 'Asthma' into the first contact for each of the encounters created during the latest day.

Dim aTr
Dim aPatient         
Dim aFilter 
Dim aParams             
Dim aEncounters, aEncounter
Dim i, j, k
Dim aMessage
Dim aFirstContact
Dim aContacts, aContact
Dim aLinks
Dim aProblems, aProblem

Set aTr = Profile.StartMapTransaction

set aPatient = Profile.SelectPatient      
set aFilter = Profile.CreateEncounterFilter
aFilter.CreatedDateFrom = DateAdd("d", -1, Now)

aFilter.PatientId = aPatient.ID                 
set aEncounters = aPatient.LoadEncounters(aFilter)

set aParams = Profile.MakePatientProblemLoadParams
aParams.PatientID = aPatient.ID
aParams.ProblemType = 1 ' ptDiagnosis
aParams.Description = "Asthma"
set aProblems = Profile.LoadPatientProblems(aParams)

if aProblems.Count = 0 then exit sub
set aProblem = aProblems.Item(0)

'Add the link to the problem 'Asthma' into the first contact for each of
'the encounters created during the latest day
for i = 0 to aEncounters.Count - 1
  set aEncounter = aEncounters.Item(i) 
  set aFirstContact = aEncounter.Contacts.Item(0)
  aFirstContact.CreateProblemLink(aProblem)
next 'i

aTr.Snapshot

set aFilter = Profile.CreateEncounterFilter
aFilter.PatientId = aPatient.ID                 
set aEncounters = aPatient.LoadEncounters(aFilter)

for i = 0 to aEncounters.Count - 1
  set aEncounter = aEncounters.Item(i) 
  set aContacts = aEncounter.Contacts                  
  aMessage = aMessage & vbNewLine & vbNewLine &_
    "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 aContacts.Count - 1
    set aContact = aContacts.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 aLinks = aContact.Actions  
    for k = 0 to aLinks.Count - 1
      aMessage = aMessage & vbNewLine &_
        "        - " & aLinks.Item(k).Description    
    next 'k  
  next 'j              
next 'i              
                                          
Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface Problem Link can be found in Clinical > Medical Record > Encounters.

See also

Version information

Added in v7.8.0