PSONVAP3 ;HPS/DSK - Non-VA Provider Updates ;June 26, 2018 11:20
;;7.0;OUTPATIENT PHARMACY;**481**;DEC 1997;Build 31
;
;continuation of routine PSONVAP2
;
;EXTERNAL REFERENCES
; ^XUSEC - IA #10076 (Supported)
; $$SENDMSG^XMXAPI - IA #2729 (Supported)
; $$SETUP1^XQALERT - IA #10081 (Supported)
;
Q
;
MAIL ;Send mail messages to holders of PSDMGR key
;variable for alerts must be XQA
N TYPE,PSOMESNUM,PSOUSER,PSOMY,PSOALMSG,XQA
S PSOUSER=0
F S PSOUSER=$O(^XUSEC("PSDMGR",PSOUSER)) Q:PSOUSER="" S PSOMY(PSOUSER)=""
;
S PSOMESNUM=$$MSEND("SUCCESS")
I PSOMESNUM D
. S PSOALMSG="MailMan message #"_PSOMESNUM_" lists providers successfully loaded"
. D ALERT(PSOALMSG)
S PSOMESNUM=$$MSEND("PROBLEM")
I PSOMESNUM D
. S PSOALMSG="MailMan message #"_PSOMESNUM_" lists providers with filing issues"
. D ALERT(PSOALMSG)
S PSOMESNUM=$$MSEND("PRENPI")
I PSOMESNUM D
. S PSOALMSG="MailMan message #"_PSOMESNUM_" lists provider NPI's already on file"
. D ALERT(PSOALMSG)
S PSOMESNUM=$$MSEND("DUPNPI")
I PSOMESNUM D
. S PSOALMSG="MailMan message #"_PSOMESNUM_" lists provider NPI's in spreadsheet multiple times"
. D ALERT(PSOALMSG)
S PSOMESNUM=$$MSEND("DUPNAME")
I PSOMESNUM D
. S PSOALMSG="MailMan message #"_PSOMESNUM_" lists providers for which name is already on file"
. D ALERT(PSOALMSG)
Q
;
MSEND(TYPE) ;Send local e-mail
;
N DIFROM,PSOA,PSOB,PSOTEXT,PSODUZ,PSOSUB,PSOTEXT,PSOMZ,PSOMIN,PSOSTR,PSOHIT,PSOSTR2
N PSOPAD,PSOMAIL
S PSOPAD=" "
S PSOMAIL="PSO_MAIL "_TYPE_" "_PSOJOB
;
;Keeping MailMessages in ^XTMP for 60 days in case needed later
S ^XTMP(PSOMAIL,0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^Non-VA Provider Update Mail Message - "_TYPE
;
S PSOHIT=0
; Returns: Message number
I TYPE="SUCCESS" D
. S PSOSUB="VACAA: Filing Success"
. S PSOHIT=1
. S ^XTMP(PSOMAIL,1)="This message lists new Non-VA Providers successfully uploaded into the VistA"
. S ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) for VACAA."
. S ^XTMP(PSOMAIL,3)=" "
. I $O(^XTMP(PSOJOB,PSODT,"SUCCESS",PSOTM,0))="" D Q
. . S ^XTMP(PSOMAIL,4)=" "
. . S ^XTMP(PSOMAIL,5)="**** NO NEW PROVIDERS SUCCESSFULLY UPLOADED ****"
. . S ^XTMP(PSOMAIL,6)="**** SEE SEPARATE MESSAGES CONCERNING FILING PROBLEMS ****"
. . S ^XTMP(PSOMAIL,7)="**** AND INFORMATION ON PROVIDERS WHICH ARE ALREADY ON FILE ****"
. . S ^XTMP(PSOMAIL,8)=" "
. S ^XTMP(PSOMAIL,4)="IEN Provider"
. S ^XTMP(PSOMAIL,5)="------------ -----------------------------------"
. S PSOB=6
. S PSOA=0 F S PSOA=$O(^XTMP(PSOJOB,PSODT,"SUCCESS",PSOTM,PSOA)) Q:PSOA="" D
. . S ^XTMP(PSOMAIL,PSOB)=$G(^XTMP(PSOJOB,PSODT,"SUCCESS",PSOTM,PSOA))
. . S PSOB=PSOB+1
I TYPE="PROBLEM",$O(^XTMP(PSOJOB,PSODT,"PROBLEM",PSOTM,0)) D
. S PSOHIT=1
. S PSOSUB="VACAA: Filing Problem(s)"
. S ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider(s) that failed to load into the VistA"
. S ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) for VACAA (described below)."
. S ^XTMP(PSOMAIL,3)=" "
. S ^XTMP(PSOMAIL,4)="A provider might be listed in both the SUCCESS and PROBLEM messages"
. S ^XTMP(PSOMAIL,5)="if not all fields in the NEW PERSON (#200) file were able to be populated."
. S ^XTMP(PSOMAIL,6)=" "
. S ^XTMP(PSOMAIL,7)="Error Message Provider"
. S ^XTMP(PSOMAIL,8)="------------- ---------------------"
. S PSOB=9
. S PSOA=0 F S PSOA=$O(^XTMP(PSOJOB,PSODT,"PROBLEM",PSOTM,PSOA)) Q:PSOA="" D
. . S ^XTMP(PSOMAIL,PSOB)=$G(^XTMP(PSOJOB,PSODT,"PROBLEM",PSOTM,PSOA))
. . S PSOB=PSOB+1
I TYPE="PRENPI",$O(^XTMP(PSOJOB,PSODT,"PRENPI",PSOTM,0)) D
. S PSOHIT=1
. S PSOSUB="VACAA: NPI(s) Already On File"
. S ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider(s) that failed to load into the VistA"
. S ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) because the NPI was already on file."
. S ^XTMP(PSOMAIL,3)=" "
. S ^XTMP(PSOMAIL,4)="NPI Provider"
. S ^XTMP(PSOMAIL,5)="---------- --------------------"
. S PSOB=6
. S PSOA=0 F S PSOA=$O(^XTMP(PSOJOB,PSODT,"PRENPI",PSOTM,PSOA)) Q:PSOA="" D
. . S PSOSTR=$G(^XTMP(PSOJOB,PSODT,"PRENPI",PSOTM,PSOA))
. . S ^XTMP(PSOMAIL,PSOB)=$P(PSOSTR,",",12)_" "_$P(PSOSTR,",",1,2)
. . S PSOB=PSOB+1
I TYPE="DUPNPI",$O(^XTMP(PSOJOB,PSODT,"DUPNPI",PSOTM,0)) D
. S PSOHIT=1
. S PSOSUB="VACAA: NPI(s) Listed Multiple Times in Spreadsheet"
. S ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider data that failed to load into the VistA"
. S ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) because the NPI was listed in the spreadsheet multiple"
. S ^XTMP(PSOMAIL,3)="times - possibly under multiple addresses."
. S ^XTMP(PSOMAIL,4)=" "
. S ^XTMP(PSOMAIL,5)="NPI Provider Street Address"
. S ^XTMP(PSOMAIL,6)="---------- -------------------- -------------------"
. S PSOB=7
. S PSOA=0 F S PSOA=$O(^XTMP(PSOJOB,PSODT,"DUPNPI",PSOTM,PSOA)) Q:PSOA="" D
. . S PSOSTR=$G(^XTMP(PSOJOB,PSODT,"DUPNPI",PSOTM,PSOA)),PSOSTR2=$E($P(PSOSTR,",",1,2),1,20)
. . S ^XTMP(PSOMAIL,PSOB)=$P(PSOSTR,",",12)_" "_PSOSTR2
. . S ^XTMP(PSOMAIL,PSOB)=^XTMP(PSOMAIL,PSOB)_$S($L(PSOSTR2)<20:$E(PSOPAD,1,20-$L(PSOSTR2)),1:"")_" "_$P(PSOSTR,",",6)
. . S PSOB=PSOB+1
I TYPE="DUPNAME",$O(^XTMP(PSOJOB,PSODT,"DUPNAME",PSOTM,0)) D
. S PSOHIT=1
. S PSOSUB="VACAA: Name(s) already on file in the New Person (#200) file"
. S ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider data that failed to load into the VistA"
. S ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) because the name is already on file"
. S ^XTMP(PSOMAIL,3)=" "
. S ^XTMP(PSOMAIL,4)="NPI Provider Street Address"
. S ^XTMP(PSOMAIL,5)="---------- -------------------- -------------------"
. S PSOB=6
. S PSOA=0 F S PSOA=$O(^XTMP(PSOJOB,PSODT,"DUPNAME",PSOTM,PSOA)) Q:PSOA="" D
. . S PSOSTR=$G(^XTMP(PSOJOB,PSODT,"DUPNAME",PSOTM,PSOA)),PSOSTR2=$E($P(PSOSTR,",",1,2),1,20)
. . S ^XTMP(PSOMAIL,PSOB)=$P(PSOSTR,",",12)_" "_PSOSTR2
. . S ^XTMP(PSOMAIL,PSOB)=^XTMP(PSOMAIL,PSOB)_$S($L(PSOSTR2)<20:$E(PSOPAD,1,20-$L(PSOSTR2)),1:"")_" "_$P(PSOSTR,",",6)
. . S PSOB=PSOB+1
I 'PSOHIT Q 0
S PSODUZ=PSOSAVDUZ
S PSOTEXT="^XTMP(""PSO_MAIL ""_TYPE_"" ""_PSOJOB)"
S PSOMIN("FROM")="Non-VA Provider Updates"
D SENDMSG^XMXAPI(PSODUZ,PSOSUB,PSOTEXT,.PSOMY,.PSOMIN,.PSOMZ,"")
Q $G(PSOMZ)
;
ALERT(XQAMSG) ;send alerts
;variables must be prefixed with "X"
N XQAID,XALERT
S XQAID="Non-VA Provider Updates"
M XQA=PSOMY
S XALERT=$$SETUP1^XQALERT
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSONVAP3 6735 printed Nov 22, 2024@17:41:34 Page 2
PSONVAP3 ;HPS/DSK - Non-VA Provider Updates ;June 26, 2018 11:20
+1 ;;7.0;OUTPATIENT PHARMACY;**481**;DEC 1997;Build 31
+2 ;
+3 ;continuation of routine PSONVAP2
+4 ;
+5 ;EXTERNAL REFERENCES
+6 ; ^XUSEC - IA #10076 (Supported)
+7 ; $$SENDMSG^XMXAPI - IA #2729 (Supported)
+8 ; $$SETUP1^XQALERT - IA #10081 (Supported)
+9 ;
+10 QUIT
+11 ;
MAIL ;Send mail messages to holders of PSDMGR key
+1 ;variable for alerts must be XQA
+2 NEW TYPE,PSOMESNUM,PSOUSER,PSOMY,PSOALMSG,XQA
+3 SET PSOUSER=0
+4 FOR
SET PSOUSER=$ORDER(^XUSEC("PSDMGR",PSOUSER))
if PSOUSER=""
QUIT
SET PSOMY(PSOUSER)=""
+5 ;
+6 SET PSOMESNUM=$$MSEND("SUCCESS")
+7 IF PSOMESNUM
Begin DoDot:1
+8 SET PSOALMSG="MailMan message #"_PSOMESNUM_" lists providers successfully loaded"
+9 DO ALERT(PSOALMSG)
End DoDot:1
+10 SET PSOMESNUM=$$MSEND("PROBLEM")
+11 IF PSOMESNUM
Begin DoDot:1
+12 SET PSOALMSG="MailMan message #"_PSOMESNUM_" lists providers with filing issues"
+13 DO ALERT(PSOALMSG)
End DoDot:1
+14 SET PSOMESNUM=$$MSEND("PRENPI")
+15 IF PSOMESNUM
Begin DoDot:1
+16 SET PSOALMSG="MailMan message #"_PSOMESNUM_" lists provider NPI's already on file"
+17 DO ALERT(PSOALMSG)
End DoDot:1
+18 SET PSOMESNUM=$$MSEND("DUPNPI")
+19 IF PSOMESNUM
Begin DoDot:1
+20 SET PSOALMSG="MailMan message #"_PSOMESNUM_" lists provider NPI's in spreadsheet multiple times"
+21 DO ALERT(PSOALMSG)
End DoDot:1
+22 SET PSOMESNUM=$$MSEND("DUPNAME")
+23 IF PSOMESNUM
Begin DoDot:1
+24 SET PSOALMSG="MailMan message #"_PSOMESNUM_" lists providers for which name is already on file"
+25 DO ALERT(PSOALMSG)
End DoDot:1
+26 QUIT
+27 ;
MSEND(TYPE) ;Send local e-mail
+1 ;
+2 NEW DIFROM,PSOA,PSOB,PSOTEXT,PSODUZ,PSOSUB,PSOTEXT,PSOMZ,PSOMIN,PSOSTR,PSOHIT,PSOSTR2
+3 NEW PSOPAD,PSOMAIL
+4 SET PSOPAD=" "
+5 SET PSOMAIL="PSO_MAIL "_TYPE_" "_PSOJOB
+6 ;
+7 ;Keeping MailMessages in ^XTMP for 60 days in case needed later
+8 SET ^XTMP(PSOMAIL,0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^Non-VA Provider Update Mail Message - "_TYPE
+9 ;
+10 SET PSOHIT=0
+11 ; Returns: Message number
+12 IF TYPE="SUCCESS"
Begin DoDot:1
+13 SET PSOSUB="VACAA: Filing Success"
+14 SET PSOHIT=1
+15 SET ^XTMP(PSOMAIL,1)="This message lists new Non-VA Providers successfully uploaded into the VistA"
+16 SET ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) for VACAA."
+17 SET ^XTMP(PSOMAIL,3)=" "
+18 IF $ORDER(^XTMP(PSOJOB,PSODT,"SUCCESS",PSOTM,0))=""
Begin DoDot:2
+19 SET ^XTMP(PSOMAIL,4)=" "
+20 SET ^XTMP(PSOMAIL,5)="**** NO NEW PROVIDERS SUCCESSFULLY UPLOADED ****"
+21 SET ^XTMP(PSOMAIL,6)="**** SEE SEPARATE MESSAGES CONCERNING FILING PROBLEMS ****"
+22 SET ^XTMP(PSOMAIL,7)="**** AND INFORMATION ON PROVIDERS WHICH ARE ALREADY ON FILE ****"
+23 SET ^XTMP(PSOMAIL,8)=" "
End DoDot:2
QUIT
+24 SET ^XTMP(PSOMAIL,4)="IEN Provider"
+25 SET ^XTMP(PSOMAIL,5)="------------ -----------------------------------"
+26 SET PSOB=6
+27 SET PSOA=0
FOR
SET PSOA=$ORDER(^XTMP(PSOJOB,PSODT,"SUCCESS",PSOTM,PSOA))
if PSOA=""
QUIT
Begin DoDot:2
+28 SET ^XTMP(PSOMAIL,PSOB)=$GET(^XTMP(PSOJOB,PSODT,"SUCCESS",PSOTM,PSOA))
+29 SET PSOB=PSOB+1
End DoDot:2
End DoDot:1
+30 IF TYPE="PROBLEM"
IF $ORDER(^XTMP(PSOJOB,PSODT,"PROBLEM",PSOTM,0))
Begin DoDot:1
+31 SET PSOHIT=1
+32 SET PSOSUB="VACAA: Filing Problem(s)"
+33 SET ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider(s) that failed to load into the VistA"
+34 SET ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) for VACAA (described below)."
+35 SET ^XTMP(PSOMAIL,3)=" "
+36 SET ^XTMP(PSOMAIL,4)="A provider might be listed in both the SUCCESS and PROBLEM messages"
+37 SET ^XTMP(PSOMAIL,5)="if not all fields in the NEW PERSON (#200) file were able to be populated."
+38 SET ^XTMP(PSOMAIL,6)=" "
+39 SET ^XTMP(PSOMAIL,7)="Error Message Provider"
+40 SET ^XTMP(PSOMAIL,8)="------------- ---------------------"
+41 SET PSOB=9
+42 SET PSOA=0
FOR
SET PSOA=$ORDER(^XTMP(PSOJOB,PSODT,"PROBLEM",PSOTM,PSOA))
if PSOA=""
QUIT
Begin DoDot:2
+43 SET ^XTMP(PSOMAIL,PSOB)=$GET(^XTMP(PSOJOB,PSODT,"PROBLEM",PSOTM,PSOA))
+44 SET PSOB=PSOB+1
End DoDot:2
End DoDot:1
+45 IF TYPE="PRENPI"
IF $ORDER(^XTMP(PSOJOB,PSODT,"PRENPI",PSOTM,0))
Begin DoDot:1
+46 SET PSOHIT=1
+47 SET PSOSUB="VACAA: NPI(s) Already On File"
+48 SET ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider(s) that failed to load into the VistA"
+49 SET ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) because the NPI was already on file."
+50 SET ^XTMP(PSOMAIL,3)=" "
+51 SET ^XTMP(PSOMAIL,4)="NPI Provider"
+52 SET ^XTMP(PSOMAIL,5)="---------- --------------------"
+53 SET PSOB=6
+54 SET PSOA=0
FOR
SET PSOA=$ORDER(^XTMP(PSOJOB,PSODT,"PRENPI",PSOTM,PSOA))
if PSOA=""
QUIT
Begin DoDot:2
+55 SET PSOSTR=$GET(^XTMP(PSOJOB,PSODT,"PRENPI",PSOTM,PSOA))
+56 SET ^XTMP(PSOMAIL,PSOB)=$PIECE(PSOSTR,",",12)_" "_$PIECE(PSOSTR,",",1,2)
+57 SET PSOB=PSOB+1
End DoDot:2
End DoDot:1
+58 IF TYPE="DUPNPI"
IF $ORDER(^XTMP(PSOJOB,PSODT,"DUPNPI",PSOTM,0))
Begin DoDot:1
+59 SET PSOHIT=1
+60 SET PSOSUB="VACAA: NPI(s) Listed Multiple Times in Spreadsheet"
+61 SET ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider data that failed to load into the VistA"
+62 SET ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) because the NPI was listed in the spreadsheet multiple"
+63 SET ^XTMP(PSOMAIL,3)="times - possibly under multiple addresses."
+64 SET ^XTMP(PSOMAIL,4)=" "
+65 SET ^XTMP(PSOMAIL,5)="NPI Provider Street Address"
+66 SET ^XTMP(PSOMAIL,6)="---------- -------------------- -------------------"
+67 SET PSOB=7
+68 SET PSOA=0
FOR
SET PSOA=$ORDER(^XTMP(PSOJOB,PSODT,"DUPNPI",PSOTM,PSOA))
if PSOA=""
QUIT
Begin DoDot:2
+69 SET PSOSTR=$GET(^XTMP(PSOJOB,PSODT,"DUPNPI",PSOTM,PSOA))
SET PSOSTR2=$EXTRACT($PIECE(PSOSTR,",",1,2),1,20)
+70 SET ^XTMP(PSOMAIL,PSOB)=$PIECE(PSOSTR,",",12)_" "_PSOSTR2
+71 SET ^XTMP(PSOMAIL,PSOB)=^XTMP(PSOMAIL,PSOB)_$SELECT($LENGTH(PSOSTR2)<20:$EXTRACT(PSOPAD,1,20-$LENGTH(PSOSTR2)),1:"")_" "_$PIECE(PSOSTR,",",6)
+72 SET PSOB=PSOB+1
End DoDot:2
End DoDot:1
+73 IF TYPE="DUPNAME"
IF $ORDER(^XTMP(PSOJOB,PSODT,"DUPNAME",PSOTM,0))
Begin DoDot:1
+74 SET PSOHIT=1
+75 SET PSOSUB="VACAA: Name(s) already on file in the New Person (#200) file"
+76 SET ^XTMP(PSOMAIL,1)="This message lists Non-VA Provider data that failed to load into the VistA"
+77 SET ^XTMP(PSOMAIL,2)="NEW PERSON file (#200) because the name is already on file"
+78 SET ^XTMP(PSOMAIL,3)=" "
+79 SET ^XTMP(PSOMAIL,4)="NPI Provider Street Address"
+80 SET ^XTMP(PSOMAIL,5)="---------- -------------------- -------------------"
+81 SET PSOB=6
+82 SET PSOA=0
FOR
SET PSOA=$ORDER(^XTMP(PSOJOB,PSODT,"DUPNAME",PSOTM,PSOA))
if PSOA=""
QUIT
Begin DoDot:2
+83 SET PSOSTR=$GET(^XTMP(PSOJOB,PSODT,"DUPNAME",PSOTM,PSOA))
SET PSOSTR2=$EXTRACT($PIECE(PSOSTR,",",1,2),1,20)
+84 SET ^XTMP(PSOMAIL,PSOB)=$PIECE(PSOSTR,",",12)_" "_PSOSTR2
+85 SET ^XTMP(PSOMAIL,PSOB)=^XTMP(PSOMAIL,PSOB)_$SELECT($LENGTH(PSOSTR2)<20:$EXTRACT(PSOPAD,1,20-$LENGTH(PSOSTR2)),1:"")_" "_$PIECE(PSOSTR,",",6)
+86 SET PSOB=PSOB+1
End DoDot:2
End DoDot:1
+87 IF 'PSOHIT
QUIT 0
+88 SET PSODUZ=PSOSAVDUZ
+89 SET PSOTEXT="^XTMP(""PSO_MAIL ""_TYPE_"" ""_PSOJOB)"
+90 SET PSOMIN("FROM")="Non-VA Provider Updates"
+91 DO SENDMSG^XMXAPI(PSODUZ,PSOSUB,PSOTEXT,.PSOMY,.PSOMIN,.PSOMZ,"")
+92 QUIT $GET(PSOMZ)
+93 ;
ALERT(XQAMSG) ;send alerts
+1 ;variables must be prefixed with "X"
+2 NEW XQAID,XALERT
+3 SET XQAID="Non-VA Provider Updates"
+4 MERGE XQA=PSOMY
+5 SET XALERT=$$SETUP1^XQALERT
+6 QUIT
+7 ;