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

IBDFQSL2.m

Go to the documentation of this file.
  1. IBDFQSL2 ;ALB/CJM/AAS/MAF - ENCOUNTER FORM - Quick selection edit (cont.);12-Jun-95
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;**34**;APR 24, 1997
  1. ;
  1. GETLST(FORM,BLOCK,LIST,INTRFACE,ARY,FILTER,COUNT) ; -- returns any specified selection list for a clinic
  1. ; -- input FORM = ien of entry in 357
  1. ; BLOCK = ien of entry in 357.1
  1. ; LIST = ien of entry in 357.2
  1. ; INTRFACE = name of selection list in package interface file
  1. ; ARY = name of array to return list in
  1. ; FILTER = predefined filters (optional, default = 1)
  1. ; 1 = must be selection list
  1. ; 2 = only visit cpts on list
  1. ;
  1. ; -- output The format of the returned array is as follows
  1. ; @ARY@(0) = count of array element (0 of nothing found)
  1. ; @ARY@(1) = ^group header
  1. ; @ARY@(2) = problem ien or cpt or icd code^user defined text
  1. ; @ARY@(3) = problem ien or cpt or icd code^used defined text
  1. ; @ARY@(k) = ^next group header
  1. ; @ARY@(k+1) = problem ien or cpt or icd code^user define text
  1. ;
  1. Q:'FORM!('BLOCK)!('LIST)!('INTRFACE)
  1. N OLDARY,IBDTMP
  1. S COUNT=$G(COUNT,0)
  1. I $G(FILTER)<1 S FILTER=1 ;default value=1
  1. I FILTER>1 S OLDARY=ARY,ARY="IBDTMP"
  1. S @ARY@(0)=+$G(@ARY@(0))
  1. D COPYLIST(LIST,ARY,.COUNT)
  1. S @ARY@(0)=COUNT
  1. I FILTER=2 D F2^IBDF18A1(OLDARY)
  1. Q
  1. ;
  1. COPYLIST(LIST,ARY,COUNT) ;copies the entries from LIST to @ARY, starting subscript at COUNT+1
  1. ;
  1. N SLCTN,SUBCOL,TEXT,IEN,NODE,TSUBCOL,NODE,GROUP,ORDER,HDR,GRPORDR
  1. ;
  1. D SUBCOL^IBDF18A1(LIST,.TSUBCOL) ;find the subcolumn containing the text
  1. ;
  1. S GRPORDR=""
  1. F S GRPORDR=$O(^IBE(357.4,"APO",LIST,GRPORDR)) Q:GRPORDR="" D
  1. .S GROUP=0
  1. .F S GROUP=$O(^IBE(357.4,"APO",LIST,GRPORDR,GROUP)) Q:'GROUP D
  1. ..S HDR=$P($G(^IBE(357.4,GROUP,0)),"^") ;I HDR="BLANK" S HDR="" If don't want to print BLANK group
  1. ..S COUNT=COUNT+1,@ARY@(COUNT)="^"_HDR_"^^^"_GROUP_"^"_GRPORDR
  1. ..S ORDER=""
  1. ..F S ORDER=$O(^IBE(357.3,"APO",LIST,GROUP,ORDER)) Q:ORDER="" D
  1. ...S SLCTN=0
  1. ...F S SLCTN=$O(^IBE(357.3,"APO",LIST,GROUP,ORDER,SLCTN)) Q:'SLCTN D
  1. ....S NODE=$G(^IBE(357.3,SLCTN,0))
  1. ....S IEN=$P(NODE,"^")
  1. ....S SUBCOL=$O(^IBE(357.3,SLCTN,1,"B",+TSUBCOL,0))
  1. ....;
  1. ....I 'SUBCOL D Q ;placeholders
  1. .....S TEXT=$S($P(NODE,"^",6)?1E.E:$P(NODE,"^",6),1:"BLANK")
  1. .....S COUNT=COUNT+1
  1. .....S @ARY@(COUNT)=" "_"^"_TEXT_"^"_LIST_"^"_SLCTN_"^"_GROUP_"^"_ORDER Q
  1. ....;
  1. ....S NODE=$G(^IBE(357.3,SLCTN,1,SUBCOL,0))
  1. ....S:$P(NODE,"^")=TSUBCOL TEXT=$P(NODE,"^",2)
  1. ....;
  1. ....I $L(TEXT) S COUNT=COUNT+1,@ARY@(COUNT)=IEN_"^"_TEXT_"^"_LIST_"^"_SLCTN_"^"_GROUP_"^"_ORDER Q
  1. Q