kdjonesmtb2
Technical User
Hello I need to take the results of array and split 4 elements of the array into 4 unique variables
I am using the split function but only one row of a 7 row array is being split into 4 unique variable values
query = "select comment from planaction(nolock) " &_
" where primaryid ='$REFERRALID$'" & _
"and source = 'HealthTrio Auth Referral' " &_
"order by comment "
query = replace(query,"$REFERRALID$",QNXT_referralid)
Set rs300 = conn.Execute(query)
nfields_cpt=""
if (not rs300.eof) then 'check that we have at least one record
nfields_cpt =trim(rs300 ("comment")) 'return the referral text field to a string variable
end if
dim CPT_Procedure_Code_disp
dim CPT_Type_disp
Dim CPT_Code_disp
Dim CPT_Quantity_disp
dim Remarks_cpt
dim Nreason_cpt
dim Nvalues_cpt
dim iT
dim nfields_cpt
' code to separate cpt array
Remarks_cpt =nfields_cpt
Remarks_cpt=replace(remarks_cpt,chr(58),chr(10)) 'replace carriage return with line feed
'Remarks_cpt=replace(remarks_cpt,chr(58),chr(10)) 'replace double line feeds with single line feeds
Nreason_cpt=split(remarks_cpt,chr(10)) 'split on line feeds into an array
'• Nfield(0)= Requesting|JOHN SMITH|Phone|617-777-2222
'• Nfield(1)= Servicing|JOHN ADAMS|Phone|617-999-2222
'• NField(2)= Remarks|KEGIT1 09/28/12 06|15 TEST REMARKS
'
''Initialize variables for Nvalues array
CPT_Procedure_ Code_disp=""
CPT_Type_disp=""
CPT_Code_disp=""
CPT_Quantity_disp""
'
''Code to split the QNXT text field "comment" - this code will assign new variable names to array values - does this code need to be within a if end if - I previously had prefix values in different array - this array does not have any prefix but I still want to assign elements to individual vbscript fields'
'Dim iS - move up higher in code
For iT = 0 to ubound(Nreason_cpt)
Nvalues_cpt = Split(Nreason_cpt(iT),":")
'If Nvalues(1) = "CPT" Then
CPT_Procedure_Code_disp=Nvalues_cpt(0) ' note changing case to upper case to match QNXT
CPT_Procedure_Code_disp=Nvalues_cpt(1)
CPT_Code_disp=Nvalues_cpt(2)
CPT_Quantity_disp=Nvalues_cpt(3)
'End if
I am using the split function but only one row of a 7 row array is being split into 4 unique variable values
query = "select comment from planaction(nolock) " &_
" where primaryid ='$REFERRALID$'" & _
"and source = 'HealthTrio Auth Referral' " &_
"order by comment "
query = replace(query,"$REFERRALID$",QNXT_referralid)
Set rs300 = conn.Execute(query)
nfields_cpt=""
if (not rs300.eof) then 'check that we have at least one record
nfields_cpt =trim(rs300 ("comment")) 'return the referral text field to a string variable
end if
dim CPT_Procedure_Code_disp
dim CPT_Type_disp
Dim CPT_Code_disp
Dim CPT_Quantity_disp
dim Remarks_cpt
dim Nreason_cpt
dim Nvalues_cpt
dim iT
dim nfields_cpt
' code to separate cpt array
Remarks_cpt =nfields_cpt
Remarks_cpt=replace(remarks_cpt,chr(58),chr(10)) 'replace carriage return with line feed
'Remarks_cpt=replace(remarks_cpt,chr(58),chr(10)) 'replace double line feeds with single line feeds
Nreason_cpt=split(remarks_cpt,chr(10)) 'split on line feeds into an array
'• Nfield(0)= Requesting|JOHN SMITH|Phone|617-777-2222
'• Nfield(1)= Servicing|JOHN ADAMS|Phone|617-999-2222
'• NField(2)= Remarks|KEGIT1 09/28/12 06|15 TEST REMARKS
'
''Initialize variables for Nvalues array
CPT_Procedure_ Code_disp=""
CPT_Type_disp=""
CPT_Code_disp=""
CPT_Quantity_disp""
'
''Code to split the QNXT text field "comment" - this code will assign new variable names to array values - does this code need to be within a if end if - I previously had prefix values in different array - this array does not have any prefix but I still want to assign elements to individual vbscript fields'
'Dim iS - move up higher in code
For iT = 0 to ubound(Nreason_cpt)
Nvalues_cpt = Split(Nreason_cpt(iT),":")
'If Nvalues(1) = "CPT" Then
CPT_Procedure_Code_disp=Nvalues_cpt(0) ' note changing case to upper case to match QNXT
CPT_Procedure_Code_disp=Nvalues_cpt(1)
CPT_Code_disp=Nvalues_cpt(2)
CPT_Quantity_disp=Nvalues_cpt(3)
'End if