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

IBORAT2B.m

Go to the documentation of this file.
IBORAT2B	;ALB/RJS - DATE SETUP IBIBROUTINE  - 1/22/92
	;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
	;CALLED BY IBORAT
	;THIS ROUTINE PARSES A TMP FILE CONTAINING DATA FROM FILE
	;399.5 AND CALCULATES BEGINNING AND ENDING DATES
	;FOR BILLING RATES AND MEDICARE DEDUCTIBLES.
	;EG. IF RATE IS EFFECTIVE ON 1/1/87 AND IS SUPERSEDED BY A NEW RATE
	;ON 1/1/88 IT IS IN EFFECT FROM 1/1/87-12/31/87
	;THIS DATA IS STORED IN 
	;^TMP($J,IBROUT,IBSPEC,IBREVCDE,IBEFFDAT)=IBCANCEL^AMOUNT^ACTIVE
	;OUTPUT BY IBORAT2C
	;
START	;
	S IBROUT="IBORAT2A",IBSPEC=""
	F  S IBSPEC=$O(^TMP($J,IBROUT,IBSPEC)) Q:IBSPEC=""  D IBREVCDE
END	;
	K IBCANCEL,IBEFFDAT,IBREVCDE,IBROUT,IBSPEC,X,X1,X2
	Q
IBREVCDE	;
	S IBREVCDE=""
	F  S IBREVCDE=$O(^TMP($J,IBROUT,IBSPEC,IBREVCDE)) Q:IBREVCDE=""  D IBPAYORS
	Q
IBPAYORS	;
	S IBPAYORS=""
	F  S IBPAYORS=$O(^TMP($J,IBROUT,IBSPEC,IBREVCDE,IBPAYORS)) Q:IBPAYORS=""  D IBEFFDAT
	Q
IBEFFDAT	;
	S IBEFFDAT=-1
	F  S IBEFFDAT=$O(^TMP($J,IBROUT,IBSPEC,IBREVCDE,IBPAYORS,IBEFFDAT)) Q:IBEFFDAT=""  D IBCANCEL
	Q
IBCANCEL	;
	S IBCANCEL=$O(^TMP($J,IBROUT,IBSPEC,IBREVCDE,IBPAYORS,IBEFFDAT))
	I IBCANCEL="" D CANDATE2 Q
	S X1=IBCANCEL,X2=-1 D C^%DTC
	S ^TMP($J,"IBORAT2B",IBSPEC,IBEFFDAT,IBREVCDE,IBPAYORS)=X_"^"_^(IBEFFDAT)
	Q
CANDATE2	;
	S ^TMP($J,"IBORAT2B",IBSPEC,IBEFFDAT,IBREVCDE,IBPAYORS)=9999999_"^"_^(IBEFFDAT)
	Q