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

GMPLSLI2.m

Go to the documentation of this file.
GMPLSLI2 ;ISP/TC - Problem Selection List Import Utility ;07/18/17  09:43
 ;;2.0;Problem List;**49**;Aug 25, 1994;Build 43
 ;
 ; External References:
 ;   ICR  10142  EN^DDIOL
 ;
ISCSV(GMPLLINE) ;Verify that LINE is in CSV format with at least 3 pieces of data
 I $L(GMPLLINE)=0 Q 0
 N GMPLCSV
 S GMPLCSV=$S($L(GMPLLINE,",")>2:1,1:0)
 I 'GMPLCSV D
 . N GMPLTXT
 . S GMPLTXT(1)=""
 . S GMPLTXT(2)="The following line is not in CSV format and cannot be processed:"
 . S GMPLTXT(3)=" "_GMPLLINE
 . D EN^DDIOL(.GMPLTXT)
 . H 1
 Q GMPLCSV
 ;============================================
RBLCKHF(GMPLNIN,GMPLNOUT) ;FTG^%ZISH breaks lines at 255 characters. This could
 ;put a mapping across two lines. Format the ^TMP array so this does not
 ;happen.
 N GMPLCHAR,GMPLI,GMPLJ,GMPLK,GMPLL1,GMPLNL1,GMPLNL2,GMPLTMP
 K ^TMP($J,"GMPLNOUT")
 S GMPLI="",GMPLNL1=0
 F  S GMPLI=+$O(^TMP($J,GMPLNIN,GMPLI)) Q:GMPLI=0  D
 . S GMPLTMP=^TMP($J,GMPLNIN,GMPLI),GMPLNL1=GMPLNL1+1
 . I '$D(^TMP($J,GMPLNIN,GMPLI,"OVF")) S ^TMP($J,GMPLNOUT,GMPLNL1,1)=GMPLTMP Q
 . S GMPLL1="",GMPLNL2=0
 . F GMPLJ=1:1:$L(GMPLTMP) D
 .. S GMPLCHAR=$E(GMPLTMP,GMPLJ)
 .. S GMPLL1=GMPLL1_GMPLCHAR
 .. I $L(GMPLL1)>230,GMPLCHAR="," S GMPLNL2=GMPLNL2+1,^TMP($J,GMPLNOUT,GMPLNL1,GMPLNL2)=GMPLL1,GMPLL1=""
 .;Check for overflow nodes.
 . S GMPLJ=0
 . F  S GMPLJ=+$O(^TMP($J,GMPLNIN,GMPLI,"OVF",GMPLJ)) Q:GMPLJ=0  D
 .. S GMPLTMP=^TMP($J,GMPLNIN,GMPLI,"OVF",GMPLJ)
 .. F GMPLK=1:1:$L(GMPLTMP) D
 ... S GMPLCHAR=$E(GMPLTMP,GMPLK)
 ... S GMPLL1=GMPLL1_GMPLCHAR
 ... I $L(GMPLL1)>230,GMPLCHAR="," S GMPLNL2=GMPLNL2+1,^TMP($J,GMPLNOUT,GMPLNL1,GMPLNL2)=GMPLL1,GMPLL1=""
 . I $L(GMPLL1)>0 S GMPLNL2=GMPLNL2+1,^TMP($J,GMPLNOUT,GMPLNL1,GMPLNL2)=GMPLL1
 Q
 ;============================================
RBLCKWEB(GMPLNIN,GMPLNOUT) ;GETURL^XTHC10 breaks lines at 245 characters. This
 ;could break a line into two lines. Format the ^TMP array so this does
 ;not happen.
 N GMPLCHAR,GMPLI,GMPLJ,GMPLK,GMPLL1,GMPLLEN,GMPLNL1,GMPLNL2,GMPLTMP
 K ^TMP($J,"GMPLNOUT")
 S GMPLI="",GMPLNL1=0
 F  S GMPLI=+$O(^TMP($J,GMPLNIN,GMPLI)) Q:GMPLI=0  D
 . S GMPLTMP=^TMP($J,GMPLNIN,GMPLI),GMPLLEN=$L(GMPLTMP)
 . I GMPLLEN=0 S GMPLNL1=GMPLNL1+1,^TMP($J,GMPLNOUT,GMPLNL1,1)=GMPLTMP Q
 . S GMPLNL1=GMPLNL1+1
 . I $D(^TMP($J,GMPLNIN,GMPLI))<11 S ^TMP($J,GMPLNOUT,GMPLNL1,1)=$TR(GMPLTMP,$C(13),"") Q
 . S GMPLL1="",GMPLNL2=0
 . F GMPLJ=1:1:$L(GMPLTMP) D
 .. S GMPLCHAR=$E(GMPLTMP,GMPLJ)
 .. I GMPLCHAR=$C(13) Q
 .. S GMPLL1=GMPLL1_GMPLCHAR
 .. I $L(GMPLL1)>230,GMPLCHAR="," S GMPLNL2=GMPLNL2+1,^TMP($J,GMPLNOUT,GMPLNL1,GMPLNL2)=GMPLL1,GMPLL1=""
 .;Check for overflow nodes.
 . S GMPLJ=0
 . F  S GMPLJ=+$O(^TMP($J,GMPLNIN,GMPLI,GMPLJ)) Q:GMPLJ=0  D
 .. S GMPLTMP=^TMP($J,GMPLNIN,GMPLI,GMPLJ)
 .. F GMPLK=1:1:$L(GMPLTMP) D
 ... S GMPLCHAR=$E(GMPLTMP,GMPLK)
 ... I GMPLCHAR=$C(13) Q
 ... S GMPLL1=GMPLL1_GMPLCHAR
 ... I $L(GMPLL1)>230,GMPLCHAR="," S GMPLNL2=GMPLNL2+1,^TMP($J,GMPLNOUT,GMPLNL1,GMPLNL2)=GMPLL1,GMPLL1=""
 . I $L(GMPLL1)>0 S GMPLNL2=GMPLNL2+1,^TMP($J,GMPLNOUT,GMPLNL1,GMPLNL2)=GMPLL1
 Q