Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORPRS13

ORPRS13.m

Go to the documentation of this file.
ORPRS13 ; slc/dcm,JER - Health Summary Report & Driver (HSR&D) ;6/10/97  15:52
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11**;Dec 17, 1997
MAIN ;Happy Birthday Elvis!!!
 N C,I,GMTYP,VAROOT,ZTRTN,GMTI,ORVP
 K ^XUTL("OR",$J,"ORU"),^("ORV"),^("ORW")
 D:$D(ORSCPAT)'>9 P^ORPRS01
 Q:$D(DUOUT)!$D(DIROUT)!'$D(ORSCPAT)
 D SELTYP
 Q:$D(DUOUT)!$D(DIROUT)!'$D(GMTYP)
 S ZTRTN="PQ^ORPRS13",GMTI=0
 F  S GMTI=$O(ORSCPAT(GMTI)) Q:GMTI'>0  S ORVP=+ORSCPAT(GMTI) D HSOUT^GMTSDVR
 K ^XUTL("OR",$J,"ORU"),^("ORV"),^("ORW")
 Q
SELTYP ; Select Health Summary Type(s)
 N DIC,X,Y
 S DIC=142,DIC("A")="Select Health Summary Type: ",DIC(0)="AEMQZ"
 S DIC("S")="I $P(^(0),U)'=""GMTS HS ADHOC OPTION"""
 I $D(GMTYP)<10 S DIC("B")=$S($D(^DISV(DUZ,"^GMT(142,"))=10:$G(^DISV(DUZ,"^GMT(142,",$O(^("^GMT(142,",0)))),1:$P($G(^GMT(142,+$G(^DISV(DUZ,"^GMT(142,")),0)),U))
 I $G(DIC("B"))="GMTS HS ADHOC OPTION" K DIC("B")
 K GMTYP
 D ^DIC
 Q:+Y'>0
 I $S($D(^GMT(142,+Y,1,0))=0:1,$O(^(0))'>0:1,1:0) W !,"The Summary Type "_$P(Y,U,2)_" includes no components...Please choose another",! Q
 S GMTYP(0)=1,GMTYP(1)=Y_U_$P(Y,U,2)_U_$P(Y,U,2)_U_$P(Y,U,2)
 Q
PQ ; Queued subroutine for HS by patient
 N DFN,GMTI,GMTS,GMTS1,GMTS2,GMTSAGE,GMTSDOB,GMTSDTM,GMTSLO,GMTSLPG,GMTSPNM
 N GMTSRB,GMTSSN,GMTSTOF,GMTSTYP,GMTSTITL,GMTSWARD,GMTJ,I,IX0,J,M4,P17,SEX
 N TRFAC,VAERR,VAIN,VAROOT
 S GMTI=0 F  S GMTI=$O(GMTYP(GMTI)) Q:GMTI'>0!$D(DIROUT)  D
 . N GMTSEG,GMTSEGC,GMTSEGI
 . S GMTSTYP=+$G(GMTYP(GMTI)),GMTSTITL=$G(^GMT(142,+GMTSTYP,"T"))
 . S:'$L(GMTSTITL) GMTSTITL=$P(GMTYP(GMTI),U,2)
 . D LOADSEG
 . S DFN=+ORVP
 . D EN^GMTS1
 Q
LOADSEG ;LOAD ENABLED COMPONENTS INTO GMTSEG ARRAY
 N GMTI,GMTJ,GMX
 S (GMTI,GMTJ)=0 F  S GMTJ=$O(^GMT(142,GMTSTYP,1,GMTJ)) Q:GMTJ'>0  S GMX=^(GMTJ,0) D
 . S GMTI=GMTI+1,GMTSEG(GMTI)=GMX,GMTSEGI($P(GMX,U,2))=GMTI
 . D SELFILE
 S GMTSEGC=GMTI
 Q
SELFILE ; Get Selection item information for GMTSEG(
 N GMTK,ITEM,FST
 S GMTK=0,FST=1
 F  S GMTK=$O(^GMT(142,GMTSTYP,1,GMTJ,1,GMTK)) Q:GMTK'>0  S ITEM=^(GMTK,0),GMTSEG(GMTI,+$P(@(U_$P(ITEM,";",2)_"0)"),U,2),GMTK)=$P(ITEM,";") I $G(FST) S GMTSEG(GMTI,+$P(@(U_$P(ITEM,";",2)_"0)"),U,2),0)=U_$P(ITEM,";",2) K FST
 Q
ADHOC ;Do adhoc
 S GMTSTITL="AD HOC"
 S DFN=+ORVP
 D EN^GMTS1
 K GMTSEG,GMTSEGI
 Q