source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPSI.m@ 862

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

initial load of WorldVistAEHR

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