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

VENPCC25.m

Go to the documentation of this file.
VENPCC25 ; IHS/OIT/GIS - FACILITY PRINT DEAMON ;
 ;;2.6;PCC+;;NOV 12, 2007
 ;
 ; NEW DATA FILE UTILITIES
 ; WORKS WITH VER 2.5 PRINT SERVICE
 ;
INIT ; EP - DIRVER
 N MN F MN="ef","25","pn","hs" D POP(MN)
 Q
 ; 
POP(MN) ; EP-POPULATE THE NEW HEADER FILE
 N STG,PATH,FILE,POP,REC,DIC,DA,X,Y,LEN,PCE
 S PATH=$G(^VEN(7.5,$$CFG^VENPCCU,2)) I '$L(PATH) Q
 S FILE=MN_"HEADER.TXT"
 S DIC="^VEN(7.49,",DIC(0)="L"
 S X=MN,DLAYGO=19707.49
 D ^DIC I Y=-1 Q
 S DA(1)=+Y S DIC=DIC_DA(1)_",1,"
 S DIC(0)="LX" S DIC("P")=19707.491
 S POP=$$OPN^VENPCCP(PATH,FILE,"R","R REC")
 S LEN=$L(REC,U)
 F PCE=1:1:LEN S X=$P(REC,U,PCE) D ^DIC
 Q
 ;
DOLD(FILE) ; EP-CONVERT A VER 2.5 DATA FILE TO A TRADITIONAL DATA FILE
 I '$L($G(FILE)) Q
 N PATH,REC,X,Y,ZPCE,STG1,STG2,POP
 S PATH=$G(^VEN(7.5,$$CFG^VENPCCU,1)) I '$L(PATH) Q
 S POP=$$OPN^VENPCCP(PATH,FILE,"R","R REC") I POP Q
 I '$L(REC) Q
 S L=$L(REC,U),STG1="",STG2=""
 F PCE=1:1:L D
 . S X=$P(REC,U,PCE)
 . S Y=$P(X,$C(30))
 . S Z=$P(X,$C(30),2)
 . I PCE>1 S STG1=STG1_U
 . S STG1=STG1_Y
 . I PCE>1 S STG2=STG2_U
 . S STG2=STG2_Z
 . Q
 S POP=$$OPN^VENPCCP(PATH,FILE,"W","W STG1,!,STG2")
 Q
 ;
HOLD(MN) ; EP-CREATE A TRADITIONAL HEADER FILE FROM THE CONTENTS OF VEN EHP HEADER GROUP
 I '$L(MN) Q
 N FILE,PATH,HFIEN,POP
 S FILE=MN_"header.txt"
 S PATH=$G(^VEN(7.5,$$CFG^VENPCCU,2)) I '$L(PATH) Q
 S POP=$$OPN^VENPCCP(PATH,FILE,"W","D HPOP^VENPCC25(MN)") I POP Q
 D CONVERT^VENPCCU(MN,2) ; ALSO CREAT THE PRINT SERVER HEADER FILE
 Q
 ;
HPOP(MN) ; EP-POPULATE THE HEADER FILE
 I '$L(MN) Q
 N HFIEN,MMF,CNT,MIEN
 S HFIEN=$O(^VEN(7.49,"B",MN,0)) I 'HFIEN Q
 S CNT=0,MIEN=0
 F  S MIEN=$O(^VEN(7.49,HFIEN,1,MIEN)) Q:'MIEN  D
 . S MMF=$P($G(^VEN(7.49,HFIEN,1,MIEN,0)),U)
 . S CNT=CNT+1
 . I CNT>1 W U
 . W MMF
 . Q
 Q
DEMODATA ; EP-CREATE A DEMO DATA FILE FOR BUILDING PCC+ TEMPLATES ; FOR VER 2.5 AND WIN XP
 N DIR,DA,DEMODATA,REC,PATH,FILE,POP,DLM,X,HDR,HIEN,HGIEN,%
 S DIR(0)="FO^1:20",DIR("A")="Name of test data file"
 S DIR("?")="Example: 'eftest'.  No file extension reqd." D ^DIR
 I Y'?2.20AN G DDX
 S DEMODATA=Y
 D DEMODATA^VENPCC
 S FILE=DEMODATA_".txt"
 S PATH=$G(^VEN(7.5,$$CFG^VENPCCU,3)) I '$L(PATH) G DDX
 S POP=$$OPN^VENPCCP(PATH,FILE,"R","R REC")
 I POP W !,"Unable to generate test file.  Request cancelled..." G DDX
 S DLM="",X=$L(REC,U)
 S $P(DLM,U,X)=""
 S HGIEN=$O(^VEN(7.49,"B","25",0)) I 'HGIEN G DDX
 S HDR="",HIEN=0
 F  S HIEN=$O(^VEN(7.49,HGIEN,1,HIEN)) Q:'HIEN  D
 . S %=$G(^VEN(7.49,HGIEN,1,HIEN,0))
 . I $L(HDR) S HDR=HDR_U
 . S HDR=HDR_%
 . Q
DDF S POP=$$OPN^VENPCCP(PATH,FILE,"W","W HDR,!,REC,!,DLM")
DDX D ^XBFMK
 Q
 ;