This function deletes the entity linked to the patient's problem.
object.DeleteEntityId
aEntityId
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISPatientProblem interface |
|
aEntityId |
In, Required | The entity identifier |
Add two entities to the patient's problem and delete them.
sub main()
Dim aTrans
Dim aPatient
Dim aProblemList, aProblem
Dim aProblem1
Dim aEntityCollection
Dim aEntity
Dim aMessage
Set aTrans = Profile.StartMapTransaction
set aPatient = Profile.SelectPatient
set aProblemList = aPatient.ProblemList
if aProblemList.Count = 0 then
Profile.MsgBox("The patient has no problems")
exit sub
end if
set aProblem1 = aProblemList.Item(0)
aProblem1.AddEntityId "My source 1", "My identifier3", "My value A"
aProblem1.AddEntityId "My source 2", "My identifier3", "My value B"
aProblem1.Save
aTrans.SnapShot
aMessage = aMessage & vbNewLine & "THE STATE BEFORE DELETING ENTITY:" & vbNewLine &_
GetProblemsEntities(aProblemList)
for each aProblem in aProblemList
set aEntityCollection = aProblem.GetEntityIdByIdentifier("My identifier3")
for each aEntity in aEntityCollection
aProblem.DeleteEntityId aEntity
next
aProblem.Save
next
aTrans.SnapShot
aMessage = aMessage & vbNewLine & "THE STATE AFTER DELETING REG KEY:" & vbNewLine &_
GetProblemsEntities(aProblemList)
Profile.MsgBox(aMessage)
end sub
function GetProblemsEntities(aProblemList)
Dim aTrans
Dim aProblem
Dim aEntityCollection
set aTrans = Profile.StartMapTransaction
for each aProblem in aProblemList
set aEntityCollection = aProblem.GetEntityIdByIdentifier("My identifier3")
aMessage = aMessage & "The patient's problem with code '" & aProblem.DxCode &_
"' has " & aEntityCollection.Count & " linked entities " & vbNewLine
next
GetProblemsEntities = aMessage
end function
In Profile Client v8 on User Interface Entity Id cannot be found and deleted.