source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSGAXR.m@ 1361

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

initial load of WorldVistAEHR

File size: 2.3 KB
RevLine 
[613]1PSGAXR ;BIR/CML3-EXECUTE VARIOUS XREFS ;24 JUN 96 / 12:06 PM
2 ;;5.0; INPATIENT MEDICATIONS ;**111**;16 DEC 97
3 ;
4ENSS ; set x-refs under 53.1,28
5 S ZZ=+$G(^PS(53.1,DA,.2)) S:$D(PSGP)[0 PSGP=$P($G(^PS(53.1,DA,0)),"^",15)_"^1" I 'PSGP,'ZZ K ZZ K:$P(PSGP,"^",2) PSGP Q
6 I PSGP D
7 . S ^PS(53.1,"AS",X,+PSGP,DA)="" I $S(X["A":0,1:X'["D") S ^PS(53.1,"AC",+PSGP,DA)="" S:ZZ ^PS(53.1,"AOD",+PSGP,ZZ,DA)=""
8 . I X="P",+$P($G(^PS(53.1,DA,4)),U) S ^PS(53.1,"AV",+PSGP,DA)=""
9 ;I X]"" S ZZ=$S($G(ORIFN):ORIFN,1:$P($G(^PS(53.1,DA,0)),"^",21)_"^1") I ZZ S ORIFN=+ZZ D ENSC^PSGORU K:$P(ZZ,"^",2) ORIFN
10 ;D EN1^PSJHL2(PSGP,"OC",DA_"P")
11 K ZZ K:$P(PSGP,"^",2) PSGP Q
12 ;
13ENSK ; kill x-refs under 53.1,28
14 S:$D(PSGP)[0 PSGP=$P($G(^PS(53.1,DA,0)),"^",15)_"^1" S ZZ=+$G(^PS(53.1,DA,.1)),ZZZ=+$G(^PS(53.1,DA,"DSS"))
15 I PSGP K ^PS(53.1,"AC",+PSGP,DA),^PS(53.1,"AS",X,+PSGP,DA),^PS(53.1,"AV",+PSGP,DA) K:ZZ ^PS(53.1,"AOD",+PSGP,ZZ,DA) K:ZZZ ^PS(53.1,"AD",ZZZ,+PSGP,DA)
16 K ZZ K:$P(PSGP,"^",2) PSGP Q
17 ;
18ENNDS ; set x-refs under 53.1,.1
19 S ^PS(53.1,"D",X,DA)="" S:$D(PSGP)[0 PSGP=$P($G(^PS(53.1,DA,0)),"^",15)_"^1" I PSGP S PSGX=X D END^PSGSICHK S X=PSGX,PSGX=$P($G(^PS(53.1,DA,0)),"^",9) I $S(PSGX["A":0,1:PSGX'["D") S ^PS(53.1,"AOD",+PSGP,X,DA)=""
20 K PSGX K:$P(PSGP,"^",2) PSGP Q
21 ;
22ENNDK ; kill x-refs under 53.1,.1
23 S:$D(PSGP)[0 PSGP=$P($G(^PS(53.1,DA,0)),"^",15)_"^1" K ^PS(53.1,"D",X,DA) K:PSGP ^PS(53.1,"AOD",+PSGP,X,DA) K:$P(PSGP,"^",2) PSGP Q
24 ;
25ENNPS ; set x-refs under 53.1,.5
26 S ^PS(53.1,"C",X,DA)="",PSGX=$P($G(^PS(53.1,DA,0)),"^",9) S:PSGX]"" ^PS(53.1,"AS",PSGX,X,DA)=""
27 I $S(PSGX["A":0,1:PSGX'["D") S ^PS(53.1,"AC",X,DA)=""
28 I PSGX="P",+$P($G(^PS(53.1,DA,4)),U) S ^PS(53.1,"AV",X,DA)=""
29 S:PSGX ^PS(53.1,"AOD",X,PSGX,DA)=""
30 K PSGX Q
31 ;
32ENNPK ; kill x-refs under 53.1,.5
33 K ^PS(53.1,"AC",X,DA),^PS(53.1,"C",X,DA) S PSGX=$P($G(^PS(53.1,DA,0)),"^",9) K:PSGX]"" ^PS(53.1,"AS",PSGX,X,DA) S PSGX=+$G(^PS(53.1,DA,.1)) K:PSGX ^PS(53.1,"AOD",X,PSGX,DA)
34 K ^PS(53.1,"AV",X,DA)
35 K PSGX Q
36ENNACK ; Set x-refs under Nurse verification for acknowleged pending orders.
37 S PSGX=$G(^PS(53.1,DA,0)) S PSGP=$P(PSGX,U,15)
38 S PSGST=$P(PSGX,U,9)
39 I PSGP,+X,(PSGST="P") S ^PS(53.1,"AV",PSGP,DA)=""
40 K PSGX,PSGP,PSGST Q
41ENNACKK ; Kill x-refs under Nurse verification
42 S PSGP=$P($G(^PS(53.1,DA,0)),U,15)
43 K:+PSGP ^PS(53.1,"AV",+PSGP,DA) Q
Note: See TracBrowser for help on using the repository browser.