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