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

ABMUVHF.m

Go to the documentation of this file.
ABMUVHF ; IHS/SD/SDR - UFMS View Host File
 ;;2.6;IHS Third Party Billing;**1**;NOV 12, 2009
 ;IHS/SD/SDR - abm*2.6*1 - Updated display for new fields.  Fixes:
 ;  3PMS10019
 ;  FIXPMS10001
 ;  FIXPMS10011
 ;  FIXPMS10026
 ;  FIXPMS10027
 Q
 ;
EP ;EP - choose file to view
 N ABMDIR,DESTIP,ARGS,ABMUFMS
 S $P(ABMDASH,"-",81)=""
 S ABMDIR=$P($G(^ABMDPARM(DUZ(2),1,4)),U,13)  ;UFMS directory
 I ABMDIR="" D  Q
 .W !!,"Before UFMS files can be created a non-public directory must be created"
 .W !,"on the Host File System. This directory must be entered in UFMS DIRECTORY"
 .W !,"using option SET  UFMS SETUP"
 .W !
 .K DIR S DIR(0)="E" D ^DIR K DIR
 W !!,"CURRENT UFMS DIRECTORY IS ",ABMDIR
 K DIR
 S DIR(0)="FO"
 S DIR("?",1)="Enter a file name e.g. IHS_TPB_RPMS_113510_20070806_084701.DAT,"
 S DIR("?",2)="or a partial filename IHS_TPB_RPMS*, the * is a wildcard,"
 S DIR("?")="or * to list all UFMS files in the UFMS directory."
 S DIR("A")="Enter filename "
 D ^DIR
 Q:$D(DTOUT)!$D(DIROUT)!$D(DUOUT)!(Y="")!(Y=" ")
 S ABMFILE=Y
 I $E(ABMFILE,1,15)="IHS_AR_RPMS_REC" W "   ??" H 1 G EP
 I ABMFILE="*" S ABMFILE="IHS_TPB_RPMS_INV*"
 K ABMARRAY
 D LIST^%ZISH(ABMDIR,ABMFILE,.ABMARRAY)
 I '$D(ABMARRAY) W "    ??" H 1 G EP
 W @IOF
 W !!!,"FILES FOUND: "
 S (ABMKEY,ABMLN,ABMSEL)=""
 S ABMF=1
 F ABMCNT=1:1 S ABMLN=$O(ABMARRAY(ABMLN)) Q:ABMKEY!(ABMLN="")!$G(ABMSEL)  D
 .W !,ABMLN_"."
 .W ?5,ABMARRAY(ABMLN)
 .I '(ABMCNT#10) D
 ..K DIR
 ..S DIR(0)="NO^1:"_ABMCNT
 ..S DIR("A")="Enter item number: "
 ..D ^DIR
 ..S ABMSEL=Y
 ..S ABMKEY=$D(DUOUT)!($D(DTOUT))
 Q:ABMKEY
 I '$G(ABMSEL),ABMLN="" D  Q:ABMKEY
 .K DIR
 .S DIR(0)="NO^1:"_(ABMCNT-1)
 .S DIR("A")="Enter item number: "
 .D ^DIR
 .S ABMSEL=Y
 .S ABMKEY=$D(DUOUT)!($D(DTOUT))!(Y="")
 ;
 S ABMITEM=ABMSEL
 ;
ASKTYP ;EP - ask for type of report--file layout or captioned
 K DIR
 S DIR(0)="SO^F:FILE LAYOUT;C:CAPTIONED"
 D ^DIR
 G:$D(DUOUT)!$D(DTOUT)!(Y="") EP
 S ABMRTYP=Y
 D FILE(ABMDIR,ABMARRAY(ABMITEM),ABMRTYP)
 G EP
 Q
 ;
