source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPSI5.m@ 1073

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1GMTSPSI5 ; SLC/JER,KER - IV Rx Summary Component (V5) ; 02/11/2003
2 ;;2.7;Health Summary;**15,28,56,62**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 68 ENHS^PSJEEU0
6 ;
7MAIN ; Controls Branching
8 N GMI,GMTSIDT,MAX,ON,PS,PSIVREA,PSJEDT,PSJNKF,PSJPFWD,TN
9 S PSJEDT=$S(GMTS2'=9999999:(9999999-GMTS2),1:""),PSJNKF=1
10 K ^UTILITY("PSIV",$J) I '$L($T(ENHS^PSJEEU0)) D NOPSJ Q
11 D ENHS^PSJEEU0 I '$D(^UTILITY("PSIV",$J)) Q
12 S GMI=0
13 S GMTSIDT=-9999999 F S GMTSIDT=$O(^UTILITY("PSIV",$J,GMTSIDT)) Q:'GMTSIDT D WRT Q:$D(GMTSQIT)
14 K ^UTILITY("PSIV",$J),^UTILITY("PSG",$J)
15 Q
16NOPSJ ; Handles case where ^PSJEEU0 not present
17 D CKP^GMTSUP Q:$D(GMTSQIT) W "Inpatient Pharmacy version 3.2 or greater is required.",!
18 Q
19WRT ; Prints IV Pharmacy order
20 N GMV,GMW,GMTSAD,GMTSDRUG,SOL,SD,SLN,FD,STAT,IR,SCH
21 S SD=$P(^UTILITY("PSIV",$J,GMTSIDT,0),U),FD=$P(^(0),U,2),STAT=$P($P(^(0),U,4),";"),IR=$P(^(0),U,5),SCH=$P(^(0),U,6)
22 ; Don't display data when start date is after To Date
23 Q:+$G(GMRANGE)&(SD>(9999999-GMTS1))
24 F GMV="SD","FD" S X=@GMV D REGDT4^GMTSU S @GMV=X K X
25 I GMI'>0 D HEAD
26 D CKP^GMTSUP Q:$D(GMTSQIT) W:GMI>0&('GMTSNPG) !
27 S GMI=1
28 I $D(^UTILITY("PSIV",$J,GMTSIDT,"A",1)) D Q:$D(GMTSQIT)
29 . D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HEAD
30 . W $E($P($P(^UTILITY("PSIV",$J,GMTSIDT,"A",1),";",2),U),1,36),?38,$P(^(1),U,2)
31 D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HEAD W ?50,STAT,?57,SD,?69,FD,!
32 Q:$D(GMTSQIT)
33 S GMTSAD=1
34 F S GMTSAD=$O(^UTILITY("PSIV",$J,GMTSIDT,"A",GMTSAD)) Q:GMTSAD'>0 D Q:$D(GMTSQIT)
35 . S GMTSDRUG=^(GMTSAD) D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HEAD
36 . W $E($P($P(GMTSDRUG,";",2),U),1,36),?38,$P(GMTSDRUG,U,2),!
37 Q:$D(GMTSQIT)
38LSTSOL ; Write Solutions
39 S SOL=0 F S SOL=$O(^UTILITY("PSIV",$J,GMTSIDT,"S",SOL)) Q:SOL'>0 D Q:$D(GMTSQIT)
40 . S SLN=^(SOL) D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HEAD
41 . W ?3,$S(SOL=1!GMTSNPG:"In: ",1:" ")
42 . W $P($P(SLN,";",2),U)," ",$P(SLN,U,2)," ",IR," ",SCH,!
43 Q
44HEAD ; Prints Header
45 I 'GMTSNPG D CKP^GMTSUP Q:$D(GMTSQIT)
46 W "Drug",?38,"Dose",?50,"Status",?58,"Start",?68,"Stop",! W:$Y'>(IOSL-GMTSLO) !
47 Q
Note: See TracBrowser for help on using the repository browser.