IBDFBKS4 ;ALB/AAS - ENCOUNTER FORM - create form spec for scanning (Broker Version) ; 6-JUN-95
;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
;
;
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(" result=DDEEXEC(ddechan,Data);}")
.;
.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);")
..D BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
..D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
..D BLDARY^IBDFBKS(" result=DDEEXEC(ddechan,Data);}")
..;D BLDARY^IBDFBKS(" Data=STRCAT(Data,RS);}")
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(" result=DDEEXEC(ddechan,Data)};")
;D BLDARY^IBDFBKS(" Data=STRCAT(Data,str);")
;D BLDARY^IBDFBKS(" Data=STRCAT(Data,RS);}")
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(" result=DDEEXEC(ddechan,Data);}")
;D BLDARY^IBDFBKS(" Data=STRCAT(Data,str);")
;D BLDARY^IBDFBKS(" Data=STRCAT(Data,RS);}")
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);
;;
IBDFBKS4 ;ALB/AAS - ENCOUNTER FORM - create form spec for scanning (Broker Version) ; 6-JUN-95
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
+2 ;
+3 ;
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(" result=DDEEXEC(ddechan,Data);}")
End DoDot:2
+39 ;
+40 IF $GET(@FIELDS@(PAGE,FLD,"END"))
Begin DoDot:2
+41 DO BLDARY^IBDFBKS(" if (narrative!=\""\"") {")
+42 DO BLDARY^IBDFBKS(" Data=Add;")
+43 IF @FIELDS@(PAGE,FLD)'=""
DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
+44 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,narrative);")
+45 DO BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
+46 DO BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
+47 DO BLDARY^IBDFBKS(" result=DDEEXEC(ddechan,Data);}")
+48 ;D BLDARY^IBDFBKS(" Data=STRCAT(Data,RS);}")
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(" result=DDEEXEC(ddechan,Data)};")
+7 ;D BLDARY^IBDFBKS(" Data=STRCAT(Data,str);")
+8 ;D BLDARY^IBDFBKS(" Data=STRCAT(Data,RS);}")
+9 QUIT
+10 ;
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(" result=DDEEXEC(ddechan,Data);}")
+9 ;D BLDARY^IBDFBKS(" Data=STRCAT(Data,str);")
+10 ;D BLDARY^IBDFBKS(" Data=STRCAT(Data,RS);}")
+11 DO BLDARY^IBDFBKS(" loop=loop+1;")
+12 DO BLDARY^IBDFBKS(" if (loop > "_LEND_") break;}")
+13 DO BLDARY^IBDFBKS(" ")
+14 QUIT
+15 ;
+16 ;;loop=9;
+17 ;;while (loop < 51){
+18 ;; str=STRFIELDS(loop,loop);
+19 ;; if (str!=\"\") {
+20 ;; Data=STRCAT(Data,str);
+21 ;; Data=STRCAT(Data,RS);
+22 ;; }
+23 ;; loop=loop+1;
+24 ;; if (loop > 51) break;
+25 ;; }
+26 ;;
+27 ;;\'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 ;;