FILE(ABMDIR,ABMFN,ABMRTYP) ;EP
 ; Pull up a file into the TMP global for display
 N Y,X,I,ABMRTNAM
 S Y=$$OPEN^%ZISH(ABMDIR,ABMFN,"R")
 I Y W !,"CAN'T OPEN FILE" H 3 Q
 S ABMRTNAM=$P($T(+1)," ")
 K ^TMP(ABMRTNAM,$J)
 F I=1:1 U IO R X:1 Q:$$STATUS^%ZISH=-1  S ^TMP(ABMRTNAM,$J,I,0)=X
 D ^%ZISC
 I $D(^TMP(ABMRTNAM,$J)) D DISPLAY(ABMFN,ABMRTYP)
 K ^TMP(ABMRTNAM,$J)
 Q
 ;
DISPLAY(ABMFNAME,ABMRTYP) ;EP - display file
 S (ABMESC,ABMPG)=0
 D FNHDR(ABMFNAME,ABMRTYP)
 S ABMRNUM=0
 F  S ABMRNUM=$O(^TMP(ABMRTNAM,$J,ABMRNUM)) Q:'ABMRNUM!(ABMESC)  D
 .I $Y>(IOSL-4) W ! K DIR S DIR(0)="E" D:'$D(ZTQUEUED) ^DIR S ABMESC=X=U Q:ABMESC  D FNHDR(ABMFNAME,ABMRTYP)
 .S ABMREC=$G(^TMP(ABMRTNAM,$J,ABMRNUM,0))
 .I ABMRTYP="C" D CAPTIONS(ABMFNAME,ABMREC,ABMRNUM) Q
 .W !,ABMRNUM
 .W ?6,ABMREC
 Q:ABMESC
 I '$D(ZTQUEUED) D
 .K DIR
 .S DIR(0)="E"
 .D ^DIR
 Q
 ;
FNHDR(ABMFNAME,ABMRTYP) ;EP - header display
 I IOM=80 D FNHDR80 Q
 I IOM=132 D FNHDR132 Q
 Q
FNHDR132 ;EP - 132 column header
 W !,"NOT YET IMPLEMENTED" H 3
 Q
FNHDR80 ;EP - 80 column header
 S ABMPG=$G(ABMPG)+1
 W @IOF
 S X="UFMS HOST FILE VIEW"
 S X=$J("",IOM-$L(X)\2-$X)_X
 W !,X
 W ?70,"PAGE ",ABMPG
 W !,$$CJ^XLFSTR("FILE: "_ABMFNAME,IOM)
 I ABMRTYP="C" W !,$$CJ^XLFSTR("CAPTIONED LAYOUT",IOM),ABMDASH Q
 W !!?7,"INVOICE#"
 W ?27,"DT/TM APP."
 W ?37,"TAX ID"
 W ?47,"DESCRIPTION"
 W !?67,"BILL AMT"
 W !?7,"CAN"
 W ?17,"HHS T-CD"
 W ?27,"OBJCL"
 W ?32,"BUDG. ACT"
 W ?42,"CC"
 W ?45,"MASTER TIN"
 W ?75,"DOS"  ;abm*2.6*2 FIXPMS10011
 W !?5,"VISIT TYPE"  ;abm*2.6*2 FIXPMS10026
 W ?55,"INSURER TYPE"  ;abm*2.6*2 FIXPMS10027
 W !,ABMDASH
 Q
 ;
