source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPSG.m@ 701

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

initial load of WorldVistAEHR

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