source: FOIAVistA/trunk/r/MEDICINE-MC/MCAPI.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1MCAPI ; CIOFO/MD - Print result from a medicine file
2 ;;2.3;Medicine;**27**;09/13/1996
3 ;;**DBIA #3042**
4 ;
5 ; RESULT= variable pointer to a medicine file entry
6 ; (e.g. "12;MCAR(691.5,") (required).
7 ;
8 ; MCFLG =1 if report to be headerless (optional)
9 ;
10EN(RESULT,MCFLG) ; Print result from a medicine file
11 N XQY0,MCARGRTN,PR,DISTP,DILCT,NUM,NAME,PRE,TSUP2,TT,TY,HOSP,ORVP,DA,MCARGDA,OT,MCARPPS,MCPRO,DFN,RDATE,SCD
12 S XQY0="",OT=$$SINGLE^MCAPI(RESULT)
13 I OT="" W !,"***** BAD MEDICINE FILE POINTER *****",! Q
14 S (DA,MCARGDA)=$P(OT,U,2),MCARPPS=$P(OT,U,3,4),MCPRO=$P(OT,U,11),DFN=$P(OT,U,13),ORVP=DFN_"DPT("
15 D MCPPROC^MCARP
16 S MCARGRTN=$P(OT,U,5)
17 D @MCARPPS
18 K %I
19 Q
20SINGLE(RESULT) ; Function to return info on single proceedure.
21 ;
22 ; RESULT = variable pointer to a medicine file
23 ; (e.g. "12;MCAR(691.5,") (required)
24 ;
25 N VALUE,ZNODE,S4,S5,S6,WH,DFN,J,K,L,LL,LL1,M,MCARCODE,MCARDT,MCARPROC,MCESKEY,MCESSEC,MCFILE,PR,S1,S2
26 S S6=+$G(RESULT) ;ien from medicine file
27 S S5=$P($P($G(RESULT),";",2),",") ;S5 is the root of the medicine file, no ^ or ,
28 S ZNODE=$G(@("^"_S5_","_S6_",0)")) ;zero node from record S6 in file S5
29 I $G(ZNODE)="" S VALUE="" G KILL
30 D:'($G(ZNODE)="")
31 . S S4=9999999.9999-($P(ZNODE,"^")) ;S4 is proceedure time/date
32 . S DFN=$P(ZNODE,"^",2),WH=""
33 . Q
34 D CONT^MCARPS2,PR0^MCARPS2 ;return single ^TMP("MCAR",$J,"GMRC", node
35 S ^TMP("MCAR",$J,"GMRC","OT",1)=$G(^TMP("OR",$J,"MCAR","OT",1)),VALUE=$S($G(^TMP("MCAR",$J,"GMRC","OT",1))'="":^TMP("MCAR",$J,"GMRC","OT",1)_"^"_DFN,1:"")
36KILL K ^TMP("MCAR",$J,"GMRC"),^TMP("OR",$J,"MCAR")
37 Q VALUE
Note: See TracBrowser for help on using the repository browser.