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

MAGGSCP.m

Go to the documentation of this file.
  1. MAGGSCP ;WOIFO/GEK - Imaging RPC Broker call for CP.
  1. ;;3.0;IMAGING;**7,8**;Sep 15, 2004
  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. ;;
  1. Q
  1. LIST(MAGRY,MAGDFN,PROC) ;RPC [MAG4 CP GET REQUESTS]
  1. ; Get list of CP Requests
  1. ; PROC = IEN FROM FILE 702.01 IF JUST ONE PROCEURE DESIRED, DEFAULTS TO ALL
  1. ;
  1. ; The compressed listing, 4 columns
  1. ; Not restructuring the output yet
  1. ; "Date^Spec^Desc^Img Count^procedure info"
  1. N MAGX,I,ACT,NODE,TMP
  1. K ^TMP($J,"MAGCP")
  1. K ^TMP($J,"MAGCP1")
  1. S PROC=$G(PROC)
  1. ;S MAGRY=$NA(^TMP($J,"MAGCP1"))
  1. D CPLIST^GMRCCP(MAGDFN,PROC,$NA(^TMP($J,"MAGCP")))
  1. I '$D(^TMP($J,"MAGCP")) S MAGRY(0)="0^There are no Clinical Procedure Requests for Patient : "_$$GET1^DIQ(2,MAGDFN,.01) Q
  1. S ACT=1
  1. S I="" F S I=$O(^TMP($J,"MAGCP",I)) Q:I="" S NODE=^(I) D
  1. . ; screening out x - cancelled and 'dc' - discontinued
  1. . I ",x,dc,"[(","_$P(NODE,U,4)_",") Q
  1. . S X=$$INF(NODE)
  1. . S ACT=ACT+1
  1. . S MAGRY(ACT)=X ;S @MAGRY@(ACT)=X
  1. S MAGRY(1)="Date~S1^CP DEF nam^urgency^status" ;^cons #^CP DEF ien
  1. S MAGRY(0)=ACT-1_"^"_ACT-1_" Clinical Procedure Requests."
  1. Q
  1. INF(NODE) ;
  1. N RY
  1. ; FOR NOW JUST SEND THE SAME DATA (TESTING)
  1. S RY=$P(NODE,U,1,4)_"|"_$P(NODE,U,5,99)
  1. S $P(RY,U)=$$EXTDT^MAGGSU1($P(RY,U))
  1. Q RY
  1. ;S RY=$$EXTDT^MAGGSU1($P(NODE,U,3))_U_"TIU"_U_$P(NODE,U,2)_U
  1. ;S RY=RY_$$IMGCT($P(NODE,U))_U_$P($P(NODE,U,5),";",2)_U
  1. ;S RY=RY_"|TIU^"_$P(NODE,U)
  1. Q RY
  1. TIUDA(MAGRY,MAGDFN,MAGCONS,MAGVSTR,MAGCMP) ;RPC [MAG4 CP CONSULT TO TIUDA]
  1. ;
  1. K MAGRY S MAGVSTR=$G(MAGVSTR),MAGCMP=$G(MAGCMP,0)
  1. ; No longer sending CP the 'Complete' Flag 9/20/01 GEK
  1. ;D ITIU^MDAPI(.MAGRY,MAGDFN,MAGCONS,MAGVSTR,MAGCMP)
  1. ; CODE^DFN^MAGIEN^<computed time 'now'>^TEXT
  1. D ACTION^MAGGTAU("API^"_MAGDFN_"|ITIU-MDAPI Params: Cnslt#-"_MAGCONS_" vstr-"_MAGVSTR)
  1. D ITIU^MDAPI(.MAGRY,MAGDFN,MAGCONS,MAGVSTR)
  1. D ACTION^MAGGTAU("API^"_MAGDFN_"|ITIU-MDAPI Result: "_MAGRY(0))
  1. Q
  1. VISITS(MAGRY,MAGDFN,MAGCONS) ;RPC [MAG4 CP GET VISITS]
  1. N I,MAGCT,MAGNODE,MAGI,MAGZ,MAGVISIT,DFN
  1. S DFN=MAGDFN
  1. S RESULTS="MAGVISIT"
  1. ; RESULTS and DFN variables are needed by MDRPCOP
  1. D GETVST^MDRPCOP
  1. I '$D(MAGVISIT(0)) S MAGRY(0)="0^ERROR: Listing visits." Q
  1. S I=0,MAGCT=1 F S I=$O(MAGVISIT(I)) Q:'I D
  1. . S MAGZ=MAGVISIT(I)
  1. . S $P(MAGNODE,"^")=$$EXTDT^MAGGSU1($P(MAGZ,"^",2)) ;Date
  1. . S $P(MAGNODE,"^",2,3)=$P(MAGZ,"^",3,4) ; Clinic, Status
  1. . S $P(MAGNODE,"|",2)=$P(MAGZ,"^",1) ; VSTRING;
  1. . S MAGCT=MAGCT+1,MAGRY(MAGCT)=MAGNODE
  1. I '$D(MAGRY) S MAGRY(0)="0^0 Visits for patient" Q
  1. S MAGRY(0)=$O(MAGRY(""),-1)-1_"^Visits for patient"
  1. S MAGRY(1)="Date~S1^Location^Status"
  1. Q
  1. UPDCONS(MAGRY,MAGCONS,MAGTIU,MAGCMP) ;Update Consults;
  1. ; Update Consults with the Complete Flag. Consults will update
  1. ; it's status to 'pr' partial results.
  1. D ACTION^MAGGTAU("API|CPDOC-GMRCCP Params: Cnslt#-"_MAGCONS_" tiuda-"_MAGTIU_" cmpfl-"_MAGCMP)
  1. S MAGRY=$$CPDOC^GMRCCP(MAGCONS,MAGTIU,MAGCMP) ; MAGCMP IS 2
  1. Q