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

DGV53PT1.m

Go to the documentation of this file.
  1. DGV53PT1 ;ALB/MTC - MAS v5.3 Post Init Routine ; 07 JAN 93
  1. ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;
  1. PROCON ;-- entry point to start the provider conversion
  1. ;
  1. ;-- create conversion log file
  1. D LOGCON
  1. ;-- do conversion
  1. D CON2^DGV53PT2,CON44^DGV53PT5,CON405^DGV53PT3,CON457^DGV53PT4,CON392^DGV53PT4,CON411^DGV53PT5,CON45^DGV53PT6
  1. ;-- conversion complete
  1. D ENDMSG
  1. ;-- generate mail message from conversion log
  1. D DOMAIL
  1. Q
  1. ;
  1. ENDMSG ;-- This function will write the completion time for the complete
  1. ; conversion to the log.
  1. N RESULT,DATE,Y
  1. D NOW^%DTC S Y=% D DD^%DT S DATE=Y
  1. S RESULT=$P(^DG(43,1,"PCL",0),U,3)
  1. S RESULT=RESULT+1,^DG(43,1,"PCL",RESULT,0)=">>> Provider Conversion Completed on "_DATE W !,^(0)
  1. S $P(^DG(43,1,"PCL",0),U,3,4)=RESULT_"^"_RESULT
  1. Q
  1. ;
  1. ADDPC(FILE) ;--add entry for provider conversion to file 43
  1. ; INPUT : FILE - File number to convert
  1. ;
  1. ;-- add entry to provider conversion multiple if none
  1. I '$D(^DG(43,1,"PCON","B",FILE)) D
  1. . I '$D(^DG(43,1,"PCON",0)) S ^DG(43,1,"PCON",0)="^43.02A^"
  1. . S DIC="^DG(43,1,""PCON"",",DIC(0)="L",X=FILE,DA(1)=1 K D0,DD D FILE^DICN K DIC,DA
  1. Q
  1. ;
  1. DONE(PSAV,TOTAL) ;-- This function will update the completion time, total number of
  1. ; records and the file sentinal indicating the file has been
  1. ; converted.
  1. ; INPUT : PSAV - IFN of the record in file 43
  1. ; TOTAL - total records processed
  1. ;
  1. ;-- enter completion time, mark conversion as completed
  1. D NOW^%DTC S $P(^DG(43,1,"PCON",PSAV,0),U,3)=%,$P(^DG(43,1,"PCON",PSAV,0),U,6)="Y",$P(^DG(43,1,"PCON",PSAV,0),U,7)=TOTAL
  1. ;
  1. Q
  1. ;
  1. LOGCON ;-- This function will create a log file entry in file 43
  1. ; if one does not exist.
  1. ;
  1. N RESULT,DATE,X,Y
  1. D NOW^%DTC S Y=% D DD^%DT S DATE=Y
  1. ;-- check if log entry is already present
  1. I $D(^DG(43,1,"PCL",0)) D G LOGCONQ
  1. . S RESULT=$P(^DG(43,1,"PCL",0),U,3)
  1. . S RESULT=RESULT+1,^DG(43,1,"PCL",RESULT,0)=">>> Provider Conversion Re-Started on "_DATE W !,^(0)
  1. . S $P(^DG(43,1,"PCL",0),U,3,4)=RESULT_"^"_RESULT
  1. ;
  1. ;-- add entry build, build header
  1. S DIE="^DG(43,",DA=1,DR="91///"_" Provider Conversion Log for MAS Files." D ^DIE K DIE,DA,DR
  1. S ^DG(43,1,"PCL",2,0)=">>> Provider Conversion Started on "_DATE W !,^(0)
  1. S ^DG(43,1,"PCL",3,0)=" Files : 2, 41.1, 44, 45, 45.7, 392 and 405" W !,^(0)
  1. S ^DG(43,1,"PCL",4,0)=""
  1. S $P(^DG(43,1,"PCL",0),U,3,4)="4^4"
  1. ;
  1. LOGCONQ Q
  1. ;
  1. NEWFILE(FILE) ;-- This function will add a information to the Provider
  1. ; Conversion Log for the file in (FILE).
  1. ; INPUT - FILE - The file number to print a header
  1. N SEQ,DATE,X,Y
  1. ;-- get the next sequence number for message
  1. S SEQ=$P($G(^DG(43,1,"PCL",0)),U,3)
  1. G:'SEQ NFQ
  1. ;-- get date/time
  1. D NOW^%DTC S Y=% D DD^%DT S DATE=Y
  1. S SEQ=SEQ+1,^DG(43,1,"PCL",SEQ,0)=""
  1. S SEQ=SEQ+1,^DG(43,1,"PCL",SEQ,0)=">>> Provider Conversion for the "_$O(^DD(FILE,0,"NM",0))_" (#"_FILE_") file :" W !!,^(0)
  1. S SEQ=SEQ+1,^DG(43,1,"PCL",SEQ,0)="Started on "_DATE W !?5,^(0)
  1. S $P(^DG(43,1,"PCL",0),U,3,4)=SEQ_U_SEQ
  1. NFQ Q
  1. ;
  1. COMFILE(FILE,OK) ;-- This function will add information to the Provider
  1. ; Conversion Log when a file has been processed.
  1. ; INPUT FILE - File currently being processsed
  1. ; OK - 1 if all entries converted, else 0
  1. N SEQ,DATE,X,Y
  1. ;-- get the next sequence number for message
  1. S SEQ=$P($G(^DG(43,1,"PCL",0)),U,3)
  1. G:'SEQ COMQ
  1. ;-- get date/time
  1. D NOW^%DTC S Y=% D DD^%DT S DATE=Y
  1. ;-- if all entries for a file converted write msg
  1. I OK S SEQ=SEQ+1,^DG(43,1,"PCL",SEQ,0)=" All entries converted." W !,^(0)
  1. S SEQ=SEQ+1,^DG(43,1,"PCL",SEQ,0)=">>> Provider Conversion for the "_$O(^DD(FILE,0,"NM",0))_" (#"_FILE_") file :" W !,^(0)
  1. S SEQ=SEQ+1,^DG(43,1,"PCL",SEQ,0)="Completed on "_DATE W !?5,^(0)
  1. S $P(^DG(43,1,"PCL",0),U,3,4)=SEQ_U_SEQ
  1. COMQ Q
  1. ;
  1. WRERROR(ERSTR) ;-- This function will write the error message to the
  1. ; Provider conversion log. The message will be format by the
  1. ; calling routine.
  1. ; INPUT : ERSTR - The error string to write into log file
  1. ;
  1. N SEQ
  1. ;-- get the next sequence number for message
  1. S SEQ=$P($G(^DG(43,1,"PCL",0)),U,3) Q:'SEQ
  1. S SEQ=SEQ+1,^DG(43,1,"PCL",SEQ,0)=ERSTR,$P(^DG(43,1,"PCL",0),U,3,4)=SEQ_U_SEQ
  1. W !,ERSTR
  1. Q
  1. ;
  1. DOMAIL ;-- This function will generate a Mailman message from the
  1. ; Provider Conversion Log field of file (#43). Lastly,
  1. ; if the message was sent, then the log entry in file #43
  1. ; will be deleted.
  1. ;
  1. K XMZ
  1. N DIFROM
  1. ;-- send mail message
  1. W !,">>> Generating mail message for Provider Conversion."
  1. S XMTEXT="^DG(43,1,""PCL"",",XMSUB="Provider Conversion Log.",XMDUZ=.5,XMY(DUZ)="",XMY(.5)=""
  1. D ^XMD
  1. I 'XMZ W !!,">>> Error Creating Provider Conversion Mail Message." G DOMAILQ
  1. ;-- clean-up log if message was sent
  1. S DIE="^DG(43,",DA=1,DR="91///@" D ^DIE K DIE,DA,DR
  1. ;
  1. DOMAILQ K XMTEXT,XMSUB,XMDUZ,XMY
  1. Q
  1. ;