source: WorldVistAEHR/trunk/r/SURGERY-SR/SROATCM2.m@ 623

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1SROATCM2 ;BIR/MAM - CREATE MESSAGES ;03/22/06
2 ;;3.0; Surgery ;**27,38,90,93,125,153**;24 Jun 93;Build 11
3 S SHEMP=3,SRAMNUM=0 F I=0:0 S SRAMNUM=$O(^TMP("SRA",$J,SRAMNUM)) Q:'SRAMNUM D MSG
4STATUS ; update status
5 S (SRAMNUM,SRASS)=0
6 F I=0:0 S SRAMNUM=$O(^TMP("SRA",$J,SRAMNUM)) Q:'SRAMNUM S SRACNT=0 F I=0:0 S SRACNT=$O(^TMP("SRA",$J,SRAMNUM,SRACNT)) Q:'SRACNT S CURLEY=$E(^TMP("SRA",$J,SRAMNUM,SRACNT,0),13,14) I +CURLEY=1 D UPDATE
7 I 'SRASS G END
8 S X=$$ACTIVE^XUSER(DUZ) I '+X S XMDUZ=.5
9 S XMSUB="CARDIAC ASSESSMENT TRANSMISSION COMPLETE"
10 S XMY("G.RISK ASSESSMENT@"_^XMB("NETNAME"))=""
11 D NOW^%DTC S Y=% D D^DIQ S SRATIME=$E($P(Y,"@",2),1,5)
12 S ^TMP("SRAMSG",$J,1,0)="The Cardiac Surgery Risk Assessment Transmission was completed at "_SRATIME_".",^TMP("SRAMSG",$J,2,0)="A total of "_SRASS_$S(SRASS=1:" assessment was sent.",1:" assessments were sent.")
13 S ^TMP("SRAMSG",$J,3,0)=" "
14 S XMTEXT="^TMP(""SRAMSG"",$J," N I D ^XMD
15END K ^TMP("SRA",$J),^TMP("SRAMSG",$J) D ^SRSKILL
16 Q
17MSG ; send message to G.CARDIAC RISK ASSESSMENTS at Denver
18 S ISC=0,NAME=$G(^XMB("NETNAME")) I NAME["FORUM"!(NAME["ISC-")!($E(NAME,1,3)="ISC")!(NAME["ISC.")!(NAME["TST")!(NAME["FO-") S ISC=1
19 I ISC S XMY("G.RISK ASSESSMENT@"_^XMB("NETNAME"))=""
20 I 'ISC S (XMY("G.CARDIAC RISK ASSESSMENTS@DENVER.VA.GOV"),XMY("G.SRCARDIAC@ISC-CHICAGO.VA.GOV"))=""
21 S SRATDATE=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
22 S X=$$ACTIVE^XUSER(DUZ) I '+X S XMDUZ=.5
23 S XMSUB=$P($$SITE^SROVAR,"^",2)_": CICSP ("_SRAMNUM_" OF "_SRATOTM_") "_SRATDATE,XMTEXT="^TMP(""SRA"",$J,"_SRAMNUM_"," N I D ^XMD
24 Q
25UPDATE ; change status to 'T'
26 S MM=$E(^TMP("SRA",$J,SRAMNUM,SRACNT,0),5,11) F X=1:1 S EMILY=$P(MM," ",X) Q:EMILY
27 N I D NOW^%DTC S SRNOW=$E(%,1,7)
28 K DR S DA=EMILY,DR="260////"_SRNOW_";235///T",DIE=130 N I D ^DIE
29 S SRASS=SRASS+1
30 S DFN=$P(^SRF(EMILY,0),"^") D DEM^VADPT S SRANAME=$P(VADM(1),"^") K VADM S X=$P(^SRF(EMILY,0),"^",9),SRADT=$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3)
31 S SHEMP=SHEMP+1,^TMP("SRAMSG",$J,SHEMP,0)="ASSESSMENT: "_EMILY_" "_$J(SRANAME,20)_" OPERATION DATE: "_SRADT
32 Q
Note: See TracBrowser for help on using the repository browser.