source: WorldVistAEHR/trunk/r/RECORD_TRACKING-RT/RTUTL.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: 2.1 KB
RevLine 
[613]1RTUTL ;MJK/TROY ISC; Utility Routine; ; 5/5/87 10:16 AM ;
2 ;;v 2.0;Record Tracking;**9,26**;10/22/91
3TYPE W ! S DIC="^DIC(195.2,",DIC("S")="I $P(^(0),U,3)=+RTAPL",DIC("A")="Select Record Type: ",DIC(0)="IAEMQ" D ^DIC K DIC Q:Y<0
4TYPE1 K RTTY Q:'$D(^DIC(195.2,+Y,0)) S RTTY=+Y_";"_^(0) Q
5 ;
6INST K F,RTINST Q:$S(X="":1,'$D(^RT(+^RTV(190.1,DA,0),0)):1,1:0) S A=+$P(^(0),"^",4)
7 ;Entry pt with A equal to application and X equal to borrower
8 ;Returns RTINST equals institution file pointer
9INST1 K F,RTINST S X=$S($D(^RTV(195.9,+X,0)):$P(^(0),"^"),1:"") G INSTQ:'X S F=$P(X,";",2)
10 I F="DIC(4,",$D(^DIC(4,+X,0)) S RTINST=+X G INSTQ
11 S I=+$O(^DIC(195.1,A,"INST",0)) I I,'$O(^(I)),$D(^DIC(4,I,0)) S RTINST=I G INSTQ
12 I F="SC(" S X1=+X D DIV G INSTQ
13 I F="DIC(42,",$D(^DIC(42,+X,44)) S X1=+^(44) D DIV G INSTQ
14 I F="VA(200," D
15 . N Y,Y1
16 . S Y=$O(^VA(200,+X,2,0)),Y1=$O(^(+Y))
17 . I Y1 Q ; two or more divisions...user must select
18 . I Y S RTINST=Y Q ; only one entry for division
19 . S RTINST=$P($G(^XTV(8989.3,1,"XUS")),"^",17) ; use site default
20 . I 'RTINST K RTINST
21INSTQ I $D(RTINST),F'="DIC(4,",'$D(^DIC(195.1,A,"INST",RTINST,0)) K RTINST
22 K F,X1,I,I1 Q
23 ;
24DIV I $D(^SC(X1,0)),$D(^DIC(4,+$P(^(0),"^",4),0)) S RTINST=+$P(^SC(X1,0),"^",4)
25 Q
26 ;
27Q X ^%ZOSF("UCI") S ZTUCI=Y,ZTRTN="DQ^RTUTL"
28 F RTI="RTHD","RTVAR","RTPGM","DUZ(0)" I $D(@RTI) S ZTSAVE(RTI)=""
29 F RTI=1:1 Q:$P(RTVAR,"^",RTI)']"" S ZTSAVE($P(RTVAR,"^",RTI))=@($P(RTVAR,"^",RTI))
30 S ZTDESC=$S($D(RTDESC):RTDESC,1:"Record Tracking Job")
31 S X1=ION_";"_IOST_";"_IOM,ZTIO=$S(X1=";;":"",1:X1) D ^%ZTLOAD W:$D(ZTSK) !,"REQUEST QUEUED!" K RTDESC,RTI,RTPGM,RTVAR,ZTSK Q
32 ;
33DQ S IO(0)=IO,U="^" S X="T",%DT="" D ^%DT S DT=Y G @RTPGM
34 ;
35ZIS S:$S('$D(RTDEV):0,1:RTDEV]"") %ZIS("B")=RTDEV S %ZIS="QMP" D ^%ZIS K %ZIS K:POP IO("Q") Q:POP I $D(IO("Q"))!(IO'=IO(0)) D Q S POP=1 Q
36 Q
37 ;
38CLOSE K ZTSK D ^%ZISC U:IO'=IO(0)&(IO]"") IO(0) Q
39 ;
40DATE S POP=0 K RTBEG,RTEND W !!,"**** Date Range Selection ****"
41 W ! S %DT="AETX",%DT("A")=" Beginning DATE/TIME : " D ^%DT S:Y<0 POP=1 Q:Y<0 S (%DT(0),RTBEG)=Y
42 W ! S %DT="AETX",%DT("A")=" Ending DATE/TIME : " D ^%DT K %DT S:Y<0 POP=1 Q:Y<0 W ! S RTEND=Y
43 Q
44 ;
Note: See TracBrowser for help on using the repository browser.