source: FOIAVistA/tag/r/SURGERY-SR/SR81UTL.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1SR81UTL ;BIR/ADM-SR*3*81 Retransmissions of FY98 data ; [ 10/06/98 1:04 PM ]
2 ;;3.0; Surgery ;**81**;24 Jun 93
3 ; SRP(1) - station number
4 ; SRP(2) - assessment/case number
5 ; SRP(3) - division
6 ; SRP(4) - patient ID
7 ; SRP(5) - date of operation
8 ; SRP(6) - hospital admission date
9 ; SRP(7) - hospital discharge date
10 ; SRP(8) - admission/transfer to surgical service
11 ; SRP(9) - transfer/discharge to non-acute care
12 ; SRP(10) - date/time patient left the OR
13 ; SRP(11) - anesthesia care start date/time
14 ; SRP(12) - PACU discharge date/time
15 ; SRP(13) - observation admission date/time
16 ; SRP(14) - observation discharge date/time
17 ; SRP(15) - observation treating specialty
18 ; SRP(16) - concurrent case number
19 Q
20EN1 K ^TMP("SRA",$J),^TMP("SRAINC",$J) S SITE=+$P($$SITE^SROVAR,"^",3),(SRI,SRAINC)=0,SROPD=2971000
21 F S SROPD=$O(^SRF("AC",SROPD)) Q:'SROPD S SRTN=0 F S SRTN=$O(^SRF("AC",SROPD,SRTN)) Q:'SRTN S SRA=$G(^SRF(SRTN,"RA")),SR235=$P(SRA,"^") I (SR235="T"!(SR235="C")),$P(SRA,"^",6)="Y",$P(SRA,"^",2)="N",$G(^SRF(SRTN,208.1))="" D
22 .K SRP F I=1:1:16 S SRP(I)=""
23 .S SRA=$G(^SRF(SRTN,0)) Q:SRA="" S SRP(1)=SITE,SRP(2)=SRTN,DFN=$P(SRA,"^"),SRP(5)=$P(SRA,"^",9) D DEM^VADPT S SRP(4)=VA("PID")
24 .I $P($G(^SRF(SRTN,208.1)),"^")="" D OBS D:'SRSOUT NA I SRSOUT D INC Q
25 .I SR235="C" Q
26 .S SRP(3)=$P($G(^SRF(SRTN,8)),"^") I SRP(3) S SRP(3)=$$GET1^DIQ(4,SRP(3),99)
27 .S SRA=$G(^SRF(SRTN,208)) F I=14:1:17 S SRP(I-8)=$E($P(SRA,"^",I),1,12)
28 .S SRA=$G(^SRF(SRTN,.2)) S SRP(10)=$P(SRA,"^",12),SRP(11)=$P(SRA,"^")
29 .S SRP(12)=$P($G(^SRF(SRTN,1.1)),"^",8),SRA=$G(^SRF(SRTN,208.1)),J=0 F I=13:1:15 S J=J+1,SRP(I)=$P(SRA,"^",J)
30 .S SRP(16)=$P($G(^SRF(SRTN,"CON")),"^")
31 .S SRTMP=SRP(1) F I=2:1:16 S SRTMP=SRTMP_"^"_SRP(I)
32 .S SRI=SRI+1,^TMP("SRA",$J,SRI)=SRTMP
33 N SRD S SRD=^XMB("NETNAME") I $E(SRD,1,3)="ISC"!(SRD["ISC-")!(SRD["ISC.")!(SRD["FORUM")!(SRD["TST.")!(SRD["TEST")!(SRD["UTL.")!(SRD["TRN.") G RAMG
34 S XMSUB="** SR*3*81 FROM VAMC-"_SITE_" **",XMDUZ=$S($D(DUZ):DUZ,1:.5)
35 S XMY("G.SRCOSERV@ISC-CHICAGO.VA.GOV")=""
36 S XMTEXT="^TMP(""SRA"",$J," N I D ^XMD
37RAMG ; send list of assessments changed to incomplete
38 G:SRAINC=0 END K XMTEXT,XMSUB,XMDUZ
39 S ^TMP("SRAINC",$J,.1)="The following completed/transmitted non-cardiac assessments have been",^TMP("SRAINC",$J,.2)="updated to incomplete. Please review patient demographic information and"
40 S ^TMP("SRAINC",$J,.3)="complete these assessments again.",^TMP("SRAINC",$J,.4)=""
41 S XMSUB="ASSESSMENTS CHANGED TO INCOMPLETE",XMDUZ=$S($D(DUZ):DUZ,1:.5)
42 S XMY("G.RISK ASSESSMENT")=""
43 S XMTEXT="^TMP(""SRAINC"",$J," N I D ^XMD
44END K ^TMP("SRA",$J),^TMP("SRAINC",$J) S ZTREQ="@"
45 Q
46OBS ; check for admission for observation following surgery
47 S SRSOUT=0,(VAIP("D"),SRSDATE)=SRP(5) D IN5^VADPT I VAIP(13) Q
48 S X1=$P($G(^SRF(SRTN,.2)),"^",12),X2=1 D C^%DTC S SR24=X,SRDT=$O(^DGPM("APTT1",DFN,SRP(5))) Q:'SRDT!(SRDT>SR24) S VAIP("D")=SRDT D IN5^VADPT I 'VAIP(13) Q
49 S SRX=$P(VAIP(13,6),"^") D SPEC S Y="18,23,24,36,41,65,94" I Y[SRSP S SRSOUT=1
50 Q
51NA F I=1:1:3 S $P(^SRF(SRTN,208.1),"^",I)="NA"
52 Q
53SPEC K DA,DIC,DIQ,DR,SRY S DIC=45.7,DR=1,DA=SRX,DIQ="SRY",DIQ(0)="I" D EN^DIQ1 S SRSP=SRY(45.7,SRX,1,"I") I SRSP,$L(SRSP)=1 S SRSP="0"_SRSP
54 Q
55INC ; make completed/transmitted assessment incomplete
56 K DA,DIE,DR S DIE=130,DA=SRTN,DR="235////I;393////"_$S(SR235="T":1,1:"") D ^DIE K DA,DIE,DR
57 I SR235="C"&($P(^SRF(SRTN,"RA"),"^",3)'="1") S DIE=130,DA=SRTN,DR="272///@" D ^DIE K DA,DIE,DR
58 S X=SRP(5),SRADT=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)
59 S SRAINC=SRAINC+1,^TMP("SRAINC",$J,SRAINC)="ASSESSMENT: "_SRTN_" "_$J(VADM(1),20)_" OPERATION DATE: "_SRADT
60 Q
61POST ; post-install action for SR*3*81
62 ; task retransmission message
63 D NOW^%DTC S ZTDTH=$E(%,1,12),ZTRTN="EN1^SR81UTL",ZTDESC="Surgery Risk Assessment Retransmission",ZTIO="" D ^%ZTLOAD
64 Q
Note: See TracBrowser for help on using the repository browser.