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