source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFBK1.m@ 1800

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

initial load of WorldVistAEHR

File size: 4.3 KB
Line 
1IBDFBK1 ;ALB/AAS - AICS broker Utilities ;23-May-95
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
3 ;
4GETFS(RESULT,IBDF) ;
5 ; -- broker call back to return the formspec in IBDFS for form FORMID
6 ;
7 N FORMID,START,STOP,GLB,IBD
8 ;
9 S FORMID=$G(IBDF("FORMID"))
10 S START=$G(IBDF("START"),0) ; Default is zero
11 S STOP=$G(IBDF("STOP"),50) ; Default is 50
12 ;S GLB=$G(IBDF("GLB")) ; Pass in global later.
13 ;
14 I $G(FORMID)="" S RESULT(1)="$$FORMID INVALID$$" G GETFSQ
15 I +FORMID'=FORMID S FORMID=$E($P(FORMID,"."),3,8)
16 I +FORMID<1 S RESULT(1)="$$FORMID INVALID$$" G GETFSQ
17 ;
18 K RESULT
19 I '$D(^IBD(359.2,FORMID,10)) D SCAN^IBDFBKS(FORMID)
20 I '$D(^IBD(359.2,FORMID,10)) S RESULT(1)="$$FORMID INVALID$$" G GETFSQ
21 ;
22 F IBD=START:1:STOP S RESULT(IBD)=$G(^IBD(359.2,FORMID,10,IBD,0)) I RESULT(IBD)="",$O(^IBD(359.2,FORMID,10,IBD))="" S RESULT(IBD)="$$END$$" Q
23 ;
24GETFSQ Q
25 ;
26IMAGEID(RESULT,TEST) ;
27 ; -- broker call back to return the next image id to save unknonw forms
28 S RESULT=0
29 L +^IBD(357.97,.03):2
30 S RESULT=$P(^IBD(357.97,1,0),"^",3)+1
31 S:RESULT<1 RESULT=1 S:RESULT>999999 RESULT=1
32 S $P(^IBD(357.97,1,0),"^",3)=RESULT
33 L -^IBD(357.97,.03)
34 Q
35 ;
36ETIME(RESULT,IBDF) ; -- broker call back
37 ; -- store elapsed time and user inputting data
38 ; -- called by manual data entry (ibdfde1)
39 ;
40 N NODE
41 S RESULT=0
42 I '$G(IBDF("FORM")) G ETQ
43 S NODE=$G(^IBD(357.96,+IBDF("FORM"),0)) I NODE="" G ETQ
44 S FDAROOT(357.96,+IBDF("FORM")_",",.15)=$G(IBDF("SECONDS"))+$P(NODE,"^",15)
45 I $P(NODE,"^",16)="" S FDAROOT(357.96,+IBDF("FORM")_",",.16)=$G(IBDF("USER"))
46 D FILE^DIE("","FDAROOT","IBDFERR")
47 S RESULT=1
48 K PXCA
49ETQ Q
50 ;
51WSERR(RESULT,FORMID) ; -- broker call back
52 ; -- store error occuring on workstation
53 ; occures when user cancels recognition.
54 ;
55 S FORMID=+$G(FORMID("FORMID")),FORMID("SOURCE")=1
56 D LOGERR^IBDF18E2(FORMID("ERRNO"),.FORMID)
57 S RESULT=1
58WSERRQ Q
59 ;
60IMAGENM(RESULT,IBDF) ; -- broker call back
61 ; -- store names of images stored and their location
62 ; along with the form id information
63 ;
64 N X,Y,NAME,PATH,FDA,IENS,FDAIEN,IBDERR
65 S RESULT=0
66 I $G(^IBD(357.96,+$G(IBDF("FORMID")),0))=""!($G(IBDF("IMAGE"))="") G IMGNMQ
67 ;
68 F I=1:1 S X=$P(IBDF("IMAGE"),"\",I) Q:X="" S NAME=$P(IBDF("IMAGE"),"\",I),PATH=$P(IBDF("IMAGE"),"\",1,I-1)
69 S IENS="+1,"_IBDF("FORMID")_","
70 S FDA(357.963,IENS,.01)=NAME
71 S FDA(357.963,IENS,.02)=PATH
72 S FDA(357.963,IENS,.03)=$G(IBDF("PAGE"))
73 S FDA(357.963,IENS,.04)=$G(IBDF("WSID"))
74 S FDA(357.963,IENS,.05)=$G(DUZ)
75 S FDA(357.963,IENS,.06)=$$NOW^XLFDT
76 ;
77 ; -- flag is as received if page already received
78 S SCANPG=+$O(^IBD(357.96,IBDF("FORMID"),9,"B",IBDF("PAGE"),0))
79 I $P($G(^IBD(357.96,+$G(IBDF("FORMID")),9,SCANPG,0)),"^",2) S FDA(357.963,IENS,.07)=1
80 ;
81 D UPDATE^DIE("","FDA","FDAIEN","IBDERR")
82 I '$D(IBDERR) S RESULT=1
83IMGNMQ Q
84 ;
85FORMID(RESULT,FORMNO) ;
86 ; -- broker call back to turn a formId into patient name/ssn/clinic/appt/formtype/status
87 ;
88 N IBID
89 S RESULT="^^^^"
90 S IBID=+$P($G(FORMNO)," ",3)
91 Q:'$G(IBID)
92 S RESULT=$$FINDPT^IBDF18C(IBID)
93 Q
94 ;
95VALIDAV(IBDUSER,IBDFKEY) ;
96 ; -- broker call back to validate security key, make sure duz array set
97 ; for xwb1t17
98 ; -- Output User Info
99 ; Piece 1 = DUZ Piece 4 = Site
100 ; Piece 2 = DUZ(0) Piece 5 = UCI/VOL
101 ; Piece 3 = UserName Piece 6 = Security key if held
102 ;
103 ; -- Invalid User codes
104 ; piece 1 = 0 =: Null or "^" in codes
105 ; piece 1 = -1 =: Invalid access code pair
106 ; piece 1 = -2 =: Invalid user (terminated, etc.)
107 ;
108 I '$D(DT) D DT^DICRW
109 N X,Y,KEY,XUM,XUSER,XQUR,XUF,XUENV,NODE
110 S NODE=$G(^VA(200,+$G(DUZ),0))
111 D UCI^%ZOSV S UCI=Y
112 S KEY=""
113 I $G(IBDFKEY)'="" I $D(^XUSEC(IBDFKEY,+DUZ)) S KEY=IBDFKEY
114 S IBDUSER=DUZ_"^"_$P(NODE,"^",4)_"^"_$P(NODE,"^")_"^"_$P($$SITE^VASITE,"^",2)_"^"_UCI_"^"_KEY
115 Q
116 ;
117SECM(RESULT,IBDUZ) ;
118 ; -- broker call back to return array of secondary menus in array RESULT
119 ;
120 I +$G(IBDUZ)<1 S RESULT(1)="No user Identified" G SECMQ
121 ;
122 N COUNT,MENU,IEN
123 S COUNT=0,MENU=0
124 F S MENU=$O(^VA(200,+IBDUZ,203,MENU)) Q:'MENU D
125 . S IEN=+$G(^VA(200,+IBDUZ,203,MENU,0))
126 . S COUNT=COUNT+1,RESULT(COUNT)=$$GET1^DIQ(19,+IEN,.01) I RESULT(COUNT)']"" S RESULT(COUNT)="Unknown"
127 ;
128 I COUNT<1 S RESULT(1)="No Secondary Menus"
129 ;
130SECMQ Q
131 ;
132TESTI ; -- test storing image name
133 S IBDF("IMAGE")="c:\vista\aics\a8001.tif"
134 S IBDF("WSID")="A"
135 S IBDF("PAGE")=1
136 S IBDF("FORMID")=800
137 D IMAGENM(.RESULT,.IBDF)
138 Q
Note: See TracBrowser for help on using the repository browser.