BDGHL7I ; IHS/ANMC/LJF - INBOUND HL7 DATA TO PIMS ;
;;5.3;PIMS;;APR 26, 2002
;
; Called by BHLPV1I to process PV1 segments
; Variables set in BHL routines:
; CS = component separator
; BHLET = Event type (A01, A03, etc.)
; BHLTMP = array of message items (BHL("PV1"))
;
PARSE ; -- parse through array BHLTMP and build PIMS array
NEW ARRAY,ITEM
S ITEM=$G(@BHLTMP@(1,3)) ;location info (fac, cln/ward, room)
S LOC=$P(ITEM,CS),HLOC=$P(ITEM,CS,2)
; DO LOOKUP ON LOCATION AND GET ASUFAC CODE
S ARRAY("LOC")=$$GET1^DIQ(9999999.06,+ITEM,.0799) ;asufac code
; DO LOOKUP ON HOSP LOCATION AND DETERMINE IF WARD OR CLINIC
I $$GET1^DIQ(44,+$P(ITEM,CS,2),2)="WARD" D
. S ARRAY("WARD")=$P(ITEM,CS,2)
;
; location determines if call is to ADT or Scheduling
I $D(ARRAY("WARD")) D ADT Q
D APPT
Q
;
ADT ; -- continue parsing ADT items
NEW ITEM,X
S ITEM=$G(@BHLTMP@(1,4)) ;admission type
;NEED TO KNOW IF THIS WILL BE IHS OR UB92 ADMIT TYPE
;
S ITEM=$G(@BHLTMP@(1,7)) ;attending doctor
;WILL PROVIDER ID BE USED? NAMES ARE NOT UNIQUE
;
S ITEM=$G(@BHLTMP@(1,8)) ;referring doctor
;WILL WE STILL USE FREE TEXT? ONLY IF NOT REQUIRED ON MS4 SIDE
;
S ITEM=$G(@BHLTMP@(1,10)) ;hospital service
;IHS SPECS SAY SERVICE CATEGORY?????
;
S ITEM=$G(@BHLTMP@(1,14)) ;admit source
;WAITING FOR VALID VALUES FROM MS4 PROGRAMMER
;
S ITEM=$G(@BHLTMP@(1,17)) ;admitting doctor
;SAME QUESTIONS ABOUT ID AS ATTENDING
;
S ITEM=$G(@BHLTMP@(1,36)) ;discharge disposition
;WAITING FOR VALID VALUES FROM MS4
;
S ITEM=$G(@BHLTMP@(1,37)) ;discharged to location
S ARRAY("TFAC")=ITEM
;NEED MS4 TO SUPPORT FIELD AND LOCAL TABLE
;ALSO NEED FOR ADMITS
;
S ITEM=$G(@BHLTMP@(1,44)) ;admit date/time
S ARRAY("DATE")=ITEM
;WOULD BOTH ADMIT AND DISCHARGE DATE BE SENT AT SAME TIME?
;WOULD MORE THAN ONE MOVEMENT BE SENT IN ONE PV1 SEGMENT?
;
S ITEM=$G(@BHLTMP@(1,45)) ;discharge date/time
S ARRAY("DATE")=ITEM
;
;DETERMINE IF ADD, EDIT OR CANCEL
;THEN CALL ^BDGAPI AT ADD, EDIT OR CANCEL ENTRY POINT
Q
;
APPT ; -- continue parsing Scheduling items
Q
BDGHL7I ; IHS/ANMC/LJF - INBOUND HL7 DATA TO PIMS ;
+1 ;;5.3;PIMS;;APR 26, 2002
+2 ;
+3 ; Called by BHLPV1I to process PV1 segments
+4 ; Variables set in BHL routines:
+5 ; CS = component separator
+6 ; BHLET = Event type (A01, A03, etc.)
+7 ; BHLTMP = array of message items (BHL("PV1"))
+8 ;
PARSE ; -- parse through array BHLTMP and build PIMS array
+1 NEW ARRAY,ITEM
+2 ;location info (fac, cln/ward, room)
SET ITEM=$GET(@BHLTMP@(1,3))
+3 SET LOC=$PIECE(ITEM,CS)
SET HLOC=$PIECE(ITEM,CS,2)
+4 ; DO LOOKUP ON LOCATION AND GET ASUFAC CODE
+5 ;asufac code
SET ARRAY("LOC")=$$GET1^DIQ(9999999.06,+ITEM,.0799)
+6 ; DO LOOKUP ON HOSP LOCATION AND DETERMINE IF WARD OR CLINIC
+7 IF $$GET1^DIQ(44,+$PIECE(ITEM,CS,2),2)="WARD"
Begin DoDot:1
+8 SET ARRAY("WARD")=$PIECE(ITEM,CS,2)
End DoDot:1
+9 ;
+10 ; location determines if call is to ADT or Scheduling
+11 IF $DATA(ARRAY("WARD"))
DO ADT
QUIT
+12 DO APPT
+13 QUIT
+14 ;
ADT ; -- continue parsing ADT items
+1 NEW ITEM,X
+2 ;admission type
SET ITEM=$GET(@BHLTMP@(1,4))
+3 ;NEED TO KNOW IF THIS WILL BE IHS OR UB92 ADMIT TYPE
+4 ;
+5 ;attending doctor
SET ITEM=$GET(@BHLTMP@(1,7))
+6 ;WILL PROVIDER ID BE USED? NAMES ARE NOT UNIQUE
+7 ;
+8 ;referring doctor
SET ITEM=$GET(@BHLTMP@(1,8))
+9 ;WILL WE STILL USE FREE TEXT? ONLY IF NOT REQUIRED ON MS4 SIDE
+10 ;
+11 ;hospital service
SET ITEM=$GET(@BHLTMP@(1,10))
+12 ;IHS SPECS SAY SERVICE CATEGORY?????
+13 ;
+14 ;admit source
SET ITEM=$GET(@BHLTMP@(1,14))
+15 ;WAITING FOR VALID VALUES FROM MS4 PROGRAMMER
+16 ;
+17 ;admitting doctor
SET ITEM=$GET(@BHLTMP@(1,17))
+18 ;SAME QUESTIONS ABOUT ID AS ATTENDING
+19 ;
+20 ;discharge disposition
SET ITEM=$GET(@BHLTMP@(1,36))
+21 ;WAITING FOR VALID VALUES FROM MS4
+22 ;
+23 ;discharged to location
SET ITEM=$GET(@BHLTMP@(1,37))
+24 SET ARRAY("TFAC")=ITEM
+25 ;NEED MS4 TO SUPPORT FIELD AND LOCAL TABLE
+26 ;ALSO NEED FOR ADMITS
+27 ;
+28 ;admit date/time
SET ITEM=$GET(@BHLTMP@(1,44))
+29 SET ARRAY("DATE")=ITEM
+30 ;WOULD BOTH ADMIT AND DISCHARGE DATE BE SENT AT SAME TIME?
+31 ;WOULD MORE THAN ONE MOVEMENT BE SENT IN ONE PV1 SEGMENT?
+32 ;
+33 ;discharge date/time
SET ITEM=$GET(@BHLTMP@(1,45))
+34 SET ARRAY("DATE")=ITEM
+35 ;
+36 ;DETERMINE IF ADD, EDIT OR CANCEL
+37 ;THEN CALL ^BDGAPI AT ADD, EDIT OR CANCEL ENTRY POINT
+38 QUIT
+39 ;
APPT ; -- continue parsing Scheduling items
+1 QUIT