VistA-WorldVistAEHR/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHMSE.m

78 lines
2.3 KiB
Mathematica

PRCHMSE ;WISC/RWS-IFCAP SERVER ROUTINE ;3/1/94 10:28 AM
V ;;5.1;IFCAP;;Oct 20, 2000
;Per VHA Directive 10-93-142, this routine should not be modified.
;
READ N X,XMB,XMSUB,XMDUN,XMDUZ,XMZ,Y,Z,XMY
N ERR,IFNO,IFSEG,ISNO,LCNT,LCSEG,LIN,SYSEG,TRANSIN,TRNSDA,TRY,TYP
S TRANSIN="^PRCF(423.6,"_PRCDA_",0)",TRNSDA=PRCDA
I $G(@TRANSIN)="" S ERR="PRCHMSE wants ^PRCF(423.6,"_PRCDA_" which does not (now) exist" G ERROR ; <<<< REW Sometimes PRCDA is not valid but no clear understanding of when/why -- should be a "clean" exit
S X=@TRANSIN
S TYP=$E(X,1,3),LIN=0,TRANSIN=$Q(@TRANSIN)
S XMSUB="ISMS to IFCAP "_TYP_" transaction"
S XMDUZ="IFCAP MESSAGE SERVER"
F TRY=1:1:5 D GET^XMA2 I TRY<5 Q:XMZ>0
I TRY=5,XMZ<1 S ERR=" UNABLE TO GET MAILMAN NUMBER AFTER 5 TRIES." G ERROR
I "-832-833-ERR-MSG-ONA-OHS-OHC-OHG-OPE-PFA-PKE-"'[("-"_TYP_"-") S ERR="INVALID TRANSACTION TYPE ENCOUNTERED" G ERROR
D @TYP
;
SEND ;SEND MAILMAN MESSAGE
I $G(ERR)'="" S LIN=$G(LIN)+1,^XMB(3.9,XMZ,2,LIN,0)=ERR
S:LIN>0 ^XMB(3.9,XMZ,2,0)="^3.92A^"_LIN_U_LIN_U_DT,XMDUN="IFCAP SERVER",X="G.OGR AUSTIN MESSAGES"
D WHO^XMA21 S:'$L($O(XMY(""))) XMY(.5)=""
D ENT1^XMD K XMY
;
EXIT ;CLEAN UP AND QUIT
I '$D(ERR) S DIK="^PRCF(423.6,",DA=TRNSDA D ^DIK K DIK,DA ; DELETE TRANS FROM TEMP FILE
Q
;
MSG ;INVENTORY MANAGEMENT MESSAGE
D MESG Q
;
ERR D MESG Q
;
832 ;CATALOG REQUEST VAMC MESSAGE
D MESG Q
;
833 ;CATALOG GLOBAL VAMC MSG
D MESG Q
;
ONA ;ORDER NUMBER ACKNOWLEDGEMENT
D ^PRCHMOP Q
;
OHS ;ORDER HEADER STATUS
D ^PRCHMESH Q
;
OHC ;ORDER HEADER CANCEL
D ^PRCHMESH Q
;
OHG ;ORDER HEADER CHANGE
D ^PRCHMESH Q
;
OPE ;ERROR ACKNOWLEDGEMENT
D ^PRCHMESE Q
;
PFA ;PACKAGING FACTOR ADJ
D ^PRCHMESP Q
;
PKE ;PICKING EXCEPTION
D ^PRCHMESP Q
;
ERROR S ZTDTH="1H" D REQ^%ZTLOAD Q
;
MESG ; READ MESSAGE LINES
S X=$Q(@TRANSIN),SYSEG=@X,ISNO=$P(SYSEG,U,7)
S ^XMB(3.9,XMZ,2,1,0)=" Message to ISMS mailgroup"
S ^XMB(3.9,XMZ,2,2,0)=""
S DIWL=0,DIWR=70 K ^UTILITY($J,"W") F LIN=2:1 D Q:Y=""!(X'[(","_PRCDA_","))
.S X=$Q(@X),Y=@X I Y?1"MS^".E S Y=$P(Y,U,2)
.I Y["$",$P(Y,"$",2)="" S Y=$P(Y,U)
.F Q:Y'[" " S Y=$P(Y," ",1)_" "_$P(Y," ",2,99)
.I $D(LSTPC) S Y=LSTPC_Y K LSTPC
.I $E(Y,$L(Y))?1AN S NOPCS=$L(Y," "),LSTPC=$P(Y," ",NOPCS),Y=$P(Y," ",1,NOPCS-1)
.D WP
F I=1:1:$G(^UTILITY($J,"W",0)) S LIN=LIN+1,^XMB(3.9,XMZ,2,LIN,0)=^UTILITY($J,"W",0,I,0)
Q
;
WP N X S X=Y D DIWP^PRCUTL($G(DA))
Q