source: WorldVistAEHR/trunk/r/CMOP-PSX/PSXDODAT.m@ 1704

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1PSXDODAT ;BRM/PDW-DOD PROCESS/FILE AUTO-SCHEDULING INFORMATION ;09/09/02 11:15 AM
2 ;;2.0;CMOP;**38,45**;11 Apr 97
3 Q
4EN(PATH,FNAME) ; needs directory & file name
5 I $L(PATH),$L(FNAME) I 1
6 E S PSXERR="0^BAD PATH OR FILENAME" G ERRMSG
7 K ^TMP($J,"PSXDOD")
8 S FNAME1=FNAME
9 S GBL="^TMP("_$J_",""PSXDOD"",1)"
10 S Y=$$FTG^%ZISH(PATH,FNAME,$NA(^TMP($J,"PSXDOD",1)),3)
11 I Y'>0 S PSXERR="9^"_PATH_U_FNAME_U_" DID NOT LOAD" G ERRMSG
12 I $D(^TMP($J,"PSXDOD"))'>1 S PSXERR="9^"_PATH_U_FNAME_U_" DID NOT LOAD" G ERRMSG
13EN1 ;
14 K PSXERR
15 S (MSH,MSH1)=^TMP($J,"PSXDOD",1),ARQ=^TMP($J,"PSXDOD",2)
16 I $E(MSH,1,3)="MSH",$E(ARQ,1,3)="ARQ" I 1
17 E S PSXERR="1^ BAD SEGMENT SEQUENCE ^ Auto Scheduling Information ^ "_PATH_U_FNAME G ERRMSG
18 ; variables are being set to call DOD^PSXMISC
19 F YY="SENDAPP^3","MSGTYPID^9","MSGID^10","HLDATETM^7" D PIECE(MSH,"|",YY)
20 I $E(IOST)="C" W !,"MSGTYPID ",MSGTYPID
21 S SITE="1"_$P(MSGID,"-") ;****Institution File
22 S XX=$O(^PSX(552,"D",SITE,0)),SITENM=$$GET1^DIQ(552,XX,.01)
23 S ARQ=$P(ARQ,"ARQ|",2)
24 F YY="STAT^6","DATE^11","HOUR^13","ROFF^15" D PIECE(ARQ,"|",YY)
25 S HOUR=$E(HOUR,2,99),HOUR=+HOUR,DATE=$$FMDATE^HLFNC(DATE)
26 I "SIU^S07,SIU^S20"'[MSGTYPID I $E(IOST)="C" W !,"STOPPING ",MSGTYPID Q ; Not a scheduling message.
27 S ROFF=$$FMNAME^HLFNC(ROFF,"^") ; remote official name
28 ;S STDATE=$$FMDATE^HLFNC(DATE)
29 S:STAT=1 STAT=1,PSXCS=0
30 S:STAT=2 STAT=1,PSXCS=1
31 S:STAT=3 STAT=0,PSXCS=0
32 S:STAT=4 STAT=0,PSXCS=1
33 D DOD^PSXMISC
34 K ^TMP($J,"PSXDOD1")
35 D NOW^%DTC S DATETM=$$HLDATE^HLFNC(%),DATETM=+DATETM
36 S RESP=$S(MSGTYPID["SIU":"SRR^S07",1:"SRR^S20")
37 S MSH="MSH|^~\&|VistA||CHCS||2001121401100||SRR^SO7|10111-011214|P|2.3.1|NE|NE"
38 F YY="SENDAPP^5","MSGID^10","DATETM^7","RESP^9" D PUT(.MSH,"|",YY)
39 S ^TMP($J,"PSXDOD1",1)=MSH
40 S MSA="MSA|CA|"_MSGID_"|"
41 S ^TMP($J,"PSXDOD1",2)=MSA
42 S FNAME2=$P(FNAME1,"."),FNAME2=FNAME2_".HAC",PATH=$$GET1^DIQ(554,1,21)
43 F XX=1:1:5 S Y=$$GTF^%ZISH($NA(^TMP($J,"PSXDOD1",1)),3,PATH,FNAME2) Q:Y=1 H 4
44 I Y'=1 S GBL=$NA(^TMP($J,"PSXDOD")) D FALERT^PSXDODNT(FNAME2,PATH,GBL)
45 ;I $E(IOST)="C" W !," FILING RESPONSE ",PATH," ",FNAME2," ",Y
46 S PATH=$$GET1^DIQ(554,1,22)
47 F XX=1:1:5 S Y=$$GTF^%ZISH($NA(^TMP($J,"PSXDOD1",1)),3,PATH,FNAME2) Q:Y=1 H 4
48 I Y'=1 S GBL=$NA(^TMP($J,"PSXDOD")) D FALERT^PSXDODNT(FNAME2,PATH,GBL)
49 Q
50PIECE(REC,DLM,XX) ;
51 ; Set variable V = piece P of REC using delimiter DLM
52 N V,P S V=$P(XX,U),P=$P(XX,U,2),@V=$P(REC,DLM,P)
53 Q
54PUT(REC,DLM,XX) ;
55 ; Set Variable V into piece P of REC using delimiter DLM
56 N V,P S V=$P(XX,U),P=$P(XX,U,2)
57 S $P(REC,DLM,P)=$G(@V)
58 Q
59AUTO ; AUTO SCAN IN DIRECTORY AND FIRE UP JOBS
60 S PATH=$$GET1^DIQ(554,1,20)
61 Q:'$L(PATH)
62 K PSXF,PSXL
63 S PSXF("*.SCH")="",Y=$$LIST^%ZISH(PATH,"PSXF","PSXL")
64 I $E(IOST)="C" I 'Y W !,"NO FILES FOUND" Q
65 S FNAME="" F S FNAME=$O(PSXL(FNAME)) Q:FNAME="" D
66 . I $E(IOST)="C" W !," processing ",PATH," ",FNAME
67 . D EN(PATH,FNAME)
68 Q
69ERRMSG ;
70MSGSEQER ;send error message to folks & DOD
71 ;W !,"error ",PSXERR
72 S XMSUB="DOD to CMOP Auto Scheduling Error"
73 ;S XMY(DUZ)="" ;***TESTING
74 S XMY("G.CMOP MANAGERS")=""
75 S XMTEXT="PSXTXT("
76 S PSXTXT(1,0)="DOD to VA CMOP Auto Scheduling experienced an error"
77 S PSXTXT(2,0)=$G(PSXERR)
78 D ^XMD
79 Q
Note: See TracBrowser for help on using the repository browser.