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

MCAPI.m

Go to the documentation of this file.
  1. MCAPI ; CIOFO/MD - Print result from a medicine file
  1. ;;2.3;Medicine;**27**;09/13/1996
  1. ;;**DBIA #3042**
  1. ;
  1. ; RESULT= variable pointer to a medicine file entry
  1. ; (e.g. "12;MCAR(691.5,") (required).
  1. ;
  1. ; MCFLG =1 if report to be headerless (optional)
  1. ;
  1. EN(RESULT,MCFLG) ; Print result from a medicine file
  1. N XQY0,MCARGRTN,PR,DISTP,DILCT,NUM,NAME,PRE,TSUP2,TT,TY,HOSP,ORVP,DA,MCARGDA,OT,MCARPPS,MCPRO,DFN,RDATE,SCD
  1. S XQY0="",OT=$$SINGLE^MCAPI(RESULT)
  1. I OT="" W !,"***** BAD MEDICINE FILE POINTER *****",! Q
  1. 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("
  1. D MCPPROC^MCARP
  1. S MCARGRTN=$P(OT,U,5)
  1. D @MCARPPS
  1. K %I
  1. Q
  1. SINGLE(RESULT) ; Function to return info on single proceedure.
  1. ;
  1. ; RESULT = variable pointer to a medicine file
  1. ; (e.g. "12;MCAR(691.5,") (required)
  1. ;
  1. N VALUE,ZNODE,S4,S5,S6,WH,DFN,J,K,L,LL,LL1,M,MCARCODE,MCARDT,MCARPROC,MCESKEY,MCESSEC,MCFILE,PR,S1,S2
  1. S S6=+$G(RESULT) ;ien from medicine file
  1. S S5=$P($P($G(RESULT),";",2),",") ;S5 is the root of the medicine file, no ^ or ,
  1. S ZNODE=$G(@("^"_S5_","_S6_",0)")) ;zero node from record S6 in file S5
  1. I $G(ZNODE)="" S VALUE="" G KILL
  1. D:'($G(ZNODE)="")
  1. . S S4=9999999.9999-($P(ZNODE,"^")) ;S4 is proceedure time/date
  1. . S DFN=$P(ZNODE,"^",2),WH=""
  1. . Q
  1. D CONT^MCARPS2,PR0^MCARPS2 ;return single ^TMP("MCAR",$J,"GMRC", node
  1. 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:"")
  1. KILL K ^TMP("MCAR",$J,"GMRC"),^TMP("OR",$J,"MCAR")
  1. Q VALUE