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 GMRCFLD(0)=^(GMRCFLD) D
.S GMRCFLDN=$P(GMRCFLD(0),"^",2) Q:GMRCFLDN[";W"
.I GMRCFLDP=GMRCFLDN S COUNT=COUNT-1,@GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_", "
.E S GMRCFLDP=GMRCFLDN,@GLOBAL@(COUNT,0)=GMRCFLDP_":"_$E(TAB,1,18-$L(GMRCFLDP))
.I $L($P(GMRCFLD(0),"^",1))>45 S @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$P(GMRCFLD(0),"^",1),COUNT=COUNT+1 Q
.I $L($P(GMRCFLD(0),"^",1))'>77 S @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$P(GMRCFLD(0),"^",1)
.S COUNT=COUNT+1 Q
Q
SUM ;
S GMRCSUM=$P(^TMP("MC",$J,"S"),"^",1),GMRCSUMP=$P(^TMP("MC",$J,"S"),"^",2)
I $L(GMRCSUM)!($L(GMRCSUMP)) S @GLOBAL@(COUNT,0)="SUMMARY:"
I $L(GMRCSUM) S @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$E(TAB,1,11)_GMRCSUM,COUNT=COUNT+1
I $L(GMRCSUMP) S @GLOBAL@(COUNT,0)="SUMMARY PROCEDURE: "_GMRCSUMP,COUNT=COUNT+1
Q
END S GMRCCT=COUNT-1
K COUNT,GMRCH,GMRCFT,GMRCFLD,GMRCSUM,GMRCFLDN,GMRCSUMP,GMRCRTIT,GMRCPRNM,GMRCFLDP,MCC,MCK,MCMFLD,MCMUP
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRCTIU3 2213 printed Dec 13, 2024@01:47:36 Page 2
GMRCTIU3 ;SLC/DCM,JFR - Extract medicine results for consults tracking ;7/1/00 09:30
+1 ;;3.0;CONSULT/REQUEST TRACKING;**4,15**;DEC 27, 1997
+2 ;
+3 ; This routine invokes IA #3171
+4 ;
EN(GMRCO,ORIFN,GLOBAL,COUNT) ;;This entry point is used to collect consult data from the Medicine Package.
+1 ;Consult/Request Tracking
+2 ;GMRCSEL: The IEN of the consult from file 123.
+3 ;COUNT: The current position in ^TMP where data is to be placed.
+4 DO ENDT
DO EXIT
QUIT
+5 ;
ENDT ;Get Medicine Results for display
+1 SET @GLOBAL@(COUNT,0)=""
SET COUNT=COUNT+1
+2 SET @GLOBAL@(COUNT,0)=$$CJ^XLFSTR("Medicine Report",80)
SET COUNT=COUNT+1
+3 DO MCRPT(GMRCSR,GLOBAL,.COUNT)
+4 SET @GLOBAL@(COUNT,0)=""
SET COUNT=COUNT+1
+5 QUIT
MCRPT(RESULT,GBL,CNT) ; call MCAPI with OR WORKSTATION and format global
+1 NEW GMRCDFN
+2 SET GMRCDFN=$GET(DFN)
+3 NEW DFN
+4 DO START^ORWRP(80,"EN^MCAPI(RESULT,1)")
+5 IF '$DATA(^TMP("ORDATA",$JOB))
Begin DoDot:1
+6 SET @GBL@(CNT,0)="No Medicine Result"
+7 SET CNT=CNT+1
End DoDot:1
QUIT
+8 NEW I
SET I=0
+9 FOR
SET I=$ORDER(^TMP("ORDATA",$JOB,1,I))
if 'I
QUIT
Begin DoDot:1
+10 SET @GBL@(CNT,0)=^TMP("ORDATA",$JOB,1,I)
+11 SET CNT=CNT+1
End DoDot:1
+12 KILL ^TMP("ORDATA",$JOB)
+13 QUIT
EXIT KILL GMRCH,GMRCX,GMRCSR,GMRCFT,GMRCFLD,GMRCSUM,GMRCFLDN,GMRCSUMP,GMRCRTIT,GMRCPRNM,GMRCFLDP,MCC,MCK,MCMFLD,MCMUP
+1 KILL ^TMP("MC",$JOB)
+2 QUIT
SETFLD SET GMRCFLD=0
SET GMRCFLDP=""
FOR
SET GMRCFLD=$ORDER(^TMP("MC",$JOB,GMRCFT,GMRCFLD))
if GMRCFLD=""
QUIT
SET GMRCFLD(0)=^(GMRCFLD)
Begin DoDot:1
+1 SET GMRCFLDN=$PIECE(GMRCFLD(0),"^",2)
if GMRCFLDN[";W"
QUIT
+2 IF GMRCFLDP=GMRCFLDN
SET COUNT=COUNT-1
SET @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_", "
+3 IF '$TEST
SET GMRCFLDP=GMRCFLDN
SET @GLOBAL@(COUNT,0)=GMRCFLDP_":"_$EXTRACT(TAB,1,18-$LENGTH(GMRCFLDP))
+4 IF $LENGTH($PIECE(GMRCFLD(0),"^",1))>45
SET @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$PIECE(GMRCFLD(0),"^",1)
SET COUNT=COUNT+1
QUIT
+5 IF $LENGTH($PIECE(GMRCFLD(0),"^",1))'>77
SET @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$PIECE(GMRCFLD(0),"^",1)
+6 SET COUNT=COUNT+1
QUIT
End DoDot:1
+7 QUIT
SUM ;
+1 SET GMRCSUM=$PIECE(^TMP("MC",$JOB,"S"),"^",1)
SET GMRCSUMP=$PIECE(^TMP("MC",$JOB,"S"),"^",2)
+2 IF $LENGTH(GMRCSUM)!($LENGTH(GMRCSUMP))
SET @GLOBAL@(COUNT,0)="SUMMARY:"
+3 IF $LENGTH(GMRCSUM)
SET @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$EXTRACT(TAB,1,11)_GMRCSUM
SET COUNT=COUNT+1
+4 IF $LENGTH(GMRCSUMP)
SET @GLOBAL@(COUNT,0)="SUMMARY PROCEDURE: "_GMRCSUMP
SET COUNT=COUNT+1
+5 QUIT
END SET GMRCCT=COUNT-1
+1 KILL COUNT,GMRCH,GMRCFT,GMRCFLD,GMRCSUM,GMRCFLDN,GMRCSUMP,GMRCRTIT,GMRCPRNM,GMRCFLDP,MCC,MCK,MCMFLD,MCMUP
+2 QUIT