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

IBCEP8C1.m

Go to the documentation of this file.
IBCEP8C1 ;DSS/SCR - Functions for IB SILENT INTERFACE FROM FB ;03-27-12
 ;;2.0;INTEGRATED BILLING;**476**;21-MAR-94;Build 2
 ;;Per VHA Directive 2004-038, this routine should not be modified.
 ;
 ; This routine contains functions to support the Non-VA Items from the
 ; Provider ID Maintenance Main Menu
FBTGLGET(IBNPRV)  ;EP from IBCEP8B
 ;  Provider ID Maintenance Main Menu
 ;  for display on screens created for NP Non-VA Provider and NF Non-VA facility selections
 ;
 ; INPUTS: IBNPRV  : IEN of the IB NON/OTHER VA BILLING PROVIDER file
 ;
 ; OUTPUT : returns 1 if currently set to 'ALLOW' or not set, 0 if currently set to 'DISALLOW'
 ;        : a NULL return indicates a DB read error
 ;
 N IBTGLNUM,IBTGLVAL,IBERR
 ;
 S IBTGLNUM=9999999
 S IBTGLNUM=$O(^IBA(355.93,IBNPRV,3,IBTGLNUM),-1)   ;should return the most recent entry
 I IBTGLNUM="" S IBTGLVAL=1
 I IBTGLNUM'="" D
 .S IBTGLVAL=$$GET1^DIQ(355.9351,IBTGLNUM_","_IBNPRV_",",".02","I","","IBERR")  ;355.9351 (#51) DATE/TIME ALLOW FB UPDATE
 .I $G(IBERR("DIERR"))'="" S IBTGLVAL=""   ;
 Q IBTGLVAL
 ;
FBTGLSET(IBNPRV)   ;EP from IBCEP8
 ;INPUT IBNPRV : IEN of IB NON/OTHER VA BILLING PROVIDER
 ;
 N DIR,DTOUT,DUOUT,Y,DA,IBNEW,IBQUIT,IBOLD,IBLAST,IBNEXT
 ;
 S IBQUIT=0
 S DIR(0)="Y"
 S DIR("A")="Allow future updates by FEE BASIS automatic interface"
 S DIR("?")="Enter YES to allow automatic updates, NO not to"
 S DA=IBNPRV
 S DIR("B")="YES"
 S IBNEXT=0
 S IBQUIT=0
 F  S IBNEXT=$O(^IBA(355.93,IBNPRV,3,IBNEXT)) Q:'+IBNEXT  S IBLAST=IBNEXT
 S:'+$G(IBLAST) IBOLD=1
 S:+$G(IBLAST) IBOLD=$P($G(^IBA(355.93,IBNPRV,3,IBLAST,0)),U,2)
 S:IBOLD=0 DIR("B")="NO"
 S:IBOLD=1 DIR("B")="YES"
 D ^DIR
 I $G(DTOUT)=1!$G(DUOUT)=1 S IBQUIT=1
 S IBNEW=Y
 I IBNEW="" S IBQUIT=1   ;don't update if we couldn't read
 I (IBNEW'=IBOLD)&'IBQUIT D
 .N DO,DD,X,%,%H,%I,IBNOW,IBFDA,IBRET
 .D NOW^%DTC
 .S IBNOW=%
 .S IBFDA(355.9351,"+1,"_IBNPRV_",",".01")=IBNOW   ;355.9351  ;(#51) DATE/TIME ALLOW FB UPDATE INTERNAL
 .S IBFDA(355.9351,"+1,"_IBNPRV_",",".02")=IBNEW  ;(#.02)CHANGED TO [2S]
 .S IBFDA(355.9351,"+1,"_IBNPRV_",",".03")=DUZ  ;(#.03) IB USER WHO CHANGED [3P:200]
 .D UPDATE^DIE("","IBFDA","IBRET","IBERR")
 Q
 ;
EPFBRPT()  ;EP FOR IB PROVIDER FROM FB STAT RPT OPTION
 ;
 N IBIEN,IBDATE,IBFROM,IBTO,IBSTYLE,DIR,Y,IBQUIT,IBTYPE
 ;
 S IBQUIT=0
 ;FIRST PROMT FOR DATES
 F  Q:IBQUIT  D
 .D CLEAR()
 .W ?3,"** SUMMARY OF NON-VA PROVIDERS AFFECTED BY FEE BASIS INTERFACE **"
 .W !!!!!
 .S DIR("A")="SELECT FIRST date to include in report"
 .S DIR(0)="DE"
 .D ^DIR
 .I $D(DUOUT) S IBQUIT=1  ;DEFINED IF USER ENTERS ONE UP ARROW
 .I $D(DIRUT) S IBQUIT=1  ;DEFINED IF USER ENTERS ""
 .I $D(DTOUT) S IBQUIT=1  ;DEFINED IF USER TIMES OUT
 .W:'IBQUIT " "_Y(0)
 .I 'IBQUIT D
 ..S IBFROM=+Y
 ..S DIR("A")="SELECT LAST date to include in report"
 ..S DIR(0)="D"
 ..D ^DIR
 ..I $D(DUOUT) S IBQUIT=1  ;DEFINED IF USER ENTERS ONE UP ARROW
 ..I $D(DIRUT) S IBQUIT=1  ;DEFINED IF USER ENTERS ""
 ..I $D(DTOUT) S IBQUIT=1  ;DEFINED IF USER TIMES OUT
 ..W:'IBQUIT " "_Y(0)
 ..I 'IBQUIT S IBTO=+Y
 .I 'IBQUIT D IBRPT(IBFROM,IBTO)
 K ^TMP($J,"IBCEP8C1")
 Q
 ;
IBRPT(IBFROM,IBTO)  ;reports from 355.935 (#50)DATE/TIME LAST FB UPDATE
 ;
 ;INPUTS IBFROM : Records modified FROM this date will be considered
 ;       IBTO   : Records modified TO this date will be considered
 ;
 K ^TMP($J,"IBCEP8C1")
 N IBNEXT,IBARRAY,IBIEN,IBCHKIEN
 ;S DIC=355.93       ;IB NON/OTHER VA BILLING PROVIDER FILE
 ;IBA(355.93,D0,4,0)=^355.935DA^^  (#50) DATE/TIME LAST FB UPDATE
 S IBIEN=0
 S IBNEXT=$P(IBFROM,".",1)_"."_0  ;first second of from date
 F  S IBIEN=$O(^IBA(355.93,IBIEN)) Q:'+IBIEN  D
 .S IBNEXT=IBFROM
 .F  S IBNEXT=$O(^IBA(355.93,IBIEN,4,"B",IBNEXT)) Q:(IBNEXT>(IBTO+1))!(IBNEXT="")  D
 ..S IBSUB=0  ;GATHER CHANGES FOR THIS DATE
 ..F  S IBSUB=$O(^IBA(355.93,IBIEN,4,"B",IBNEXT,IBSUB)) Q:IBSUB=""  D
 ...S ^TMP($J,"IBCEP8C1",IBNEXT,IBIEN,IBSUB)=^IBA(355.93,IBIEN,4,IBSUB,0)
 ;Now count records by date
 S ^TMP($J,"IBCEP8C1",0)=0  ;HOLDS THE NUMBER OF RECORDS MODIFIED BY THE INTERFACE FOR TIME FRAME
 S ^TMP($J,"IBCEP8C1",0,1)=0 ;HOLDS THE NUMBER RECORDS CREATED BY THE INTERFACE FOR TIME FRAME
 S IBNEXT=0
 F  S IBNEXT=$O(^TMP($J,"IBCEP8C1",IBNEXT)) Q:IBNEXT=""  D
 .S ^TMP($J,"IBCEP8C1",IBNEXT,0)=0  ;HOLDS THE NUMBER OF RECORDS MODIFIED BY THE INTERFACE FOR A DATE
 .S ^TMP($J,"IBCEP8C1",IBNEXT,0,1)=0  ;HOLDS THE NUMBER OF RECORDS CREATED BY THE INTERFACE FOR A DATE
 .S IBIEN=0
 .F  S IBIEN=$O(^TMP($J,"IBCEP8C1",IBNEXT,IBIEN)) Q:IBIEN=""  D
 ..S IBSUB=$O(^TMP($J,"IBCEP8C1",IBNEXT,IBIEN,0))
 ..I $P(^TMP($J,"IBCEP8C1",IBNEXT,IBIEN,IBSUB),U,3)'=1 D
 ...S ^TMP($J,"IBCEP8C1",IBNEXT,0)=$G(^TMP($J,"IBCEP8C1",IBNEXT,0))+1
 ...S ^TMP($J,"IBCEP8C1",0)=$G(^TMP($J,"IBCEP8C1",0))+1
 ..I $P(^TMP($J,"IBCEP8C1",IBNEXT,IBIEN,IBSUB),U,3)=1 D
 ...S ^TMP($J,"IBCEP8C1",IBNEXT,0,1)=$G(^TMP($J,"IBCEP8C1",IBNEXT,0,1))+1
 ...S ^TMP($J,"IBCEP8C1",0,1)=$G(^TMP($J,"IBCEP8C1",0,1))+1
 D DAYIBRPT(IBTO,IBFROM)
 Q
 ;
DAYIBRPT(IBTO,IBFROM)  ;PRINTS RECORDS BY DAY THAT WERE MODIFIED BY FB
 ;
 ;
 N DIR,DUOUT,DIRUT,DTOUT,IBQUIT,IBIEN,X,Y,IBSUB,IBTYPE,IBDAT1,IBDAT2,IBDATE,IBIENS,IBSUBS
 S IBQUIT=0
 S %ZIS("A")="OUTPUT DEVICE: "
 D ^%ZIS
 I POP S IBQUIT=1 Q
 S Y=IBFROM
 D DD^%DT
 S IBDAT1=Y
 S Y=IBTO
 D DD^%DT
 S IBDAT2=Y
 W !,?15,"*** IB PROVIDER FROM FB SUMMARY LISTING ***"
 W !,?25,IBDAT1_" - "_IBDAT2
 W !!,?3,"Includes information about records in the IB NON/OTHER BILLING PROVIDER"
 W !,?3,"file modified by the FB PAID TO IB automatic interface for date range"
 W !
 S IBDATE=0
 W !,?13,"TOTAL RECORDS MODIFIED FOR DATE RANGE: "_^TMP($J,"IBCEP8C1",0)
 W !?16,"TOTAL RECORDS CREATED FOR DATE RANGE: "_^TMP($J,"IBCEP8C1",0,1)
 F  S IBDATE=$O(^TMP($J,"IBCEP8C1",IBDATE)) Q:(IBDATE=""!IBQUIT)  D
 .S Y=IBDATE
 .D DD^%DT
 .W !!,?3,"FB PROCESS DATE: "_Y
 .W !,?5,"TOTAL RECORDS MODIFIED FOR THIS DATE: "_^TMP($J,"IBCEP8C1",IBDATE,0)
 .W !,?8,"TOTAL RECORDS CREATED FOR THIS DATE: "_$G(^TMP($J,"IBCEP8C1",IBDATE,0,1))
 .S IBIEN=0
 .F  S IBIEN=$O(^TMP($J,"IBCEP8C1",IBDATE,IBIEN)) Q:IBIEN=""  D GETS^DIQ(355.93,IBIEN_",","**","","IBRET")
 .S IBIEN=0
 .S IBQUIT=0
 .W !!,?3,"PROVIDER",?38,"NPI",?52,"TYPE",?63,"CREATED BY FB"
 .W !,?3,"--------------------------------------------------------------------------"
 .F  S IBIEN=$O(^TMP($J,"IBCEP8C1",IBDATE,IBIEN)) Q:(IBIEN="")!IBQUIT  D
 ..W !,?3,$G(IBRET(355.93,IBIEN_",",.01))
 ..S IBIENS=IBIEN_","
 ..W ?38,$G(IBRET(355.93,IBIENS,41.01))
 ..W ?52,$G(IBRET(355.93,IBIENS,.02))
 ..S IBSUB=$O(^TMP($J,"IBCEP8C1",IBDATE,IBIEN,""))
 ..S IBSUBS=IBSUB_","_IBIEN_","
 ..W:$G(IBRET(355.935,IBSUBS,.03))'="" ?68,$G(IBRET(355.935,IBSUBS,.03))
 ..W:$G(IBRET(355.935,IBSUBS,.03))="" ?68,"NO"
 .I (IOT="VTRM") D
 ..W !
 ..S DIR("A")="Enter RETURN to continue or '^' to exit"
 ..S DIR(0)="FO"
 ..D ^DIR
 ..I $D(DUOUT) S IBQUIT=1  ;DEFINED IF USER ENTERS ONE UP ARROWS
 ..I $D(DTOUT) S IBQUIT=1  ;DEFINED IF USER TIMES OUT
 ..I $O(^TMP($J,"IBCEP8C1",IBDATE))'="" D
 ...W !!,?15,"*** IB PROVIDER FROM FB SUMMARY LISTING (CONT.)***"
 ...W !,?25,IBDAT1_" - "_IBDAT2
 .Q:IBQUIT
 Q 
 ;
CLEAR()   ;clears screen between reports
 N IBLINE
 F IBLINE=1:1:15 W !
 Q