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

PSXDODAT.m

Go to the documentation of this file.
  1. PSXDODAT ;BRM/PDW-DOD PROCESS/FILE AUTO-SCHEDULING INFORMATION ;09/09/02 11:15 AM
  1. ;;2.0;CMOP;**38,45**;11 Apr 97
  1. Q
  1. EN(PATH,FNAME) ; needs directory & file name
  1. I $L(PATH),$L(FNAME) I 1
  1. E S PSXERR="0^BAD PATH OR FILENAME" G ERRMSG
  1. K ^TMP($J,"PSXDOD")
  1. S FNAME1=FNAME
  1. S GBL="^TMP("_$J_",""PSXDOD"",1)"
  1. S Y=$$FTG^%ZISH(PATH,FNAME,$NA(^TMP($J,"PSXDOD",1)),3)
  1. I Y'>0 S PSXERR="9^"_PATH_U_FNAME_U_" DID NOT LOAD" G ERRMSG
  1. I $D(^TMP($J,"PSXDOD"))'>1 S PSXERR="9^"_PATH_U_FNAME_U_" DID NOT LOAD" G ERRMSG
  1. EN1 ;
  1. K PSXERR
  1. S (MSH,MSH1)=^TMP($J,"PSXDOD",1),ARQ=^TMP($J,"PSXDOD",2)
  1. I $E(MSH,1,3)="MSH",$E(ARQ,1,3)="ARQ" I 1
  1. E S PSXERR="1^ BAD SEGMENT SEQUENCE ^ Auto Scheduling Information ^ "_PATH_U_FNAME G ERRMSG
  1. ; variables are being set to call DOD^PSXMISC
  1. F YY="SENDAPP^3","MSGTYPID^9","MSGID^10","HLDATETM^7" D PIECE(MSH,"|",YY)
  1. I $E(IOST)="C" W !,"MSGTYPID ",MSGTYPID
  1. S SITE="1"_$P(MSGID,"-") ;****Institution File
  1. S XX=$O(^PSX(552,"D",SITE,0)),SITENM=$$GET1^DIQ(552,XX,.01)
  1. S ARQ=$P(ARQ,"ARQ|",2)
  1. F YY="STAT^6","DATE^11","HOUR^13","ROFF^15" D PIECE(ARQ,"|",YY)
  1. S HOUR=$E(HOUR,2,99),HOUR=+HOUR,DATE=$$FMDATE^HLFNC(DATE)
  1. I "SIU^S07,SIU^S20"'[MSGTYPID I $E(IOST)="C" W !,"STOPPING ",MSGTYPID Q ; Not a scheduling message.
  1. S ROFF=$$FMNAME^HLFNC(ROFF,"^") ; remote official name
  1. ;S STDATE=$$FMDATE^HLFNC(DATE)
  1. S:STAT=1 STAT=1,PSXCS=0
  1. S:STAT=2 STAT=1,PSXCS=1
  1. S:STAT=3 STAT=0,PSXCS=0
  1. S:STAT=4 STAT=0,PSXCS=1
  1. D DOD^PSXMISC
  1. K ^TMP($J,"PSXDOD1")
  1. D NOW^%DTC S DATETM=$$HLDATE^HLFNC(%),DATETM=+DATETM
  1. S RESP=$S(MSGTYPID["SIU":"SRR^S07",1:"SRR^S20")
  1. S MSH="MSH|^~\&|VistA||CHCS||2001121401100||SRR^SO7|10111-011214|P|2.3.1|NE|NE"
  1. F YY="SENDAPP^5","MSGID^10","DATETM^7","RESP^9" D PUT(.MSH,"|",YY)
  1. S ^TMP($J,"PSXDOD1",1)=MSH
  1. S MSA="MSA|CA|"_MSGID_"|"
  1. S ^TMP($J,"PSXDOD1",2)=MSA
  1. S FNAME2=$P(FNAME1,"."),FNAME2=FNAME2_".HAC",PATH=$$GET1^DIQ(554,1,21)
  1. F XX=1:1:5 S Y=$$GTF^%ZISH($NA(^TMP($J,"PSXDOD1",1)),3,PATH,FNAME2) Q:Y=1 H 4
  1. I Y'=1 S GBL=$NA(^TMP($J,"PSXDOD")) D FALERT^PSXDODNT(FNAME2,PATH,GBL)
  1. ;I $E(IOST)="C" W !," FILING RESPONSE ",PATH," ",FNAME2," ",Y
  1. S PATH=$$GET1^DIQ(554,1,22)
  1. F XX=1:1:5 S Y=$$GTF^%ZISH($NA(^TMP($J,"PSXDOD1",1)),3,PATH,FNAME2) Q:Y=1 H 4
  1. I Y'=1 S GBL=$NA(^TMP($J,"PSXDOD")) D FALERT^PSXDODNT(FNAME2,PATH,GBL)
  1. Q
  1. PIECE(REC,DLM,XX) ;
  1. ; Set variable V = piece P of REC using delimiter DLM
  1. N V,P S V=$P(XX,U),P=$P(XX,U,2),@V=$P(REC,DLM,P)
  1. Q
  1. PUT(REC,DLM,XX) ;
  1. ; Set Variable V into piece P of REC using delimiter DLM
  1. N V,P S V=$P(XX,U),P=$P(XX,U,2)
  1. S $P(REC,DLM,P)=$G(@V)
  1. Q
  1. AUTO ; AUTO SCAN IN DIRECTORY AND FIRE UP JOBS
  1. S PATH=$$GET1^DIQ(554,1,20)
  1. Q:'$L(PATH)
  1. K PSXF,PSXL
  1. S PSXF("*.SCH")="",Y=$$LIST^%ZISH(PATH,"PSXF","PSXL")
  1. I $E(IOST)="C" I 'Y W !,"NO FILES FOUND" Q
  1. S FNAME="" F S FNAME=$O(PSXL(FNAME)) Q:FNAME="" D
  1. . I $E(IOST)="C" W !," processing ",PATH," ",FNAME
  1. . D EN(PATH,FNAME)
  1. Q
  1. ERRMSG ;
  1. MSGSEQER ;send error message to folks & DOD
  1. ;W !,"error ",PSXERR
  1. S XMSUB="DOD to CMOP Auto Scheduling Error"
  1. ;S XMY(DUZ)="" ;***TESTING
  1. S XMY("G.CMOP MANAGERS")=""
  1. S XMTEXT="PSXTXT("
  1. S PSXTXT(1,0)="DOD to VA CMOP Auto Scheduling experienced an error"
  1. S PSXTXT(2,0)=$G(PSXERR)
  1. D ^XMD
  1. Q