IBDFBKS4 ;ALB/AAS - Create form spec file for scanning ; 6-JUN-95
;;3.0;AUTOMATED INFO COLLECTION SYS;**3,25**;APR 24, 1997
;
RECOMP ;Recompiles all form specs for paper keyboard
N QZZ
S QZZ=0 F S QZZ=$O(^IBD(359.2,QZZ)) Q:'QZZ D SCAN^IBDFBKS(QZZ)
Q
;
FIELDS ;
S FLD=1 F S FLD=$O(@FIELDS@(PAGE,FLD)) Q:'FLD D
.N DATATP S DATATP=$G(@FIELDS@(PAGE,FLD,"DATATYPE"))
.I DATATP="" D Q
..S (LBEGIN,LEND,QUIT)=0
..S LBEGIN=FLD F S FLD=$O(@FIELDS@(PAGE,FLD)) Q:QUIT D Q:QUIT
...I LEND=0,$S(FLD="":1,1:$G(@FIELDS@(PAGE,FLD,"DATATYPE"))'="") S FLD=LBEGIN D ONEBUB S QUIT=1 Q
...I FLD="",LEND>LBEGIN D LOOP(LBEGIN,LEND) S FLD=LEND,QUIT=1 Q
...I $G(@FIELDS@(PAGE,FLD,"DATATYPE"))'="" D LOOP(LBEGIN,LEND) S FLD=LEND,QUIT=1 Q
...S LEND=FLD
...Q
.;
.I DATATP'="" D
..N TOSTRING
..S TOSTRING=$S($G(@FIELDS@(PAGE,FLD,"START")):"narrative",1:"str")
..;
..D BLDARY^IBDFBKS(" "_TOSTRING_"=\""\"";")
..;
..I DATATP="ALPHA" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(GETAVALUE("_FLD_"));") Q
..;
..I DATATP="FLOAT" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(FTOA(GETFVALUE("_FLD_")));") Q
..;
..I DATATP="INT" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(ITOA(GETIVALUE("_FLD_")));") Q
..;
..I DATATP="DATE" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(DTOA(GETIVALUE("_FLD_")));") Q
..;
..I DATATP="TIME" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(TTOA(GETIVALUE("_FLD_")));") Q
..;
..;D BLDARY^IBDFBKS(" "_TOSTRING_"=STRFIELDS("_FLD_","_FLD_");") Q
.;
.I $G(@FIELDS@(PAGE,FLD,"MULT")),'$G(@FIELDS@(PAGE,FLD,"START")) D BLDARY^IBDFBKS(" if (str!=\""\"") narrative=STRIP(STRCAT(STRCAT(narrative,\"" \""),str));")
.;
.I '$G(@FIELDS@(PAGE,FLD,"MULT")) D
..D BLDARY^IBDFBKS(" if (str != \""\"") {")
..D BLDARY^IBDFBKS(" Data=Add;")
..I @FIELDS@(PAGE,FLD)'="" D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
..D BLDARY^IBDFBKS(" Data=STRCAT(Data,str);")
..D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
..D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
..D BLDARY^IBDFBKS(" ")
.;
.I $G(@FIELDS@(PAGE,FLD,"END")) D
..D BLDARY^IBDFBKS(" if (narrative!=\""\"") {")
..D BLDARY^IBDFBKS(" Data=Add;")
..I @FIELDS@(PAGE,FLD)'="" D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
..D BLDARY^IBDFBKS(" Data=STRCAT(Data,narrative);")
..I $P($G(@FIELDS@(PAGE,FLD)),":")'="H" D BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
..D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
..D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
FIELDSQ Q
;
ONEBUB ; -- for a single bubble field
D BLDARY^IBDFBKS(" str=STRFIELDS("_FLD_","_FLD_");")
D BLDARY^IBDFBKS(" if (str!=\""\"") {")
I @FIELDS@(PAGE,FLD)'="" D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
D BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
Q
;
LOOP(LBEGIN,LEND) ; -- Loop through fields instead of one by one
D BLDARY^IBDFBKS(" ")
D BLDARY^IBDFBKS(" loop="_LBEGIN_";")
D BLDARY^IBDFBKS(" while (loop < "_(LEND+1)_"){")
D BLDARY^IBDFBKS(" str=STRFIELDS(loop,loop);")
D BLDARY^IBDFBKS(" if (str!=\""\"") {")
D BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
D BLDARY^IBDFBKS(" loop=loop+1;")
D BLDARY^IBDFBKS(" if (loop > "_LEND_") break;}")
D BLDARY^IBDFBKS(" ")
Q
;
;;loop=9;
;;while (loop < 51){
;; str=STRFIELDS(loop,loop);
;; if (str!=\"\") {
;; Data=STRCAT(Data,str);
;; Data=STRCAT(Data,RS);}
;; loop=loop+1;
;; if (loop > 51) break;
;; }
;;
;;\'SHOW(Data);
DATA1 ;; Data = STRCAT(\"FORMTYPE=153\", RS);
;; Data = STRCAT(Data, \"FORMID=\");
;; Data = STRCAT(Data, ITOA(GETIVALUE(7)));
;; Data = STRCAT(Data,RS);
;; Data = STRCAT(Data,\"PAGE=1\");
;; Data = STRCAT(Data,RS);
;; Data = STRCAT(Data, \"DATA=\");
;; Data = STRCAT(Data,RS);
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBDFBKS4 4338 printed Nov 22, 2024@18:02:08 Page 2
IBDFBKS4 ;ALB/AAS - Create form spec file for scanning ; 6-JUN-95
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;**3,25**;APR 24, 1997
+2 ;
RECOMP ;Recompiles all form specs for paper keyboard
+1 NEW QZZ
+2 SET QZZ=0
FOR
SET QZZ=$ORDER(^IBD(359.2,QZZ))
if 'QZZ
QUIT
DO SCAN^IBDFBKS(QZZ)
+3 QUIT
+4 ;
FIELDS ;
+1 SET FLD=1
FOR
SET FLD=$ORDER(@FIELDS@(PAGE,FLD))
if 'FLD
QUIT
Begin DoDot:1
+2 NEW DATATP
SET DATATP=$GET(@FIELDS@(PAGE,FLD,"DATATYPE"))
+3 IF DATATP=""
Begin DoDot:2
+4 SET (LBEGIN,LEND,QUIT)=0
+5 SET LBEGIN=FLD
FOR
SET FLD=$ORDER(@FIELDS@(PAGE,FLD))
if QUIT
QUIT
Begin DoDot:3
+6 IF LEND=0
IF $SELECT(FLD="":1,1:$GET(@FIELDS@(PAGE,FLD,"DATATYPE"))'="")
SET FLD=LBEGIN
DO ONEBUB
SET QUIT=1
QUIT
+7 IF FLD=""
IF LEND>LBEGIN
DO LOOP(LBEGIN,LEND)
SET FLD=LEND
SET QUIT=1
QUIT
+8 IF $GET(@FIELDS@(PAGE,FLD,"DATATYPE"))'=""
DO LOOP(LBEGIN,LEND)
SET FLD=LEND
SET QUIT=1
QUIT
+9 SET LEND=FLD
+10 QUIT
End DoDot:3
if QUIT
QUIT
End DoDot:2
QUIT
+11 ;
+12 IF DATATP'=""
Begin DoDot:2
+13 NEW TOSTRING
+14 SET TOSTRING=$SELECT($GET(@FIELDS@(PAGE,FLD,"START")):"narrative",1:"str")
+15 ;
+16 DO BLDARY^IBDFBKS(" "_TOSTRING_"=\""\"";")
+17 ;
+18 IF DATATP="ALPHA"
DO BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(GETAVALUE("_FLD_"));")
QUIT
+19 ;
+20 IF DATATP="FLOAT"
DO BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(FTOA(GETFVALUE("_FLD_")));")
QUIT
+21 ;
+22 IF DATATP="INT"
DO BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(ITOA(GETIVALUE("_FLD_")));")
QUIT
+23 ;
+24 IF DATATP="DATE"
DO BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(DTOA(GETIVALUE("_FLD_")));")
QUIT
+25 ;
+26 IF DATATP="TIME"
DO BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(TTOA(GETIVALUE("_FLD_")));")
QUIT
+27 ;
+28 ;D BLDARY^IBDFBKS(" "_TOSTRING_"=STRFIELDS("_FLD_","_FLD_");") Q
End DoDot:2
+29 ;
+30 IF $GET(@FIELDS@(PAGE,FLD,"MULT"))
IF '$GET(@FIELDS@(PAGE,FLD,"START"))
DO BLDARY^IBDFBKS(" if (str!=\""\"") narrative=STRIP(STRCAT(STRCAT(narrative,\"" \""),str));")
+31 ;
+32 IF '$GET(@FIELDS@(PAGE,FLD,"MULT"))
Begin DoDot:2
+33 DO BLDARY^IBDFBKS(" if (str != \""\"") {")
+34 DO BLDARY^IBDFBKS(" Data=Add;")
+35 IF @FIELDS@(PAGE,FLD)'=""
DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
+36 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,str);")
+37 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
+38 DO BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
+39 DO BLDARY^IBDFBKS(" ")
End DoDot:2
+40 ;
+41 IF $GET(@FIELDS@(PAGE,FLD,"END"))
Begin DoDot:2
+42 DO BLDARY^IBDFBKS(" if (narrative!=\""\"") {")
+43 DO BLDARY^IBDFBKS(" Data=Add;")
+44 IF @FIELDS@(PAGE,FLD)'=""
DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
+45 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,narrative);")
+46 IF $PIECE($GET(@FIELDS@(PAGE,FLD)),":")'="H"
DO BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
+47 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
+48 DO BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
End DoDot:2
End DoDot:1
FIELDSQ QUIT
+1 ;
ONEBUB ; -- for a single bubble field
+1 DO BLDARY^IBDFBKS(" str=STRFIELDS("_FLD_","_FLD_");")
+2 DO BLDARY^IBDFBKS(" if (str!=\""\"") {")
+3 IF @FIELDS@(PAGE,FLD)'=""
DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
+4 DO BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
+5 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
+6 DO BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
+7 QUIT
+8 ;
LOOP(LBEGIN,LEND) ; -- Loop through fields instead of one by one
+1 DO BLDARY^IBDFBKS(" ")
+2 DO BLDARY^IBDFBKS(" loop="_LBEGIN_";")
+3 DO BLDARY^IBDFBKS(" while (loop < "_(LEND+1)_"){")
+4 DO BLDARY^IBDFBKS(" str=STRFIELDS(loop,loop);")
+5 DO BLDARY^IBDFBKS(" if (str!=\""\"") {")
+6 DO BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
+7 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
+8 DO BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
+9 DO BLDARY^IBDFBKS(" loop=loop+1;")
+10 DO BLDARY^IBDFBKS(" if (loop > "_LEND_") break;}")
+11 DO BLDARY^IBDFBKS(" ")
+12 QUIT
+13 ;
+14 ;;loop=9;
+15 ;;while (loop < 51){
+16 ;; str=STRFIELDS(loop,loop);
+17 ;; if (str!=\"\") {
+18 ;; Data=STRCAT(Data,str);
+19 ;; Data=STRCAT(Data,RS);}
+20 ;; loop=loop+1;
+21 ;; if (loop > 51) break;
+22 ;; }
+23 ;;
+24 ;;\'SHOW(Data);
DATA1 ;; Data = STRCAT(\"FORMTYPE=153\", RS);
+1 ;; Data = STRCAT(Data, \"FORMID=\");
+2 ;; Data = STRCAT(Data, ITOA(GETIVALUE(7)));
+3 ;; Data = STRCAT(Data,RS);
+4 ;; Data = STRCAT(Data,\"PAGE=1\");
+5 ;; Data = STRCAT(Data,RS);
+6 ;; Data = STRCAT(Data, \"DATA=\");
+7 ;; Data = STRCAT(Data,RS);
+8 ;;