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

BDWALPMR.m

Go to the documentation of this file.
BDWALPMR ; IHS/CMI/LAB - BDW Populate Various DW1 HL7 Segments ; [ 04/05/2007  2:56 PM ]
 ;;1.0;IHS DATA WAREHOUSE;**4**;JAN 23, 2006;Build 24
 ;       
 ;this routine will set up all of the necessary variables to populate varios DW1 HL7 segments
 ;
MAIN ;EP - this is the main routine driver
 S INQUE=1  ;cmi/anch/maw 7/26/04 this appears to suppress output queue setup in GIS for this interfaces A08 message
 ;I '$G(BHLVIEN) S BHLVIEN=INDA
 S DFN=INDA
 S BDWREGID=$$UID^BDWAID(DFN)
 D ZPB,ZRF,ZMC,WH
 K BDWREGID
 Q
 ;
ZPB ;EP - populate the dw1 ZPB segment
 K PRB
 S BDWCNT=0
 D PRB^BDWUTIL2(.PRB,INDA)
 S BDWDA=0 F  S BDWDA=$O(PRB(BDWDA)) Q:'BDWDA  D
 . S BDWDATA=$G(PRB(BDWDA))
 . S BDWCNT=BDWCNT+1
 . S INDA("ZPB",BDWCNT)=""
 . S INA("BDW1ZPB1",BDWCNT)=BDWCNT
 . S INA("BDW1ZPB2",BDWCNT)=$P(BDWDATA,U)_U_$P(BDWDATA,U,2)_U_$P(BDWDATA,U,3)
 . S INA("BDW1ZPB3",BDWCNT)=$P(BDWDATA,U,4)
 . S INA("BDW1ZPB4",BDWCNT)=$P(BDWDATA,U,5)
 . S INA("BDW1ZPB5",BDWCNT)=$P(BDWDATA,U,6)
 . S INA("BDW1ZPB6",BDWCNT)=$P(BDWDATA,U,7)
 . S INA("BDW1ZPB7",BDWCNT)=$P(BDWDATA,U,8)
 . S INA("BDW1ZPB8",BDWCNT)=$P(BDWDATA,U,9)_U_$P(BDWDATA,U,10)
 . S INA("BDW1ZPB9",BDWCNT)=$P(BDWDATA,U,11)
 . S INA("BDW1ZPB10",BDWCNT)=$P(BDWDATA,U,12)
 . S INA("BDW1ZPB11",BDWCNT)=BDWREGID
 K BDWDA,BDWCNT,BDWDATA,PRB
 Q
 ;
ZRF ;EP - populate the dw1 ZRF segment
 K REF
 S BDWCNT=0
 D REF^BDWUTIL2(.REF,INDA)
 S BDWDA=0 F  S BDWDA=$O(REF(BDWDA)) Q:'BDWDA  D
 . S BDWDATA=$G(REF(BDWDA))
 . S BDWCNT=BDWCNT+1
 . S INDA("ZRF",BDWCNT)=""
 . S INA("BDW1ZRF1",BDWCNT)=BDWCNT
 . S INA("BDW1ZRF2",BDWCNT)=$P(BDWDATA,U)
 . S INA("BDW1ZRF3",BDWCNT)=$P(BDWDATA,U,2)
 . S INA("BDW1ZRF4",BDWCNT)=$P(BDWDATA,U,3)
 . S INA("BDW1ZRF5",BDWCNT)=$P(BDWDATA,U,4)_U_$P(BDWDATA,U,5)
 . S INA("BDW1ZRF6",BDWCNT)=$P(BDWDATA,U,6)
 . S INA("BDW1ZRF7",BDWCNT)=BDWREGID
 K BDWCNT,BDWDA,BDWDATA,REF
 Q
 ;
ZMC ;EP - populate the dw1 ZMC
 K IMC
 S BDWCNT=0
 D IMC^BDWUTIL2(.IMC,INDA)
 S BDWDA=0 F  S BDWDA=$O(IMC(BDWDA)) Q:'BDWDA  D
 . S BDWDATA=$G(IMC(BDWDA))
 . S BDWCNT=BDWCNT+1
 . S INDA("ZMC",BDWCNT)=""
 . S INA("BDW1ZMC1",BDWCNT)=BDWCNT
 . S INA("BDW1ZMC2",BDWCNT)=$P(BDWDATA,U)
 . S INA("BDW1ZMC3",BDWCNT)=$P(BDWDATA,U,2)
 . S INA("BDW1ZMC4",BDWCNT)=$P(BDWDATA,U,3)
 . S INA("BDW1ZMC5",BDWCNT)=BDWREGID
 K BDWCNT,BDWDA,BDWDATA,IMC
 Q
 ;
WH ;EP
 K WH
 S BDWCNT=0
 D WH^BDWUTIL2(.WH,INDA)
 S BDWDA=0 F  S BDWDA=$O(WH(BDWDA)) Q:'BDWDA  D
 . S BDWDATA=$G(WH(BDWDA))
 . S BDWCNT=BDWCNT+1
 . S INDA("WHP",BDWCNT)=""
 . S INA("BDW1WH1",BDWCNT)=BDWCNT
 . S INA("BDW1WH2",BDWCNT)="WH"
 . S INA("BDW1WH3",BDWCNT)=$P(BDWDATA,U)
 . S INA("BDW1WH5",BDWCNT)=$P(BDWDATA,U,2)
 . S INA("BDW1WH14",BDWCNT)=$P(BDWDATA,U,3)
 . S INA("BDW1WH15",BDWCNT)=BDWREGID
 K BDWDA,BDWDATA,WH
 Q
 ;