CAPTIONS(ABMFNAME,ABMREC,ABMRNUM) ;EP - captioned records
 S ABMRECT=$TR($E(ABMREC,1,1)," ")
 ;start old code abm*2.6*2 NO HEAT
 ;S ABMINV=$TR($E(ABMREC,2,21)," ")
 ;S ABMDTTMA=$TR($E(ABMREC,22,31)," ")
 ;S ABMTAXID=$TR($E(ABMREC,32,41)," ")
 ;S ABMDESC=$TR($E(ABMREC,42,141)," ")
 ;S ABMAMT=+$TR($E(ABMREC,142,161)," ")
 ;S ABMAMT=$E(ABMAMT,1,$L(ABMAMT)-2)_"."_$E(ABMAMT,$L(ABMAMT)-1,$L(ABMAMT))
 ;S ABMAMT=$E(ABMAMT,1,$L(ABMAMT)-2)_"."_$E(ABMAMT,$L(ABMAMT)-1,$L(ABMAMT))
 ;S ABMCAN=$TR($E(ABMREC,162,171)," ")
 ;S ABMTCODE=$TR($E(ABMREC,172,181)," ")
 ;S ABMCL=$TR($E(ABMREC,182,186)," ")
 ;S ABMCC=$TR($E(ABMREC,197,199)," ")
 ;end old code start new code NO HEAT
 S ABMINV=$TR($E(ABMREC,2,41)," ")
 S ABMDTTMA=$TR($E(ABMREC,42,51)," ")
 S ABMTAXID=$TR($E(ABMREC,52,61)," ")
 S ABMDESC=$TR($E(ABMREC,62,161)," ")
 S ABMAMT=+$TR($E(ABMREC,162,181)," ")
 S ABMAMT=$E(ABMAMT,1,$L(ABMAMT)-2)_"."_$E(ABMAMT,$L(ABMAMT)-1,$L(ABMAMT))
 S ABMCAN=$TR($E(ABMREC,192,201)," ")
 S ABMTCODE=$TR($E(ABMREC,202,206)," ")
 S ABMCL=$TR($E(ABMREC,182,186)," ")
 S ABMCC=$TR($E(ABMREC,207,209)," ")
 ;end new code NO HEAT
 S ABMBUDG=$TR($E(ABMREC,187,196)," ")
 S ABMCC=$TR($E(ABMREC,197,199)," ")
 S ABMPTIN=$TR($E(ABMREC,200,209)," ")
 S ABMDOS=$TR($E(ABMREC,230,239)," ")  ;abm*2.6*2 FIXPMS10011
 S ABMVTYP=$TR($E(ABMREC,240,289)," ")  ;abm*2.6*2 FIXPMS10026
 S ABMITYP=$TR($E(ABMREC,290,299)," ")  ;abm*2.6*2 FIXPMS10027
 ;
 I $Y>(IOSL-8) W ! K DIR S DIR(0)="E" D:'$D(ZTQUEUED) ^DIR S ABMESC=X=U Q:ABMESC  D FNHDR(ABMFNAME,ABMRTYP)
 I ABMRECT'="T" D  Q
 .W !!,"RECORD #: ",ABMRNUM
 .W !,"RECORD TYPE: ",ABMRECT
 .W !,"INV#: ",ABMINV
 .W !,"DT/TM APPROVED: ",ABMDTTMA
 .W !,"TAX ID: ",ABMTAXID
 .W !,"DESC: ",ABMDESC
 .W !,"BILL AMT: ",ABMAMT
 .W !,"CAN: ",ABMCAN
 .W !,"HHS T-CODE: ",ABMTCODE
 .W !,"OBJECT CLASS: ",ABMCL
 .W !,"BUDGET ACTIVITY: ",ABMBUDG
 .W !,"COST CENTER: ",ABMCC
 .W !,"MASTER TIN: ",ABMPTIN
 .W !,"DATE OF SERVICE: ",ABMDOS  ;abm*2.6*2 FIXPMS10011
 .W !,"VISIT TYPE: ",ABMVTYP  ;abm*2.6*2 FIXPMS10026
 .W !,"INSURER TYPE: ",ABMITYP  ;abm*2.6*2 FIXPMS10027
 S ABMTREC=$E(ABMREC,2,11)
 S ABMTAMT=$E(ABMREC,12,31)
 I ABMTAMT[("-") D
 .S ABMTAMT="-"_$P(ABMTAMT,"-",2)
 S ABMTAMT=$E(ABMTAMT,1,$L(ABMTAMT)-2)_"."_$E(ABMTAMT,$L(ABMTAMT)-1,$L(ABMTAMT))
 W !,"RECORD TYPE: ",ABMRECT
 W !,"TOTAL RECORDS: ",ABMTREC
 W !,"TOTAL AMOUNT: ",ABMTAMT
 Q