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

GMRCTIU3.m

Go to the documentation of this file.
GMRCTIU3 ;SLC/DCM,JFR - Extract medicine results for consults tracking ;7/1/00 09:30
 ;;3.0;CONSULT/REQUEST TRACKING;**4,15**;DEC 27, 1997
 ;
 ; This routine invokes IA #3171
 ;
EN(GMRCO,ORIFN,GLOBAL,COUNT) ;;This entry point is used to collect consult data from the Medicine Package.
 ;Consult/Request Tracking
 ;GMRCSEL: The IEN of the consult from file 123.
 ;COUNT:   The current position in ^TMP where data is to be placed.
 D ENDT,EXIT Q
 ;
ENDT ;Get Medicine Results for display
 S @GLOBAL@(COUNT,0)="",COUNT=COUNT+1
 S @GLOBAL@(COUNT,0)=$$CJ^XLFSTR("Medicine Report",80),COUNT=COUNT+1
 D MCRPT(GMRCSR,GLOBAL,.COUNT)
 S @GLOBAL@(COUNT,0)="",COUNT=COUNT+1
 Q
MCRPT(RESULT,GBL,CNT) ; call MCAPI with OR WORKSTATION and format global  
 N GMRCDFN
 S GMRCDFN=$G(DFN)
 N DFN
 D START^ORWRP(80,"EN^MCAPI(RESULT,1)")
 I '$D(^TMP("ORDATA",$J)) D  Q
 . S @GBL@(CNT,0)="No Medicine Result"
 . S CNT=CNT+1
 N I S I=0
 F  S I=$O(^TMP("ORDATA",$J,1,I)) Q:'I  D
 . S @GBL@(CNT,0)=^TMP("ORDATA",$J,1,I)
 . S CNT=CNT+1
 K ^TMP("ORDATA",$J)
 Q
EXIT K GMRCH,GMRCX,GMRCSR,GMRCFT,GMRCFLD,GMRCSUM,GMRCFLDN,GMRCSUMP,GMRCRTIT,GMRCPRNM,GMRCFLDP,MCC,MCK,MCMFLD,MCMUP
 K ^TMP("MC",$J)
 Q
SETFLD S GMRCFLD=0,GMRCFLDP="" F  S GMRCFLD=$O(^TMP("MC",$J,GMRCFT,GMRCFLD)) Q:GMRCFLD=""  S GMRCFL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