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

BAR276.m

Go to the documentation of this file.
BAR276 ; IHS/SD/LSL - A/R EDI 276 SETUP ;
 ;;1.8;IHS ACCOUNTS RECEIVABLE;;OCT 26, 2005
 ;
 ; Original routine created by cmi/flag/maw - V1.6 Patch 3
 ;
 ; ********************************************************************
 ;
 ; E.g. (msm) : 
 ;       KILL A S A="" D GEN276^BAR276(D) ZW A
 ;       where:  D = IEN of the of the Status File
 ;
GEN276(BARSIEN) ;
 ; DUZ(2) must exist.
 ; BARSIEN = IEN of the Bill.
 ;
 S BARBIEN=$P($G(^BARECLST(BARSIEN,0)),U,2)
 ;S BARBIEN=2737  ;maw test
 S BARDUZ2=$P($G(^BARECLST(BARSIEN,0)),U,3)
 ;S BARDUZ2=1575  ;maw test
 ;
ST ;TRANSACTION SET HEADER
 ; ST01
 S BAR("276HFST1")=276
 ; ST02
 ;S BAR("276HFST2")="0001"  ;make this unique maw
 ;
BHT ;BEGINNING OF HIERARCHICAL TRANSACTION
 ; BHT01
 S BAR("276HFBHT1")="0010"
 ; BHT02
 S BAR("276HFBHT2")="13"
 ; BHT03
 ;S BAR("276HFBHT3")=$TR($$TS_BARSIEN,"-")  not used
 ; BHT04
 S BAR("276HFBHT4")=$E($$TS,1,8)
 ; BHT05
 ;S BAR("276HFBHT5")=$E($$TS,9,12)  not used
 ;
 ;2000A INFORMATION SOURCE LEVEL
 ; HL01
 S BAR("2762000AHL1")=1
 ; HL02
 ; HL03
 S BAR("2762000AHL3")=20
 ; HL04
 S BAR("2762000AHL4")=1
 ;
 ;2100A PAYER NAME
 ; NM101
 S BAR("2762100ANM11")="PR"
 ; NM102
 S BAR("2762100ANM12")=2
 ; NM103
 S BAR("PAYER")=$$GET1^DIQ(90050.01,BARBIEN_","_BARDUZ2_",",3)
 S BAR("2762100ANM13")=BAR("PAYER")
 ; NM104
 ; NM105
 ; NM106
 ; NM107
 ; NM108
 S BAR("2762100ANM18")="NI"
 ; NM109
 S BAR("INS IEN")=$$INSIEN^BARUTL("BILL",BARBIEN,BARDUZ2)
 I $G(BAR("INS IEN")) D
 . S BAR("2762100ANM19")=$$RCID^ABMERUTL(BAR("INS IEN"))
 ;
 ;2100A PAYER CONTACT INFO
 ; PER01n/a
 ; PER02n/a
 ; PER03n/a
 ; PER04n/a
 ; PER05n/a
 ; PER06n/a
 ; PER07n/a
 ; PER08n/a
 ;
 ;2000B INFORMATION RECEIVER LEVEL
 ; HL01
 S BAR("2762000BHL1")=2
 ; HL02
 S BAR("2762000BHL2")=1
 ; HL03
 S BAR("2762000BHL3")=21
 ; HL04
 S BAR("2762000BHL4")=1
 ;
 ;2010B INFORMATION RECEIVER NAME
 ; NM101
 S BAR("2762100BNM11")="41"  ;gis
 ; NM102
 S BAR("2762100BNM12")="2"  ;gis
 ; NM103
 S BAR("2762100BNM13")=$P($G(^DIC(4,BARDUZ2,0)),U)  ;gis
 ; NM104
 ; NM105
 ; NM106
 ; NM107
 ; NM108
 S BAR("2762100BNM18")="FI"  ;gis
 ; NM109
 S BAR("2762100BNM19")=$$GET1^DIQ(9999999.06,BARDUZ2,.21)  ;gis
 ;
 ;2000C SERVICE PROVIDER LEVEL
 ; HL01
 S BAR("2762000CHL1")=3
 ; HL02
 S BAR("2762000CHL2")=2
 ; HL03
 S BAR("2762000CHL3")=19
 ; HL04
 S BAR("2762000CHL4")=1
 ;
 ;2100C PROVIDER NAME
 ; NM101
 S BAR("2762100CNM11")="1P"  ;gis
 ; NM102
 S BAR("2762100CNM12")="2"  ;gis
 ; NM103
 S BAR("2762100CNM13")=$P($G(^DIC(4,BARDUZ2,0)),U)  ;gis
 ; NM104n/a
 ; NM105n/a
 ; NM106n/a
 ; NM107n/a
 ; NM108
 S BAR("2762100CNM18")="FI"  ;gis
 ; NM109
 S BAR("2762100CNM19")=$$GET1^DIQ(9999999.06,BARDUZ2,.21)  ;gis
 ;
 ;2000D SUBSCRIBER LEVEL
 ;
 D SBR^BARUTL(BARDUZ2,BARBIEN)
 ;
 ; HL01
