[613] | 1 | PRCOSS5 ;WISC/DJM/DL-SSO Server Interface to IFCAP ; 1/27/98 1500
|
---|
| 2 | V ;;5.1;IFCAP;;Oct 20, 2000
|
---|
| 3 | ;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
| 4 | ;Routine to handle messages from PRCOSSO. Messages are specified in MSGX. Results are sent out as MailMan message to G.SSO.
|
---|
| 5 | Q
|
---|
| 6 | MSG1(C) ;WRONG STATION NUMBER
|
---|
| 7 | N DATE1,PRCO,S,SITE,TIME1 S S=";;",SITE=$P(C,U,3) D DT S PRCO(1)=$P($T(MSGS+1),S,2)_DATE1_" at "_TIME1_" "_$P($T(MSGS+2),S,2),PRCO(2)=SITE_". "_$P($T(MSGS+3),S,2) G SEND
|
---|
| 8 | MSG2(C) ;NO "LC" SEGMENT
|
---|
| 9 | N PRCO,S D MF1 S PRCO(2)="has no "_$C(34)_"LC"_$C(34)_" segment." G SEND
|
---|
| 10 | MSG3(C) ;NO COUNT IN "LC" SEGMENT
|
---|
| 11 | N PRCO,S D MF1 S PRCO(2)=$P($T(MSGS+4),S,2) G SEND
|
---|
| 12 | MSG4(C) ;WRONG SEGMENT TYPE
|
---|
| 13 | N PRCO,S D MF1 S PRCO(2)=$P($T(MSGS+5),S,2) G SEND
|
---|
| 14 | MSG5(C) ;WRONG COUNT OF "SL" SEGMENTS
|
---|
| 15 | N PRCO,S D MF1 S PRCO(2)=$P($T(MSGS+6),S,2),PRCO(3)=$P($T(MSGS+7),S,2) G SEND
|
---|
| 16 | MSG6(C) ;MISSING NSN WITHIN "SL" SEGMENT
|
---|
| 17 | N PRCO,S D MF1 S PRCO(2)=$P($T(MSGS+8),S,2) G SEND
|
---|
| 18 | MSG7(C) ;NO GENERIC INVENTORY FILE ENTRY FOUND
|
---|
| 19 | N PRCO,SITE S SITE=$P(C,U,3),PRCO(1)="I can find NO warehouse entry in the GENERIC INVENTORY file for station "_SITE G SEND
|
---|
| 20 | MSG8(C) ;NO CATALOG SOURCE WITHIN "SL" SEGMENT
|
---|
| 21 | N PRCO,S D MF1 S PRCO(2)=$P($T(MSGS+9),S,2) G SEND
|
---|
| 22 | DT ;CONVERTS TRANS DATE AND TRANS TIME INTO HUMAN READABLE FORM
|
---|
| 23 | N AP,DATE,DAY,DAYS,II,MO,S,TIME,TOTAL,YR S DATE=$P(C,U,5),TIME=$P(C,U,6)
|
---|
| 24 | S S=":",YR=$E(DATE,1,4),DAY=+$E(DATE,5,7),DAYS="31^28^31^30^31^30^31^31^30^31^30^31"
|
---|
| 25 | S $P(DAYS,U,2)=$S(YR#400=0:29,(YR#4=0&(YR#100'=0)):29,1:28)
|
---|
| 26 | S TOTAL="" F MO=1:1:12 S DAY=DAY-$P(DAYS,U,MO) Q:DAY'>0 S TOTAL=TOTAL+$P(DAYS,U,MO)
|
---|
| 27 | S DAY=+$E(DATE,5,7)-TOTAL,YR=YR-1700,MO=$S($L(MO)=1:"0"_MO,1:MO),DAY=$S($L(DAY)=1:"0"_DAY,1:DAY),Y=YR_MO_DAY_"."_TIME D DD^%DT S DATE1=$P(Y,"@"),TIME1=$P(Y,"@",2),$P(TIME1,S)=+$P(TIME1,S)
|
---|
| 28 | S AP=$S($P(TIME1,S)>11:"P",1:"A")_"M" S:AP="PM"&($P(TIME1,S)>12) $P(TIME1,S)=$P(TIME1,":")-12 S:$P(TIME1,S)=0 $P(TIME1,S)=12 S:TIME1="12:00" TIME1="12 "_$S(AP="AM":"midnight",1:"noon"),AP=""
|
---|
| 29 | S TIME1=TIME1_$S($L(AP):" "_AP,1:"") Q
|
---|
| 30 | SEND K ^TMP("SSO") D MAIL Q:XMZ'>0 D MAIL1 Q
|
---|
| 31 | MAIL ;HERE THE MAILMAN MESSAGE IS CREATED.
|
---|
| 32 | S XMSUB="IFCAP 'SSO' message",XMDUZ="IFCAP 'SSO' SERVER" F I=1:1:5 D GET^XMA2 I I<5 Q:XMZ>0
|
---|
| 33 | I XMZ'>0 S ^TMP("SSO",$J,$H)="CAN'T CREATE MAILMAN MESSAGE"
|
---|
| 34 | Q ;EXIT HERE AFTER 'CREATING' THE MAILMAN MESSAGE. THE CALLING ROUTINE CAN CHECK XMZ TO SEE IF THE MAIL CALL ERRORED OUT.
|
---|
| 35 | MAIL1 ;THIS IS THE PLACE WHERE THE TEXT IS ADDED TO THE MAILMAN MESSAGE AND THE MESSAGE IS 'FORWARDED' TO ITS RECEIPENTS.
|
---|
| 36 | S II=0,JJ=1 F S II=$O(PRCO(II)) Q:II="" S ^XMB(3.9,XMZ,2,JJ,0)=PRCO(II),JJ=JJ+1
|
---|
| 37 | S JJ=JJ-1,^XMB(3.9,XMZ,2,0)="^3.9A^"_JJ_"^"_JJ_"^"_DT,XMDUN="IFCAP 'SSO' MESSAGE",X="G.SSO" D WHO^XMA21 S:'$L($O(XMY(""))) XMY(.5)="" D ENT1^XMD Q
|
---|
| 38 | MF1 N DATE1,SITE,TIME1 S S=";;",SITE=$P(C,U,3) D DT S PRCO(1)=$P($T(MSGS+1),S,2)_DATE1_" at "_TIME1_" for station "_SITE Q
|
---|
| 39 | MSGS ;THE MESSAGE LINE OR LINE FRAGEMENT
|
---|
| 40 | ;;The SSO transaction dated
|
---|
| 41 | ;;is for station
|
---|
| 42 | ;;This station is not listed in your site parameter file.
|
---|
| 43 | ;;has no LINE COUNT in the "LC" segment.
|
---|
| 44 | ;;has a wrong segment type after the "LC" segment.
|
---|
| 45 | ;;has a wrong count. The "LC" segment LINE COUNT and the number
|
---|
| 46 | ;;of "SL" segments following don't agree.
|
---|
| 47 | ;;is missing NSN within "SL" segment/s.
|
---|
| 48 | ;;is missing SOURCE CODE within "SL" segment/s.
|
---|