source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORMBLDP1.m@ 1686

Last change on this file since 1686 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1ORMBLDP1 ;SLC/MKB-Build outgoing Pharmacy ORM msgs ;05/09/2007
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**243**;Dec 17, 1997;Build 242
3 ;
4MOB(ORIEN,DFN) ;
5 N IVTYPE,NODE,NUM,TYPE
6 S IVTYPE=""
7 D MOB^PSBAPIPM(DFN,ORIEN)
8 S NODE=$G(^TMP("PSB",$J,0)) I NODE=-1 Q IVTYPE
9 S TYPE=$P(NODE,U,3)
10 S NUM=+$P(NODE,U,4)
11 I TYPE="A" S IVTYPE="C" Q IVTYPE
12 I TYPE="P" S IVTYPE="I" Q IVTYPE
13 I TYPE="S",NUM=0 S IVTYPE="C" Q IVTYPE
14 I TYPE="S",NUM=1 S IVTYPE="I" Q IVTYPE
15 Q IVTYPE
16 ;
17HL7IVLMT(STR) ;
18 N LEN,VAL,UNIT,IVLMT,TVAL
19 S (UNIT,IVLMT)="",VAL=0
20 I $E($$LOW^XLFSTR(STR))="f" D
21 . I STR["for a total of" D Q
22 . .S VAL=$P(STR," ",5)
23 . .S UNIT=$P(STR," ",6)
24 . S VAL=$P(STR," ",2)
25 . S UNIT=$E($P(STR," ",3))
26 I $E($$LOW^XLFSTR(STR))="w" D
27 . S TVAL=$P(STR," ",4) ;pull data in total example 0.5ml
28 . S VAL=+TVAL ;this will strip out leading zero and alpha 00.5L becomes .5 or 05.5 becomes 5.5
29 . S LEN=$F(TVAL,VAL) ;get length up to alphas or trailing zeros
30 . I $P(VAL,".")="" S VAL=0_VAL ;make sure decimal values have only one leading zero .5 becomes 0.5.
31 . F S UNIT=$E(TVAL,LEN) Q:((UNIT'=0)&(UNIT'=".")) D ;get first alpha m or l
32 . . S LEN=LEN+1
33 I $L(UNIT),$L(VAL) S IVLMT=$$LOW^XLFSTR(UNIT)_VAL
34 Q IVLMT
Note: See TracBrowser for help on using the repository browser.