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

IBORAT2A.m

Go to the documentation of this file.
IBORAT2A	;ALB/RJS - FILTER FOR FILE 399.5- 1/22/92
	;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
	;THIS ROUTINE FILTERS FILE 399.5 TO BUILD A TEMPORARY
	;FILE NAMED TMP($J,"IBORAT2A") THIS FILE IS PASSED ON TO
	;ROUTINE IBORAT2B FOR FURTHER PROCESSING
START	;
	S IBCOUNT=0
	F IBRECNR=0:0 S IBRECNR=$O(^DGCR(399.5,IBRECNR)) Q:IBRECNR'>0  D NEXT
END	;
	K IBACTIVE,IBAMOUNT,IBBILL,IBEFFDAT,IBPAYORS,IBPTR,IBRECNR,IBREVCDE,IBXDATA,IBSTAND,IBCOUNT
	Q
NEXT	;
	S IBXDATA=$G(^DGCR(399.5,IBRECNR,0))
	I IBXDATA'="" D XTRACT,NEXT3
	Q
XTRACT	;
	S IBEFFDAT=$P(IBXDATA,U,1),IBPTR=$P(IBXDATA,U,2),IBREVCDE=$P(IBXDATA,U,3),IBAMOUNT=$P(IBXDATA,U,4),IBACTIVE=$P(IBXDATA,U,5),IBPAYORS=$P(IBXDATA,U,6),IBSTAND=$P(IBXDATA,U,7)
	Q
NEXT3	;
	Q:$G(IBPTR)=""
	S IBBILL=""
	S IBBILL=$P($G(^DGCR(399.1,IBPTR,0)),U,1)
	I IBBILL'="" D LOAD
	Q
LOAD	;
	Q:IBBILL=""!(IBREVCDE="")!(IBEFFDAT="")
	I (IBPAYORS'="") S ^TMP($J,"IBORAT2A",IBBILL,IBREVCDE,IBPAYORS,IBEFFDAT)=IBAMOUNT_"^"_IBPAYORS_"^"_IBACTIVE_"^"_IBSTAND
	E  S IBPAYORS=IBCOUNT+1,^TMP($J,"IBORAT2A",IBBILL,IBREVCDE,IBPAYORS,IBEFFDAT)=IBAMOUNT_"^"_IBPAYORS_"^"_IBACTIVE_"^"_IBSTAND,IBCOUNT=IBCOUNT+1
	Q