ISContact.AddImageBase64

Description

This function adds an image into the contact of the encounter.

Syntax

object.AddImageBase64 aBase64string, aType, aCaption

Part Attribute Type Description
object Required
The object always implements the ISContact interface
aBase64string In, Required
string
The image in BASE64-string presentation
aType In, Required
string
The media type or file extension of the image
aCaption In, Required
string
The caption of the image

Example

Add an image into each encounter contact and display some information about the updated contacts.

Dim aPatient        
Dim aFilter              
Dim aEncounters, aEncounter
Dim i, j
Dim aMessage
Dim aContact
Dim aImageStream
Dim aImageBase64

set aImageStream = Profile.MakeStream
aImageStream.LoadFromFile("d:\image.jpg")
aImageBase64 = aImageStream.AsBase64

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

  for j = 0 to aEncounter.Contacts.Count - 1
    set aContact = aEncounter.Contacts.Item(j)
    
    aContact.AddImageBase64 aImageBase64, "JPEG", "Linked Photo"
       
    aMessage = aMessage & "      Updated 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
  next 'j                                                                                       
next 'i                                                                
                                          
Profile.MsgBox(aMessage)  
Note:

In Profile Client v8 on User Interface Contact Content can be found in Clinical > Medical Record > Encounters > Open Encounter > Contact Properties.

Version information

Added in v7.8.0