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

MAGGTCPR.m

Go to the documentation of this file.
  1. MAGGTCPR ;WOIFO/GEK - RPC Calls for Patient DHCP Reports ; [ 06/20/2001 08:56 ]
  1. ;;3.0;IMAGING;;Mar 01, 2002
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. DGRPD(MAGRPTY,DFN) ;RPC Call to Generate Patient Profile
  1. ;
  1. ; -- MAGRPTY -- is the name of the global holding the report.
  1. ; -- @MAGRPTY@(0)-- if = 0 then error occurred
  1. ; -- DFN := Patient File IEN
  1. ; the variable MAGRPTY is referenced by CLOSE^MAGGTU5 to load
  1. ; the report from the VMS file WS.DAT into the referenced global;
  1. ;
  1. S MAGRPTY=$NA(^TMP($J,"WSDAT"))
  1. K @MAGRPTY
  1. S @MAGRPTY@(0)="0^-Cannot Open Workstation Redirection Device"
  1. S IOP="IMAGING WORKSTATION",%ZIS=0 D ^%ZIS Q:POP ;Redirect Output Here
  1. U IO
  1. D EN^DGRPD
  1. D:IO'=IO(0) ^%ZISC
  1. S @MAGRPTY@(0)="1^OK"
  1. Q
  1. HSUM(MAGRPTY,MAGGZ) ;RPC Call to Get Health Summary for Patient
  1. ; MAGGZ -> DFN ^ HS Type (IEN)
  1. ;
  1. N Y,X,GMTSTYP,GMTSTITL
  1. IF $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTCPR"
  1. E S X="ERRA^MAGGTCPR",@^%ZOSF("TRAP")
  1. S MAGRPTY=$NA(^TMP($J,"WSDAT"))
  1. K @MAGRPTY
  1. S @MAGRPTY@(0)="0^Health Summary Report NOT successful"
  1. S IOP="IMAGING WORKSTATION",%ZIS=0 D ^%ZIS Q:POP
  1. S GMTSTYP=$P(MAGGZ,U,2),DFN=$P(MAGGZ,U)
  1. S GMTSTITL=$$GET1^DIQ(142,GMTSTYP,".02","I")
  1. U IO
  1. D SELTYP1^GMTS,EN^GMTS1
  1. D END^GMTS K GMTSEG,GMTSEGI,GMTSEGC ; MOD GEK 5\13\96
  1. D:IO'=IO(0) ^%ZISC
  1. S @MAGRPTY@(0)="1^OK"
  1. Q
  1. HSLIST(MAGRY,ZY) ;RPC Call To do a lookup using LIST^DIC to return
  1. ; the List of Health Summary Types for a user to select from.
  1. ; MAGRY is the Array to return.
  1. ; ZY is NOT USED
  1. ; Kernel uses Y, we have to New it because calls to DIC etc
  1. ; also use it and change it, and kill it.
  1. N Y,XI,Z,FI,MAGIEN,INFO
  1. N FILE,IENS,FLDS,FLAGS,VAL,NUM,FROM,PART,INDEX,SCR,IDENT,TROOT
  1. S (FILE,IENS,FLDS,FLAGS,VAL,NUM,FROM,PART,INDEX,SCR,IDENT,TROOT)=""
  1. ;
  1. ; Format
  1. ;LIST^DIC(FILE,IENS,FIELDS,FLAGS,NUMBER,
  1. ; [.]FROM,[.]PART,INDEX,[.]SCREEN,IDENTIFIER,TARGET_ROOT,MSG_ROOT)
  1. ;
  1. K ^TMP("DILIST",$J) ; is this necessary ?
  1. K ^TMP("DIERR",$J) ; This is.
  1. S FILE=142,NUM=9000,FROM="",PART="",FLDS="@;.01",INDEX="B"
  1. D LIST^DIC(FILE,IENS,FLDS,FLAGS,NUM,FROM,PART,INDEX,SCR,IDENT,TROOT)
  1. ;
  1. I '$D(^TMP("DILIST",$J,2)) D Q
  1. . S MAGRY(XI)="0^NO Health Summary Types Found in VistA"
  1. S INFO=^TMP("DILIST",$J,0)
  1. S XI="" F S XI=$O(^TMP("DILIST",$J,2,XI)) Q:XI="" S MAGIEN=^(XI) D
  1. . S Z=".01",X=^TMP("DILIST",$J,"ID",XI,Z)
  1. . F S Z=$O(^TMP("DILIST",$J,"ID",XI,Z)) Q:Z="" S X=X_" "_^(Z)
  1. . S MAGRY(XI)=X_"^"_MAGIEN
  1. ;
  1. S MAGRY(0)=$P(INFO,"^")_U_"Found "_$P(INFO,"^")_" entr"_$S((+INFO=1):"y",1:"ies")
  1. I $P(INFO,"^",3)>0 S MAGRY(0)=MAGRY(0)_" there are more"
  1. Q
  1. DISSUM(MAGRPTY,DFN) ; Discharge summary
  1. S MAGRPTY=$NA(^TMP($J,"WSDAT"))
  1. S @MAGRPTY@(0)="0^NOT YET IMPLEMENTED"
  1. Q
  1. ERRA S @MAGRPTY@(0)="0^"_$$EC^%ZOSV
  1. D @^%ZOSF("ERRTN")
  1. Q