source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFBKS4.m@ 1211

Last change on this file since 1211 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1IBDFBKS4 ;ALB/AAS - Create form spec file for scanning ; 6-JUN-95
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;**3,25**;APR 24, 1997
3 ;
4RECOMP ;Recompiles all form specs for paper keyboard
5 N QZZ
6 S QZZ=0 F S QZZ=$O(^IBD(359.2,QZZ)) Q:'QZZ D SCAN^IBDFBKS(QZZ)
7 Q
8 ;
9FIELDS ;
10 S FLD=1 F S FLD=$O(@FIELDS@(PAGE,FLD)) Q:'FLD D
11 .N DATATP S DATATP=$G(@FIELDS@(PAGE,FLD,"DATATYPE"))
12 .I DATATP="" D Q
13 ..S (LBEGIN,LEND,QUIT)=0
14 ..S LBEGIN=FLD F S FLD=$O(@FIELDS@(PAGE,FLD)) Q:QUIT D Q:QUIT
15 ...I LEND=0,$S(FLD="":1,1:$G(@FIELDS@(PAGE,FLD,"DATATYPE"))'="") S FLD=LBEGIN D ONEBUB S QUIT=1 Q
16 ...I FLD="",LEND>LBEGIN D LOOP(LBEGIN,LEND) S FLD=LEND,QUIT=1 Q
17 ...I $G(@FIELDS@(PAGE,FLD,"DATATYPE"))'="" D LOOP(LBEGIN,LEND) S FLD=LEND,QUIT=1 Q
18 ...S LEND=FLD
19 ...Q
20 .;
21 .I DATATP'="" D
22 ..N TOSTRING
23 ..S TOSTRING=$S($G(@FIELDS@(PAGE,FLD,"START")):"narrative",1:"str")
24 ..;
25 ..D BLDARY^IBDFBKS(" "_TOSTRING_"=\""\"";")
26 ..;
27 ..I DATATP="ALPHA" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(GETAVALUE("_FLD_"));") Q
28 ..;
29 ..I DATATP="FLOAT" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(FTOA(GETFVALUE("_FLD_")));") Q
30 ..;
31 ..I DATATP="INT" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(ITOA(GETIVALUE("_FLD_")));") Q
32 ..;
33 ..I DATATP="DATE" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(DTOA(GETIVALUE("_FLD_")));") Q
34 ..;
35 ..I DATATP="TIME" D BLDARY^IBDFBKS(" if (GETSTATUS("_FLD_")==FIELD_OK) "_TOSTRING_"=STRIP(TTOA(GETIVALUE("_FLD_")));") Q
36 ..;
37 ..;D BLDARY^IBDFBKS(" "_TOSTRING_"=STRFIELDS("_FLD_","_FLD_");") Q
38 .;
39 .I $G(@FIELDS@(PAGE,FLD,"MULT")),'$G(@FIELDS@(PAGE,FLD,"START")) D BLDARY^IBDFBKS(" if (str!=\""\"") narrative=STRIP(STRCAT(STRCAT(narrative,\"" \""),str));")
40 .;
41 .I '$G(@FIELDS@(PAGE,FLD,"MULT")) D
42 ..D BLDARY^IBDFBKS(" if (str != \""\"") {")
43 ..D BLDARY^IBDFBKS(" Data=Add;")
44 ..I @FIELDS@(PAGE,FLD)'="" D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
45 ..D BLDARY^IBDFBKS(" Data=STRCAT(Data,str);")
46 ..D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
47 ..D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
48 ..D BLDARY^IBDFBKS(" ")
49 .;
50 .I $G(@FIELDS@(PAGE,FLD,"END")) D
51 ..D BLDARY^IBDFBKS(" if (narrative!=\""\"") {")
52 ..D BLDARY^IBDFBKS(" Data=Add;")
53 ..I @FIELDS@(PAGE,FLD)'="" D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
54 ..D BLDARY^IBDFBKS(" Data=STRCAT(Data,narrative);")
55 ..I $P($G(@FIELDS@(PAGE,FLD)),":")'="H" D BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
56 ..D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
57 ..D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
58FIELDSQ Q
59 ;
60ONEBUB ; -- for a single bubble field
61 D BLDARY^IBDFBKS(" str=STRFIELDS("_FLD_","_FLD_");")
62 D BLDARY^IBDFBKS(" if (str!=\""\"") {")
63 I @FIELDS@(PAGE,FLD)'="" D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"""_@FIELDS@(PAGE,FLD)_"\"");")
64 D BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
65 D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
66 D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
67 Q
68 ;
69LOOP(LBEGIN,LEND) ; -- Loop through fields instead of one by one
70 D BLDARY^IBDFBKS(" ")
71 D BLDARY^IBDFBKS(" loop="_LBEGIN_";")
72 D BLDARY^IBDFBKS(" while (loop < "_(LEND+1)_"){")
73 D BLDARY^IBDFBKS(" str=STRFIELDS(loop,loop);")
74 D BLDARY^IBDFBKS(" if (str!=\""\"") {")
75 D BLDARY^IBDFBKS(" Data=STRCAT(Add,str);")
76 D BLDARY^IBDFBKS(" Data=STRCAT(Data,\"",\"");")
77 D BLDARY^IBDFBKS(" if (ddechan != 0) result=DDEEXEC(ddechan,Data);}")
78 D BLDARY^IBDFBKS(" loop=loop+1;")
79 D BLDARY^IBDFBKS(" if (loop > "_LEND_") break;}")
80 D BLDARY^IBDFBKS(" ")
81 Q
82 ;
83 ;;loop=9;
84 ;;while (loop < 51){
85 ;; str=STRFIELDS(loop,loop);
86 ;; if (str!=\"\") {
87 ;; Data=STRCAT(Data,str);
88 ;; Data=STRCAT(Data,RS);}
89 ;; loop=loop+1;
90 ;; if (loop > 51) break;
91 ;; }
92 ;;
93 ;;\'SHOW(Data);
94DATA1 ;; Data = STRCAT(\"FORMTYPE=153\", RS);
95 ;; Data = STRCAT(Data, \"FORMID=\");
96 ;; Data = STRCAT(Data, ITOA(GETIVALUE(7)));
97 ;; Data = STRCAT(Data,RS);
98 ;; Data = STRCAT(Data,\"PAGE=1\");
99 ;; Data = STRCAT(Data,RS);
100 ;; Data = STRCAT(Data, \"DATA=\");
101 ;; Data = STRCAT(Data,RS);
102 ;;
Note: See TracBrowser for help on using the repository browser.