Difference between revisions of "Host File Handling"

From VistApedia
Jump to: navigation, search
 
Line 1: Line 1:
Host Files (also called Host Operating System Files) are generally stored on the disk outside of the [[MUMPS system]].  
+
Host Files (also called [[Host Operating System Files]]) are generally stored on the disk outside of the [[MUMPS system]].  
  
 
== Reading from Host Files into MUMPS data arrays ==
 
== Reading from Host Files into MUMPS data arrays ==

Revision as of 01:39, 26 February 2005

Host Files (also called Host Operating System Files) are generally stored on the disk outside of the MUMPS system.

Reading from Host Files into MUMPS data arrays

From User:Greg Woodhouse

I'll look into it more as soon as I get a chance. In the meantime, here is some code I wrote to append strings to build large arrays by sequentially appending substrings. This is the format used by th VistA HL7 package to represent long strings and it is NOT the same as the format of WP fields, but the same idea can be used here.


APPEND(PRCBUF,PRCSTR,PRCLIM)    ;
        N HASCHD,LAST,VAL,L1,L2,L3
        S:+$G(PRCLIM)'>0 PRCLIM=245 ;default
        S HASCHD=$S($D(@PRCBUF)'<10:1,1:0)
        I HASCHD S LAST=$O(@PRCBUF@(" "),-1)
        S L1=$S(HASCHD:$L($NA(@PRCBUF@(LAST))),1:$L(PRCBUF))
        S L2=$L(PRCSTR)
        I HASCHD S VAL=$G(@PRCBUF@(LAST))
        I 'HASCHD S VAL=$G(@PRCBUF)
        S L3=$L(VAL)
        I L1+L2+L3<PRCLIM D
        .S:'HASCHD @PRCBUF=VAL_PRCSTR
        .S:HASCHD @PRCBUF@(LAST)=VAL_PRCSTR
        I L1+L2+L3'<PRCLIM D
        .S LAST=$S(HASCHD:LAST+1,1:1)
        .S @PRCBUF@(LAST)=PRCSTR
        Q