source: WorldVistAEHR/trunk/r/ACCOUNTS_RECEIVABLE-PRCA-PRY-RC/RCXVDC10.m@ 1211

Last change on this file since 1211 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1RCXVDC10 ;ALBANY OI@ALTOONA,PA/TJK-AR Data Extraction Data Creation ;08/18/05
2 ;;4.5;Accounts Receivable;**232**;Mar 20, 1995
3 ;
4 ; Monthly transmissions
5 Q
6EN ;Entry point from nightly process to set up monthly batch jobs
7 N RCXVMO,RCXVDA,IENARRAY,RCDA
8 S X1=$E(DT,1,5)_"01",X2=-1 D C^%DTC S RCXVMO=$E(X,1,5)_"00"
9EN1 ;branch point for historical job
10 F RCXVBTY="P","B","I" K RCXVDA,IENARRAY D NBT^RCXVDEQ S RCDA(RCXVBTY)=RCXVDA
11 S RCXVDA=RCDA("I"),$P(^RCXV(RCXVDA,0),U,10)=RCXVMO D D3547A
12 S RCXVDA=RCDA("P"),$P(^RCXV(RCXVDA,4),U)=RCXVMO
13 S RCXVDA=RCDA("B"),$P(^RCXV(RCXVDA,5),U)=RCXVMO
14 Q
15D3547 ;IB Patient Copay account data
16 ;DFN,RCXVBTN defined in routine RCXVTSK
17 ;RCXVBTN=Internal number of batch file in ^RCXV(
18 N I,RCFLAG,RCXVDA,RCXVMO,SSN,RCXVDT,RCXVCO,VADM
19 S RCXVMO=$P(^RCXV(RCXVBTN,0),U,10)
20 S (I,RCFLAG)=0 F S I=$O(^IBAM(354.7,DFN,1,I)) Q:'I S RCXVCO=$G(^(I,0)) D Q:RCFLAG
21 . I +RCXVCO=RCXVMO S RCFLAG=1
22 . Q
23 Q:'RCFLAG
24 ; Write data into FTP file
25 D DEM^VADPT S SSN=$P(VADM(2),U)
26 S RCXVDT=$P(RCXVCO,U),RCXVDA=SSN_RCXVU_$E($$HLDATE^HLFNC(RCXVDT),1,8)
27 S RCXVDA=RCXVDA_RCXVU_$P(RCXVCO,U,2)
28 S X=$P(RCXVCO,U,3),X=$S(X=1:"YES",X=2:"OVER",1:"NO")
29 S RCXVDA=RCXVDA_RCXVU_X_RCXVU_$P(RCXVCO,U,4)
30 S ^TMP($J,"RCXVDC10",DFN)=RCXVDA
31 W "REC:"_$P(RCXVDA,RCXVU,1),!
32 W "354.7:"_$P(RCXVDA,RCXVU,2,5),!
33 Q
34PREREG ;Pre-Registration
35 N IBDATA,X1,X2,IBEDT,IBBDT,RCXVDA
36 S IBBDT=$E(RCXVMO,1,5)_"01",IBEDT=$$ENDT(IBBDT)
37 S IBDATA=$$PREREG^IBRFN4(IBBDT,IBEDT)
38 S RCXVDA=$E($$HLDATE^HLFNC(IBBDT),1,8)
39 S RCXVDA=RCXVDA_RCXVU_$E($$HLDATE^HLFNC(IBEDT),1,8)_RCXVU_IBDATA
40 S ^TMP($J,"RCXVDC10","PRE-REG")=RCXVDA
41 W "PRE-REG:"_RCXVDA,!
42 Q
43BUFFER ;Insurance buffer
44 S IBBDT=$E(RCXVMO,1,5)_"01",IBEDT=$$ENDT(IBBDT)
45 S IBDATA=$$BUFFER^IBRFN4(IBBDT,IBEDT)
46 S RCXVDA=$E($$HLDATE^HLFNC(IBBDT),1,8)
47 S RCXVDA=RCXVDA_RCXVU_$E($$HLDATE^HLFNC(IBEDT),1,8)_RCXVU_IBDATA
48 S ^TMP($J,"RCXVDC10","BUFFER")=RCXVDA
49 W "BUFFER:"_RCXVDA,!
50 Q
51ENDT(IBBDT) ;Calculates end date
52 S X1=IBBDT,X2=+31 D C^%DTC
53 S X1=$E(X,1,5)_"01",X2=-1 D C^%DTC
54 Q X
55D3547A ;Sets Patient list from 354.7 into 348.4
56 N I,DFN,RCXVDA
57 S RCXVDA=RCDA("I")
58 F I=0,1,2 D
59 . S DFN=0 F S DFN=$O(^IBAM(354.7,"AC",RCXVMO,I,DFN)) Q:'DFN D
60 . . D FIL^RCXVDEQ("I")
61 . . ; If this patient already exists in this batch, quit
62 . . I $D(^RCXV(RCXVDA,3,DFN)) Q
63 . . ;; File record
64 . . NEW DIC,DIE,X,DA,DLAYGO,Y,DINUM
65 . . S DA(1)=RCXVDA,DIC="^RCXV("_DA(1)_",3,",DIE=DIC,(X,DINUM)=DFN
66 . . S DLAYGO=348.43,DIC(0)="L",DIC("P")=DLAYGO
67 . . I '$D(^RCXV(DA(1),3,0)) S ^RCXV(DA(1),3,0)="^348.43^^"
68 . . D FILE^DICN
69 . . Q
70 . Q
71 S $P(^RCXV(RCXVDA,0),U,10)=RCXVMO
72 ;
73 Q
74HIST ;entry point from post-init for historical job
75 D EN1
76 Q
Note: See TracBrowser for help on using the repository browser.