source: FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XQALSUR2.m@ 1039

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

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1XQALSUR2 ;FO-OAK.SEA/JLI-Continuation of alert surrogate processing ;9/6/05 14:23
2 ;;8.0;KERNEL;**366**;Jul 10, 1995
3 Q
4 ; added to handle adjustment for manual or Fileman editing of surrogate on top zero node
5CHEKSUBS(XQAUSER) ;
6 N XQA0,XQASTR1,XQANOW,XQB0,XQB1
7 S XQANOW=$$NOW^XLFDT()
8 S XQA0=$G(^XTV(8992,XQAUSER,0)) I $P(XQA0,U,2)>0 D
9 . N XQAFDA,XQAIEN
10 . S XQASTR1=$P(XQA0,U,3) S:XQASTR1'>0 XQASTR1=XQANOW,XQAFDA(8992,XQAUSER_",",.03)=XQASTR1 I '$D(^XTV(8992,XQAUSER,2,"B",XQASTR1)) D Q
11 . . S XQAIEN="+1,"_XQAUSER_"," S XQAFDA(8992.02,XQAIEN,.01)=XQASTR1
12 . . S XQAFDA(8992.02,XQAIEN,.02)=$P(XQA0,U,2) S:$P(XQA0,U,4)>0 XQAFDA(8992.02,XQAIEN,.03)=$P(XQA0,U,4)
13 . . D UPDATE^DIE("","XQAFDA")
14 . . Q
15 . K XQAFDA S XQB0=$O(^XTV(8992,XQAUSER,2,"B",XQASTR1,0))
16 . I XQB0>0 S XQB1=^XTV(8992,XQAUSER,2,XQB0,0) I $P(XQB1,U,3)>0,$P(XQA0,U,4)="" D
17 . . ; have an entry appearing to have ended, but still data on zero node.
18 . . I $P(XQB1,U,3)<XQANOW D Q
19 . . . ; add a matching subfile with startdate two seconds before, and end to now less one second - next time it is looked at it will be removed.
20 . . . S XQAFDA(8992,XQAUSER_",",.03)=XQASTR1-.000002,XQAFDA(8992,XQAUSER_",",.04)=XQANOW-.000001 D FILE^DIE("","XQAFDA") K XQAFDA
21 . . . S XQAIEN="+1,"_XQAUSER_",",XQAFDA(8992.02,XQAIEN,.01)=XQASTR1-.000002,XQAFDA(8992.02,XQAIEN,.02)=$P(XQA0,U,2),XQAFDA(8992.02,XQAIEN,.03)=XQANOW-.000001 D UPDATE^DIE("","XQAFDA")
22 . . . Q
23 . . ; add end date/time in future to zero node
24 . . S $P(^XTV(8992,XQAUSER,0),U,4)=$P(XQB1,U,3) ; set 0 node end date/time to that of the subfile
25 . . Q
26 . Q
27 Q
Note: See TracBrowser for help on using the repository browser.