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

RMPO190P.m

Go to the documentation of this file.
RMPO190P ;RGB/DEV - HO BILLING VIEW FIX PRE-INSTALL ;9/27/17  07:34
 ;;3.0;PROSTHETICS;**190**;Feb 09, 1996;Build 5
 Q
 ;RMPR*3.0*190  This pre-install routine will drive down through
 ;              the HO billing file (665.72) for each month in 
 ;              2017, beginning with April 2017.  The code will 
 ;              insure that every 660 pointer in the items billed 
 ;              has a valid date in the 660 entry for field #1, 
 ;              Request Date.  If null, the date will be populated
 ;              with the 15th of the month following the compiled 
 ;              month.
 ;
START K ^XTMP("RMPO190P")
 D NOW^%DTC S RMPOSTRT=%
 S ^XTMP("RMPO190P","START COMPILE")=RMPOSTRT
 S ^XTMP("RMPO190P","END COMPILE")="RUNNING"
 S ^XTMP("RMPO190P",0)=$$FMADD^XLFDT(RMPOSTRT,180)_"^"_RMPOSTRT
 S U="^",RMPOSIT=0,XXX=0
A S RMPOSIT=$O(^RMPO(665.72,RMPOSIT)),RMPODT=3170300 G AQ:'RMPOSIT
A1 S RMPODT=$O(^RMPO(665.72,RMPOSIT,1,RMPODT)),RMPOVND=0 G A:'RMPODT
 S RMPORQDT=($E(RMPODT,1,5)+1)_15 I $E(RMPORQDT,4,5)=13 S RMPORQDT=($E(RMPORQDT,1,3)+1)_"0115"
A2 S RMPOVND=$O(^RMPO(665.72,RMPOSIT,1,RMPODT,1,RMPOVND)),RMPOPAT=0 G A1:'RMPOVND
 I '$P(^RMPO(665.72,RMPOSIT,1,RMPODT,1,RMPOVND,0),U,2) S $P(^RMPO(665.72,RMPOSIT,1,RMPODT,1,RMPOVND,0),U,2)=RMPORQDT
A3 S RMPOPAT=$O(^RMPO(665.72,RMPOSIT,1,RMPODT,1,RMPOVND,"V",RMPOPAT)),RMPOITM=0 G A2:'RMPOPAT
A4 S RMPOITM=$O(^RMPO(665.72,RMPOSIT,1,RMPODT,1,RMPOVND,"V",RMPOPAT,1,RMPOITM)) G A3:'RMPOITM
 S RMPOBITM=^RMPO(665.72,RMPOSIT,1,RMPODT,1,RMPOVND,"V",RMPOPAT,1,RMPOITM,0)
 S RMPR660P=$P(RMPOBITM,U,16) I 'RMPR660P S ^XTMP("RMPO190P",2,RMPOSIT,1,RMPODT,1,RMPOVND,"V",RMPOPAT,1,RMPOITM,0)=RMPOSIT_U_RMPODT_U_RMPOVND_U_RMPOPAT_U_RMPOITM G A4
 S RMPR660R=$G(^RMPR(660,RMPR660P,0)) I 'RMPR660R S ^XTMP("RMPO190P",3,RMPR660P,0)=RMPOSIT_U_RMPODT_U_RMPOVND_U_RMPOPAT_U_RMPOITM_U_RMPR660P G A4
 I $P(RMPR660R,U,3)="" D
 . S DA=RMPR660P,DIE="^RMPR(660,",DR="1////^S X=RMPORQDT" D ^DIE   ;SET 660 REC REQUEST DATE WITH NEXT MONTH RUN DATE
 . S ^XTMP("RMPO190P",1,RMPR660P,0)=^RMPR(660,RMPR660P,0)
 G A4
AQ K RMPOSIT,RMPODT,RMPOVND,RMPOPAT,RMPR660P,RMPR660R,RMPOSTRT,DA,DIE,DR,RMPOBITM,RMPOITM,RMPORQDT,%
 W !!,"<< PRE-INSTALL RUN COMPLETED, CORRECTING HO ITEMS WITH NULL 'REQUEST DATE' >>"
 QUIT