SBR ;
 S BAR("2762000DHL1")=4
 ; HL02
 S BAR("2762000DHL2")=3
 ; HL03
 S BAR("2762000DHL3")=22
 ; HL04
 S BAR("2762000DHL4")=$S($G(BARREL)=18:0,1:1)
 ;
 ;2000D SUBSCRIBER DEMPGRAPHIC INFO
 ; DMG01
 I $G(BARREL)=18 S BAR("2762000DDMG1")="D8"
 ; DMG02
 I $G(BARREL)=18 D
 . S BAR("2762000DDMG2")=$$DOB^ABMUTLN($P(ABMSBR,"-"),$P(ABMSBR,"-",2))
 I $G(BAR("2762000DDMG2")) D
 . S BAR("2762000DDMG2")=$$Y2KD2^BARDUTL(BAR("2762000DDMG2"))
 ; DMG03
 I $G(BARREL)=18 D
 . S BAR("2762000DDMG3")=$$SEX^ABMUTLN($P(ABMSBR,"-"),$P(ABMSBR,"-",2))
 I $G(BAR("2762000DDMG3"))="" D
 . Q:$G(BARREL)'=18
 . S BAR("2762000DDMG3")="U"
 ;
 ;2100D SUBSCRIBER NAME
 ; NM101
 S BAR("2762100DNM11")=$S($G(BARREL)=18:"QC",1:"IL")  ;gis
 ; NM102
 S BAR("2762100DNM12")="1"  ;gis
 ; NM103
 I $G(BARREL)=18 D
 . S BARFILE=2,BARPIEN=$G(ABMPDFN)
 I $G(BARREL)'=18 D
 . S BARFILE=$P(ABMSBR,"-"),BARPIEN=$P(ABMSBR,"-",2)
 S BAR("2762100DNM13")=$$LNM^ABMUTLN(BARFILE,BARPIEN)  ;gis
 ; NM104
 S BAR("2762100DNM14")=$$FNM^ABMUTLN(BARFILE,BARPIEN)  ;gis
 ; NM105
 S BAR("2762100DNM15")=$$MI^ABMUTLN(BARFILE,BARPIEN)
 ; NM106n/a
 ; NM107
 S BAR("2762100DNM17")=$$SFX^ABMUTLN(BARFILE,BARPIEN)
 ; NM108
 S BAR("2762100DNM18")="MI"
 ; NM109
 S BAR("2762100DNM19")=$G(ABMP("SNUM"))
 ;
 ;
 ;2200D CLAIM SUBMITTER TRACE NUMBER
 ; TRN01
 S BAR("2762200DTRN1")=1
 ; TRN02
 S BAR("2762200DTRN2")=$G(BARSIEN)
 ;
 ;2200D PAYER CLAIM ID NUMBER
 ; REF01
 I $G(BARREL)=18 S BAR("2762200DREFA1")="1K"
 ; REF02
 I $G(BARREL)=18 D
 . S BAR("2762200DREFA2")=$P($G(^BARBL(BARDUZ2,BARBIEN,0)),U)
 ;
 ;2200D INSTITUTIONAL BILL TYPE ID
 ; REF01
 I $G(BARREL)=18 S BAR("2762200DREFB1")="BLT"
 ; REF02
 I $G(BARREL)=18 D
 . S BAR("2762200DREFB2")=$G(ABMP("BTYP"))
 ;
 ;2200D MEDICAL RECORD ID
 ; REF01
 I $G(BARREL)=18 S BAR("2762200DREFC1")="EA"
 ; REF02
 I $G(BARREL)=18 D
 . S BAR("VISIT LOC")=$P($G(^BARBL(BARDUZ2,BARBIEN,1)),U,8)
 . I $G(BAR("VISIT LOC")) S BAR("SUB CHART")=$P($G(^AUPNPAT(ABMP("PDFN"),41,BAR("VISIT LOC"),0)),U,2)
 . S BAR("2762200DREFC2")=$G(BAR("SUB CHART"))
 ;
 ;2200D CLAIM SUBMITTED CHARGES
 ; AMT01
 I $G(BARREL)=18 S BAR("2762200DAMT1")="T3"
 ; AMT02
 I $G(BARREL)=18 D
 . S BAR("2762200DAMT2")=$P($G(^BARBL(BARDUZ2,BARBIEN,0)),U,13)
 ; AMT03n/a
 ;
 ;
 ;2200D CLAIM SERVICE DATE
 ; DTP01
 I $G(BARREL)=18 S BAR("2762200DDTP1")=232
 ; DTP02
 I $G(BARREL)=18 S BAR("2762200DDTP2")="RD8"
 ; DTP03
 I $G(BARREL)=18 D
 . S BAR("DOS BEG")=$$Y2KD2^BARDUTL($P($G(^BARBL(BARDUZ2,BARBIEN,1)),U,2))
 . S BAR("DOS END")=$$Y2KD2^BARDUTL($P($G(^BARBL(BARDUZ2,BARBIEN,1)),U,3))
 . S BAR("2762200DDTP3")=BAR("DOS BEG")_"-"_BAR("DOS END")
 ;
 ;2210D SERVICE LINE INFORMATION
 ; SVC01n/A
 ; SVC02n/A
 ; SVC03n/A
 ; SVC04n/A
 ; SVC05n/A
 ; SVC06n/A
 ; SVC07n/A
 ;
 ;2210D SERVICE LINE ITEM ID
 ; REF01n/a
 ; REF02n/a
 ;
 ;2210D SERVICE LINE DATE
 ; DTP01n/a
 ; DTP02n/a
 ; DTP03n/a
 ;
