source: WorldVistAEHR/trunk/r/CONSULT_REQUEST_TRACKING-GMRC-GMRS-GMRT/GMRCTIU3.m@ 1800

Last change on this file since 1800 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.1 KB
RevLine 
[613]1GMRCTIU3 ;SLC/DCM,JFR - Extract medicine results for consults tracking ;7/1/00 09:30
2 ;;3.0;CONSULT/REQUEST TRACKING;**4,15**;DEC 27, 1997
3 ;
4 ; This routine invokes IA #3171
5 ;
6EN(GMRCO,ORIFN,GLOBAL,COUNT) ;;This entry point is used to collect consult data from the Medicine Package.
7 ;Consult/Request Tracking
8 ;GMRCSEL: The IEN of the consult from file 123.
9 ;COUNT: The current position in ^TMP where data is to be placed.
10 D ENDT,EXIT Q
11 ;
12ENDT ;Get Medicine Results for display
13 S @GLOBAL@(COUNT,0)="",COUNT=COUNT+1
14 S @GLOBAL@(COUNT,0)=$$CJ^XLFSTR("Medicine Report",80),COUNT=COUNT+1
15 D MCRPT(GMRCSR,GLOBAL,.COUNT)
16 S @GLOBAL@(COUNT,0)="",COUNT=COUNT+1
17 Q
18MCRPT(RESULT,GBL,CNT) ; call MCAPI with OR WORKSTATION and format global
19 N GMRCDFN
20 S GMRCDFN=$G(DFN)
21 N DFN
22 D START^ORWRP(80,"EN^MCAPI(RESULT,1)")
23 I '$D(^TMP("ORDATA",$J)) D Q
24 . S @GBL@(CNT,0)="No Medicine Result"
25 . S CNT=CNT+1
26 N I S I=0
27 F S I=$O(^TMP("ORDATA",$J,1,I)) Q:'I D
28 . S @GBL@(CNT,0)=^TMP("ORDATA",$J,1,I)
29 . S CNT=CNT+1
30 K ^TMP("ORDATA",$J)
31 Q
32EXIT K GMRCH,GMRCX,GMRCSR,GMRCFT,GMRCFLD,GMRCSUM,GMRCFLDN,GMRCSUMP,GMRCRTIT,GMRCPRNM,GMRCFLDP,MCC,MCK,MCMFLD,MCMUP
33 K ^TMP("MC",$J)
34 Q
35SETFLD S GMRCFLD=0,GMRCFLDP="" F S GMRCFLD=$O(^TMP("MC",$J,GMRCFT,GMRCFLD)) Q:GMRCFLD="" S GMRCFLD(0)=^(GMRCFLD) D
36 .S GMRCFLDN=$P(GMRCFLD(0),"^",2) Q:GMRCFLDN[";W"
37 .I GMRCFLDP=GMRCFLDN S COUNT=COUNT-1,@GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_", "
38 .E S GMRCFLDP=GMRCFLDN,@GLOBAL@(COUNT,0)=GMRCFLDP_":"_$E(TAB,1,18-$L(GMRCFLDP))
39 .I $L($P(GMRCFLD(0),"^",1))>45 S @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$P(GMRCFLD(0),"^",1),COUNT=COUNT+1 Q
40 .I $L($P(GMRCFLD(0),"^",1))'>77 S @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$P(GMRCFLD(0),"^",1)
41 .S COUNT=COUNT+1 Q
42 Q
43SUM ;
44 S GMRCSUM=$P(^TMP("MC",$J,"S"),"^",1),GMRCSUMP=$P(^TMP("MC",$J,"S"),"^",2)
45 I $L(GMRCSUM)!($L(GMRCSUMP)) S @GLOBAL@(COUNT,0)="SUMMARY:"
46 I $L(GMRCSUM) S @GLOBAL@(COUNT,0)=@GLOBAL@(COUNT,0)_$E(TAB,1,11)_GMRCSUM,COUNT=COUNT+1
47 I $L(GMRCSUMP) S @GLOBAL@(COUNT,0)="SUMMARY PROCEDURE: "_GMRCSUMP,COUNT=COUNT+1
48 Q
49END S GMRCCT=COUNT-1
50 K COUNT,GMRCH,GMRCFT,GMRCFLD,GMRCSUM,GMRCFLDN,GMRCSUMP,GMRCRTIT,GMRCPRNM,GMRCFLDP,MCC,MCK,MCMFLD,MCMUP
51 Q
Note: See TracBrowser for help on using the repository browser.