source: FOIAVistA/trunk/r/SURGERY-SR/SROXR1.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

File size: 3.0 KB
Line 
1SROXR1 ;B'HAM ISC/MAM - CROSS REFERENCES (CONT) ;10/05/04
2 ;;3.0; Surgery ;**34,72,79,100,134**;24 Jun 93
3ATT ; ATT x-ref on surgeon to update attend surg
4 N SRDIV,SREQ S SRDIV=$$SITE^SROUTL0(DA) Q:'SRDIV
5 I $P(^SRO(133,SRDIV,0),"^",19)'=0 Q
6 S SREQ(130,DA_",",.164)=X D FILE^DIE("","SREQ","^TMP(""SR"",$J)")
7 Q
8KATT ; kill logic for ATT x-ref
9 Q
10ATTP ; ATTP x-ref on provider to update attend provider
11 N SRDIV,SREQ S SRDIV=$$SITE^SROUTL0(DA) Q:'SRDIV
12 I $P(^SRO(133,SRDIV,0),"^",19)'=0 Q
13 S SREQ(130,DA_",",124)=X D FILE^DIE("","SREQ","^TMP(""SR"",$J)")
14 Q
15KATTP ; kill logic for ATTP x-ref
16 Q
17AR ; 'AR' x-ref on the 'DATE OF OPERATION'
18 ; field in the SURGERY file (130)
19 Q:'$D(^SRF(DA,"REQ")) I $P(^SRF(DA,"REQ"),"^")'=1 Q
20 I $D(^SRF(DA,31)),$P(^(31),"^",4) Q
21 S:$E(X,1,7)'<DT DFN=$P(^SRF(DA,0),"^"),^SRF("AR",$E(X,1,7),DFN,DA)=""
22 Q
23KAR ; 'KILL' logic of the 'AR' x-ref on the 'DATE OF
24 ; OPERATION' field in the SURGERY file (130)
25 S DFN=$P(^SRF(DA,0),"^") K ^SRF("AR",$E(X,1,7),DFN,DA)
26 Q
27SP ; set 'ASP' and 'AOR' x-refs when date is changed
28 I $P(^SRF(DA,0),"^",4) S ^SRF("ASP",$P(^(0),"^",4),$E(X,1,7),DA)=DA
29OR I $P(^SRF(DA,0),"^",2) S ^SRF("AOR",$P(^(0),"^",2),$E(X,1,7),DA)=""
30 Q
31KSP ; kill 'ASP' and 'AOR' x-refs when date is changed
32 I $P(^SRF(DA,0),"^",4) K ^SRF("ASP",$P(^(0),"^",4),$E(X,1,7),DA)
33KOR S DFN=$P(^SRF(DA,0),"^") I $P(^SRF(DA,0),"^",2) K ^SRF("AOR",$P(^(0),"^",2),$E(X,1,7),DA)
34 Q
35IV ; delete IV orders
36 S SRT("X")=X D NOW^%DTC S X=SRT("X"),X1=$E(%,1,12) D MINS^SRSUTL2
37 I X>1440 D OUT Q
38 I X>60 D
39 .D EN^DDIOL("A considerable amount of time has passed since the "_$S($P($G(^SRF(SRTN,"NON")),"^")="Y":"procedure",1:"operation")_" start",,"!!,?2")
40 .D EN^DDIOL("time and the present time.",,"!,?2")
41 D IV1
42OUT S X=SRT("X") K SRT,X1,Y
43 Q
44IV1 K DIR W ! S DIR("?",1)="Enter 'YES' to cancel current IV orders. Enter 'NO' or '^' to continue",DIR("?")="without cancelling the patient's current IV orders.",DIR("B")=$S($P($G(^SRF(SRTN,"NON")),"^")="Y":"NO",1:"YES")
45 S DIR("A")="Do you want to cancel all current IV orders for this patient (Y/N)",DIR(0)="Y" D ^DIR I $D(DTOUT)!(Y=0)!$D(DUOUT) Q
46 S X="PSIVACT" X ^%ZOSF("TEST") Q:'$T
47 S ZTDESC="Cancel IV Orders from Surgery",ZTDTH=$H,ZTIO="",ZTRTN="DCOR^SROXR1",ZTSAVE("PSIVRES")="SURGERY PACKAGE",ZTSAVE("DFN")=DFN N X,Y D ^%ZTLOAD
48 Q
49DCOR ; entry for tasked job to cancel IVs
50 D DCOR^PSIVACT S ZTREQ="@"
51 Q
52END K DFN,I,S,SRSC1,SRSDAT,SRSOR
53 Q
54STAFF ; update STAFF/RESIDENT field
55 S STAFF="R" I $D(^XUSEC("SR STAFF SURGEON",X)) S STAFF="S"
56 S $P(^SRF(DA,.1),"^",3)=STAFF
57 Q
58KSTAFF ; update STAFF/RESIDENT when deleted
59 S $P(^SRF(DA,.1),"^",3)=""
60 Q
61ANES ; update ANESTHETIST CATEGORY field
62 N SRASITE,SRAML,SRACAT S SRASITE=$O(^SRO(133,0)) I SRASITE S SRAML=$P(^SRO(133,SRASITE,0),"^",4)
63 S SRACAT=$S($D(^XUSEC("SR ANESTHESIOLOGIST",X)):"A",$D(^XUSEC("SR SURGEON",X)):"A",$D(^XUSEC("SR NURSE ANESTHETIST",X)):"N",1:"O")
64 I SRACAT="A",SRAML'=$P($G(^VA(200,X,5)),"^",2) S SRACAT="O"
65 S $P(^SRF(DA,.3),"^",8)=SRACAT K SRASITE,SRAML,SRACAT
66 Q
67KANES ; update ANESTHETIST CATEGORY when deleted
68 S $P(^SRF(DA,.3),"^",8)=""
69 Q
Note: See TracBrowser for help on using the repository browser.