Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (14 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/IMAGING-MAG-ZMAG/MAGSIXG1.m

    r628 r636  
    11MAGSIXG1 ;WOIFO/EdM/GEK/SEB - RPCs for Document Imaging ; 04/29/2002  16:15
    2  ;;3.0;IMAGING;**8,48,59**;Nov 27, 2007;Build 20
    3  ;;Per VHA Directive 2004-038, this routine should not be modified.
     2 ;;3.0;IMAGING;**8,48**;Jan 11, 2005
    43 ;; +---------------------------------------------------------------+
    54 ;; | Property of the US Government.                                |
     
    1918 Q
    2019 ;
    21  ; OUT  =  Output array. 
    22  ;   OUT(0)        ->  1|0 ^ message
    23  ;   OUT(1)        ->  Field Headers
    24  ;       '^' delimited list of column headers used in cMagListView
    25  ;   OUT(2..n) ->  each line is information on 1 image.
    26  ;       piece '|' 1 is '^' delimited data to be displayed in columns.
    27  ;       piece '|' 2  is data that is used internally by App.
    28  ;       
    29  ; PKG   - Package fld 40
    30  ; CLS   - Class   fld 41
    31  ; TYPE  - Type    fld 42
    32  ; EVENT - Proc/Event         fld 43
    33  ; SPEC  - Spec/SubSpecialty  fld 44
    34  ; FROM  - Date to search from
    35  ; UNTIL - Date to search to
    36  ; ORIGIN - Origin fld 45
    37  ; DATA  -  Future
    38  ; FLGS  -  Future 
    39  ;
    40 PGI(OUT,DFN,PKG,CLS,TYPE,EVENT,SPEC,FROM,UNTIL,ORIGIN,DATA,FLGS) ;RPC [MAG4 PAT GET IMAGES]
     20 ; OUT ;--- Output array
     21 ; CLS ;--- Class
     22 ; TYPE ;-- Type (of what?)
     23 ; SPEC ;-- Specialty or SubSpecialty
     24 ; EVENT ;- Event or Procedure or Action
     25PGI(OUT,DFN,PKG,CLS,TYPE,EVENT,SPEC,FROM,UNTIL,ORIGIN) ;RPC [MAG4 PAT GET IMAGES]
    4126 ; Get Images for Patient. 
    4227 ; New call in Patch 3.0.8 uses Image Filter to get list of images
     28 ;
    4329 N C,DAT1,DAT2,E,IMAGE,N,OK,P,RDT,RESULT,S,T,V,CT,PKG1,CLS1,TYPE1,EVENT1,SPEC1,FLTX,FLTY,CAPDUZ,CAPDT,MAGVR,FNL
    4430 S FROM=$G(FROM),UNTIL=$G(UNTIL)
     
    5642 S N=0
    5743 D NETPLCS^MAGGTU6
     44 ;S RDT="" F  S RDT=$O(^MAG(2005,"APDTPX",DFN,RDT)) Q:RDT=""  D
    5845 ;3.0.8/gek, Quit searching all images, just do the date range.
    5946 S RDT=DAT1 F  S RDT=$O(^MAG(2005,"APDTPX",DFN,RDT)) Q:(RDT="")!(RDT>DAT2)  D
    60  . K ^TMP($J,"MAGSIX")
    6147 . N COUNT,PRX,X0,X2,X40,I1,X01
    62  . S PRX="" F  S PRX=$O(^MAG(2005,"APDTPX",DFN,RDT,PRX)) Q:PRX=""  M ^TMP($J,"MAGSIX")=^MAG(2005,"APDTPX",DFN,RDT,PRX)
    63  . S IMAGE="" F  S IMAGE=$O(^TMP($J,"MAGSIX",IMAGE),-1) Q:IMAGE=""  D
    64  . . S X0=$G(^MAG(2005,IMAGE,0))
    65  . . Q:$P(X0,"^",10)  ; child of Group
    66  . . S X2=$G(^MAG(2005,IMAGE,2)),X40=$G(^MAG(2005,IMAGE,40)),I1=$O(^MAG(2005,IMAGE,1,0))
    67  . . S P=$P(X40,U),C=$P(X40,"^",2),T=$P(X40,"^",3),E=$P(X40,"^",4),S=$P(X40,"^",5)
    68  . . ;Patch 59.  Treat Class as a computed Field.  Arrange with Mike to change DB.
    69  . . S C=$S('T:"",'$D(^MAG(2005.83,T,0)):"",1:$P(^(0),"^",2))
    70  . . S V=$S($P(X40,"^",6)="":"V",1:$P(X40,"^",6)) ; P48T1 show VA for Null
    71  . . D CHK^DIE(2005,45,"E",V,.MAGVR) I MAGVR'="^" S V=MAGVR(0) ; P48T1 show External Value
    72  . . I PKG'="",P'="",'$D(OK(5,P)) Q
    73  . . I ORIGIN'="",V'="",'$D(OK(6,V)) Q
    74  . . I CLS'="",C'="",'$D(OK(1,C)) Q
    75  . . I EVENT'="",E,'$D(OK(2,E)) Q
    76  . . ;3.0.8 Stop list entries with no Event, if Event is in Search Specs
    77  . . I EVENT'="",E="" Q
    78  . . I SPEC'="",S,'$D(OK(3,S)) Q
    79  . . ;3.0.8 Stop list entries with no Spec, if Spec is in Search Specs
    80  . . I SPEC'="",S="" Q
    81  . . I TYPE'="",T,'$D(OK(4,T)) Q
    82  . . ; Get Count of Images in Group, use 4th piece of ,1,0) multiple
    83  . . S COUNT=$S($P($G(^MAG(2005,IMAGE,1,0)),"^",4):$P($G(^MAG(2005,IMAGE,1,0)),"^",4),1:1)
    84  . . S FLTX=""
    85  . . ; PUT in Site Code as 2nd piece.
    86  . . S X01=$S(I1:$G(^MAG(2005,+$G(^MAG(2005,IMAGE,1,I1,0)),0)),1:X0)
    87  . . S FNL=$S(+$P(X01,"^",3):$P(X01,"^",3),1:+$P(X01,"^",5))
    88  . . S FLTX=$P($G(MAGJOB("NETPLC",FNL)),"^",2)
    89  . . I FLTX="" S FLTX=$G(MAGJOB("PLCODE"))
    90  . . S FLTX=FLTX_"^"_$$RPTITLE($P(X2,"^",6),$P(X2,"^",7))
    91  . . S X=$$FMTE^XLFDT($P(X2,"^",5),"5Z")
    92  . . S X=$P(X,"@",1)_" "_$S($L($P(X,"@",2)):$P(X,"@",2),1:"00:01")
    93  . . S FLTX=FLTX_"^"_X
    94  . . S FLTX=FLTX_"^"_$P(X0,"^",8)_"^"_COUNT_"^"_$P(X2,"^",4)
    95  . . S FLTX=FLTX_"^"_P
    96  . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.82,+C,0)),"^",1)
    97  . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.83,+T,0)),"^",1)
    98  . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.84,+S,0)),"^",1)
    99  . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.85,+E,0)),"^",1)
    100  . . S FLTX=FLTX_"^"_V
    101  . . ;S FLTX=FLTX_"^"_$P($$FMTE^XLFDT($P(X2,"^",1),"5Z"),"@",1)
    102  . . S X=$$FMTE^XLFDT($P(X2,"^",1),"5Z")
    103  . . S X=$P(X,"@",1)_" "_$S($L($P(X,"@",2)):$P(X,"@",2),1:"00:01")
    104  . . S FLTX=FLTX_"^"_X
    105  . . ;;;;;;;;;
    106  . . ; P8T36 gek. Fix Error caused if $P(X2,"^",2) "ImageSavedBy" is null
    107  . . S FLTX=FLTX_"^"_$$GET1^DIQ(200,+$P(X2,"^",2)_",",.01)
    108  . . N MAGFILE,MAGXX
    109  . . S MAGXX=IMAGE D INFO^MAGGTII
    110  . . S FLTX=FLTX_"^"_$P(MAGFILE,"^",1)
    111  . . S N=N+1,@RESULT@(N+1)=N_"^"_FLTX_"|"_MAGFILE
    112  . . Q:N<76  Q:RESULT["^"
    113  . . ; Image count is getting big, switch from array to Global return type
    114  . . S ^TMP($T(+0),$J)=""
    115  . . M ^TMP($T(+0),$J)=OUT
    116  . . K OUT
    117  . . S X=$$RTRNFMT^XWBLIB("GLOBAL ARRAY",1)
    118  . . S RESULT=$NA(^TMP($T(+0),$J))
    119  . . S OUT=$NA(^TMP($T(+0),$J)) ;GEK 10/01/02
     48 . S PRX="" F  S PRX=$O(^MAG(2005,"APDTPX",DFN,RDT,PRX)) Q:PRX=""  D
     49 . . S IMAGE="" F  S IMAGE=$O(^MAG(2005,"APDTPX",DFN,RDT,PRX,IMAGE)) Q:IMAGE=""  D
     50 . . . S X0=$G(^MAG(2005,IMAGE,0))
     51 . . . Q:$P(X0,"^",10)  ; child of Group
     52 . . . S X2=$G(^MAG(2005,IMAGE,2)),X40=$G(^MAG(2005,IMAGE,40)),I1=$O(^MAG(2005,IMAGE,1,0))
     53 . . . S P=$P(X40,U),C=$P(X40,"^",2),T=$P(X40,"^",3),E=$P(X40,"^",4),S=$P(X40,"^",5)
     54 . . . S V=$S($P(X40,"^",6)="":"V",1:$P(X40,"^",6)) ; P48T1 show VA for Null
     55 . . . D CHK^DIE(2005,45,"E",V,.MAGVR) S V=MAGVR(0) ; P48T1 show External Value
     56 . . . I PKG'="",P'="",'$D(OK(5,P)) Q
     57 . . . I ORIGIN'="",V'="",'$D(OK(6,V)) Q
     58 . . . I CLS'="",C'="",'$D(OK(1,C)) Q
     59 . . . I EVENT'="",E,'$D(OK(2,E)) Q
     60 . . . ;3.0.8 Stop list entries with no Event, if Event is in Search Specs
     61 . . . I EVENT'="",E="" Q
     62 . . . I SPEC'="",S,'$D(OK(3,S)) Q
     63 . . . ;3.0.8 Stop list entries with no Spec, if Spec is in Search Specs
     64 . . . I SPEC'="",S="" Q
     65 . . . I TYPE'="",T,'$D(OK(4,T)) Q
     66 . . . ; Get Count of Images in Group, use 4th piece of ,1,0) multiple
     67 . . . S COUNT=$S($P($G(^MAG(2005,IMAGE,1,0)),"^",4):$P($G(^MAG(2005,IMAGE,1,0)),"^",4),1:1)
     68 . . . S FLTX=""
     69 . . . ; PUT in Site Code as 2nd piece.
     70 . . . S X01=$S(I1:$G(^MAG(2005,+$G(^MAG(2005,IMAGE,1,I1,0)),0)),1:X0)
     71 . . . S FNL=$S(+$P(X01,"^",3):$P(X01,"^",3),1:+$P(X01,"^",5))
     72 . . . S FLTX=$P($G(MAGJOB("NETPLC",FNL)),"^",2)
     73 . . . S FLTX=FLTX_"^"_$P($$FMTE^XLFDT($P(X2,"^",5),"5Z"),"@",1)
     74 . . . S FLTX=FLTX_"^"_$P(X0,"^",8)_"^"_COUNT_"^"_$P(X2,"^",4)
     75 . . . S FLTX=FLTX_"^"_P
     76 . . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.82,+C,0)),"^",1)
     77 . . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.83,+T,0)),"^",1)
     78 . . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.84,+S,0)),"^",1)
     79 . . . S FLTX=FLTX_"^"_$P($G(^MAG(2005.85,+E,0)),"^",1)
     80 . . . S FLTX=FLTX_"^"_V
     81 . . . S FLTX=FLTX_"^"_$P($$FMTE^XLFDT($P(X2,"^",1),"5Z"),"@",1)
     82 . . . ; P8T36 gek. Fix Error caused if $P(X2,"^",2) "ImageSavedBy" is null
     83 . . . S FLTX=FLTX_"^"_$$GET1^DIQ(200,+$P(X2,"^",2)_",",.01)
     84 . . . N MAGFILE,MAGXX
     85 . . . S MAGXX=IMAGE D INFO^MAGGTII
     86 . . . S FLTX=FLTX_"^"_$P(MAGFILE,"^",1)
     87 . . . S N=N+1,@RESULT@(N+1)=N_"^"_FLTX_"|"_MAGFILE
     88 . . . Q:N<101  Q:RESULT["^"
     89 . . . ; Image count is getting big, switch from array to Global return type
     90 . . . S ^TMP($T(+0),$J)=""
     91 . . . M ^TMP($T(+0),$J)=OUT
     92 . . . K OUT
     93 . . . S X=$$RTRNFMT^XWBLIB("GLOBAL ARRAY",1)
     94 . . . S RESULT=$NA(^TMP($T(+0),$J))
     95 . . . S OUT=$NA(^TMP($T(+0),$J)) ;GEK 10/01/02
     96 . . . Q
    12097 . . Q
    121  . ;Q
    12298 . Q
    12399 S FLTY=$$FLTDESC(X)
    124100 I 'N S @RESULT@(0)="0^No images for filter: "_FLTY  Q
    125101 S @RESULT@(0)="1^"_FLTY
    126  S @RESULT@(1)="Item~S2^Site^Note Title~~W0^Proc DT~S1^Procedure^# Img~S2^Short Desc^Pkg^Class^Type^Specialty^Event^Origin^Cap Dt~S1~W0^Cap by~~W0^Image ID~S2~W0"
    127  ;S @RESULT@(1)="Item~S2^Site^Proc DT~S1^Procedure^# Img~S2^Short Desc^Pkg^Class^Type^Specialty^Event^Origin^Cap Dt~S1~W0^Cap by~~W0^Image ID~S2~W0"
     102 S @RESULT@(1)="Item~S2^Site^Proc DT~S1^Procedure^# Img~S2^Short Desc^Pkg^Class^Type^Specialty^Event^Origin^Cap Dt~S1~W0^Cap by~~W0^Image ID~S2~W0"
    128103 Q
    129 RPTITLE(FILE,IEN) ;
    130  I FILE=8925,$D(^TIU(8925,IEN,0)) Q $P(^TIU(8925.1,$P(^TIU(8925,IEN,0),"^",1),0),"^",1)
    131  ;I FILE=8925,$D(^TIU(8925,IEN,0)) Q $$GET1^DIQ(FILE,IEN,".01:.01")
    132  E  Q "   "
    133104FLTDESC(X) ;
    134105 N FLT
     
    153124 . S $P(EVENT,",",CT)=$E(EVENT1)_$$LOW^XLFSTR($E(EVENT1,2,999))
    154125 S FLT=FLT_$S(EVENT="":"",1:"Event: "_EVENT_" - ")
    155  ; Origin
     126 ; Orgin
    156127 S FLT=FLT_$S(ORIGIN="":"",1:"Origin: "_ORIGIN_" - ")
    157128 ; Date Range - From
Note: See TracChangeset for help on using the changeset viewer.