OOPSCSN ;HINES CIOFO/WAA-Finding case number for stub record ;3/5/98
;;2.0;ASISTS;;Jun 03, 2002
;;
FYEAR(DATE) ; FIND CURRENT FISCAL YEAR FOR A GIVEN DATE
; DATE IS THE DATE THAT THE DATE WAS PASSED IN.
N FYEAR,FYDATE
S FYEAR=1700+$E(DATE,1,3)
S FYDATE=$E(DATE,1,3)_"1001" ;FISICAL DATE IF CURRENT YEAR
I DATE'<FYDATE S FYEAR=FYEAR+1
Q FYEAR
;
NEWR(FYEAR) ;
N NUM,SEQ
S NUM="",NUM=$O(^OOPS(2260,"B",NUM),-1)
I $E(NUM,1,4)'=FYEAR S NUM=FYEAR_"-00000"
S SEQ=+$E(NUM,6,10)
S SEQ=SEQ+1 F I=1:1:5-$L(SEQ) S SEQ=0_SEQ
S NUM=$E(NUM,1,5)_SEQ
Q NUM
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSCSN 575 printed Dec 13, 2024@01:38:43 Page 2
OOPSCSN ;HINES CIOFO/WAA-Finding case number for stub record ;3/5/98
+1 ;;2.0;ASISTS;;Jun 03, 2002
+2 ;;
FYEAR(DATE) ; FIND CURRENT FISCAL YEAR FOR A GIVEN DATE
+1 ; DATE IS THE DATE THAT THE DATE WAS PASSED IN.
+2 NEW FYEAR,FYDATE
+3 SET FYEAR=1700+$EXTRACT(DATE,1,3)
+4 ;FISICAL DATE IF CURRENT YEAR
SET FYDATE=$EXTRACT(DATE,1,3)_"1001"
+5 IF DATE'<FYDATE
SET FYEAR=FYEAR+1
+6 QUIT FYEAR
+7 ;
NEWR(FYEAR) ;
+1 NEW NUM,SEQ
+2 SET NUM=""
SET NUM=$ORDER(^OOPS(2260,"B",NUM),-1)
+3 IF $EXTRACT(NUM,1,4)'=FYEAR
SET NUM=FYEAR_"-00000"
+4 SET SEQ=+$EXTRACT(NUM,6,10)
+5 SET SEQ=SEQ+1
FOR I=1:1:5-$LENGTH(SEQ)
SET SEQ=0_SEQ
+6 SET NUM=$EXTRACT(NUM,1,5)_SEQ
+7 QUIT NUM