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

PRCFVEX1.m

Go to the documentation of this file.
  1. PRCFVEX1 ;WASH IRM/KCMO;SERVER to process returned DUNS numbers; ;8/26/96 11:33
  1. ;;5.0;IFCAP;**84**;4/21/95
  1. ;
  1. Q:XQSUB'["EDV" ; Must be one of our Messages
  1. N FACID,XMSER,XMZ,IEN,DUNS,CURR,I K ^TMP($J)
  1. S FACID=$P($G(^XTV(8989.3,1,"XUS")),U,17) ;Default Institution KSP
  1. S XMZ=XQMSG
  1. ;
  1. REC ; -- Read the Msg lines, Parse and Process
  1. X XMREC G STAT:XMER<0 D G REC
  1. . Q:$P(XMRG,U)'[FACID ; -- Line must begin with Station Number
  1. . S IEN=$P(XMRG,U,2),DUNS=$P($P(XMRG,U,3),"|")
  1. . ; -- Ensure Record Exists
  1. . I '$D(^PRC(440,+IEN,0))#2 Q ;
  1. . ; -- Get Current Value if any, either file or report
  1. . S CURR=$P($G(^PRC(440,+IEN,7)),U,12) I CURR'=DUNS D Q ;
  1. . . ;I $L(CURR) S ^TMP($J,+IEN)="Record: "_IEN_" Current: "_CURR_" D&B: "_DUNS_" *Data has been edited since Extract run."
  1. . . ; -- Validate the Data using silent FM
  1. . . K TMP D VAL^DIE(440,+IEN_",","18.3","",DUNS,.X)
  1. . . I X["^" S ^TMP($J,+IEN)="Record: "_IEN_" D&B: "_DUNS_" *Failed Validation" Q
  1. . . ; -- File it, FDA created in validation
  1. . . S TMP(440,+IEN_",",18.3)=DUNS D FILE^DIE("","TMP")
  1. . . I $D(DIERR)#2 S ^TMP($J,+IEN)="Record: "_IEN_" D&B: "_DUNS_" *Unable to File" Q
  1. Q
  1. STAT ; -- Mail the Discrepency Report
  1. I $O(^TMP($J,0))>0 D ;
  1. . N XMSUB,XMTEXT,XMDUZ,XMY
  1. . S ^TMP($J,.5)="The following DUNS# were not filed in the VENDOR file"
  1. . S ^TMP($J,.6)="and will need to be entered manually."
  1. . S ^TMP($J,.7)=" "
  1. . S XMSUB="IFCAP Vendor DUNS Upload Discrepency Report"
  1. . S XMTEXT="^TMP($J,",XMY("G.EDV")="",XMDUZ="PRCFVEX1" D ^XMD
  1. JOB ; -- Mail the Job Completion Message
  1. ;N XMSUB,XMTEXT,XMDUZ,XMY K ^TMP($J)
  1. ;S ^TMP($J,1)="The Dun & Bradstreet message: "
  1. ;S ^TMP($J,2)="",^TMP($J,3)=" "_XQSUB,^TMP($J,4)=""
  1. ;S ^TMP($J,5)="has been processed successfully."
  1. ;S XMSUB="IFCAP VENDOR DUNS BULLETIN",XMTEXT="^TMP($J,",XMY("G.EDV")="",XMDUZ="SERVER: PRCFVEX" D ^XMD
  1. REM ; -- Remove the Msg from the Server Queue Basket
  1. S XMSER="S."_XQSOP D REMSBMSG^XMA1C
  1. Q