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

ORU2.m

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