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

HLUTIL1.m

Go to the documentation of this file.
  1. HLUTIL1 ;ALB/RJS - HL7 UTILITIES ;1/17/95 11:15
  1. ;;1.6;HEALTH LEVEL SEVEN;;Oct 13, 1995
  1. ;
  1. DAT1(X) ; Convert a FileMan date to a displayable (mm/dd/yy) format.
  1. Q $S(X:$E(X,4,5)_"/"_$E(X,6,7)_"/"_$E(X,2,3),1:"")
  1. ;
  1. DAT2(Y) ; Convert a FileMan date to a displayable (mmm dd yyyy) format.
  1. Q:'$G(Y) ""
  1. N % D D^DIQ
  1. Q $TR(Y,"@"," ")
  1. ;
  1. HLFM(Y) ; Convert a quasi HL7 formatted date to a Fileman date.
  1. I Y="" Q ""
  1. N % S Y=$TR(Y,".",""),%=$E(Y,9,14)
  1. Q $E(Y,1,2)-17_$E(Y,3,8)_$S(+%:+("."_%),1:"")
  1. ;
  1. TASK(X) ; Is the background task currently running?
  1. ; Input: X -- Task number for the background job
  1. ; Output: 0 -- No, the job is not currently running
  1. ; 1 -- Yes, the job is currently running
  1. Q +$G(^%ZTSK(+$G(X),.1))=5
  1. ;
  1. PAUSE() ; Pause for CRT output.
  1. ; Input: IOST, IOSL
  1. ; Output: 0 -- Continue to display output
  1. ; 1 -- Quit
  1. Q:$E(IOST,1,2)'["C-" 0
  1. N DIR,DIRUT,DTOUT,DUOUT,HLJ
  1. F HLJ=$Y:1:(IOSL-5) W !
  1. S DIR(0)="E" D ^DIR
  1. Q $D(DIRUT)!($D(DUOUT))
  1. EXPAND(FILE,FIELD,VALUE) ; - returns internal data in an output format
  1. ; Taken from IVMUFNC w/help of CPM
  1. N Y,C S Y=VALUE
  1. I 'FILE!('FIELD)!(VALUE="") G EXPQ
  1. S Y=VALUE,C=$P(^DD(FILE,FIELD,0),"^",2) D Y^DIQ
  1. EXPQ Q Y
  1. EVENT(EID,NODES,RESULT) ;Entry point to get event data from the Protocol file
  1. ;
  1. ;This is a subroutine call with parameter passing. It returns each
  1. ;of the nodes from the Protocol file for the entry specified by EID
  1. ;in the array specified by the RESULT parameter
  1. ;
  1. ;Required Input Parameters
  1. ; EID = The IEN of the protocol in the Protocol file for which
  1. ; data is being requested
  1. ; NODES = The node subscripts to be returned separated by commas.
  1. ; Allowable subscripts are 15, 20, 770, 771, 772, 773
  1. ; Example: 15,20,770
  1. ; RESULT = The name of the array in which the nodes will be returned.
  1. ; The node subscripts will be used as the array subscripts.
  1. ; Example: RESULT(15)=...
  1. ;
  1. ;Check for required parameter
  1. I '$G(EID)!($G(NODES)']"") Q
  1. I '$D(^ORD(101,EID,0)) Q
  1. ;Get data for nodes requested
  1. I NODES[15 S RESULT(15)=$G(^ORD(101,EID,15))
  1. I NODES[20 S RESULT(20)=$G(^ORD(101,EID,20))
  1. I NODES[770 S RESULT(770)=$G(^ORD(101,EID,770))
  1. I NODES[771 S RESULT(771)=$G(^ORD(101,EID,771))
  1. I NODES[772 S RESULT(772)=$G(^ORD(101,EID,772))
  1. I NODES[773 S RESULT(773)=$G(^ORD(101,EID,773))
  1. Q