PSXMISC ;BIR/BAB,WPB-Miscellaneous Transmission Utilities ;02 Aug 2001 11:02AM
;;2.0;CMOP;**23,27,30,38**;11 Apr 97
;Reference to ^DIC(4.2 supported by DBIA #1966
;Reference to ^VA(200 supported by DBIA #10060
;Reference to File #59 supported by DBIA #1976
TIMER ;
D NOW^%DTC S XX=$$FMADD^XLFDT(%,0,24,0,0),ZTDESC="CMOP Return Message Timer",ZTDTH=XX,ZTIO="PSX",ZTRTN="TIME^PSXMISC",ZTSAVE("XX")="",ZTSAVE("PSXBAT")="" D ^%ZTLOAD
K ZTDESC,ZTDTH,ZTRTN,%,X
Q
;Called by Taskman to build Acknowledgment not Received Mail message
TIME F XDUZ=0:0 S XDUZ=$O(^XUSEC("PSXCMOPMGR",XDUZ)) Q:XDUZ'>0 S XMY(XDUZ)=""
S ACKTM=$P($G(^PSX(550.2,PSXBAT,1)),U,1) I ACKTM="" D
.S PSXDUZ=$P($G(^PSX(550.2,PSXBAT,0)),U,5)
.S XMDUZ=.5,XMSUB=("CMOP Acknowledgement not Received"),LCNT=3
.N PSXMMDIV
.S PSXMMDIV=$$GET1^DIQ(550.2,PSXBAT,2,"I"),PSXMMDIV=$$GET1^DIQ(59,PSXMMDIV,.06)
.S XMSUB=PSXMMDIV_" "_XMSUB
.D XMZ^XMA2
.G:XMZ<1 TIME
.S ^XMB(3.9,XMZ,2,1,0)="An acknowledgment message for transmission # "_PSXBAT_" has not been"
.S ^XMB(3.9,XMZ,2,2,0)="received within the specified time. Please contact the CMOP facility"
.S ^XMB(3.9,XMZ,2,3,0)="to see if there is a problem."
.S ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_U_LCNT_U_DT,XMDUN="CMOP Manager"
.S XMDUZ=.5 D ENT1^XMD
S ZTREQ="@"
K XMZ,ZMSUB,ACKTM,PSXDUZ,Y,%,LCNT,XMDUN,XMDUZ,XMY
Q
SERV S XX=$P($G(^PSX(550,+PSXSYS,0)),U,4),DOMAIN=$$GET1^DIQ(4.2,XX,.01)
D NOW^%DTC S DATE=% S SITE=$P(PSXSYS,U,2),NAME=$$GET1^DIQ(200,DUZ,.01),SITENM=$P(PSXSYS,U,3)
S ZMSG1="Schedule "_$S($G(PSXCS)=1:"CS ",1:"")_"Auto Transmission"
S ZMSG2="Unschedule "_$S($G(PSXCS)=1:"CS ",1:"")_"Auto Transmission"
S XMDUZ=.5,XMSUB=$S(PSXAUTO=1:ZMSG1,PSXAUTO=0:ZMSG2,1:""),LCNT=2
K ZMSG1,ZMSG2
D XMZ^XMA2 G:XMZ<1 SERV
S ^XMB(3.9,XMZ,2,1,0)="$$AUTO^"_PSXAUTO_"^"_PSXDATE_"^"_PSXHOUR_"^"_SITE_"^"_NAME_"^"_SITENM_"^"_THRU
S ^XMB(3.9,XMZ,2,2,0)="$$ENDAUTO"
S ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_"^"_LCNT_"^"_DT,XMDUN="CMOP Manager"
K XMY S XMDUZ=.5,XMY("S.PSXX CMOP SERVER@"_DOMAIN)="" D ENT1^XMD
K XX,DOMAIN,Y,%,SITE,XMSUB,LCNT,XMZ,XMDUN,XMDUZ,XMY,NAME,SITENM,DATE
Q
AUTO ;Called by taskman to set/file automatic CMOP transmissions
S STAT=$P(XMRG,U,2),DATE=$P(XMRG,U,3),HOUR=$P($G(XMRG),U,4),SITE=$P(XMRG,U,5),XMSER="S."_XQSOP,TXMZ=XMZ,ROFF=$P(XMRG,U,6),SITENM=$P(XMRG,U,7),ZTREQ="@"
;S X=SITE,DIC="4",DIC(0)="MOZX" S:$D(^PSX(552,"D",X)) X=$E(X,2,99) D ^DIC S SITN=+Y,THRU=$P(XMRG,U,8) K DIC,X,Y ;****DOD L1
S X=SITE,AGNCY="VASTANUM" S:$D(^PSX(552,"D",X)) X=$E(X,2,99),AGNCY="DMIS" S SITN=$$IEN^XUMF(4,AGNCY,X),THRU=$P(XMRG,U,8) K X,Y,AGNCY ;****DOD L1
S XX=$O(^PSX(552,"B",SITN,""))
DOD ; entry for DOD and other agency interface to file auto scheduling information
S STDATE=$$FMTE^XLFDT(DATE,"1")
K DD,DO
F S:'$D(^PSX(552,XX,1,0)) ^PSX(552,XX,1,0)="^552.01DA^^"
D NOW^%DTC
S DA(1)=XX,(DA,X)=%,DIC(0)="Z",DIC="^PSX(552,"_XX_",1,",DIC("DR")="1////"_$S(STAT=1:"3",STAT=0:"4",1:"")_";2////"_ROFF_";3////"_DATE_";5////"_HOUR D FILE^DICN G:$P(Y,U,3)'=1 F K DIC,DA,DA(1),DIC("DR"),X
I $G(TXMZ) S XMZ=TXMZ D REMSBMSG^XMA1C
MSG S XMDUZ=.5,XMSUB="CMOP "_$S($G(PSXCS)=1:"CS ",1:"")_"Auto-Transmission Schedule, "_SITENM,LCNT=$S(STAT=0:"5",STAT=1:"7",1:"")
D XMZ^XMA2 G:XMZ<1 MSG
S ZMSG1="Cancel "_$S($G(PSXCS)=1:"CS ",1:"")_"Auto Transmission Schedule."
S ZMSG2=$S($G(PSXCS)=1:"CS ",1:"")_"Auto Transmission Schedule."
S ^XMB(3.9,XMZ,2,1,0)=$S(STAT=0:ZMSG1,STAT=1:ZMSG2,1:"")
S ^XMB(3.9,XMZ,2,2,0)=""
S ^XMB(3.9,XMZ,2,3,0)="Facility : "_SITENM
S ^XMB(3.9,XMZ,2,4,0)="Initiating Official : "_ROFF
S ^XMB(3.9,XMZ,2,5,0)=$S(STAT=0:"Cancellation Date : ",STAT=1:"Begin Automatic Transmissions : ",1:"")_$P(STDATE,":",1,2)
K ZMSG1,ZMSG2
I STAT=1 S ^XMB(3.9,XMZ,2,6,0)="Scheduling Frequency (hours) : "_HOUR
I STAT=1 S ^XMB(3.9,XMZ,2,7,0)="Number of days to transmit thru: "_$S($G(THRU)'>0:"Current date",1:$G(THRU))
S ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_U_LCNT_U_DT,XMDUN="CMOP Manager"
K XMY
S XMY(DUZ)="" ;****TESTING
S XMDUZ=.5 D GRP^PSXNOTE,ENT1^XMD Q
K STAT,DATE,HOUR,SITE,SITN,XMSER,TXMZ,XMZ,XQSOP,XQMSG,%,XX,SS,ROFF,STDATE,LCNT,SITENM
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSXMISC 4208 printed Dec 13, 2024@01:44:29 Page 2
PSXMISC ;BIR/BAB,WPB-Miscellaneous Transmission Utilities ;02 Aug 2001 11:02AM
+1 ;;2.0;CMOP;**23,27,30,38**;11 Apr 97
+2 ;Reference to ^DIC(4.2 supported by DBIA #1966
+3 ;Reference to ^VA(200 supported by DBIA #10060
+4 ;Reference to File #59 supported by DBIA #1976
TIMER ;
+1 DO NOW^%DTC
SET XX=$$FMADD^XLFDT(%,0,24,0,0)
SET ZTDESC="CMOP Return Message Timer"
SET ZTDTH=XX
SET ZTIO="PSX"
SET ZTRTN="TIME^PSXMISC"
SET ZTSAVE("XX")=""
SET ZTSAVE("PSXBAT")=""
DO ^%ZTLOAD
+2 KILL ZTDESC,ZTDTH,ZTRTN,%,X
+3 QUIT
+4 ;Called by Taskman to build Acknowledgment not Received Mail message
TIME FOR XDUZ=0:0
SET XDUZ=$ORDER(^XUSEC("PSXCMOPMGR",XDUZ))
if XDUZ'>0
QUIT
SET XMY(XDUZ)=""
+1 SET ACKTM=$PIECE($GET(^PSX(550.2,PSXBAT,1)),U,1)
IF ACKTM=""
Begin DoDot:1
+2 SET PSXDUZ=$PIECE($GET(^PSX(550.2,PSXBAT,0)),U,5)
+3 SET XMDUZ=.5
SET XMSUB=("CMOP Acknowledgement not Received")
SET LCNT=3
+4 NEW PSXMMDIV
+5 SET PSXMMDIV=$$GET1^DIQ(550.2,PSXBAT,2,"I")
SET PSXMMDIV=$$GET1^DIQ(59,PSXMMDIV,.06)
+6 SET XMSUB=PSXMMDIV_" "_XMSUB
+7 DO XMZ^XMA2
+8 if XMZ<1
GOTO TIME
+9 SET ^XMB(3.9,XMZ,2,1,0)="An acknowledgment message for transmission # "_PSXBAT_" has not been"
+10 SET ^XMB(3.9,XMZ,2,2,0)="received within the specified time. Please contact the CMOP facility"
+11 SET ^XMB(3.9,XMZ,2,3,0)="to see if there is a problem."
+12 SET ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_U_LCNT_U_DT
SET XMDUN="CMOP Manager"
+13 SET XMDUZ=.5
DO ENT1^XMD
End DoDot:1
+14 SET ZTREQ="@"
+15 KILL XMZ,ZMSUB,ACKTM,PSXDUZ,Y,%,LCNT,XMDUN,XMDUZ,XMY
+16 QUIT
SERV SET XX=$PIECE($GET(^PSX(550,+PSXSYS,0)),U,4)
SET DOMAIN=$$GET1^DIQ(4.2,XX,.01)
+1 DO NOW^%DTC
SET DATE=%
SET SITE=$PIECE(PSXSYS,U,2)
SET NAME=$$GET1^DIQ(200,DUZ,.01)
SET SITENM=$PIECE(PSXSYS,U,3)
+2 SET ZMSG1="Schedule "_$SELECT($GET(PSXCS)=1:"CS ",1:"")_"Auto Transmission"
+3 SET ZMSG2="Unschedule "_$SELECT($GET(PSXCS)=1:"CS ",1:"")_"Auto Transmission"
+4 SET XMDUZ=.5
SET XMSUB=$SELECT(PSXAUTO=1:ZMSG1,PSXAUTO=0:ZMSG2,1:"")
SET LCNT=2
+5 KILL ZMSG1,ZMSG2
+6 DO XMZ^XMA2
if XMZ<1
GOTO SERV
+7 SET ^XMB(3.9,XMZ,2,1,0)="$$AUTO^"_PSXAUTO_"^"_PSXDATE_"^"_PSXHOUR_"^"_SITE_"^"_NAME_"^"_SITENM_"^"_THRU
+8 SET ^XMB(3.9,XMZ,2,2,0)="$$ENDAUTO"
+9 SET ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_"^"_LCNT_"^"_DT
SET XMDUN="CMOP Manager"
+10 KILL XMY
SET XMDUZ=.5
SET XMY("S.PSXX CMOP SERVER@"_DOMAIN)=""
DO ENT1^XMD
+11 KILL XX,DOMAIN,Y,%,SITE,XMSUB,LCNT,XMZ,XMDUN,XMDUZ,XMY,NAME,SITENM,DATE
+12 QUIT
AUTO ;Called by taskman to set/file automatic CMOP transmissions
+1 SET STAT=$PIECE(XMRG,U,2)
SET DATE=$PIECE(XMRG,U,3)
SET HOUR=$PIECE($GET(XMRG),U,4)
SET SITE=$PIECE(XMRG,U,5)
SET XMSER="S."_XQSOP
SET TXMZ=XMZ
SET ROFF=$PIECE(XMRG,U,6)
SET SITENM=$PIECE(XMRG,U,7)
SET ZTREQ="@"
+2 ;S X=SITE,DIC="4",DIC(0)="MOZX" S:$D(^PSX(552,"D",X)) X=$E(X,2,99) D ^DIC S SITN=+Y,THRU=$P(XMRG,U,8) K DIC,X,Y ;****DOD L1
+3 ;****DOD L1
SET X=SITE
SET AGNCY="VASTANUM"
if $DATA(^PSX(552,"D",X))
SET X=$EXTRACT(X,2,99)
SET AGNCY="DMIS"
SET SITN=$$IEN^XUMF(4,AGNCY,X)
SET THRU=$PIECE(XMRG,U,8)
KILL X,Y,AGNCY
+4 SET XX=$ORDER(^PSX(552,"B",SITN,""))
DOD ; entry for DOD and other agency interface to file auto scheduling information
+1 SET STDATE=$$FMTE^XLFDT(DATE,"1")
+2 KILL DD,DO
F if '$DATA(^PSX(552,XX,1,0))
SET ^PSX(552,XX,1,0)="^552.01DA^^"
+1 DO NOW^%DTC
+2 SET DA(1)=XX
SET (DA,X)=%
SET DIC(0)="Z"
SET DIC="^PSX(552,"_XX_",1,"
SET DIC("DR")="1////"_$SELECT(STAT=1:"3",STAT=0:"4",1:"")_";2////"_ROFF_";3////"_DATE_";5////"_HOUR
DO FILE^DICN
if $PIECE(Y,U,3)'=1
GOTO F
KILL DIC,DA,DA(1),DIC("DR"),X
+3 IF $GET(TXMZ)
SET XMZ=TXMZ
DO REMSBMSG^XMA1C
MSG SET XMDUZ=.5
SET XMSUB="CMOP "_$SELECT($GET(PSXCS)=1:"CS ",1:"")_"Auto-Transmission Schedule, "_SITENM
SET LCNT=$SELECT(STAT=0:"5",STAT=1:"7",1:"")
+1 DO XMZ^XMA2
if XMZ<1
GOTO MSG
+2 SET ZMSG1="Cancel "_$SELECT($GET(PSXCS)=1:"CS ",1:"")_"Auto Transmission Schedule."
+3 SET ZMSG2=$SELECT($GET(PSXCS)=1:"CS ",1:"")_"Auto Transmission Schedule."
+4 SET ^XMB(3.9,XMZ,2,1,0)=$SELECT(STAT=0:ZMSG1,STAT=1:ZMSG2,1:"")
+5 SET ^XMB(3.9,XMZ,2,2,0)=""
+6 SET ^XMB(3.9,XMZ,2,3,0)="Facility : "_SITENM
+7 SET ^XMB(3.9,XMZ,2,4,0)="Initiating Official : "_ROFF
+8 SET ^XMB(3.9,XMZ,2,5,0)=$SELECT(STAT=0:"Cancellation Date : ",STAT=1:"Begin Automatic Transmissions : ",1:"")_$PIECE(STDATE,":",1,2)
+9 KILL ZMSG1,ZMSG2
+10 IF STAT=1
SET ^XMB(3.9,XMZ,2,6,0)="Scheduling Frequency (hours) : "_HOUR
+11 IF STAT=1
SET ^XMB(3.9,XMZ,2,7,0)="Number of days to transmit thru: "_$SELECT($GET(THRU)'>0:"Current date",1:$GET(THRU))
+12 SET ^XMB(3.9,XMZ,2,0)="^3.92A^"_LCNT_U_LCNT_U_DT
SET XMDUN="CMOP Manager"
+13 KILL XMY
+14 ;****TESTING
SET XMY(DUZ)=""
+15 SET XMDUZ=.5
DO GRP^PSXNOTE
DO ENT1^XMD
QUIT
+16 KILL STAT,DATE,HOUR,SITE,SITN,XMSER,TXMZ,XMZ,XQSOP,XQMSG,%,XX,SS,ROFF,STDATE,LCNT,SITENM
+17 QUIT