ISContact.AddToProblemList

Description

This function creates a new patient's problem with the specified type and disease code of the contact.

Syntax

object.AddToProblemList(ProblemType)

Part Attribute Type Description
object Required
The object always implements the ISContact interface
ProblemType In, Required
The type of the problem

Return Value

ISPatientProblem

Returns the created problem.

Example

Create a new patient's problem for each contact with the specified type and disease code and display the number of the problems before and after adding a new one.

Dim aPatient        
Dim aFilter              
Dim aEncounters, aEncounter
Dim i, j
Dim aMessage
Dim aContact
Dim aContactsInfo

Set aPatient = Profile.SelectPatient 
set aFilter = Profile.CreateEncounterFilter
aFilter.PatientId = aPatient.ID                 
set aEncounters = aPatient.LoadEncounters(aFilter)
                                                                 
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 &_
    "The number of the problems before adding: " & aPatient.ProblemList.Count
      
  aContactsInfo = ""  
  for j = 0 to aEncounter.Contacts.Count -1
    set aContact = aEncounter.Contacts.Item(j)
    aContact.AddToProblemList(1) 'ptDiagnosis
      
    aContactsInfo = aContactsInfo & "      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 
    next 'j

  'Reload the patient because it holds the problem list that should be reloaded
  set aPatient = Profile.LoadPatient(aPatient.Id)      
  aMessage = aMessage & vbNewLine & "The number of the problems after adding: " &_
    aPatient.ProblemList.Count & vbNewLine

  aMessage = aMessage & aContactsInfo & vbNewLine               
next 'i 
                                          
Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface the Add To Problem List checkbox can be checked in Clinical > Medical Record > Encounters > Open Encounter > Contact Properties > Add To Problem List.

Version information

Added in v7.8.0