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

ABME650.m

Go to the documentation of this file.
ABME650 ; IHS/ASDST/DMJ - UB92 EMC RECORD 50 (INPATIENT ACCOMMODATIONS) ;   
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
 ;Original;DMJ;07/19/96 5:20 PM
START ;START HERE
 K ABMR(50),ABMREC(50)
 S ABME("RTYPE")=50
 D SET^ABMERUTL
 S ABME("S#")=1 D LOOP
 D S90^ABMERUTL
 K ABM
 Q
LOOP ;LOOP HERE
 F I=10,20,30,35,40:10:90,110,120,130 D
 .D @I
 .I $D(^ABMEXLM("AA",+$G(ABMP("INS")),+$G(ABMP("EXP")),50,I)) D @(^(I))
 .I '$G(ABMP("NOFMT")) S ABMREC(50,ABME("S#"))=$G(ABMREC(50,ABME("S#")))_ABMR(50,I)
 Q
10 ;1-2 Record type
 S ABMR(50,10)=50
 Q
20 ;3-5 Sequence 
 S ABMR(50,20)=ABME("S#")
 S ABMR(50,20)=$$FMT^ABMERUTL(ABMR(50,20),"3NR")
 Q
30 ;6-25 Patient Control Number
 S ABMR(50,30)=$$EX^ABMER20(30,ABMP("BDFN"))
 S ABMR(50,30)=$$FMT^ABMERUTL(ABMR(50,30),20)
 Q
35 ;26-28, Filler (National Use)
 S ABMR(50,35)=""
 S ABMR(50,35)=$$FMT^ABMERUTL(ABMR(50,35),3)
 Q
40 ;29-32 Accommodations Revenue Code 1
 D GET25 S ABMR(50,40)=$P(ABM(25,1),U)
 S ABMR(50,40)=$$FMT^ABMERUTL(ABMR(50,40),"4NR")
 Q
50 ;33-41 Accommodations Rate 1
 D GET25 S ABMR(50,50)=$P(ABM(25,1),"^",3)
 S ABMR(50,50)=$$FMT^ABMERUTL(ABMR(50,50),"9RNJ2")
 Q
60 ;42-45 Accommodation Days 1
 D GET25 S ABMR(50,60)=$P(ABM(25,1),"^",2)
 S ABMR(50,60)=$$FMT^ABMERUTL(ABMR(50,60),"4NR")
 Q
70 ;46-55 Accommodation Total Charges 1
 D GET25 S ABMR(50,70)=$P(ABM(25,1),"^",4)
 S ABMR(50,70)=$$FMT^ABMERUTL(ABMR(50,70),"10NRJ2")
 Q
80 ;56-65 Accommodations Non-Covered Charges 1
 D GET25
 S ABMR(50,80)=$$FMT^ABMERUTL(ABMR(50,80),"10NRJ2")
 Q
90 ;66-69 Form Locator 49 1
 S ABMR(50,90)=""
 S ABMR(50,90)=$$FMT^ABMERUTL(ABMR(50,90),4)
 Q
110 ;70-110 Accommodations Revenue Code 2
 D GET25
 S ABM("RC#")=2
 N I F I=1101:1:1106 D @I S ABMR(50,110)=$G(ABMR(50,110))_ABMR(50,I)
 Q
120 ;111-151 Accommodations Revenue Code 3
 D GET25
 S ABM("RC#")=3
 N I F I=1201:1:1206 D @(I-100) S ABMR(50,120)=$G(ABMR(50,120))_ABMR(50,I)
 Q
130 ;152-192 Accommodations Revenue Code 4
 D GET25
 S ABM("RC#")=4
 N I F I=1301:1:1306 D @(I-200) S ABMR(50,130)=$G(ABMR(50,130))_ABMR(50,I)
 Q
1101 ;Revenue Code    
 S ABMR(50,I)=$P(ABM(25,ABM("RC#")),U)
 S ABMR(50,I)=$$FMT^ABMERUTL(ABMR(50,I),"4NR")
 Q
1102 ;Rate
 S ABMR(50,I)=$P(ABM(25,ABM("RC#")),"^",3)
 S ABMR(50,I)=$$FMT^ABMERUTL(ABMR(50,I),"9RNJ2")
 Q
