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

IBCRHBRV.m

Go to the documentation of this file.
  1. IBCRHBRV ;ALB/ARH - RATES: UPLOAD (RC) VERSION FUNCTIONS ; 14-FEB-01
  1. ;;2.0;INTEGRATED BILLING;**148,169,245,270,285,298,325,334,355,360,365,382,390,408,412,423,427,439,445,462,468,484,491,508,520,536,542,556,559,573,584,600,612,628,634,658,667,683,693,719,724,744,755,783**;21-MAR-94;Build 2
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. ; RC functions related to Version. Update VLIST with new versions. Update FTYPE if new types of files.
  1. ;
  1. SELVERS() ; get version to upload from user
  1. N DIR,DIRUT,DTOUT,DUOUT,IBVLIST,IBQUIT,IBVERS,IBI,IBJ,IBX,X,Y
  1. ;
  1. S IBVLIST=$$VERSTR(),IBQUIT=0,IBVERS=0
  1. ;
  1. W !!,"Select the version of Reasonable Charges to upload."
  1. S DIR("?",1)="Enter the code from the list corresponding to the version of Reasonable Charges"
  1. S DIR("?",2)="to upload. There are no version 1.3, 2.2, or 2.10 (ten) RC charges." S DIR("?",3)=" "
  1. S DIR("?",4)="Versions: "_IBVLIST S DIR("?",5)=" " S DIR("?")="Enter version number to upload."
  1. ;
  1. F IBI=1:1 D I +IBQUIT Q
  1. . W !!,?5,"Select one of the following:",!
  1. . F IBJ=1:1 S IBX=$P(IBVLIST,",",IBJ) Q:'IBX W !,?10,IBX,?20,"Reasonable Charges version ",IBX
  1. . ;
  1. . W ! S DIR("A")="Enter Version" S DIR(0)="FO^1:5" D ^DIR I $D(DIRUT) S IBQUIT=1
  1. . I Y>0,(","_IBVLIST_",")[(","_Y_",") S IBVERS=Y,IBQUIT=1 W " Reasonable Charges version ",IBVERS
  1. ;
  1. Q IBVERS
  1. ;
  1. VERSION() ; return currently loaded version of RC files (1, 1.1, ...)
  1. N IBX S IBX=$G(^XTMP("IBCR RC SITE","VERSION"))
  1. Q IBX
  1. ;
  1. VERSDT(VERS) ; return Effective Date of a version of RC files, either version passed in or currently loaded version
  1. N IBI,LINE,IBX S IBX="" S VERS=+$G(VERS) I 'VERS S VERS=$$VERSION
  1. I +VERS F IBI=1:1 S LINE=$P($T(VLIST+IBI),";;",2,99) Q:'LINE I VERS=+LINE S IBX=$P(LINE,U,3)
  1. Q IBX
  1. ;
  1. VERSEDT(VERS) ; return Inactive Date of a version of RC files, either version passed in or currently loaded version
  1. N IBI,LINE,IBX S IBX="" S VERS=+$G(VERS) I 'VERS S VERS=$$VERSION
  1. I +VERS F IBI=1:1 S LINE=$P($T(VLIST+IBI),";;",2,99) Q:'LINE I VERS=+LINE S IBX=$P(LINE,U,4)
  1. Q IBX
  1. ;
  1. VERSALL() ; return all RC versions and corresponding effective date 'VERS;EFFDT^VERS;EFFDT^...'
  1. N IBI,LINE,IBX,IBC S IBX="",IBC=""
  1. F IBI=1:1 S LINE=$P($T(VLIST+IBI),";;",2,99) Q:'LINE S IBX=IBX_IBC_+LINE_";"_$P(LINE,U,3),IBC=U
  1. Q IBX
  1. ;
  1. VERSEND() ; return all RC versions and corresponding inactive date 'VERS;INACTIVE DT^VERS;INACTIVE DT^...'
  1. N IBI,LINE,IBX,IBC S IBX="",IBC=""
  1. F IBI=1:1 S LINE=$P($T(VLIST+IBI),";;",2,99) Q:'LINE I $P(LINE,U,4) S IBX=IBX_IBC_+LINE_";"_$P(LINE,U,4),IBC=U
  1. Q IBX
  1. ;
  1. VERSITE(SITE) ; returns the list of versions loaded for a particular site
  1. ; *** uses 99201 in the RC PHYSICIAN set to check which versions/dates are loaded
  1. ; *** so 99201 must have a pro charge in all versions, if not it must be replaced with an item that does
  1. ; *693 - 99202 for 4.215
  1. N IBCS,IBXRF,IBITM,IBITM2,IBVERS,IBCSFN,IBI,IBV,IBX,IBY,IBC
  1. S IBVERS=$$VERSALL,IBITM=99201,IBITM2=99202
  1. ;
  1. I $G(SITE)'="" S IBCS="RC-PHYSICIAN" F S IBCS=$O(^IBE(363.1,"B",IBCS)) Q:IBCS'["RC-PHYSICIAN" D
  1. . S IBV=$L(IBCS," ") I $P(IBCS," ",IBV)'=SITE Q
  1. . S IBCSFN=$O(^IBE(363.1,"B",IBCS,0)) Q:'IBCSFN S IBXRF="AIVDTS"_IBCSFN
  1. . F IBI=1:1 S IBV=$P(IBVERS,U,IBI) Q:'IBV I ($O(^IBA(363.2,IBXRF,IBITM,-$P(IBV,";",2),0)))!($O(^IBA(363.2,IBXRF,IBITM2,-$P(IBV,";",2),0))) S IBY(+IBV)=""
  1. ;
  1. S (IBX,IBC)="" F IBI=1:1 S IBV=+$P(IBVERS,U,IBI) Q:'IBV I $D(IBY(IBV)) S IBX=IBX_IBC_IBV S IBC=","
  1. ;
  1. Q IBX
  1. ;
  1. MSGSITE(SITE) ; display a message indicating which versions are loaded for a site
  1. N IBVERS Q:'$G(SITE)
  1. S IBVERS=$$VERSITE(SITE)
  1. I 'IBVERS W !!,?12,"There appear to be no RC charges already loaded for "_SITE_"."
  1. I +IBVERS W !!,?12,"RC versions "_IBVERS_" appear to be already loaded for "_SITE_"."
  1. Q
  1. ;
  1. MSGVERS(SITE) ; check if versions are being loaded in the correct order, should be loaded in date order
  1. ; - if loading a version that has already been loaded for the site
  1. ; - if loading a version when any future versions have already been loaded for the site
  1. ; - if loading a version when the last version has not yet been loaded for the site
  1. ; *** uses 99201 in the RC PHYSICIAN set to check which versions/dates are loaded
  1. ; *** so 99201 must have a pro charge in all versions, if not it must be replaced with an item that does
  1. N IBVERS,IBVDTC,IBVERSIN,IBVERSC,IBVERSO,IBI,VERSTR Q:'$G(SITE)
  1. ;
  1. S IBVERS=$$VERSION Q:'IBVERS S IBVDTC=$$VERSDT,IBVERSIN=","_$$VERSITE(SITE)_",",IBVERSC=","_IBVERS_","
  1. ;
  1. ; check if loading a version that has already been loaded
  1. I IBVERSIN[IBVERSC D
  1. . W !!,?5,"*** It appears version RC v",IBVERS," has already been loaded for this site ***"
  1. ;
  1. ; check if loading a version when any future versions have already been loaded
  1. S VERSTR=","_$$VERSTR()_",",VERSTR=$P(VERSTR,IBVERSC,2) ; all versions after current version
  1. F IBI=1:1 S IBVERSO=$P(VERSTR,",",IBI) Q:'IBVERSO I IBVERSIN[(","_IBVERSO_",") D
  1. . W !!,?5,">>> Currently trying to load RC v"_IBVERS_" but RC v"_IBVERSO_" appears to be already",!,?9,"loaded for this site. The versions should be loaded in date order."
  1. ;
  1. ; check if loading a version when the last version has not yet been loaded
  1. S VERSTR=","_$$VERSTR(1)_",",VERSTR=$P(VERSTR,IBVERSC,2) ; all versions before current version, reverse order
  1. S IBVERSO=$P(VERSTR,",",1) I +IBVERSO,IBVERSIN'[(","_IBVERSO_",") D
  1. . W !!,?5,"*** Currently trying to load RC v"_IBVERS_" but RC v"_IBVERSO_" does not appear to be",!,?9,"loaded for this site. The versions should be loaded in date order."
  1. . W !!,?5,">>> Continue only if there will never be a need to bill events before ",!,?9,$$FMTE^XLFDT(IBVDTC,2)," for this site. If RC v"_IBVERSO_" will be needed for this site then",!,?9,"load it first."
  1. ;
  1. Q
  1. ;
  1. VERSTR(RVRS) ; returns string containing list of all Reasonable Charges versions with charges, separated by ","
  1. ; RVRS - if set, returns the list of versions in reverse order
  1. N IBI,LINE,IBS,IBR,IBC,IBX S (IBS,IBR,IBC,IBX)=""
  1. F IBI=1:1 S LINE=$P($T(VLIST+IBI),";;",2,99) Q:'LINE S IBS=IBS_IBC_+LINE,IBR=+LINE_IBC_IBR S IBC=","
  1. S IBX=IBS I +$G(RVRS) S IBX=IBR
  1. Q IBX
  1. ;
  1. ;
  1. ;
  1. ;
  1. ;
  1. ; File Names: 'IBRCyymmx.TXT' w/ yymm - year month of version release (except v1)
  1. ; 'IBRCyymm', file version identifier prefix, from VLIST text version description
  1. ; x=A-I/F, single character file identifier, from FTYPE text file description
  1. ;
  1. FILES(IBFILES,VERS) ; returns array of source Host Files and data for version requested, pass IBFILES by reference
  1. N IBI,LINE,IBTYPE,IBFILE,IBNAME,IBDESC S VERS=+$G(VERS) I 'VERS S VERS=1
  1. ;
  1. ; get requested versions data
  1. F IBI=1:1 S LINE=$P($T(VLIST+IBI),";;",2,99) Q:'LINE I VERS=+LINE S IBTYPE=$P(LINE,U,2),IBFILE=$P(LINE,U,5) Q
  1. ;
  1. ; get requested versions files
  1. I +$G(IBTYPE) F IBI=1:1 S LINE=$P($T(@("FT"_IBTYPE)+IBI),";;",2,99) Q:LINE="" D
  1. . S IBNAME=IBFILE_$P(LINE,":",1)_".TXT",IBDESC="RC v"_+VERS_" "_$P(LINE,":",2,99)
  1. . S IBFILES(IBNAME)=IBDESC
  1. Q
  1. ;
  1. ;
  1. ; versions and their critical data, add new versions here
  1. VLIST ; version ^ file type/version ^ effective date ^ inactive date ^ file prefix
  1. ;;1.0^1^2990901^3001101^IBRCV
  1. ;;1.1^1^3001102^3010507^IBRC0011
  1. ;;1.2^1^3010508^3030428^IBRC0105
  1. ;;1.4^1^3030429^3031218^IBRC0304
  1. ;;2.0^2^3031219^3040414^IBRC0312
  1. ;;2.1^2^3040415^3041231^IBRC0404
  1. ;;2.3^2^3050101^3050410^IBRC0501
  1. ;;2.4^2^3050411^3050930^IBRC0504
  1. ;;2.5^2^3051001^3051231^IBRC0510
  1. ;;2.6^2^3060101^3060824^IBRC0601
  1. ;;2.7^2^3060825^3060930^IBRC0608
  1. ;;2.8^2^3061001^3061231^IBRC0610
  1. ;;2.9^2^3070101^3070930^IBRC0701
  1. ;;2.11^2^3071001^3071231^IBRC0710
  1. ;;3.1^2^3080101^3080930^IBRC0801
  1. ;;3.2^2^3081001^3081231^IBRC0810
  1. ;;3.3^2^3090101^3090930^IBRC0901
  1. ;;3.4^2^3091001^3091231^IBRC0910
  1. ;;3.5^2^3100101^3100930^IBRC1001
  1. ;;3.6^2^3101001^3101231^IBRC1010
  1. ;;3.7^2^3110101^3110930^IBRC1101
  1. ;;3.8^2^3111001^3111231^IBRC1110
  1. ;;3.9^2^3120101^3120930^IBRC1201
  1. ;;3.11^2^3121001^3121231^IBRC1210
  1. ;;3.12^2^3130101^3130930^IBRC1301
  1. ;;3.13^2^3131001^3131231^IBRC1310
  1. ;;3.14^2^3140101^3140930^IBRC1401
  1. ;;3.15^2^3141001^3141231^IBRC1410
  1. ;;3.16^2^3150101^3150930^IBRC1501
  1. ;;3.17^2^3151001^3151231^IBRC1510
  1. ;;3.18^2^3160101^3160930^IBRC1601
  1. ;;3.19^2^3161001^3161231^IBRC1610
  1. ;;3.21^2^3170101^3170930^IBRC1701
  1. ;;3.22^2^3171001^3171231^IBRC1710
  1. ;;3.23^2^3180101^3180930^IBRC1801
  1. ;;3.24^2^3181001^3181231^IBRC1810
  1. ;;3.25^2^3190101^3190930^IBRC1901
  1. ;;3.26^2^3191001^3191231^IBRC1910
  1. ;;3.27^2^3200101^3200930^IBRC2001
  1. ;;4.21^2^3201001^3201231^IBRC2010
  1. ;;4.215^2^3210101^3210930^IBRC2101
  1. ;;4.22^2^3211001^3211231^IBRC2110
  1. ;;4.225^2^3220101^3220930^IBRC2201
  1. ;;4.23^2^3221001^3221231^IBRC2210
  1. ;;4.235^2^3230101^3231231^IBRC2301
  1. ;;5.24^2^3240101^^IBRC2401
  1. ;
  1. FTYPE ; file type/versions and relevant data
  1. ; file identifier is used with XTMP subscript 'IBCR RC ' and routine label to parse file
  1. ; file identifier : file name/description ^ file identifier ^ number of columns (for v2+)
  1. ;
  1. FT1 ; Reasonable Charge File Type 1 files
  1. ;;A:Inpatient Facility Charges^A
  1. ;;B:Inpatient Facility Area Factors^B
  1. ;;C:Outpatient Facility Charges^C
  1. ;;D:Outpatient Facility Area Factors^D
  1. ;;E:Physician Charges E^E
  1. ;;F:Physician Charges F^F
  1. ;;G:Physician Charges G^G
  1. ;;H:Physician Area Factors^H
  1. ;;I:Physician Unit Area Factors^I
  1. ;;
  1. ;
  1. FT2 ; Reasonable Charges File Type 2 files
  1. ;;A:Inpatient Facility Charges^A^10
  1. ;;B:Outpatient Facility Charges^B^14
  1. ;;C:Professional Charges^C^23
  1. ;;D:Service Category Codes^D^4
  1. ;;E:Area Factors^E^41
  1. ;;F:VA Sites and Zip Codes^F^4
  1. ;;