source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPSG5.m

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

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1GMTSPSG5 ; SLC/JER,KER - UD Rx Summary Component (V5) ; 08/27/2002
2 ;;2.7;Health Summary;**15,28,56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 486 ENHS^PSJEEU0
6 ;
7MAIN ; Controls Branching
8 N GMI,IX,ON,PS,PSIVREA,PSJEDT,PSJNKF,PSJPFWD,GMR,TN,UDS
9 S PSJEDT=$S(GMTS2'=9999999:(9999999-GMTS2),1:""),PSJNKF=1
10 K ^UTILITY("PSG",$J) I '$L($T(ENHS^PSJEEU0)) D NOPSJ Q
11 D ENHS^PSJEEU0
12 I '$D(^UTILITY("PSG",$J)) Q
13 S IX=-9999999,GMI=0
14 F S IX=$O(^UTILITY("PSG",$J,IX)) Q:'IX S GMR=^(IX) D WRT Q:$D(GMTSQIT)
15 W !
16 K ^UTILITY("PSG",$J),^UTILITY("PSIV",$J)
17 Q
18NOPSJ ; Handles case where routine ^PSJEEU0 not installed
19 D CKP^GMTSUP Q:$D(GMTSQIT) W "Inpatient Pharmacy version 3.2 or greater is required.",!
20 Q
21WRT ; Writes the Unit Dose Component
22 N SD,FD,DRG,DOSE,GMV,RT,STAT,SIG
23 S SD=$P(GMR,U),FD=$P(GMR,U,2),DRG=$P($P(GMR,U,3),";",2),STAT=$P($P(GMR,U,5),";")
24 ;
25 ; Don't display data when start date is after
26 ; Date Range To Date and stop date is before
27 ; Date Range End Date. (Need end date because of
28 ; FOR LOOP on $O(^PS(53.1,"AC",DFN,Y)) in PSJEEU0
29 ;
30 I +$G(GMRANGE),(SD>(9999999-GMTS1))!(FD<(9999999-GMTS2)) Q
31 F GMV="SD","FD" S X=@GMV D REGDT4^GMTSU S @GMV=X
32 D CKP^GMTSUP Q:$D(GMTSQIT) W:GMI>0&('GMTSNPG) !
33 I GMTSNPG!(GMI'>0) D HEAD
34 S GMI=1
35 S DOSE=$P(GMR,U,6),RT=$P($P(GMR,U,7),";",3),SIG=$P(GMR,U,8)
36 D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HEAD W $E(DRG,1,36),?38,DOSE,?50,STAT,?57,SD,?69,FD,!
37 D CKP^GMTSUP Q:$D(GMTSQIT) G:GMTSNPG WRT W ?2,SIG," ",RT
38 Q
39HEAD ; Prints Header
40 D CKP^GMTSUP Q:$D(GMTSQIT)
41 W "Drug",?38,"Dose",?50,"Status",?58,"Start",?68,"Stop",! W:$Y'>(IOSL-GMTSLO) !
42 Q
Note: See TracBrowser for help on using the repository browser.