ISRxMedication.GetEntityIdBySource

Description

This function returns the entities of the Rx medication by the specified source.

Syntax

object.GetEntityIdBySource(aSource)

Part Attribute Type Description
object Required
The object always implements the ISRxMedication interface
aSource In, Required
string
The entity source

Return Value

ISList

Returns the entities of the Rx medication by the specified source.

Example

Add a new entity with the source "Source1" to the loaded Rx medication. Get the entities with the specified source and display their count.

Dim aRxMedication
Dim aTr
Dim aSource
Dim aIdentifier
Dim aValue  
Dim aEntities1, aEntities2, aEntity  
Dim aRxMedicationInfo  

Set aTr = Profile.StartMapTransaction 
set aRxMedication = Profile.LoadRxMedication(1507)

if aRxMedication is nothing then 
  Profile.MsgBox("There is no Rx Medication with the specified ID")
  exit sub
end if

aSource = "Source1"

set aEntities1 = aRxMedication.GetEntityIdBySource(aSource)
aRxMedicationInfo = "Before adding: " &_
  aRxMedication.RxName & " has " & aEntities1.Count & " entities" & vbNewLine
  
aIdentifier = "Identifier1"
aValue = "Value1" 
set aEntity = aRxMedication.AddEntityId(aSource, aIdentifier, aValue)
aTr.SnapShot
  
if not aEntity is nothing then
  aRxMedicationInfo = aRxMedicationInfo & "New Entity with source '" &_
    aSource & "' was added successfully" & vbNewLine 
end if
  
set aEntities2 = aRxMedication.GetEntityIdBySource(aSource)
aRxMedicationInfo = aRxMedicationInfo & "After adding: " &_ 
  aRxMedication.RxName & " has " & aEntities2.Count & " entities"  

Profile.MsgBox(aRxMedicationInfo)  
Note:

In Profile Client v8 on User Interface Entity Source cannot be found, but Rx medications can be found in Clinical > Medical Record > MedChart.

Version information

Added in v8.2.0