source: FOIAVistA/tag/r/SURGERY-SR/SROESX0.m@ 1251

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1SROESX0 ;BIR/ADM - SURGERY E-SIG UTILITY ; [ 02/13/02 12:03 PM ]
2 ;;3.0; Surgery ;**100**;24 Jun 93
3 ;
4 ;** NOTICE: This routine is part of an implementation of a nationally
5 ;** controlled procedure. Local modifications to this routine
6 ;** are prohibited.
7 ;
8 ; Reference to UPDATE^TIUSRVP supported by DBIA #3535
9 ; Reference to EXTRACT^TIULQ supported by DBIA #2693
10 ; Reference to FILE^TIUSRVP supported by DBIA #3540
11 ;
12 Q
13SET ; set logic for AES1 and AES2 x-refs
14 N SRPHY,SRSTAT,SRTN,SRTIU,SRX,ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSAVE,ZTSK
15 S SRPHY=X2 D NEXT Q:'SRTIU
16TASK ; task call to TIU
17 S ZTDESC="Update Signer in TIU",ZTRTN="SIGNER^SROESX0",ZTIO="",ZTDTH=$H,(ZTSAVE("SRTIU"),ZTSAVE("SRPHY"))="" D ^%ZTLOAD
18 Q
19SIGNER ; make call to TIU to update author and expected signer
20 D STATUS S SRAY(.05)=$S(SRSTAT:SRSTAT,1:1),(SRAY(1202),SRAY(1204))=SRPHY
21 D UPDATE^TIUSRVP(.SRDOC,SRTIU,.SRAY,1)
22END I $D(ZTQUEUED) S ZTREQ="@"
23 Q
24NEXT S SRTN=DA,SRX=$G(^SRF(SRTN,"TIU"))
25 S SRTIU=$S($P($G(^SRF(SRTN,"NON")),"^")="Y":$P(SRX,"^",3),1:$P(SRX,"^"))
26 Q
27STATUS ; get TIU document status
28 D EXTRACT^TIULQ(SRTIU,"SRY",.SRERR,".05",1) S SRSTAT=$G(SRY(SRTIU,.05,"I"))
29 Q
30SET1 ; set logic for AES3 and AES4 and x-refs
31 N SRPHY,SRSTAT,SRTN,SRTIU,SRX,ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSAVE,ZTSK
32 S SRPHY=X2 D NEXT Q:'SRTIU
33TASK1 ; task call to TIU
34 S ZTDESC="Update Cosigner in TIU",ZTRTN="COSIG^SROESX0",ZTIO="",ZTDTH=$H,(ZTSAVE("SRTIU"),ZTSAVE("SRPHY"))="" D ^%ZTLOAD
35 Q
36COSIG ; make call to TIU to update attending and expected cosigner
37 D STATUS S SRAY(.05)=$S(SRSTAT:SRSTAT,1:1),(SRAY(1208),SRAY(1209))=SRPHY
38 D UPDATE^TIUSRVP(.SRDOC,SRTIU,.SRAY,1) D END
39 Q
40SET2 ; set logic for AES5 x-ref
41 N SRPHY,SRSTAT,SRTN,SRTIU,SRX,ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSAVE,ZTSK
42 S SRPHY=X2,SRTN=DA,SRX=$G(^SRF(SRTN,"TIU")),SRTIU=$P(SRX,"^",4) Q:'SRTIU
43 D TASK,ALTSK
44 Q
45SET3 ; set logic for AES6 x-ref
46 N SRPHY,SRSTAT,SRTN,SRTIU,SRX,ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSAVE,ZTSK
47 S SRPHY=X2,SRTN=DA,SRX=$G(^SRF(SRTN,"TIU")),SRTIU=$P(SRX,"^",4) Q:'SRTIU
48 D TASK1
49ALTSK S ZTDESC="Task Alerts to Anesthesia",ZTRTN="ANLRT^SROESX0",ZTIO="",ZTDTH=$H,(ZTSAVE("SRTIU"),ZTSAVE("SRTN"))="" D ^%ZTLOAD
50 Q
51ANLRT ; for anesthesia report, delete and re-issue alert
52 N SRSTAT D STATUS I SRSTAT=1 D ALERT^SROESXA,END
53 Q
54SET4 ; set logic for AES7 x-ref
55 N SRTN,SRTIU,SRX,ZTDESC,ZTRTN,ZTIO,ZTDTH,ZTSAVE,ZTSK
56 S SRTN=DA(1),SRX=$G(^SRF(SRTN,"TIU")),SRTIU=$P(SRX,"^",2) Q:'SRTIU
57 S ZTDESC="Update Nurse Report Signer in TIU",ZTRTN="RNSIG^SROESX0",ZTIO="",ZTDTH=$H,(ZTSAVE("SRTIU"),ZTSAVE("SRTN"))="" D ^%ZTLOAD
58 S ZTDESC="Task Alerts to Circulating Nurses",ZTRTN="RNLRT^SROESX0",ZTIO="",ZTDTH=$H,(ZTSAVE("SRTIU"),ZTSAVE("SRTN"))="" D ^%ZTLOAD
59 Q
60RNSIG ; update signer/author of nurse report
61 ; get first circulating nurse as author and expected signer
62 S SRPHY="",SRRN=$O(^SRF(SRTN,19,0)) S:SRRN SRPHY=$P($G(^SRF(SRTN,19,SRRN,0)),"^")
63 D SIGNER
64 Q
65RNLRT ; for nurse report, delete and re-issue alert
66 N SRSTAT D STATUS I SRSTAT=1 D ALERT^SROESX,END
67 Q
68AES8 ; set logic for AES7 cross-reference
69 N II,SR0,SRAY,SRTDA,SRTN,SRTIU
70 S SRTN=$S($D(SRTN):SRTN,1:DA)
71 S SR0=^SRF(SRTN,0),SRTIU=$G(^SRF(SRTN,"TIU")),SRAY(1301)=$P(SR0,"^",9)
72 F II=1,2,3,4 I $P(SRTIU,"^",II) S SRTDA=$P(SRTIU,"^",II) D
73 .D FILE^TIUSRVP(.SRERR,SRTDA,.SRAY,1)
74 Q
Note: See TracBrowser for help on using the repository browser.