ORWPFSS2 ;SLC-GDU CPRS HL7 PROCESSING FOR RAD PRE-CERT;[04/15/05 09:19]; 4/28/05 15:34
;;3.0;ORDER ENTRY/RESULTS REPORTING;**228**;Dec 17, 1997
;Routine to process the HL7 message from the Ancillary Radiology
;package for the Pre-Certification Account Reference to be associated
;with the radiology order record in the Order File, file # 100.
;External Variables, set by the HL7 processing
; ORIFN - 1st piece of 3rd piece of ORC message segment, Order IEN
; ORMSG - The HL7 message being processed
; PV1 - PV1 segment number in the HL7 message
;Internal Variables
; ORAR - Order PFSS Account Reference
; ORFDA - Fileman Data Array
; OREM - Error Message
; ORIEN - Order Internal Entry Number
; ORRPAR - Order Radiology Pre-Certification Account Reference
; ORUPDT - Order Update Indicator
; ORPFSS - PFSS Active Indicator
;DBIA References
; $$GET1^DIQ - DBIA 2056
; PFSSACTV^ORWPFSS - Internal to CPRS PFSS
; $$ACCTREF^ORWPFSS1 - Internal to CPRS PFSS
PRECERT ;Process Radiology HL7 message for precertification PFSS Account
;Reference.
N ORAR,ORFDA,OREM,ORIEN,ORRPAR,ORUPDT,ORPFSS
;If PFSS inactive quit
D PFSSACTV^ORWPFSS(.ORPFSS) I ORPFSS=0 Q
;If PV1 is null quit
I PV1="" Q
;If pre-cert not present in HL7 PV1 seg quit
S ORRPAR=$P(@ORMSG@(PV1),"|",51)
I ORRPAR="" Q
;If PFSS AR already on file with order quit
S ORIEN=+ORIFN
S ORAR=$$GET1^DIQ(100,ORIEN,97)
I ORAR'="" Q
;Update order with pre-cert PFSS AR
S ORUPDT=$$ACCTREF^ORWPFSS1(ORIEN,ORRPAR)
I ORUPDT=1 Q
;Return error message is error happens during update
S ORERR=$P(ORUPDT,U,2)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWPFSS2 1656 printed Nov 22, 2024@17:47:02 Page 2
ORWPFSS2 ;SLC-GDU CPRS HL7 PROCESSING FOR RAD PRE-CERT;[04/15/05 09:19]; 4/28/05 15:34
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**228**;Dec 17, 1997
+2 ;Routine to process the HL7 message from the Ancillary Radiology
+3 ;package for the Pre-Certification Account Reference to be associated
+4 ;with the radiology order record in the Order File, file # 100.
+5 ;External Variables, set by the HL7 processing
+6 ; ORIFN - 1st piece of 3rd piece of ORC message segment, Order IEN
+7 ; ORMSG - The HL7 message being processed
+8 ; PV1 - PV1 segment number in the HL7 message
+9 ;Internal Variables
+10 ; ORAR - Order PFSS Account Reference
+11 ; ORFDA - Fileman Data Array
+12 ; OREM - Error Message
+13 ; ORIEN - Order Internal Entry Number
+14 ; ORRPAR - Order Radiology Pre-Certification Account Reference
+15 ; ORUPDT - Order Update Indicator
+16 ; ORPFSS - PFSS Active Indicator
+17 ;DBIA References
+18 ; $$GET1^DIQ - DBIA 2056
+19 ; PFSSACTV^ORWPFSS - Internal to CPRS PFSS
+20 ; $$ACCTREF^ORWPFSS1 - Internal to CPRS PFSS
PRECERT ;Process Radiology HL7 message for precertification PFSS Account
+1 ;Reference.
+2 NEW ORAR,ORFDA,OREM,ORIEN,ORRPAR,ORUPDT,ORPFSS
+3 ;If PFSS inactive quit
+4 DO PFSSACTV^ORWPFSS(.ORPFSS)
IF ORPFSS=0
QUIT
+5 ;If PV1 is null quit
+6 IF PV1=""
QUIT
+7 ;If pre-cert not present in HL7 PV1 seg quit
+8 SET ORRPAR=$PIECE(@ORMSG@(PV1),"|",51)
+9 IF ORRPAR=""
QUIT
+10 ;If PFSS AR already on file with order quit
+11 SET ORIEN=+ORIFN
+12 SET ORAR=$$GET1^DIQ(100,ORIEN,97)
+13 IF ORAR'=""
QUIT
+14 ;Update order with pre-cert PFSS AR
+15 SET ORUPDT=$$ACCTREF^ORWPFSS1(ORIEN,ORRPAR)
+16 IF ORUPDT=1
QUIT
+17 ;Return error message is error happens during update
+18 SET ORERR=$PIECE(ORUPDT,U,2)
+19 QUIT