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

ABMAPAS1.m

Go to the documentation of this file.
ABMAPAS1 ; IHS/ASDST/DMJ - PASS INFO TO A/R ;
 ;;2.6;IHS 3P BILLING SYSTEM;;NOV 12, 2009
 ;
 ; IHS/SD/SDR - v2.5 p10 - IM20395
 ;   Split out lines bundled by rev code
 ;
 ; IHS/SD/SDR - v2.6 CSV
 ;
START ;START HERE
 Q:X'="A"&(X'="X")&(X'="B")
 Q:'$L($T(TPB^BARUP))
 K ABMA
 S (ABMA("BLDA"),ABMP("BDFN"))=DA
 S ABMA("ACTION")=X S:X="X" ABMA("ACTION")="C"
 N I F I=1:1 S ABMA("LINE")=$T(TXT+I) Q:ABMA("LINE")["END"  D
 .S ABMA("DR")=$P(ABMA("LINE"),";;",2)
 .S ABMA($P(ABMA("LINE"),";;",3))=$$VALI^XBDIQ1(DIC,DA,ABMA("DR"))
 .I ABMA("DR")=.17,ABMA("DTBILL") S ABMA("DTBILL")=$$VALI^XBDIQ1(^DIC(9002274.6,0,"GL"),ABMA("DTBILL"),.01)
 I ABMA("ACTION")="B",ABMA("DTBILL")="" S ABMA("DTBILL")=DT
 D BLNM
 N I,DA,K S K=0 F I=21,23,25,27,33,35,37,39,43 D
 .K ABM,ABMRV
 .D @(I_"^ABMERGR2")
 .Q:'$D(ABMRV)
 .D CONV
 D ORV^ABMERGRV N I S I=.97 D CONV
 N ABME D
 .S ABMP("ITYPE")=$P($G(^AUTNINS(+ABMA("INS"),2)),"^",1) D ISET^ABMERUTL,CONV2 K ABMP("SET")
 .S ABMP("PDFN")=ABMA("PTNM")
 .S ABME("INS")=ABMA("INS") D EN^XBNEW("ISET^ABMERINS","ABME,ABMP,ABMR") S ABMA("POLH")=$G(ABME("PHNM")),ABMA("POLN")=$G(ABMR(30,70))
 D PROV
 S ABMA("CREDIT")=$$TCR^ABMERUTL(ABMP("BDFN"))
 K ABMA("LINE"),ABMA("DR"),ABMA("DA")
 I $P($G(^AUTNINS(ABMA("INS"),2)),"^",1)="N" S ABMA("INS")=""
 D TPB^BARUP(.ABMA)
 K ABMA,ABM,ABMR
 Q
BLNM ;BILL NAME
 I $P($G(^ABMDPARM(DUZ(2),1,2)),"^",4)]"" S ABMA("BLNM")=ABMA("BLNM")_"-"_$P(^(2),"^",4)
 I $P($G(^ABMDPARM(DUZ(2),1,3)),"^",3) D
 .S ABM("HRN")=$P($G(^AUPNPAT(ABMA("PTNM"),41,ABMA("VSLC"),0)),"^",2)
 .S:ABM("HRN")]"" ABMA("BLNM")=ABMA("BLNM")_"-"_ABM("HRN")
 Q
CONV ;CONVERT ABMRV ARRAY TO ABMA ARRAY
 N L,J
 S L=-1
 F  S L=$O(ABMRV(L)) Q:L=""  D
 .S J=-1
 .F  S J=$O(ABMRV(L,J)) Q:J=""  D
 ..S M=0
 ..F  S M=$O(ABMRV(L,J,M)) Q:M=""  D
 ...S K=K+1
 ...S ABMA(K,"DOS")=""
 ...S ABMA(K,"BLSRV")=$P(^DD(9002274.4,I,0),U)
 ...S ABMA(K,"BLSRV")=$$UPC^ABMERUTL(ABMA(K,"BLSRV"))
 ...S ABMA(K,"ITCODE")=L
 ...S ABMA(K,"ITQT")=$P(ABMRV(L,J,M),U,5)
 ...S ABMA(K,"ITUC")=$P(ABMRV(L,J,M),U,6)
 ...I I=23 D
 ....S ABMA(K,"OTUC")=ABM(5),ABMA(K,"OTIT")="DISPENSE FEE"
 ....S ABMA(K,"ITUC")=ABMA(K,"ITUC")-ABM(5)
 ...I I=25 S ABMA(K,"ITNM")=$P($G(^AUTTREVN(L,0)),U,2)
 ...I J,I'=33 D
 ....S ABMA(K,"ITNM")=$P($$CPT^ABMCVAPI(J,$P(ABMRV(L,J,M),U,10),ABMP("VDT")),U,3)  ;CSV-c
 ....S ABMA(K,"ITCODE")=J
 ...I J,I=33 D
 ....S ABMA(K,"ITCODE")=$P(ABMRV(L,J,M),U,2)
 ...S:$P(ABMRV(L,J,M),U,9)'="" ABMA(K,"ITNM")=$P(ABMRV(L,J,M),U,9)
 ...S:$P(ABMRV(L,J,M),U,10) ABMA(K,"DOS")=$P(ABMRV(L,J,M),U,10)
 ...I '$G(ABMA(K,"ITQT")) S ABMA(K,"ITUC")=0 Q
 ...S ABMA(K,"ITUC")=$J(ABMA(K,"ITUC")/ABMA(K,"ITQT"),1,3)
 Q
CONV2 ;CONVERT INSURER ARRAY
 F I=1:1:3 D
 .Q:'$D(ABMP("INS",I))
 .Q:ABMA("ACTION")="C"
 .S:+ABMP("INS",I)=ABMA("INS") ABMA("ACTION")=I
 .S:$P($G(^AUTNINS(+ABMP("INS",I),0)),"^",1)="N" ABMP("INS",I)=""
 S ABMA("PRIM")=$P($G(ABMP("INS",1)),"^",1)
 S ABMA("SEC")=$P($G(ABMP("INS",2)),"^",1)
 S ABMA("TERT")=$P($G(ABMP("INS",3)),"^",1)
 Q
PROV ;GET ATTENDING PROVIDER
 S ABMA("PROV")=""
 N I S I=$O(^ABMDBILL(DUZ(2),ABMP("BDFN"),41,"C","A",0))
 Q:'I
 N J S J=$P(^ABMDBILL(DUZ(2),ABMP("BDFN"),41,I,0),"^",1)
 S ABMA("PROV")=J
 Q
TXT ;FIELDS
 ;;.01;;BLNM
 ;;.03;;VSLC
 ;;.05;;PTNM
 ;;.07;;VSTP
 ;;.08;;INS
 ;;.1;;CLNC
 ;;.15;;DTAP
 ;;.17;;DTBILL
 ;;.21;;BLAMT
 ;;.71;;DOSB
 ;;.72;;DOSE
 ;;END
EXT ;EP - EXTERNAL CALL (NEEDS DA DEFINED)
 S DIC="^ABMDBILL(DUZ(2),"
 S X="A"
 D START
 K ABM,ABMP,ABMA,ABME
 Q