source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCRPW401.m@ 846

Last change on this file since 846 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1SCRPW401 ;BPCIOFO/ACS - Diagnosis/Procedure Frequency Report ;06/23/99
2 ;;5.3;Scheduling;**180**;Aug 13, 1993
3 ;
4 ;------------------------------------------------------------
5 ;
6 ; Purpose : Rank and print the CPT modifiers
7 ; Called by: SCRPW40
8 ;
9 ;
10 ;INPUT : MODARRAY(MOD ptr,TYPE)=COUNT
11 ; the full array referenced from SCRPW40 is -
12 ; ^TMP("SCRPW",$J,SDIV,"PROC",1,SDPROC,SDMOD,TYPE))
13 ; SDIV : division
14 ; SDPROC: pointer to CPT code
15 ; SDMOD : pointer to CPT modifier code
16 ; TYPE : encounter "ENC" or quantity "QTY"
17 ;
18 ;OUTPUT : none
19 ;
20 ;OTHER : RANKMOD is the array to hold the ranked modifiers
21 ; for the current CPT code
22 ; LINEFLAG is used as a flag to indicate that a line
23 ; will be skipped before printing the next cpt code
24 ; (cpt codes are double spaced on the report, but not
25 ; immediately after printing the report headers, when
26 ; LINEFLAG=0)
27 ;------------------------------------------------------------
28 ;
29START(MODARRAY) ;build array to hold ranked modifiers (by quantity)
30 ;
31 N SDMOD,RANKMOD,SDMODQTY
32 ;
33 ; spin through modifier array and get modifier quantity
34 S SDMOD=0
35 F S SDMOD=$O(@MODARRAY@(SDMOD)) Q:'SDMOD D
36 . S SDMODQTY=$G(@MODARRAY@(SDMOD,"QTY"))
37 . Q:'SDMODQTY
38 . ;
39 . ; put modifier quantity and code into new array
40 . S RANKMOD(SDMODQTY,SDMOD)=""
41 . Q
42 ;
43 ; loop through ranked modifiers in descending order
44 S SDMODQTY=""
45 F S SDMODQTY=$O(RANKMOD(SDMODQTY),-1) Q:SDMODQTY="" D
46 . S SDMOD=""
47 . F S SDMOD=$O(RANKMOD(SDMODQTY,SDMOD),-1) Q:SDMOD="" D
48 .. ; check page length. go to new page if necessary.
49 .. I $Y>(IOSL-4) D HDR^SCRPW40 D PRHD^SCRPW40 Q:SDOUT
50 .. ;
51 .. ; get modifier and desc
52 .. N MODINFO,MODCODE,MODTEXT,SDMENC,SDMQTY
53 .. S MODINFO=$$MOD^ICPTMOD(SDMOD,"I")
54 .. Q:+MODINFO<0
55 .. S MODCODE=$P(MODINFO,"^",2)
56 .. S MODTEXT=$E($P(MODINFO,"^",3),1,28)
57 .. S SDMENC="-"_$G(@MODARRAY@(SDMOD,"ENC"))
58 .. S SDMQTY="-"_$G(@MODARRAY@(SDMOD,"QTY"))
59 .. W !,?(C+2),"-",MODCODE,?(C+8),MODTEXT
60 .. W ?(C+38),$J(SDMENC,9,0),?(C+50),$J(SDMQTY,9,0)
61 .. Q
62 . S LINEFLAG=1
63 . Q
64 Q
Note: See TracBrowser for help on using the repository browser.