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

MAGTP007.m

Go to the documentation of this file.
  1. MAGTP007 ;WOIFO/FG - TELEPATHOLOGY TAGS ; 25 Jul 2013 5:38 PM
  1. ;;3.0;IMAGING;**138**;Mar 19, 2002;Build 5380;Sep 03, 2013
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  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. ;; | 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. ;
  1. ;***** GET LAB INFO FOR A CASE AS SHOWN IN CPRS
  1. ; RPC: MAGTP GET CPRS REPORT
  1. ;
  1. ; .MAGRY Reference to a local variable where the results
  1. ; are returned to.
  1. ;
  1. ; LRSS AP Section
  1. ;
  1. ; YEAR Accession Year (Two figures)
  1. ;
  1. ; LRAN Accession Number
  1. ;
  1. ; Return Values
  1. ; =============
  1. ;
  1. ; If MAGRY(0) 1st '^'-piece is 0, then an error
  1. ; occurred during execution of the procedure: 0^0^ ERROR explanation
  1. ;
  1. ; Otherwise, the output array reproduces the structure
  1. ; of global ^TMP("ORDATA",$J), containing the CPRS report:
  1. ;
  1. ; MAGRY(0) Description
  1. ; ^01: 1
  1. ; ^02: Number of Lines
  1. ;
  1. ; MAGRY(i) Description
  1. ; ^01: Text from CPRS Report
  1. ;
  1. ; Notes
  1. ; =====
  1. ;
  1. ; The ^TMP("ORDATA",$J) global node is used by this procedure
  1. ;
  1. GETREP(MAGRY,LRSS,YEAR,LRAN) ; RPC [MAGTP GET CPRS REPORT]
  1. K MAGRY
  1. N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGGTERR"
  1. I $G(LRSS)=""!($G(YEAR)="")!($G(LRAN)="") D Q
  1. . S MAGRY(0)="0^0^One or more input parameters are missing"
  1. N INPUT
  1. S INPUT=$$CONTEXT^MAGTP006(.MAGRY,LRSS,YEAR,LRAN) Q:'MAGRY(0)
  1. N LRI,LRDFN,DFN,FIELD,LABEL,RPTID,ROOT,TEMP,CT,I,J
  1. S LRI=$P(INPUT,",",2),LRDFN=$P(INPUT,",",3)
  1. S DFN=$$GET1^DIQ(63,LRDFN_",",".03","I") ; Internal Patient ID
  1. S FIELD=$S(LRSS="CY":9,LRSS="EM":2,1:8)
  1. S LABEL=$$GET1^DID(63,FIELD,"","LABEL") ; Name (label) of AP Section
  1. S RPTID="OR_"_LRSS_":"_LABEL_"~"_LRSS_";ORDV02A;0;1000"
  1. D RPT^ORWRP(.ROOT,DFN,RPTID) ; Get all reports for a patient
  1. M TEMP=@($P(ROOT,")")_","""_LRI_LRSS_""",""WP"")") ; Select only one case report
  1. ; Strip line numbers, set MAGRY
  1. S (CT,I)=0
  1. F S I=$O(TEMP(I)) Q:I="" D
  1. . S J=""
  1. . F S J=$O(TEMP(I,J)) Q:J="" D
  1. . . S CT=CT+1
  1. . . S MAGRY(CT)=$P(TEMP(I,J),U,2)
  1. . . Q
  1. . Q
  1. S MAGRY(0)="1^"_CT
  1. K ^TMP("ORDATA",$J),^TMP("LRC",$J) ; Clean up temporary globals
  1. Q ;