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

RMPOPST3.m

Go to the documentation of this file.
  1. RMPOPST3 ;EDS/JAM,HinesIO/DDA - HOME OXYGEN BILLING TRANSACTIONS/ACCEPT FOR POST ;7/24/98
  1. ;;3.0;PROSTHETICS;**29,44,41,98,110**;Feb 09, 1996;Build 10
  1. ;This subroutine is part of the billing module. Check file 665.72
  1. ;for accepted transactions not yet posted.
  1. Q
  1. ACCEPT ; Check for accepted entries and post if user indicates
  1. N DFNS
  1. D FNDACC I $O(DFNS(""))="" Q
  1. D PSTACC
  1. Q ;ACCEPT
  1. ;
  1. TEST ;set test data
  1. N RMPOXITE,RMPOVDR,RMPODATE,DFNS
  1. S RMPOXITE=1,RMPOVDR=10,RMPODATE=2981200,DFNS(47)=""
  1. S RMPO("STA")=521
  1. D FNDACC I $O(DFNS(""))="" Q
  1. D PSTACC
  1. Q ;TEST
  1. ;
  1. FNDACC ;Check records to ensure all accepted transactions are posted.
  1. N DFN,BILDT,SITE,FIL,VDR,I
  1. S FIL=665.72,SITE=RMPOXITE,BILDT=RMPODATE,VDR=RMPOVDR
  1. S DFN=0
  1. F I=1:1 S DFN=$O(^RMPO(FIL,SITE,1,BILDT,1,VDR,"V",DFN)) Q:'DFN D
  1. . ;check if patient transaction posted
  1. . I $P(^RMPO(FIL,SITE,1,BILDT,1,VDR,"V",DFN,0),U,3)="Y" Q
  1. . ;check if patient transaction accepted
  1. . I $P(^RMPO(FIL,SITE,1,BILDT,1,VDR,"V",DFN,0),U,2)'="Y" Q
  1. . I I=10 D
  1. . . W !!,"Verifying all accepted transactions posted. Please be patient"
  1. . S DFNS(DFN)=""
  1. Q ;FNDACC
  1. ;
  1. PSTACC ;Post accepted transactions if so indicated by user
  1. N MES K DIR
  1. S DIR(0)="Y",DIR("B")="NO"
  1. S MES="There are patients whose billing transactions have been accepted"
  1. S DIR("A",1)=MES,DIR("A",2)=" and not yet posted"
  1. S DIR("A")="Would you like to post them now"
  1. S DIR("?")="YES will Post accepted transaction and NO will not post"
  1. D ^DIR
  1. I 'Y!($D(DIRUT))!($D(DIROUT)) Q
  1. ;Call post module to post transactions
  1. D POST^RMPOPST0
  1. K DIR,DIRUT,DIROUT,Y
  1. Q ;PSTACC
  1. F660 ;Post to file ^RMPR(660 for form 2319
  1. N ITM,ITMD,D665A,SUSDES,TRXDT,D660,D6I,D6X,RMPOG,ERR
  1. S D665A=$G(^RMPR(665,DFN,"RMPOA")) I D665A="" Q
  1. D ;AMIS grouper number
  1. . L +^RMPR(669.9,RMPOXITE,0):9999 I $T=0 S RMPOG=DT_$P(DT,2,3) Q
  1. . S RMPOG=$P(^RMPR(669.9,RMPOXITE,0),U,7),RMPOG=RMPOG-1
  1. . S $P(^RMPR(669.9,RMPOXITE,0),U,7)=RMPOG
  1. . L -^RMPR(669.9,RMPOXITE,0)
  1. S TRXDT=$P(^RMPO(665.72,RMPOXITE,1,RMPODATE,1,RMPOVDR,0),U,2)
  1. S ITM="" F S ITM=$O(^TMP($J,FCP,DFN,ITM)) Q:ITM="" D
  1. . S ITMD=$G(^RMPO(665.72,RMPOXITE,1,RMPODATE,1,RMPOVDR,"V",DFN,1,ITM,0))
  1. . I ITMD="" Q
  1. .; I $P(ITMD,U,6)'>0 Q ;nothing posted to IFCAP
  1. . S RMCPHC=$P(ITMD,U,2),RMCPT="",RMCPRENT=$P(ITMD,U,18),RMCPSO="C"
  1. . S RMCPTY=$P(ITMD,U,14),RMCPQH=$P(ITMD,U,19)
  1. . S RMCPT1=$G(^RMPR(661.1,RMCPHC,4))
  1. . I RMCPT1["RP",((RMCPTY="R")!(RMCPTY="X")) S RMCPT=RMCPT_"RP,"
  1. . I RMCPT1["QH",($G(RMCPQH)) S RMCPT=RMCPT_"QH,"
  1. . I (RMCPRENT=1),(RMCPT1["RR") S RMCPT=RMCPT_"RR,"
  1. . I RMCPT1["NU",(RMCPT'["RR") S RMCPT=RMCPT_"NU,"
  1. . I $L(RMCPT)>2 S RMCLEN=$L(RMCPT),RMCPT=$E(RMCPT,1,RMCLEN-1)
  1. . S DIC="^RMPR(660,",DIC(0)="L",X=DT
  1. . K DD,DO D FILE^DICN I +Y<0 Q
  1. . S D6I=+Y,D6X=D6I_","
  1. . K DIE,DA,DR S DA(4)=RMPOXITE,DA(3)=RMPODATE,DA(2)=RMPOVDR,DA(1)=DFN
  1. . S DIE="^RMPO(665.72,"_DA(4)_",1,"_DA(3)_",1,"_DA(2)_",""V"","_DA(1)
  1. . S DIE=DIE_",1,",DA=ITM,DR="15////^S X=D6I" D ^DIE
  1. . S D660(660,D6X,.02)=DFN ;Patient name pointer
  1. . S D660(660,D6X,1)=TRXDT ;Request date
  1. . S D660(660,D6X,2)=$P(ITMD,U,14) ;Type of transaction
  1. . S D660(660,D6X,4)=$P(ITMD,U) ;item
  1. . S D660(660,D6X,4.1)=$P(^RMPR(661.1,$P(ITMD,U,2),0),U,4) ;HCPCS
  1. . S D660(660,D6X,4.5)=$P(ITMD,U,2) ;PSAS HCPCS
  1. . S D660(660,D6X,4.7)=RMCPT ;CPT MODIFIER
  1. . S D660(660,D6X,5)=$P(ITMD,U,7)-$P(ITMD,U,17) ;quantity
  1. . S D660(660,D6X,7)=RMPOVDR ;vendor
  1. . S D660(660,D6X,8)=RMPO("STA") ;station
  1. . S D660(660,D6X,10)=CURDT ;Delivery date
  1. . D
  1. . . I $P(PAYINF,U) D Q
  1. . . . S D660(660,D6X,11)=9 ;form requested on(1358)
  1. . . . ;IFCAP transaction number - from file 424
  1. . . . I $G(IEN424)'="" S D660(660,D6X,23)=$P($G(^PRC(424,IEN424,0)),U)
  1. . . S D660(660,D6X,11)=14 ;form requested on (visa)
  1. . . S D660(660,D6X,23)=SRVORD ;IFCAP transaction number
  1. . S D660(660,D6X,12)="C" ;Source
  1. . S D660(660,D6X,14)=$P(ITMD,U,6) ;total cost
  1. . S D660(660,D6X,16)=$P(ITMD,U,4) ;remarks
  1. . S SUSDES=$S($P(ITMD,U,11)'="":"Suspended Amt "_$P(ITMD,U,11)_" ",1:"")
  1. . S D660(660,D6X,24)=SUSDES_$P(ITMD,U,12) ;description
  1. . S D660(660,D6X,27)=DUZ ;initiator
  1. . S D660(660,D6X,62)=$P(D665A,U) ;patient category
  1. . S D660(660,D6X,63)=$P(D665A,U,5) ;special category
  1. . S D660(660,D6X,68)=RMPOG
  1. . S D660(660,D6X,78)=$P(ITMD,U,15) ;unit of issue
  1. . D FILE^DIE("K","D660","ERR")
  1. . I $D(ERR) D
  1. . . W !!,"Posting to 2319 for item ",ITM," patient ",DFN," failed."
  1. . . W "Posting will be done later"
  1. . . Q
  1. . ; RMPR*3*98
  1. . ; CALL TO PROCESS PFSS CHARGE MESSAGE
  1. . I '$D(ERR) D CHARGE^RMPOPF
  1. . Q
  1. K DIC,X,Y
  1. Q