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

RCXVDC10.m

Go to the documentation of this file.
  1. RCXVDC10 ;ALBANY OI@ALTOONA,PA/TJK-AR Data Extraction Data Creation ;08/18/05
  1. ;;4.5;Accounts Receivable;**232**;Mar 20, 1995
  1. ;
  1. ; Monthly transmissions
  1. Q
  1. EN ;Entry point from nightly process to set up monthly batch jobs
  1. N RCXVMO,RCXVDA,IENARRAY,RCDA
  1. S X1=$E(DT,1,5)_"01",X2=-1 D C^%DTC S RCXVMO=$E(X,1,5)_"00"
  1. EN1 ;branch point for historical job
  1. F RCXVBTY="P","B","I" K RCXVDA,IENARRAY D NBT^RCXVDEQ S RCDA(RCXVBTY)=RCXVDA
  1. S RCXVDA=RCDA("I"),$P(^RCXV(RCXVDA,0),U,10)=RCXVMO D D3547A
  1. S RCXVDA=RCDA("P"),$P(^RCXV(RCXVDA,4),U)=RCXVMO
  1. S RCXVDA=RCDA("B"),$P(^RCXV(RCXVDA,5),U)=RCXVMO
  1. Q
  1. D3547 ;IB Patient Copay account data
  1. ;DFN,RCXVBTN defined in routine RCXVTSK
  1. ;RCXVBTN=Internal number of batch file in ^RCXV(
  1. N I,RCFLAG,RCXVDA,RCXVMO,SSN,RCXVDT,RCXVCO,VADM
  1. S RCXVMO=$P(^RCXV(RCXVBTN,0),U,10)
  1. S (I,RCFLAG)=0 F S I=$O(^IBAM(354.7,DFN,1,I)) Q:'I S RCXVCO=$G(^(I,0)) D Q:RCFLAG
  1. . I +RCXVCO=RCXVMO S RCFLAG=1
  1. . Q
  1. Q:'RCFLAG
  1. ; Write data into FTP file
  1. D DEM^VADPT S SSN=$P(VADM(2),U)
  1. S RCXVDT=$P(RCXVCO,U),RCXVDA=SSN_RCXVU_$E($$HLDATE^HLFNC(RCXVDT),1,8)
  1. S RCXVDA=RCXVDA_RCXVU_$P(RCXVCO,U,2)
  1. S X=$P(RCXVCO,U,3),X=$S(X=1:"YES",X=2:"OVER",1:"NO")
  1. S RCXVDA=RCXVDA_RCXVU_X_RCXVU_$P(RCXVCO,U,4)
  1. S ^TMP($J,"RCXVDC10",DFN)=RCXVDA
  1. W "REC:"_$P(RCXVDA,RCXVU,1),!
  1. W "354.7:"_$P(RCXVDA,RCXVU,2,5),!
  1. Q
  1. PREREG ;Pre-Registration
  1. N IBDATA,X1,X2,IBEDT,IBBDT,RCXVDA
  1. S IBBDT=$E(RCXVMO,1,5)_"01",IBEDT=$$ENDT(IBBDT)
  1. S IBDATA=$$PREREG^IBRFN4(IBBDT,IBEDT)
  1. S RCXVDA=$E($$HLDATE^HLFNC(IBBDT),1,8)
  1. S RCXVDA=RCXVDA_RCXVU_$E($$HLDATE^HLFNC(IBEDT),1,8)_RCXVU_IBDATA
  1. S ^TMP($J,"RCXVDC10","PRE-REG")=RCXVDA
  1. W "PRE-REG:"_RCXVDA,!
  1. Q
  1. BUFFER ;Insurance buffer
  1. S IBBDT=$E(RCXVMO,1,5)_"01",IBEDT=$$ENDT(IBBDT)
  1. S IBDATA=$$BUFFER^IBRFN4(IBBDT,IBEDT)
  1. S RCXVDA=$E($$HLDATE^HLFNC(IBBDT),1,8)
  1. S RCXVDA=RCXVDA_RCXVU_$E($$HLDATE^HLFNC(IBEDT),1,8)_RCXVU_IBDATA
  1. S ^TMP($J,"RCXVDC10","BUFFER")=RCXVDA
  1. W "BUFFER:"_RCXVDA,!
  1. Q
  1. ENDT(IBBDT) ;Calculates end date
  1. S X1=IBBDT,X2=+31 D C^%DTC
  1. S X1=$E(X,1,5)_"01",X2=-1 D C^%DTC
  1. Q X
  1. D3547A ;Sets Patient list from 354.7 into 348.4
  1. N I,DFN,RCXVDA
  1. S RCXVDA=RCDA("I")
  1. F I=0,1,2 D
  1. . S DFN=0 F S DFN=$O(^IBAM(354.7,"AC",RCXVMO,I,DFN)) Q:'DFN D
  1. . . D FIL^RCXVDEQ("I")
  1. . . ; If this patient already exists in this batch, quit
  1. . . I $D(^RCXV(RCXVDA,3,DFN)) Q
  1. . . ;; File record
  1. . . NEW DIC,DIE,X,DA,DLAYGO,Y,DINUM
  1. . . S DA(1)=RCXVDA,DIC="^RCXV("_DA(1)_",3,",DIE=DIC,(X,DINUM)=DFN
  1. . . S DLAYGO=348.43,DIC(0)="L",DIC("P")=DLAYGO
  1. . . I '$D(^RCXV(DA(1),3,0)) S ^RCXV(DA(1),3,0)="^348.43^^"
  1. . . D FILE^DICN
  1. . . Q
  1. . Q
  1. S $P(^RCXV(RCXVDA,0),U,10)=RCXVMO
  1. ;
  1. Q
  1. HIST ;entry point from post-init for historical job
  1. D EN1
  1. Q