BHLZV1 ; cmi/sitka/maw - BHL GIS ZV1 Supplement ;
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;
;
;this routine will supplement the GIS ZV1 segment
;
VHSP ;-- generate ZV1 fields from the V Hospitalization file
S BHLDA=$O(^AUPNVINP("AD",BHL("VIEN"),0))
Q:'BHLDA
S BHLASVCI=$$VALI^XBDIQ1(9000010.02,BHLDA,.04)
S BHLASVCE=$$VAL^XBDIQ1(9000010.02,BHLDA,.04)
S BHLASVCC=$S(BHLASVCI'="":$$VAL^XBDIQ1(45.7,BHLASVCI,9999999.01),1:"")
S INA("ZV110")=BHLASVCC_CS_BHLASVCE_CS_BHL("IHST")
S BHLDSVCI=$$VALI^XBDIQ1(9000010.02,BHLDA,.05)
S BHLDSVCE=$$VAL^XBDIQ1(9000010.02,BHLDA,.05)
S BHLDSVCC=$S(BHLDSVCI'="":$$VAL^XBDIQ1(45.7,BHDASVCI,9999999.01),1:"")
S INA("ZV111")=BHLDSVCC_CS_BHLDSVCE_CS_BHL("IHST")
S INA("ZV112")=$$VAL^XBDIQ1(9000010.02,BHLDA,.08)
S INA("ZV113")=$$VALI^XBDIQ1(9000010.02,BHLDA,.11)
S INA("ZV114")=$$VALI^XBDIQ1(9000010.02,BHLDA,.13)
;
VCHS ;-- generate ZV1 fields from the V CHS file
S BHLDA=$O(^AUPNVCHS("AD",BHL("VIEN"),0))
Q:'BHLDA
S BHLCAN=$$VAL^XBDIQ1(9000010.03,BHLDA,.04)
S BHLCAF=$$VAL^XBDIQ1(9000010.03,BHLDA,.01)
S INA("ZV115")=BHLCAN_CS_BHLCAF
S BHLPSI=$$VALI^XBDIQ1(9000010.03,BHLDA,.05)
S BHLPSE=$$VAL^XBDIQ1(9000010.03,BHLDA,.05)
S INA("ZV116")=BHLPSI_CS_BHLPSE_CS_BHL("IHST")
S INA("ZV117")=$$VAL^XBDIQ1(9000010.03,BHLDA,.06)
S BHLSTI=$$VALI^XBDIQ1(9000010.03,BHLDA,.11)
S BHLSTE=$$VAL^XBDIQ1(9000010.03,BHLDA,.11)
S INA("ZV118")=BHLSTI_CS_BHLSTE_CS_BHL("IHST")
S INA("ZV119")=$$VAL^XBDIQ1(9000010.03,BHLDA,.12)
S INA("ZV120")=$$VAL^XBDIQ1(9000010.03,BHLDA,.13)
S INA("ZV121")=$$VAL^XBDIQ1(9000010.03,BHLDA,.14)
;
VACT ;-- generate the ZV1 fields from the V Activity File
S BHLDA=$O(^AUPNVACT("AD",BHL("VIEN"),0))
Q:'BHLDA
S INA("ZV122")=$$VAL^XBDIQ1(9000010.19,BHLDA,.01)
S INA("ZV123")=$$VAL^XBDIQ1(9000010.19,BHLDA,.04)
;
EOJ ;-- lets kill the variables
K BHLDA,BHLCAN,BHLCAF,BHLPSI,BHLPSE,BHLSTI,BHLSTE,BHLASVCI,BHLASVCE
K BHLASVCC,BHLDSVCI,BHLDSVCE,BHLDSVCC
Q
;
BHLZV1 ; cmi/sitka/maw - BHL GIS ZV1 Supplement ;
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;
+3 ;
+4 ;this routine will supplement the GIS ZV1 segment
+5 ;
VHSP ;-- generate ZV1 fields from the V Hospitalization file
+1 SET BHLDA=$ORDER(^AUPNVINP("AD",BHL("VIEN"),0))
+2 IF 'BHLDA
QUIT
+3 SET BHLASVCI=$$VALI^XBDIQ1(9000010.02,BHLDA,.04)
+4 SET BHLASVCE=$$VAL^XBDIQ1(9000010.02,BHLDA,.04)
+5 SET BHLASVCC=$SELECT(BHLASVCI'="":$$VAL^XBDIQ1(45.7,BHLASVCI,9999999.01),1:"")
+6 SET INA("ZV110")=BHLASVCC_CS_BHLASVCE_CS_BHL("IHST")
+7 SET BHLDSVCI=$$VALI^XBDIQ1(9000010.02,BHLDA,.05)
+8 SET BHLDSVCE=$$VAL^XBDIQ1(9000010.02,BHLDA,.05)
+9 SET BHLDSVCC=$SELECT(BHLDSVCI'="":$$VAL^XBDIQ1(45.7,BHDASVCI,9999999.01),1:"")
+10 SET INA("ZV111")=BHLDSVCC_CS_BHLDSVCE_CS_BHL("IHST")
+11 SET INA("ZV112")=$$VAL^XBDIQ1(9000010.02,BHLDA,.08)
+12 SET INA("ZV113")=$$VALI^XBDIQ1(9000010.02,BHLDA,.11)
+13 SET INA("ZV114")=$$VALI^XBDIQ1(9000010.02,BHLDA,.13)
+14 ;
VCHS ;-- generate ZV1 fields from the V CHS file
+1 SET BHLDA=$ORDER(^AUPNVCHS("AD",BHL("VIEN"),0))
+2 IF 'BHLDA
QUIT
+3 SET BHLCAN=$$VAL^XBDIQ1(9000010.03,BHLDA,.04)
+4 SET BHLCAF=$$VAL^XBDIQ1(9000010.03,BHLDA,.01)
+5 SET INA("ZV115")=BHLCAN_CS_BHLCAF
+6 SET BHLPSI=$$VALI^XBDIQ1(9000010.03,BHLDA,.05)
+7 SET BHLPSE=$$VAL^XBDIQ1(9000010.03,BHLDA,.05)
+8 SET INA("ZV116")=BHLPSI_CS_BHLPSE_CS_BHL("IHST")
+9 SET INA("ZV117")=$$VAL^XBDIQ1(9000010.03,BHLDA,.06)
+10 SET BHLSTI=$$VALI^XBDIQ1(9000010.03,BHLDA,.11)
+11 SET BHLSTE=$$VAL^XBDIQ1(9000010.03,BHLDA,.11)
+12 SET INA("ZV118")=BHLSTI_CS_BHLSTE_CS_BHL("IHST")
+13 SET INA("ZV119")=$$VAL^XBDIQ1(9000010.03,BHLDA,.12)
+14 SET INA("ZV120")=$$VAL^XBDIQ1(9000010.03,BHLDA,.13)
+15 SET INA("ZV121")=$$VAL^XBDIQ1(9000010.03,BHLDA,.14)
+16 ;
VACT ;-- generate the ZV1 fields from the V Activity File
+1 SET BHLDA=$ORDER(^AUPNVACT("AD",BHL("VIEN"),0))
+2 IF 'BHLDA
QUIT
+3 SET INA("ZV122")=$$VAL^XBDIQ1(9000010.19,BHLDA,.01)
+4 SET INA("ZV123")=$$VAL^XBDIQ1(9000010.19,BHLDA,.04)
+5 ;
EOJ ;-- lets kill the variables
+1 KILL BHLDA,BHLCAN,BHLCAF,BHLPSI,BHLPSE,BHLSTI,BHLSTE,BHLASVCI,BHLASVCE
+2 KILL BHLASVCC,BHLDSVCI,BHLDSVCE,BHLDSVCC
+3 QUIT
+4 ;