Dear All,
I am currently working on a project to record ORU^R01 into a global for a particular set of tests.
I have multiple OBX repeats that need to go into a specific fields withing one row/ record on the global.
I am having trouble finding a way to either count or loop though the OBX's correctly in ObjectScript often with the counter being undefined.
I have done this this way, as I am building upon an existing class to populate this global.
The latest iteration of my obx looping code is below:
// handle repeating obx's by setting count of value
set segcnt = pMsg.SegCountGet()
///count no of obx repeats
for segmentIndex = 1:1:segcnt{
IF pMsg.FindSegment("OBX",segmentIndex,.sc)='"",$$$ISOK(sc) {
set obxcnt = obxcnt+1}
}
for obxIndex=1:1:obxcnt {
// Check for OBX-3.1 = "CodeA" f
IF GetValueAt("OBX("_obxIndex_"):3.1") = "SARS" {
set CovRes.Ward = "CodeA"
set tResultAB = $ZSTRIP(GetValueAt("OBX("_obxIndex_"):5(1)"),"<>W")
IF tResultAB = "Positive" {
set CovRes.TotalAbPositive = 1
}
elseif tResultAB = "Negative" {
set CovRes.TotalAbPositive = 0
}
}
// Check for OBX-3.1 = "CodeB"
elseIF GetValueAt("OBX("_obxndex_"):3.1") = "CodeB" {
set tResultAB = $ZSTRIP(GetValueAt("OBX("_obxIndex_"):5(1)"),"<>W")
If tResultAB = "Positive" {
set CovRes.IgGPositive = 1
}
}