This function links the specified concept to the HRC.
object.SetConcept
aConcept
Replace the specified concepts linked to the observations.
sub main
Dim aPatient
Dim aFilter
Dim aCDOForms, aCDOForm
Dim aConcepts
Dim aNewConcept
Dim i
Dim aMessage
Set aPatient = Profile.SelectPatient
set aFilter = Profile.CreateCdoFormFilter
aFilter.PatientId = aPatient.Id
set aCDOForms = Profile.LoadCdoForms(aFilter) ' ISHRObservations
aMessage = "CDO Forms (Count = " & aCDOForms.Count & "):"
set aFilter = Profile.CreateConceptsFilter
aFilter.AddConceptRef "IH", "z..UB", False
set aConcepts = Profile.LoadConcepts(aFilter)
set aNewConcept = aConcepts.Item(0)
for i = 0 to aCDOForms.Count - 1
set aCDOForm = aCDOForms.Item(i) 'ISHRObservation
ProcessHRC aCDOForm.AsHRC, aNewConcept
aMessage = aMessage & vbNewLine & (i + 1) & ") " & aCDOForm.Name & " - processed"
next
Profile.MsgBox(aMessage)
end sub
sub ProcessHRI(aHRI, aNewConcept)
if (aHRI.TermsetCode = "IH" and aHRI.ConceptCode = "z..2T") then
aHRI.SetConcept aNewConcept
end if
end sub
sub ProcessHRC(aHRC, aNewConcept)
Dim i
Dim aObs
if (aHRC.TermsetCode = "IH" and aHRC.ConceptCode = "z..2T") then
aHRC.SetConcept aNewConcept
end if
for i = 0 to aHRC.Count - 1
set aObs = aHRC.Item(i)
if aObs.IsHRI then
ProcessHRI aObs.AsHRI, aNewConcept
else
ProcessHRC aObs.AsHRC, aNewConcept
end if
next
end sub