Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SROATCM2

SROATCM2.m

Go to the documentation of this file.
SROATCM2 ;BIR/MAM - CREATE MESSAGES ;03/10/11
 ;;3.0;Surgery;**27,38,90,93,125,153,175,200**;24 Jun 93;Build 9
 S SHEMP=3,SRAMNUM=0 F I=0:0 S SRAMNUM=$O(^TMP("SRA",$J,SRAMNUM)) Q:'SRAMNUM  D MSG
STATUS ; update status
 S (SRAMNUM,SRASS)=0
 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
 I 'SRASS G END
 S X=$$ACTIVE^XUSER(DUZ) I '+X S XMDUZ=.5
 S XMSUB="CARDIAC ASSESSMENT TRANSMISSION COMPLETE"
 S XMY("G.RISK ASSESSMENT@"_^XMB("NETNAME"))=""
 D NOW^%DTC S Y=% D D^DIQ S SRATIME=$E($P(Y,"@",2),1,5)
 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.")
 S ^TMP("SRAMSG",$J,3,0)="  "
 S XMTEXT="^TMP(""SRAMSG"",$J," N I D ^XMD
END K ^TMP("SRA",$J),^TMP("SRAMSG",$J) D ^SRSKILL
 Q
MSG ; send message to G.CARDIAC RISK ASSESSMENTS at Denver
 S ISC=1 I $$PROD^XUPROD() S ISC=0
 S NAME=$G(^XMB("NETNAME")) I NAME["FORUM" S ISC=1
 I ISC S XMY("G.RISK ASSESSMENT@"_^XMB("NETNAME"))=""
 I 'ISC S (XMY("G.CARDIAC RISK ASSESSMENTS@DENVER.DOMAIN.EXT"),XMY("G.SRCARDIAC@ISC-CHICAGO.DOMAIN.EXT"))=""
 S SRATDATE=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
 S X=$$ACTIVE^XUSER(DUZ) I '+X S XMDUZ=.5
 S XMSUB=$P($$SITE^SROVAR,"^",2)_": CARDIAC ("_SRAMNUM_" OF "_SRATOTM_") "_SRATDATE,XMTEXT="^TMP(""SRA"",$J,"_SRAMNUM_"," N I D ^XMD
 Q
UPDATE ; change status to 'T'
 S MM=$E(^TMP("SRA",$J,SRAMNUM,SRACNT,0),5,11) F X=1:1 S EMILY=$P(MM," ",X) Q:EMILY
 N I D NOW^%DTC S SRNOW=$E(%,1,7)
 K DR S DA=EMILY,DR="260////"_SRNOW_";235///T",DIE=130 N I D ^DIE
 S SRASS=SRASS+1
 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)
 S SHEMP=SHEMP+1,^TMP("SRAMSG",$J,SHEMP,0)="ASSESSMENT: "_EMILY_"   "_$J(SRANAME,20)_"        OPERATION DATE: "_SRADT
 Q