1103 ;Days
 S ABMR(50,I)=$P(ABM(25,ABM("RC#")),"^",2)
 S ABMR(50,I)=$$FMT^ABMERUTL(ABMR(50,I),"4NR")
 Q
1104 ;Total Charges
 S ABMR(50,I)=$P(ABM(25,ABM("RC#")),"^",4)
 S ABMR(50,I)=$$FMT^ABMERUTL(ABMR(50,I),"10NRJ2")
 Q
1105 ;Non-Covered Charges
 S ABMR(50,I)=""
 I $P(ABM(25,ABM("RC#")),U)="001" S ABMR(50,I)=ABMR(50,80)
 S ABMR(50,I)=$$FMT^ABMERUTL(ABMR(50,I),"10NR")
 Q
1106 ;Form Locator 49
 S ABMR(50,I)=""
 S ABMR(50,I)=$$FMT^ABMERUTL(ABMR(50,I),4)
 Q
GET25 ;GET INFO FOR ROOM AND BOARD CHARGES   
 Q:$D(ABM(25))
 N I K ABMP("FLAT") D FRATE^ABMDF11
 S ABM("T2")=0,ABM("T4")=0
 I '$D(ABMP("FLAT")) D
 .N I S I=0,CNT=0 F  S I=$O(^ABMDBILL(DUZ(2),ABMP("BDFN"),25,I)) Q:'I!(CNT>2)  D
 ..S CNT=CNT+1
 ..S ABM(25,CNT)=^ABMDBILL(DUZ(2),ABMP("BDFN"),25,I,0)
 ..S $P(ABM(25,CNT),"^",4)=$P(ABM(25,CNT),"^",3)*$P(ABM(25,CNT),"^",2)
 ..S ABM("T2")=ABM("T2")+$P(ABM(25,CNT),"^",2),ABM("T4")=ABM("T4")+$P(ABM(25,CNT),"^",4)
 I $D(ABMP("FLAT")) D
 .Q:$P(ABMP("FLAT"),"^",2)>219
 .S CNT=1
 .S ABM(25,1)=$P(ABMP("FLAT"),"^",2)_"^"_$P(ABMP("FLAT"),"^",3)_"^"_$P(ABMP("FLAT"),U)_"^"_($P(ABMP("FLAT"),U)*$P(ABMP("FLAT"),"^",3))
 .S ABM("T2")=ABM("T2")+$P(ABM(25,1),"^",2),ABM("T4")=ABM("T4")+$P(ABM(25,1),"^",4)
 S ABMRT(90,130)=+$G(ABMRT(90,130))+ABM("T4")
 S ABMRT(95,80)=+$G(ABMRT(95,80))+ABM("T4")
 S ABMRT(99,60)=+$G(ABMRT(99,60))+ABM("T4")
 S ABMR(50,80)="",ABM("NCDAYS")=$P($G(^ABMDBILL(DUZ(2),ABMP("BDFN"),6)),"^",6) I ABM("NCDAYS") D
 .S ABMR(50,80)=ABM("NCDAYS")*$P(ABM(25,1),"^",3)
 .S ABMRT(90,140)=ABMR(50,80)
 .S ABMRT(95,90)=+$G(ABMRT(95,90))+ABMR(50,80)
 .S ABMRT(99,70)=+$G(ABMRT(99,70))+ABMR(50,80)
 S CNT=CNT+1,ABM(25,CNT)="001^"_ABM("T2")_"^^"_ABM("T4")
 F I=1:1:4 S:'$D(ABM(25,I)) ABM(25,I)=""
 Q
EX(ABMX,ABMY) ;EXTRINSIC FUNCTION HERE
 ;X=data element, Y=bill internal entry number
 S ABMP("BDFN")=ABMY D SET^ABMERUTL
 I '$G(ABMP("NOFMT")) S ABMP("FMT")=0
 D @ABMX
 S Y=ABMR(50,ABMX)
 I $D(ABMP("FMT")) S ABMP("FMT")=1
 K ABMR(50,ABMX),ABME,ABMX,ABMY,ABMZ,ABM
 Q Y