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

PXRMSMAN.m

Go to the documentation of this file.
  1. PXRMSMAN ;SLC/PKR - Utilities for working with ScreenMan ;12/16/2011
  1. ;;2.0;CLINICAL REMINDERS;**22**;Feb 04, 2005;Build 160
  1. ;=============================================
  1. FSOC(FILENUM,FIELD) ;Format a set of codes for display in ScreenMan.
  1. N CODES,MSG,LEN,NL,TEXTOUT
  1. S CODES=$$GET1^DID(FILENUM,FIELD,"","POINTER","MSG")
  1. S CODES=$TR(CODES,":","=")
  1. S CODES=$$STRREP^PXRMUTIL(CODES,";",", ")
  1. D FORMATS^PXRMTEXT(1,IOM,CODES,.NL,.TEXTOUT)
  1. S LEN=$L(TEXTOUT(NL))
  1. S:$E(TEXTOUT(NL),LEN)="," TEXTOUT(NL)=$E(TEXTOUT(NL),1,(LEN-1))
  1. D HLP^DDSUTL(.TEXTOUT)
  1. Q
  1. ;
  1. ;=============================================
  1. 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
  1. ;74-$L(FIELD). Pass it as parameter so it does not need to be
  1. ;constantly recomputed.
  1. N L1,TEXT,WPTEXT
  1. S WPTEXT=$$GET^DDSVAL(FNUM,.DA,FIELD)
  1. S TEXT=FIELD_": "
  1. I $$WPNCHAR^PXRMSMAN(WPTEXT)=0 Q TEXT
  1. S L1=@WPTEXT@(1,0)
  1. S LEN=$L(L1)
  1. Q TEXT_$S(LEN>MAXLEN:$E(L1,1,MAXLEN)_" ...",1:L1)
  1. ;
  1. ;=============================================
  1. WPNCHAR(WP) ;Return 0 if a word-processing field does not contain any text.
  1. I '$D(@WP@(0)) Q 0
  1. N LN,NC
  1. S NC=0
  1. F LN=1:1:$P(@WP@(0),U,4) Q:NC>0 S NC=NC+$L(@WP@(LN,0))
  1. Q NC
  1. ;
  1. ;=============================================
  1. VSPON(FILENUM,DA,SPONIEN,DDSERROR) ;Make sure the Class of the Sponsor matches
  1. ;the Class of the entry.
  1. N CLASS,SCLASS
  1. S CLASS=$$GET^DDSVAL(FILENUM,DA,100,,"E")
  1. S SCLASS=$$GET1^DIQ(811.6,SPONIEN,100)
  1. I CLASS=SCLASS Q
  1. N TEXT
  1. S TEXT(1)="The entry's class is "_CLASS_"."
  1. S TEXT(2)="The selected sponsor's class is "_SCLASS_"."
  1. S TEXT(3)="They must match."
  1. D HLP^DDSUTL(.TEXT)
  1. S DDSERROR=1
  1. Q
  1. ;