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

ADEGRL33.m

Go to the documentation of this file.
ADEGRL33 ; IHS/HQT/MJL - GET TX HX ;  [ 11/06/2000  2:07 PM ]
 ;;6.0;ADE;**2,4**;NOVEMBER 2000
 ;STORE PROCEDURE HX IN ARRAYS
 ;ADEHXC(CODE,DATE) AND ADEHXO(OPSITE,CODE,DATE)
 ;^TMP("ADEHXF",$J,CODE,DATE)=QTY^FACILITY
EN1 ;EP
 K ^TMP("ADEHXF",$J)
 N ADEDFN,ADEHVFM,ADEHX,ADENOD,ADECOD,ADELOE,ADENOD0
 Q:'$D(^ADEPCD("B",ADEPAT))
 S ADEDFN=0 F  S ADEDFN=$O(^ADEPCD("B",ADEPAT,ADEDFN)) Q:'+ADEDFN  D GET
 Q
 K ADEHVFM,ADEHX,ADELOE,ADENOD0 ;*NE
 ;
GETHX(ADEPAT)      ;EP
 ;Sets ADEHX* arrays for patient ADEPAT
 K ADEHXC,ADEHXO,ADEHXF
 K ^TMP("ADEHXF",$J)
 D EN1^ADEGRL33
 Q
 ;
GET Q:'$D(^ADEPCD(ADEDFN,0))
 S ADENOD0=^ADEPCD(ADEDFN,0)
 S ADEHVFM=$P(ADENOD0,U,2)
 S ADELOE=$P(ADENOD0,U,3)
 S ADEHX=0 F  S ADEHX=$O(^ADEPCD(ADEDFN,"ADA",ADEHX)) Q:'+ADEHX  D G1
 Q
G1 ;IHS/HMW ADEK Subroutine modified to increment ADEHXC( array
 ;by 1 for each code
 S ADENOD=^ADEPCD(ADEDFN,"ADA",ADEHX,0)
 Q:$P(ADENOD,U,5)]""
 S ADECOD=$P($G(^AUTTADA($P(ADENOD,U),0)),U)
 Q:ADECOD=""  Q:ADEHVFM=""
 I $P(ADENOD,U,2)]"" D  Q
 . S ADEHXO($P(ADENOD,U,2),ADECOD,ADEHVFM)=""
 . S:'$D(ADEHXC(ADECOD,ADEHVFM)) ADEHXC(ADECOD,ADEHVFM)=0
 . S:'$D(^TMP("ADEHXF",$J,ADECOD,ADEHVFM)) ^TMP("ADEHXF",$J,ADECOD,ADEHVFM)="0^"_ADELOE
 . S ADEHXC(ADECOD,ADEHVFM)=ADEHXC(ADECOD,ADEHVFM)+1
 . S $P(^TMP("ADEHXF",$J,ADECOD,ADEHVFM),U)=$P(^TMP("ADEHXF",$J,ADECOD,ADEHVFM),U)+1
 I $P(ADENOD,U,2)="" D  Q
 . S:'$D(ADEHXC(ADECOD,ADEHVFM)) ADEHXC(ADECOD,ADEHVFM)=0
 . S:'$D(^TMP("ADEHXF",$J,ADECOD,ADEHVFM)) ^TMP("ADEHXF",$J,ADECOD,ADEHVFM)="0^"_ADELOE
 . S ADEHXC(ADECOD,ADEHVFM)=ADEHXC(ADECOD,ADEHVFM)+1
 . S $P(^TMP("ADEHXF",$J,ADECOD,ADEHVFM),U)=$P(^TMP("ADEHXF",$J,ADECOD,ADEHVFM),U)+1
 . ;instead of +1 use +quantity
 . ;Otherwise, all codes with no opsite must have qty=1
 Q