ORU2 ; slc/dcm - More OE/RR Utilities ;1/21/92 16:08
;;3.0;ORDER ENTRY/RESULTS REPORTING;**11**;Dec 17, 1997
;
FORMAT(TEXT,LENGTH) ; Formats text field
N ORI,ORX
F ORI=1:1:$L(TEXT,"|") S $P(TEXT,"|",ORI)=$$STRIP($P(TEXT,"|",ORI))
S ORX="" F ORI=1:1:$L(TEXT,"|") S:$P(TEXT,"|",ORI)]"" ORX=ORX_$S(ORI=1:"",1:" -")_$P(TEXT,"|",ORI)
S TEXT=ORX
I $L(TEXT)>LENGTH S TEXT=$$WRAP(TEXT,LENGTH)
Q TEXT
STRIP(TEXT) ; Strips white space from text
N ORI,ORX
S ORX="" F ORI=1:1:$L(TEXT," ") S:$A($P(TEXT," ",ORI))>0 ORX=ORX_$S(ORI=1:"",1:" ")_$P(TEXT," ",ORI)
S TEXT=ORX
Q TEXT
WRAP(TEXT,LENGTH) ; Breaks text string into substrings of length LENGTH
N ORI,LINE,ORX,ORY
S LINE=1,ORX(1)="",ORY=0
F ORI=1:1:$L(TEXT," ") S:$L(ORX(LINE)_" "_$P(TEXT," ",ORI))>LENGTH LINE=LINE+1,ORY=0 S:'$D(ORX(LINE)) ORX(LINE)="" S ORX(LINE)=$G(ORX(LINE))_$S(ORY=0:"",1:" ")_$P(TEXT," ",ORI),ORY=1
S TEXT="" F ORI=1:1:3 Q:$G(ORX(ORI))']"" S TEXT=TEXT_$S(ORI=1:"",1:"| ")_$G(ORX(ORI))
Q TEXT
PATHLP(X) ; Writes executable help for Patient lookup
N I,J,XQH,Y
I X?1.2"?" W !!,"Enter selection(s) by typing the name(s) or number(s) (separated by commas)."
I X?2"?" D
. W !!,"ALL items (except those numbered above 900) may be selected by typing 'ALL'."
. W !!,"RANGES of numbers may be entered using dashes."
. W !?5,"For example: 2-5,7-9"
. W !!,"EXCEPTIONS may be entered by preceding them with an apostrophe."
. W !?5,"For example: 1-10,'9 or 1-10,'BRANDX"
. W !,"(These select items 1 thru 10 except for 9 or BRANDX, respectively.)"
. I $E($G(^%ZOSF("OS")),1,3)'="DSM" W !!,"HELP for advanced look-up features may be obtained by entering '???'."
I X?3"?",($E($G(^%ZOSF("OS")),1,3)'="DSM") S XQH="OR PATIENT LOOKUP" D EN^XQH
Q ""
PATHLP1(X) ; Writes executable help for Patient lookup
N DIC,I,J,XQH,Y
I X?1.2"?" S DIC=2,DIC(0)="M" D ^DIC
I X?2"?",($E($G(^%ZOSF("OS")),1,3)'="DSM") D
. W !!?1,"You may also enter User, Provider or Treating Specialty name to pick from",!?5,"corresponding patient lists."
. W !!?1,"HELP for advanced look-up features may be obtained by entering '???'."
I X?3"?",($E($G(^%ZOSF("OS")),1,3)'="DSM") S XQH="OR PATIENT LOOKUP" D EN^XQH
Q ""
ORU2 ; slc/dcm - More OE/RR Utilities ;1/21/92 16:08
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11**;Dec 17, 1997
+2 ;
FORMAT(TEXT,LENGTH) ; Formats text field
+1 NEW ORI,ORX
+2 FOR ORI=1:1:$LENGTH(TEXT,"|")
SET $PIECE(TEXT,"|",ORI)=$$STRIP($PIECE(TEXT,"|",ORI))
+3 SET ORX=""
FOR ORI=1:1:$LENGTH(TEXT,"|")
IF $PIECE(TEXT,"|",ORI)]""
SET ORX=ORX_$SELECT(ORI=1:"",1:" -")_$PIECE(TEXT,"|",ORI)
+4 SET TEXT=ORX
+5 IF $LENGTH(TEXT)>LENGTH
SET TEXT=$$WRAP(TEXT,LENGTH)
+6 QUIT TEXT
STRIP(TEXT) ; Strips white space from text
+1 NEW ORI,ORX
+2 SET ORX=""
FOR ORI=1:1:$LENGTH(TEXT," ")
IF $ASCII($PIECE(TEXT," ",ORI))>0
SET ORX=ORX_$SELECT(ORI=1:"",1:" ")_$PIECE(TEXT," ",ORI)
+3 SET TEXT=ORX
+4 QUIT TEXT
WRAP(TEXT,LENGTH) ; Breaks text string into substrings of length LENGTH
+1 NEW ORI,LINE,ORX,ORY
+2 SET LINE=1
SET ORX(1)=""
SET ORY=0
+3 FOR ORI=1:1:$LENGTH(TEXT," ")
IF $LENGTH(ORX(LINE)_" "_$PIECE(TEXT," ",ORI))>LENGTH
SET LINE=LINE+1
SET ORY=0
IF '$DATA(ORX(LINE))
SET ORX(LINE)=""
SET ORX(LINE)=$GET(ORX(LINE))_$SELECT(ORY=0:"",1:" ")_$PIECE(TEXT," ",ORI)
SET ORY=1
+4 SET TEXT=""
FOR ORI=1:1:3
IF $GET(ORX(ORI))']""
QUIT
SET TEXT=TEXT_$SELECT(ORI=1:"",1:"| ")_$GET(ORX(ORI))
+5 QUIT TEXT
PATHLP(X) ; Writes executable help for Patient lookup
+1 NEW I,J,XQH,Y
+2 IF X?1.2"?"
WRITE !!,"Enter selection(s) by typing the name(s) or number(s) (separated by commas)."
+3 IF X?2"?"
Begin DoDot:1
+4 WRITE !!,"ALL items (except those numbered above 900) may be selected by typing 'ALL'."
+5 WRITE !!,"RANGES of numbers may be entered using dashes."
+6 WRITE !?5,"For example: 2-5,7-9"
+7 WRITE !!,"EXCEPTIONS may be entered by preceding them with an apostrophe."
+8 WRITE !?5,"For example: 1-10,'9 or 1-10,'BRANDX"
+9 WRITE !,"(These select items 1 thru 10 except for 9 or BRANDX, respectively.)"
+10 IF $EXTRACT($GET(^%ZOSF("OS")),1,3)'="DSM"
WRITE !!,"HELP for advanced look-up features may be obtained by entering '???'."
End DoDot:1
+11 IF X?3"?"
IF ($EXTRACT($GET(^%ZOSF("OS")),1,3)'="DSM")
SET XQH="OR PATIENT LOOKUP"
DO EN^XQH
+12 QUIT ""
PATHLP1(X) ; Writes executable help for Patient lookup
+1 NEW DIC,I,J,XQH,Y
+2 IF X?1.2"?"
SET DIC=2
SET DIC(0)="M"
DO ^DIC
+3 IF X?2"?"
IF ($EXTRACT($GET(^%ZOSF("OS")),1,3)'="DSM")
Begin DoDot:1
+4 WRITE !!?1,"You may also enter User, Provider or Treating Specialty name to pick from",!?5,"corresponding patient lists."
+5 WRITE !!?1,"HELP for advanced look-up features may be obtained by entering '???'."
End DoDot:1
+6 IF X?3"?"
IF ($EXTRACT($GET(^%ZOSF("OS")),1,3)'="DSM")
SET XQH="OR PATIENT LOOKUP"
DO EN^XQH
+7 QUIT ""