PXSMAN ;SLC/PKR - Utilities for working with ScreenMan ;10/24/2016
;;1.0;PCE PATIENT CARE ENCOUNTER;**211**;Aug 12, 1996;Build 454
;=============================================
FSOC(FILENUM,FIELD) ;Format a set of codes for display in ScreenMan.
N CODES,MSG,LEN,NL,TEXTOUT
S CODES=$$GET1^DID(FILENUM,FIELD,"","POINTER","MSG")
S CODES=$TR(CODES,":","=")
S CODES=$$STRREP^PXUTIL(CODES,";",", ")
D FORMATS^PXRMTEXT(1,IOM,CODES,.NL,.TEXTOUT)
S LEN=$L(TEXTOUT(NL))
S:$E(TEXTOUT(NL),LEN)="," TEXTOUT(NL)=$E(TEXTOUT(NL),1,(LEN-1))
D HLP^DDSUTL(.TEXTOUT)
Q
;
;=============================================
WPECAP(FNUM,DA,FIELD,MAXLEN) ;Executable caption for word-processing fields.
;FNUM is the file number and FIELD is the field name. MAXLEN is
;74-$L(FIELD). Pass it as parameter so it does not need to be
;constantly recomputed.
N L1,TEXT,WPTEXT
S WPTEXT=$$GET^DDSVAL(FNUM,.DA,FIELD)
S TEXT=FIELD_": "
I $$WPNCHAR^PXSMAN(WPTEXT)=0 Q TEXT
S L1=@WPTEXT@(1,0)
S LEN=$L(L1)
Q TEXT_$S(LEN>MAXLEN:$E(L1,1,MAXLEN)_" ...",1:L1)
;
;=============================================
WPNCHAR(WP) ;Return 0 if a word-processing field does not contain any text.
I '$D(@WP@(0)) Q 0
N LN,NC
S NC=0
F LN=1:1:$P(@WP@(0),U,4) Q:NC>0 S NC=NC+$L(@WP@(LN,0))
Q NC
;
;=============================================
VUPAGE(FILENUM,UPAGE,DA,DDSERROR) ;Make sure the Upper Age is not less than
;the Lower Age.
N LWRAGE
S LWRAGE=$$GET^DDSVAL(FILENUM,.DA,"LOWER AGE")
I UPAGE'<LWRAGE Q
D HLP^DDSUTL("The Upper Age cannot be less than the Lower Age.")
S DDSERROR=1
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXSMAN 1619 printed Dec 13, 2024@02:31:28 Page 2
PXSMAN ;SLC/PKR - Utilities for working with ScreenMan ;10/24/2016
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**211**;Aug 12, 1996;Build 454
+2 ;=============================================
FSOC(FILENUM,FIELD) ;Format a set of codes for display in ScreenMan.
+1 NEW CODES,MSG,LEN,NL,TEXTOUT
+2 SET CODES=$$GET1^DID(FILENUM,FIELD,"","POINTER","MSG")
+3 SET CODES=$TRANSLATE(CODES,":","=")
+4 SET CODES=$$STRREP^PXUTIL(CODES,";",", ")
+5 DO FORMATS^PXRMTEXT(1,IOM,CODES,.NL,.TEXTOUT)
+6 SET LEN=$LENGTH(TEXTOUT(NL))
+7 if $EXTRACT(TEXTOUT(NL),LEN)=","
SET TEXTOUT(NL)=$EXTRACT(TEXTOUT(NL),1,(LEN-1))
+8 DO HLP^DDSUTL(.TEXTOUT)
+9 QUIT
+10 ;
+11 ;=============================================
WPECAP(FNUM,DA,FIELD,MAXLEN) ;Executable caption for word-processing fields.
+1 ;FNUM is the file number and FIELD is the field name. MAXLEN is
+2 ;74-$L(FIELD). Pass it as parameter so it does not need to be
+3 ;constantly recomputed.
+4 NEW L1,TEXT,WPTEXT
+5 SET WPTEXT=$$GET^DDSVAL(FNUM,.DA,FIELD)
+6 SET TEXT=FIELD_": "
+7 IF $$WPNCHAR^PXSMAN(WPTEXT)=0
QUIT TEXT
+8 SET L1=@WPTEXT@(1,0)
+9 SET LEN=$LENGTH(L1)
+10 QUIT TEXT_$SELECT(LEN>MAXLEN:$EXTRACT(L1,1,MAXLEN)_" ...",1:L1)
+11 ;
+12 ;=============================================
WPNCHAR(WP) ;Return 0 if a word-processing field does not contain any text.
+1 IF '$DATA(@WP@(0))
QUIT 0
+2 NEW LN,NC
+3 SET NC=0
+4 FOR LN=1:1:$PIECE(@WP@(0),U,4)
if NC>0
QUIT
SET NC=NC+$LENGTH(@WP@(LN,0))
+5 QUIT NC
+6 ;
+7 ;=============================================
VUPAGE(FILENUM,UPAGE,DA,DDSERROR) ;Make sure the Upper Age is not less than
+1 ;the Lower Age.
+2 NEW LWRAGE
+3 SET LWRAGE=$$GET^DDSVAL(FILENUM,.DA,"LOWER AGE")
+4 IF UPAGE'<LWRAGE
QUIT
+5 DO HLP^DDSUTL("The Upper Age cannot be less than the Lower Age.")
+6 SET DDSERROR=1
+7 QUIT
+8 ;