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

ORMBLDP1.m

Go to the documentation of this file.
  1. ORMBLDP1 ;SLC/MKB-Build outgoing Pharmacy ORM msgs ;05/09/2007
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
  1. ;
  1. MOB(ORIEN,DFN) ;
  1. N IVTYPE,NODE,NUM,TYPE
  1. S IVTYPE=""
  1. D MOB^PSBAPIPM(DFN,ORIEN)
  1. S NODE=$G(^TMP("PSB",$J,0)) I NODE=-1 Q IVTYPE
  1. S TYPE=$P(NODE,U,3)
  1. S NUM=+$P(NODE,U,4)
  1. I TYPE="A" S IVTYPE="C" Q IVTYPE
  1. I TYPE="P" S IVTYPE="I" Q IVTYPE
  1. I TYPE="S",NUM=0 S IVTYPE="C" Q IVTYPE
  1. I TYPE="S",NUM=1 S IVTYPE="I" Q IVTYPE
  1. Q IVTYPE
  1. ;
  1. HL7IVLMT(STR) ;
  1. N LEN,VAL,UNIT,IVLMT,TVAL
  1. S (UNIT,IVLMT)="",VAL=0
  1. I $E($$LOW^XLFSTR(STR))="f" D
  1. . I STR["for a total of" D Q
  1. . .S VAL=$P(STR," ",5)
  1. . .S UNIT=$P(STR," ",6)
  1. . S VAL=$P(STR," ",2)
  1. . S UNIT=$E($P(STR," ",3))
  1. I $E($$LOW^XLFSTR(STR))="w" D
  1. . S TVAL=$P(STR," ",4) ;pull data in total example 0.5ml
  1. . S VAL=+TVAL ;this will strip out leading zero and alpha 00.5L becomes .5 or 05.5 becomes 5.5
  1. . S LEN=$F(TVAL,VAL) ;get length up to alphas or trailing zeros
  1. . I $P(VAL,".")="" S VAL=0_VAL ;make sure decimal values have only one leading zero .5 becomes 0.5.
  1. . F S UNIT=$E(TVAL,LEN) Q:((UNIT'=0)&(UNIT'=".")) D ;get first alpha m or l
  1. . . S LEN=LEN+1
  1. I $L(UNIT),$L(VAL) S IVLMT=$$LOW^XLFSTR(UNIT)_VAL
  1. Q IVLMT