SDRRC20 ;10N20/MAH - ENV/POST-INSTALL FOR PATCH SD*5.3*536 CONVERT PATIENT FILE ; 3/01/2008 12:24pm
;;5.3;PIMS;**1016**;JUN 30, 2012;Build 20
;;SDRR-RECALL REMINDER
Q
ENV ;Environment check
K ^XTMP("SDRRC20")
S XPDABORT=""
;checks programmer variables
D PROGCHK(.XPDABORT)
;check if install is running
D ISRUNING(.XPDABORT)
I XPDABORT="" K XPDABORT
POST ;Check for Clinic Recall PATIENTs file)
I '$D(^DIZ(687065)) D Q
. D NOFILE
D CHECKDD
I DDISSUE=1 K DDISSUE,PFLAG,PFLAG1 Q
K DDISSUE,PFLAG,PFLAG1
D TASK
Q
START ;Background job entry point
N SDAIEN,SDANUSB,SDX,SDFDAIEN,SDARAY,SDERAY,SDSAVE,SDRRREC,SDRRFDA,TOTAL
N SDTOT,SDTOT2,SDTOT3,SDENCPTR,SDCKCNT,SDRRSTOP,SDENT,SDFIL,DFN,PATIENT
S TOTAL=0
D XTMP
;seed var's if Re-Run
I $D(^XTMP("SDRRC20","TOT")) D
. S SDTOT=+$G(^XTMP("SDRRC20","TOT"))
. S (SDSAVE,SDAIEN)=+$G(^XTMP("SDRRC20","PATIENT"))
E D
. S SDAIEN=0 F S SDAIEN=$O(^DIZ(687065,SDAIEN)) Q:SDAIEN<1 S SDRRREC=$G(^DIZ(687065,SDAIEN,0)) D
. .Q:$P($G(SDRRREC),U,6)=""
. .S SDRRFDA(403.5,"+1,",.01)=$P(SDRRREC,U,1)
. .S SDRRFDA(403.5,"+1,",2)=$P(SDRRREC,U,3)
. .S SDRRFDA(403.5,"+1,",2.5)=$P(SDRRREC,U,7)
. .S SDRRFDA(403.5,"+1,",2.6)=$P(SDRRREC,U,8)
. .I $P($G(SDRRREC),U,4)'="" S SDRRFDA(403.5,"+1,",3)=$P($G(SDRRREC),U,4)
. .I $P($G(SDRRREC),U,5)'="" S SDRRFDA(403.5,"+1,",4)=$P($G(SDRRREC),U,5)
. .I $P($G(SDRRREC),U,2)'="" S SDRRFDA(403.5,"+1,",4.5)=$P($G(SDRRREC),U,2)
. .I $P($G(SDRRREC),U,9)'="" S SDRRFDA(403.5,"+1,",4.7)=$P($G(SDRRREC),U,9)
. .S SDRRFDA(403.5,"+1,",5)=$P($G(SDRRREC),U,6)
. .I $P($G(SDRRREC),U,10)'="" S SDRRFDA(403.5,"+1,",6)=$P($G(SDRRREC),U,10)
. .I $P($G(SDRRREC),U,11)'="" S SDRRFDA(403.5,"+1,",7)=$P($G(SDRRREC),U,11) ;WILL STUFF PROGRAMMER DUZ IF NOT ALREADY SET
. .N NEWREC S NEWREC(1)=SDAIEN
. .D UPDATE^DIE("","SDRRFDA","NEWREC")
. .S TOTAL=TOTAL+1
S ^XTMP("SDRRC20","COMPLETED")=$$NOW^XLFDT()
S ^XTMP("SDRRC20","TOT")=TOTAL
K ^XTMP("SDRRC20","RUNNING")
D SENDMSG
Q
SENDMSG ;send MailMan msg to patch installer
N DIFROM,SDMSG,SDTXT,SDLN,XMY,XMDUZ,XMSUB,XMTEXT,XMDUN,XMZ
K ^TMP("SDRRC20",$J)
S XMSUB="SD*5.3*536 OUTPATIENT CLINIC RECALL FILE CONVERSION REPORT"
S XMTEXT="^TMP(""SDRRC20"",$J,",XMDUZ=.5,(XMY(DUZ),XMY(XMDUZ))=""
S SDLN=0
D ADD(.SDLN,"Patch: SD*5.3*536 RECALL REMINDER FILE CONVERSION PROCESSING")
D ADD(.SDLN," "),ADD(.SDLN,"************")
D ADD(.SDLN,"The existing Class III file called OUTPATIENT CLINIC RECALL (687065), ")
D ADD(.SDLN,"which contains Clinic Recall ENTRIES have been converted to")
D ADD(.SDLN,"a new Class I file called Recall Reminder (403.5)")
D ADD(.SDLN,"which will provide the same functionality. If you have added")
D ADD(.SDLN,"any local site field to file 687065 they will not be moved over.")
D ADD(.SDLN,"************"),ADD(.SDLN," "),ADD(.SDLN," ")
D ADD(.SDLN,"SUMMARY OF PROCESSING RESULTS:")
D ADD(.SDLN,"==============================")
D ADD(.SDLN," ")
D ADD(.SDLN,"<<< The Class III OUTPATIENT CLINIC RECALL PATIENT File Conversion has "_$S(+$G(SDRRSTOP):"NOT ",1:"")_"Completed. >>>")
I +$G(SDRRSTOP) D
. D ADD(.SDLN," Please restart the post-install process from the following")
. D ADD(.SDLN," programmer's prompt:")
. D ADD(.SDLN," D POST^SDRRC20")
D ADD(.SDLN," "),ADD(.SDLN," ")
D ADD(.SDLN," DATE/TIME TASK STARTED: "_$$FMTE^XLFDT(+$G(^XTMP("SDRRC20","START")),"P"))
D ADD(.SDLN,"DATE/TIME TASK COMPLETED: "_$$FMTE^XLFDT(+$G(^XTMP("SDRRC20","COMPLETED")),"P"))
I $D(^XTMP("SDRRC20","LAST RUN")) D
. D ADD(.SDLN," DATE/TIME LAST RUN: "_$$FMTE^XLFDT(+$G(^XTMP("SDRRC20","LAST RUN")),"P"))
D ADD(.SDLN," "),ADD(.SDLN," ")
D ADD(.SDLN," TOTAL RECORDS THAT HAVE BEEN CONVERTED: "_+$G(^XTMP("SDRRC20","TOT")))
D ADD(.SDLN," <END OF REPORT> :")
D ^XMD
K ^TMP("SDRRC20",$J)
Q
ADD(SDLN,SDTXT) ;add line
Q:$L(SDTXT)'>0
S SDLN=$G(SDLN)+1
S ^TMP("SDRRC20",$J,SDLN)=SDTXT
Q
PROGCHK(XPDABORT) ;checks programmer variables
I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D
. D BMES^XPDUTL("******")
. D MES^XPDUTL("Your programming variables are not set up properly.")
. D MES^XPDUTL("Installation aborted.")
. D MES^XPDUTL("******")
. S XPDABORT=2
Q
ISRUNING(XPDABORT) ;check if running
I +$G(^XTMP("SDRRC20","RUNNING")) D
. D BMES^XPDUTL("******")
. D MES^XPDUTL("This patch is currently being Installed. Try later.")
. D MES^XPDUTL("Installation aborted...")
. D MES^XPDUTL("******")
. S XPDABORT=2
Q
NOFILE ;no File
D BMES^XPDUTL("******")
D MES^XPDUTL("The Class III Outpatient Clinic Recall File Conversion is NOT necessary because")
D MES^XPDUTL("file (#687065) does not exist on this system.")
D MES^XPDUTL("Post-Install process terminated...For conversion to Recall Reminder PATIENT (#403.5)")
D MES^XPDUTL("******")
Q
TASK ;run TaskMan
N ZTSK,ZTDTH,ZTRTN,ZTDESC,ZTIO,ZTSAVE,ZTREQ,ZTSTOP,SDSTOP
S SDSTOP=+$G(^XTMP("SDRRC20","STOPPED"))
S ZTRTN="START^SDRRC20"
S ZTDESC="SD*5.3*536 RECALL REMINDER PATIENT FILE CONVERSION PROCESSING"
S ZTIO="",ZTDTH=$H,ZTREQ="@",ZTSAVE("ZTREQ")=""
D ^%ZTLOAD
D BMES^XPDUTL("******")
I '$D(ZTSK) D
. D MES^XPDUTL("Unable to schedule TaskMan task to run the Class III (687065) File")
. D MES^XPDUTL("Conversion.")
. D BMES^XPDUTL("Please re-run Post-Install routine POST^SDRRC20 from")
. D MES^XPDUTL("the programmer prompt.")
. ;
E D
. D MES^XPDUTL("Task "_ZTSK_" has been "_$S(+SDSTOP:"Re-",1:"")_"started to run the Class III (687065) File")
. D MES^XPDUTL("Conversion.")
. I SDSTOP D
. . D MES^XPDUTL(" <<< The last task run was STOPPED on "_$$FMTE^XLFDT(SDSTOP,"P")_". >>>")
. D BMES^XPDUTL("You will receive a MailMan message when this task is completed")
. D MES^XPDUTL("or if it has been manually stopped.")
D MES^XPDUTL("******")
Q
XTMP ;setup ^XTMP to control output for 90 days
I $D(^XTMP("SDRRC20",0)) D
. S ^XTMP("SDRRC20","LAST RUN")=$G(^XTMP("SDRRC20","START"))
E D
. N SDX
. S SDX=$$FMADD^XLFDT($$NOW^XLFDT(),90)_U_$$NOW^XLFDT()
. S SDX=SDX_"^SD*5.3*536 RECALL REMINDER PATIENT FILE CONVERSION PROCESSING"
. S ^XTMP("SDRRC20",0)=SDX
S ^XTMP("SDRRC20","START")=$$NOW^XLFDT()
S ^XTMP("SDRRC20","RUNNING")="1"
Q
UPXTMP(SDENCPTR,NODE,SDENT) ;add to ^XTMP
; Input:
; NODE - Unique subscript
; Output: none
Q:'$G(SDENCPTR)
I $G(NODE)="" S NODE="UNKNOWN"
S ^XTMP("SDRRC20","TOT2",NODE,SDENCPTR)=$G(SDENT)
Q
CHECKDD ;CHECKS CURRENT FIELDS IN 687065
S (DDISSUE,PFLAG,PFLAG1)=""
S PFLAG=$P(^DD(687065,.01,0),U,2) I PFLAG'["RP2'" S DDISSUE=1 W !,"1 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,2,0),U,2) I PFLAG'["F" S DDISSUE=1 W !,"2 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,2.5,0),U,2) I PFLAG'["F" S DDISSUE=1 W !,"3 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,2.6,0),U,2),PFLAG1=$P(^DD(687065,2.6,0),U,3) I PFLAG'["S"!(PFLAG1'["f:FASTING;n:NON-FASTING") S DDISSUE=1 W !,"4 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,3,0),U,2) I PFLAG'["RP653204'" S DDISSUE=1 W !,"5 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,4,0),U,2) I PFLAG'["RP687067'" S DDISSUE=1 W !,"6 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,4.5,0),U,2) I PFLAG'["P44'" S DDISSUE=1 W !,"7 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,4.7,0),U,2) I PFLAG'["NJ3,0" S DDISSUE=1 W !,"8 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,5,0),U,2) I PFLAG'["RD" S DDISSUE=1 W !,"9 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,6,0),U,2) I PFLAG'["D" S DDISSUE=1 W !,"10 "_PFLAG G NOENTRY
S PFLAG=$P(^DD(687065,7,0),U,2) I PFLAG'["P200'" S DDISSUE=1 W !,"11 "_PFLAG G NOENTRY
Q
NOENTRY ;no File
D BMES^XPDUTL("******")
D MES^XPDUTL("The Class III Outpatient Clinic Recall File Conversion WILL NOT happen because")
D MES^XPDUTL("file (#687065) has DD changes to needed fields.")
D MES^XPDUTL("Post-Install process terminated...For conversion to Recall Reminder(#403.5)")
D MES^XPDUTL("******")
Q
SDRRC20 ;10N20/MAH - ENV/POST-INSTALL FOR PATCH SD*5.3*536 CONVERT PATIENT FILE ; 3/01/2008 12:24pm
+1 ;;5.3;PIMS;**1016**;JUN 30, 2012;Build 20
+2 ;;SDRR-RECALL REMINDER
+3 QUIT
ENV ;Environment check
+1 KILL ^XTMP("SDRRC20")
+2 SET XPDABORT=""
+3 ;checks programmer variables
+4 DO PROGCHK(.XPDABORT)
+5 ;check if install is running
+6 DO ISRUNING(.XPDABORT)
+7 IF XPDABORT=""
KILL XPDABORT
POST ;Check for Clinic Recall PATIENTs file)
+1 IF '$DATA(^DIZ(687065))
Begin DoDot:1
+2 DO NOFILE
End DoDot:1
QUIT
+3 DO CHECKDD
+4 IF DDISSUE=1
KILL DDISSUE,PFLAG,PFLAG1
QUIT
+5 KILL DDISSUE,PFLAG,PFLAG1
+6 DO TASK
+7 QUIT
START ;Background job entry point
+1 NEW SDAIEN,SDANUSB,SDX,SDFDAIEN,SDARAY,SDERAY,SDSAVE,SDRRREC,SDRRFDA,TOTAL
+2 NEW SDTOT,SDTOT2,SDTOT3,SDENCPTR,SDCKCNT,SDRRSTOP,SDENT,SDFIL,DFN,PATIENT
+3 SET TOTAL=0
+4 DO XTMP
+5 ;seed var's if Re-Run
+6 IF $DATA(^XTMP("SDRRC20","TOT"))
Begin DoDot:1
+7 SET SDTOT=+$GET(^XTMP("SDRRC20","TOT"))
+8 SET (SDSAVE,SDAIEN)=+$GET(^XTMP("SDRRC20","PATIENT"))
End DoDot:1
+9 IF '$TEST
Begin DoDot:1
+10 SET SDAIEN=0
FOR
SET SDAIEN=$ORDER(^DIZ(687065,SDAIEN))
IF SDAIEN<1
QUIT
SET SDRRREC=$GET(^DIZ(687065,SDAIEN,0))
Begin DoDot:2
+11 IF $PIECE($GET(SDRRREC),U,6)=""
QUIT
+12 SET SDRRFDA(403.5,"+1,",.01)=$PIECE(SDRRREC,U,1)
+13 SET SDRRFDA(403.5,"+1,",2)=$PIECE(SDRRREC,U,3)
+14 SET SDRRFDA(403.5,"+1,",2.5)=$PIECE(SDRRREC,U,7)
+15 SET SDRRFDA(403.5,"+1,",2.6)=$PIECE(SDRRREC,U,8)
+16 IF $PIECE($GET(SDRRREC),U,4)'=""
SET SDRRFDA(403.5,"+1,",3)=$PIECE($GET(SDRRREC),U,4)
+17 IF $PIECE($GET(SDRRREC),U,5)'=""
SET SDRRFDA(403.5,"+1,",4)=$PIECE($GET(SDRRREC),U,5)
+18 IF $PIECE($GET(SDRRREC),U,2)'=""
SET SDRRFDA(403.5,"+1,",4.5)=$PIECE($GET(SDRRREC),U,2)
+19 IF $PIECE($GET(SDRRREC),U,9)'=""
SET SDRRFDA(403.5,"+1,",4.7)=$PIECE($GET(SDRRREC),U,9)
+20 SET SDRRFDA(403.5,"+1,",5)=$PIECE($GET(SDRRREC),U,6)
+21 IF $PIECE($GET(SDRRREC),U,10)'=""
SET SDRRFDA(403.5,"+1,",6)=$PIECE($GET(SDRRREC),U,10)
+22 ;WILL STUFF PROGRAMMER DUZ IF NOT ALREADY SET
IF $PIECE($GET(SDRRREC),U,11)'=""
SET SDRRFDA(403.5,"+1,",7)=$PIECE($GET(SDRRREC),U,11)
+23 NEW NEWREC
SET NEWREC(1)=SDAIEN
+24 DO UPDATE^DIE("","SDRRFDA","NEWREC")
+25 SET TOTAL=TOTAL+1
End DoDot:2
End DoDot:1
+26 SET ^XTMP("SDRRC20","COMPLETED")=$$NOW^XLFDT()
+27 SET ^XTMP("SDRRC20","TOT")=TOTAL
+28 KILL ^XTMP("SDRRC20","RUNNING")
+29 DO SENDMSG
+30 QUIT
SENDMSG ;send MailMan msg to patch installer
+1 NEW DIFROM,SDMSG,SDTXT,SDLN,XMY,XMDUZ,XMSUB,XMTEXT,XMDUN,XMZ
+2 KILL ^TMP("SDRRC20",$JOB)
+3 SET XMSUB="SD*5.3*536 OUTPATIENT CLINIC RECALL FILE CONVERSION REPORT"
+4 SET XMTEXT="^TMP(""SDRRC20"",$J,"
SET XMDUZ=.5
SET (XMY(DUZ),XMY(XMDUZ))=""
+5 SET SDLN=0
+6 DO ADD(.SDLN,"Patch: SD*5.3*536 RECALL REMINDER FILE CONVERSION PROCESSING")
+7 DO ADD(.SDLN," ")
DO ADD(.SDLN,"************")
+8 DO ADD(.SDLN,"The existing Class III file called OUTPATIENT CLINIC RECALL (687065), ")
+9 DO ADD(.SDLN,"which contains Clinic Recall ENTRIES have been converted to")
+10 DO ADD(.SDLN,"a new Class I file called Recall Reminder (403.5)")
+11 DO ADD(.SDLN,"which will provide the same functionality. If you have added")
+12 DO ADD(.SDLN,"any local site field to file 687065 they will not be moved over.")
+13 DO ADD(.SDLN,"************")
DO ADD(.SDLN," ")
DO ADD(.SDLN," ")
+14 DO ADD(.SDLN,"SUMMARY OF PROCESSING RESULTS:")
+15 DO ADD(.SDLN,"==============================")
+16 DO ADD(.SDLN," ")
+17 DO ADD(.SDLN,"<<< The Class III OUTPATIENT CLINIC RECALL PATIENT File Conversion has "_$SELECT(+$GET(SDRRSTOP):"NOT ",1:"")_"Completed. >>>")
+18 IF +$GET(SDRRSTOP)
Begin DoDot:1
+19 DO ADD(.SDLN," Please restart the post-install process from the following")
+20 DO ADD(.SDLN," programmer's prompt:")
+21 DO ADD(.SDLN," D POST^SDRRC20")
End DoDot:1
+22 DO ADD(.SDLN," ")
DO ADD(.SDLN," ")
+23 DO ADD(.SDLN," DATE/TIME TASK STARTED: "_$$FMTE^XLFDT(+$GET(^XTMP("SDRRC20","START")),"P"))
+24 DO ADD(.SDLN,"DATE/TIME TASK COMPLETED: "_$$FMTE^XLFDT(+$GET(^XTMP("SDRRC20","COMPLETED")),"P"))
+25 IF $DATA(^XTMP("SDRRC20","LAST RUN"))
Begin DoDot:1
+26 DO ADD(.SDLN," DATE/TIME LAST RUN: "_$$FMTE^XLFDT(+$GET(^XTMP("SDRRC20","LAST RUN")),"P"))
End DoDot:1
+27 DO ADD(.SDLN," ")
DO ADD(.SDLN," ")
+28 DO ADD(.SDLN," TOTAL RECORDS THAT HAVE BEEN CONVERTED: "_+$GET(^XTMP("SDRRC20","TOT")))
+29 DO ADD(.SDLN," <END OF REPORT> :")
+30 DO ^XMD
+31 KILL ^TMP("SDRRC20",$JOB)
+32 QUIT
ADD(SDLN,SDTXT) ;add line
+1 IF $LENGTH(SDTXT)'>0
QUIT
+2 SET SDLN=$GET(SDLN)+1
+3 SET ^TMP("SDRRC20",$JOB,SDLN)=SDTXT
+4 QUIT
PROGCHK(XPDABORT) ;checks programmer variables
+1 IF '$GET(DUZ)!($GET(DUZ(0))'="@")!('$GET(DT))!($GET(U)'="^")
Begin DoDot:1
+2 DO BMES^XPDUTL("******")
+3 DO MES^XPDUTL("Your programming variables are not set up properly.")
+4 DO MES^XPDUTL("Installation aborted.")
+5 DO MES^XPDUTL("******")
+6 SET XPDABORT=2
End DoDot:1
+7 QUIT
ISRUNING(XPDABORT) ;check if running
+1 IF +$GET(^XTMP("SDRRC20","RUNNING"))
Begin DoDot:1
+2 DO BMES^XPDUTL("******")
+3 DO MES^XPDUTL("This patch is currently being Installed. Try later.")
+4 DO MES^XPDUTL("Installation aborted...")
+5 DO MES^XPDUTL("******")
+6 SET XPDABORT=2
End DoDot:1
+7 QUIT
NOFILE ;no File
+1 DO BMES^XPDUTL("******")
+2 DO MES^XPDUTL("The Class III Outpatient Clinic Recall File Conversion is NOT necessary because")
+3 DO MES^XPDUTL("file (#687065) does not exist on this system.")
+4 DO MES^XPDUTL("Post-Install process terminated...For conversion to Recall Reminder PATIENT (#403.5)")
+5 DO MES^XPDUTL("******")
+6 QUIT
TASK ;run TaskMan
+1 NEW ZTSK,ZTDTH,ZTRTN,ZTDESC,ZTIO,ZTSAVE,ZTREQ,ZTSTOP,SDSTOP
+2 SET SDSTOP=+$GET(^XTMP("SDRRC20","STOPPED"))
+3 SET ZTRTN="START^SDRRC20"
+4 SET ZTDESC="SD*5.3*536 RECALL REMINDER PATIENT FILE CONVERSION PROCESSING"
+5 SET ZTIO=""
SET ZTDTH=$HOROLOG
SET ZTREQ="@"
SET ZTSAVE("ZTREQ")=""
+6 DO ^%ZTLOAD
+7 DO BMES^XPDUTL("******")
+8 IF '$DATA(ZTSK)
Begin DoDot:1
+9 DO MES^XPDUTL("Unable to schedule TaskMan task to run the Class III (687065) File")
+10 DO MES^XPDUTL("Conversion.")
+11 DO BMES^XPDUTL("Please re-run Post-Install routine POST^SDRRC20 from")
+12 DO MES^XPDUTL("the programmer prompt.")
+13 ;
End DoDot:1
+14 IF '$TEST
Begin DoDot:1
+15 DO MES^XPDUTL("Task "_ZTSK_" has been "_$SELECT(+SDSTOP:"Re-",1:"")_"started to run the Class III (687065) File")
+16 DO MES^XPDUTL("Conversion.")
+17 IF SDSTOP
Begin DoDot:2
+18 DO MES^XPDUTL(" <<< The last task run was STOPPED on "_$$FMTE^XLFDT(SDSTOP,"P")_". >>>")
End DoDot:2
+19 DO BMES^XPDUTL("You will receive a MailMan message when this task is completed")
+20 DO MES^XPDUTL("or if it has been manually stopped.")
End DoDot:1
+21 DO MES^XPDUTL("******")
+22 QUIT
XTMP ;setup ^XTMP to control output for 90 days
+1 IF $DATA(^XTMP("SDRRC20",0))
Begin DoDot:1
+2 SET ^XTMP("SDRRC20","LAST RUN")=$GET(^XTMP("SDRRC20","START"))
End DoDot:1
+3 IF '$TEST
Begin DoDot:1
+4 NEW SDX
+5 SET SDX=$$FMADD^XLFDT($$NOW^XLFDT(),90)_U_$$NOW^XLFDT()
+6 SET SDX=SDX_"^SD*5.3*536 RECALL REMINDER PATIENT FILE CONVERSION PROCESSING"
+7 SET ^XTMP("SDRRC20",0)=SDX
End DoDot:1
+8 SET ^XTMP("SDRRC20","START")=$$NOW^XLFDT()
+9 SET ^XTMP("SDRRC20","RUNNING")="1"
+10 QUIT
UPXTMP(SDENCPTR,NODE,SDENT) ;add to ^XTMP
+1 ; Input:
+2 ; NODE - Unique subscript
+3 ; Output: none
+4 IF '$GET(SDENCPTR)
QUIT
+5 IF $GET(NODE)=""
SET NODE="UNKNOWN"
+6 SET ^XTMP("SDRRC20","TOT2",NODE,SDENCPTR)=$GET(SDENT)
+7 QUIT
CHECKDD ;CHECKS CURRENT FIELDS IN 687065
+1 SET (DDISSUE,PFLAG,PFLAG1)=""
+2 SET PFLAG=$PIECE(^DD(687065,.01,0),U,2)
IF PFLAG'["RP2'"
SET DDISSUE=1
WRITE !,"1 "_PFLAG
GOTO NOENTRY
+3 SET PFLAG=$PIECE(^DD(687065,2,0),U,2)
IF PFLAG'["F"
SET DDISSUE=1
WRITE !,"2 "_PFLAG
GOTO NOENTRY
+4 SET PFLAG=$PIECE(^DD(687065,2.5,0),U,2)
IF PFLAG'["F"
SET DDISSUE=1
WRITE !,"3 "_PFLAG
GOTO NOENTRY
+5 SET PFLAG=$PIECE(^DD(687065,2.6,0),U,2)
SET PFLAG1=$PIECE(^DD(687065,2.6,0),U,3)
IF PFLAG'["S"!(PFLAG1'["f:FASTING;n:NON-FASTING")
SET DDISSUE=1
WRITE !,"4 "_PFLAG
GOTO NOENTRY
+6 SET PFLAG=$PIECE(^DD(687065,3,0),U,2)
IF PFLAG'["RP653204'"
SET DDISSUE=1
WRITE !,"5 "_PFLAG
GOTO NOENTRY
+7 SET PFLAG=$PIECE(^DD(687065,4,0),U,2)
IF PFLAG'["RP687067'"
SET DDISSUE=1
WRITE !,"6 "_PFLAG
GOTO NOENTRY
+8 SET PFLAG=$PIECE(^DD(687065,4.5,0),U,2)
IF PFLAG'["P44'"
SET DDISSUE=1
WRITE !,"7 "_PFLAG
GOTO NOENTRY
+9 SET PFLAG=$PIECE(^DD(687065,4.7,0),U,2)
IF PFLAG'["NJ3,0"
SET DDISSUE=1
WRITE !,"8 "_PFLAG
GOTO NOENTRY
+10 SET PFLAG=$PIECE(^DD(687065,5,0),U,2)
IF PFLAG'["RD"
SET DDISSUE=1
WRITE !,"9 "_PFLAG
GOTO NOENTRY
+11 SET PFLAG=$PIECE(^DD(687065,6,0),U,2)
IF PFLAG'["D"
SET DDISSUE=1
WRITE !,"10 "_PFLAG
GOTO NOENTRY
+12 SET PFLAG=$PIECE(^DD(687065,7,0),U,2)
IF PFLAG'["P200'"
SET DDISSUE=1
WRITE !,"11 "_PFLAG
GOTO NOENTRY
+13 QUIT
NOENTRY ;no File
+1 DO BMES^XPDUTL("******")
+2 DO MES^XPDUTL("The Class III Outpatient Clinic Recall File Conversion WILL NOT happen because")
+3 DO MES^XPDUTL("file (#687065) has DD changes to needed fields.")
+4 DO MES^XPDUTL("Post-Install process terminated...For conversion to Recall Reminder(#403.5)")
+5 DO MES^XPDUTL("******")
+6 QUIT