source: WorldVistAEHR/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XDRUTL.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: 1.4 KB
Line 
1XDRUTL ;SF-IRMFO/RSD - XDR utilities ;11/3/95 16:32
2 ;;7.3;TOOLKIT;**23**;Apr 25, 1995
3 ;;
4 Q
5 ;
6NEWCP(XDR,XDRP) ;create new check point, returns 0=error or ien
7 ;XDR=name, XDRP=parameters
8 Q:$G(XDR)="" 0
9 N %,XDRI,XDRJ,XDRF,XDRY
10 S %=$$FIND1^DIC(15.013,","_XDRMPDA_",","X",XDR) Q:% %
11 S XDRF="+1,"_XDRMPDA_",",XDRJ(15.013,XDRF,.01)=XDR
12 S:$D(XDRP) XDRJ(15.013,XDRF,1)=XDRP
13 D UPDATE^DIE("","XDRJ","XDRY")
14 Q $G(XDRY(1))
15 ;
16UPCP(XDR,XDRP) ;update check point, returns 0=error or ien
17 ;XDR=name, XDRP=parameters
18 N XDRI,XDRJ,XDRF,XDRY
19 S XDRY=$$DICCP($G(XDR))
20 Q:'XDRY 0
21 S XDRF=XDRY_","_XDRMPDA_","
22 S:$D(XDRP) XDRJ(15.013,XDRF,1)=XDRP
23 D FILE^DIE("","XDRJ")
24 Q XDRY
25 ;
26COMCP(XDR) ;complete check point, returns 0=error or date/time
27 ;XDR=name
28 N XDRD,XDRI,XDRJ,XDRY
29 S XDRY=$$DICCP($G(XDR))
30 Q:'XDRY 0
31 S XDRD=$$NOW^XLFDT,XDRJ(15.013,XDRY_","_XDRMPDA_",",1)=XDRD
32 D FILE^DIE("","XDRJ")
33 Q XDRD
34 ;
35VERCP(XDR) ;verify check point exists, returns 1=exist, 0=doesn't
36 ;XDR=name
37 N XDRI,XDRY
38 S XDRY=$$DICCP($G(XDR))
39 Q $S('XDRY:0,1:1)
40 ;
41PARCP(XDR,XDRF) ;returns parameters of check point
42 ;XDR=name, XDRF="PRE"
43 N XDRI,XDRY
44 I $G(XDRF)="PRE" N XDRCP S XDRCP="INI"
45 S XDRY=$$DICCP($G(XDR))
46 Q:'XDRY 0
47 Q $$GET1^DIQ(15.013,XDRY_","_XDRMPDA_",",1,"I")
48 ;
49DICCP(X) ;lookup check point, returns ien or 0
50 Q:$G(X)="" 0
51 I X=+X S Y=X Q:'$D(^VA(15,XDRMPDA,"CP",Y,0)) 0
52 E S Y=$$FIND1^DIC(15.013,","_XDRMPDA_",","X",X)
53 Q Y
Note: See TracBrowser for help on using the repository browser.