ONCASCI ;Hines OIFO/GWB - Search TEXT fields for illegal ASCII characters ;02/09/11
;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
;
N IEN,NSFLAG,TEXTIEN,TEXTLINE,TEXTNAME,TEXTNODE,TEXTNUM,Y,Z,ZZ
S DIC="^ONCO(165.5,",DIC(0)="AEQZM"
S DIC("A")=" Select primary or patient name: "
D ^DIC K DIC Q:Y<0
S NSFLAG=""
S IEN=+Y
F TEXTNODE=9:1:22 D
.S TEXTNUM=$S(TEXTNODE=9:103,TEXTNODE=10:104,TEXTNODE=11:105,TEXTNODE=12:106,TEXTNODE=13:107,TEXTNODE=14:108,TEXTNODE=15:109,TEXTNODE=16:110,TEXTNODE=17:111,TEXTNODE=18:112,TEXTNODE=19:113,TEXTNODE=20:114,TEXTNODE=21:115,TEXTNODE=22:116,1:"")
.S TEXTNAME=$P(^DD(165.5,TEXTNUM,0),U,1)
.S TEXTIEN=0
.F S TEXTIEN=$O(^ONCO(165.5,IEN,TEXTNODE,TEXTIEN)) Q:TEXTIEN'>0 D
..S TEXTLINE=^ONCO(165.5,IEN,TEXTNODE,TEXTIEN,0)
..F Z=1:1:$L(TEXTLINE) S ZZ=$E(TEXTLINE,Z) I ($A(ZZ)<32)!($A(ZZ)>126) D
...W !!,TEXTNAME
...W !,"TEXT line: ",TEXTLINE
...W !,"Non-standard character: ",ZZ
...S NSFLAG="Yes"
;
EX ;Exit
I NSFLAG="" W !!," No non-standard characters found."
W ! K DIR S DIR(0)="E" D ^DIR
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCASCI 1067 printed Dec 13, 2024@02:22:03 Page 2
ONCASCI ;Hines OIFO/GWB - Search TEXT fields for illegal ASCII characters ;02/09/11
+1 ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
+2 ;
+3 NEW IEN,NSFLAG,TEXTIEN,TEXTLINE,TEXTNAME,TEXTNODE,TEXTNUM,Y,Z,ZZ
+4 SET DIC="^ONCO(165.5,"
SET DIC(0)="AEQZM"
+5 SET DIC("A")=" Select primary or patient name: "
+6 DO ^DIC
KILL DIC
if Y<0
QUIT
+7 SET NSFLAG=""
+8 SET IEN=+Y
+9 FOR TEXTNODE=9:1:22
Begin DoDot:1
+10 SET TEXTNUM=$SELECT(TEXTNODE=9:103,TEXTNODE=10:104,TEXTNODE=11:105,TEXTNODE=12:106,TEXTNODE=13:107,TEXTNODE=14:108,TEXTNODE=15:109,TEXTNODE=16:110,TEXTNODE=17:111,TEXTNODE=18:112,TEXTNODE=19:113,TEXTNODE=20:114,TEXTNODE=21:115,TEXTNODE=
22:116,1:"")
+11 SET TEXTNAME=$PIECE(^DD(165.5,TEXTNUM,0),U,1)
+12 SET TEXTIEN=0
+13 FOR
SET TEXTIEN=$ORDER(^ONCO(165.5,IEN,TEXTNODE,TEXTIEN))
if TEXTIEN'>0
QUIT
Begin DoDot:2
+14 SET TEXTLINE=^ONCO(165.5,IEN,TEXTNODE,TEXTIEN,0)
+15 FOR Z=1:1:$LENGTH(TEXTLINE)
SET ZZ=$EXTRACT(TEXTLINE,Z)
IF ($ASCII(ZZ)<32)!($ASCII(ZZ)>126)
Begin DoDot:3
+16 WRITE !!,TEXTNAME
+17 WRITE !,"TEXT line: ",TEXTLINE
+18 WRITE !,"Non-standard character: ",ZZ
+19 SET NSFLAG="Yes"
End DoDot:3
End DoDot:2
End DoDot:1
+20 ;
EX ;Exit
+1 IF NSFLAG=""
WRITE !!," No non-standard characters found."
+2 WRITE !
KILL DIR
SET DIR(0)="E"
DO ^DIR
+3 QUIT