DEP ;2000E DEPENDENT LEVEL
 Q:$G(BARREL)=18
 ; HL01
 S BAR("2762000EHL1")=5
 ; HL02
 S BAR("2762000EHL2")=4
 ; HL03
 S BAR("2762000EHL3")=23
 ; HL04
 ;S BAR("2762000EHL4")=""  not used
 ;
 ;2000E DEPENDENT DEMPGRAPHIC INFO
 ; DMG01
 S BAR("2762000EDMG1")="D8"
 ; DMG02
 S BAR("2762000EDMG2")=$$DOB^ABMUTLN($P(ABMSBR,"-"),$P(ABMSBR,"-",2))
 I $G(BAR("2762000EDMG2")) D
 . S BAR("2762000EDMG2")=$$Y2KD2^BARDUTL(BAR("2762000EDMG2"))
 ; DMG03
 S BAR("2762000EDMG3")=$$SEX^ABMUTLN($P(ABMSBR,"-"),$P(ABMSBR,"-",2))
 I $G(BAR("2762000EDMG3"))="" S BAR("2762000EDMG3")="U"
 ;
 ;2100E DEPENDENT NAME
 ; NM101
 S BAR("2762100ENM11")="QC"  ;gis
 ; NM102
 S BAR("2762100ENM12")="1"  ;gis
 ; NM103
 S BARFILE=$P(ABMSBR,"-"),BARPIEN=$P(ABMSBR,"-",2)
 S BAR("2762100ENM13")=$$LNM^ABMUTLN(BARFILE,BARPIEN)  ;gis
 ; NM104
 S BAR("2762100ENM14")=$$FNM^ABMUTLN(BARFILE,BARPIEN)  ;gis
 ; NM105
 S BAR("2762100ENM15")=$$MI^ABMUTLN(BARFILE,BARPIEN)
 ; NM106n/a
 ; NM107
 S BAR("2762100ENM17")=$$SFX^ABMUTLN(BARFILE,BARPIEN)
 ; NM108
 S BAR("2762100ENM18")="MI"
 ; NM109
 S BAR("2762100ENM19")=$G(ABMP("PNUM"))
 ;
 ;
 ;2200E CLAIM SUBMITTER TRACE NUMBER
 ; TRN01
 S BAR("2762200ETRN1")=1
 ; TRN02
 S BAR("2762200ETRN2")=$G(BARSIEN)
 ;
 ;2200E PAYER CLAIM ID NUMBER
 ; REF01
 S BAR("2762200EREFA1")="1K"
 ; REF02
 S BAR("2762200EREFA2")=$P($G(^BARBL(BARDUZ2,BARBIEN,0)),U)
 ;
 ;2200E INSTITUTIONAL BILL TYPE ID
 ; REF01
 S BAR("2762200EREFB1")="BLT"
 ; REF02
 S BAR("2762200EREFB2")=$G(ABMP("BTYP"))
 ;
 ;2200E MEDICAL RECORD ID
 ; REF01
 S BAR("2762200EREFC1")="EA"
 ; REF02
 S BAR("VISIT LOC")=$P($G(^BARBL(BARDUZ2,BARBIEN,1)),U,8)
 I $G(BAR("VISIT LOC")) S BAR("DEP CHART")=$P($G(^AUPNPAT(ABMP("PDFN"),41,BAR("VISIT LOC"),0)),U,2)
 S BAR("2762200EREFC2")=$G(BAR("DEP CHART"))
 ;
 ;2200E CLAIM SUBMITTED CHARGES
 ; AMT01
 S BAR("2762200EAMT1")="T3"
 ; AMT02
 S BAR("2762200EAMT2")=$P($G(^BARBL(BARDUZ2,BARBIEN,0)),U,13)
 ; AMT03n/a
 ;
 ;
 ;2200E CLAIM SERVICE DATE
 ; DTP01
 S BAR("2762200EDTP1")=232
 ; DTP02
 S BAR("2762200EDTP2")="RD8"
 ; DTP03
 S BAR("DOS BEG")=$$Y2KD2^BARDUTL($P($G(^BARBL(BARDUZ2,BARBIEN,1)),U,2))
 S BAR("DOS END")=$$Y2KD2^BARDUTL($P($G(^BARBL(BARDUZ2,BARBIEN,1)),U,3))
 S BAR("2762200EDTP3")=BAR("DOS BEG")_"-"_BAR("DOS END")
 ;
 ;2210D SERVICE LINE INFORMATION
 ; SVC01n/A
 ; SVC02n/A
 ; SVC03n/A
 ; SVC04n/A
 ; SVC05n/A
 ; SVC06n/A
 ; SVC07n/A
 ;
 ;2210D SERVICE LINE ITEM ID
 ; REF01n/a
 ; REF02n/a
 ;
 ;2210D SERVICE LINE DATE
 ; DTP01n/a
 ; DTP02n/a
 ; DTP03n/a
 ;
GIS ;-- make the gis call
 S BARMSG=$$276^BHLEVENT(BARSIEN,.BAR)
 Q
 ;
TS() ;-- make a time stamp
 D NOW^%DTC
 Q $$TS^INHUT1(%)
 ;