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

VPSOBJ.m

Go to the documentation of this file.
VPSOBJ ;WOIFO/BT - PDO OUTPUT DISPLAY - UTILITIES ;11/20/11 15:30
 ;;1.0;VA POINT OF SERVICE (KIOSKS);**3**;Nov 14, 2012;Build 64
 ;;Per VHA Directive 2004-038, this routine should not be modified.
 ;;
 Q
 ;IA #10104 - supported use of XLFSTR function
 ;
NEW(PATIEN,PDOARY) ; Object Construction - create a new PDO object
 K:PDOARY'="" @PDOARY
 K ^TMP("VPSPUTL1",$J)
 K ^TMP("VPSOBJ",$J)
 ;
 N LASTOREF S LASTOREF=$O(^TMP("VPSOBJ",$J,""),-1)+1
 D SETDFN(LASTOREF,PATIEN)
 D SETPDO(LASTOREF,PDOARY)
 D SETFORMT(LASTOREF)  ; SET UP OF NOTE FORMATTING REFERENCES
 Q LASTOREF
 ;
CLOSE(OREF) ; Destroy object - clean up  pdo
 K ^TMP("VPSOBJ",$J,OREF)
 Q
 ; 
 ; ====== Properties =============
 ; -- Property DFN (Read/Write)
SETDFN(OREF,VAL) ; set DFN property
 D SET(OREF,"DFN",VAL)
 Q
GETDFN(OREF) ; get DFN property
 Q $$GET(OREF,"DFN")
 ;
 ; -- Property PDOARY (Read/Write)
SETPDO(OREF,VAL) ; set PDOARY property
 D SET(OREF,"PDOARY",VAL)
 Q
GETPDO(OREF) ; get PDOARY property
 Q $$GET(OREF,"PDOARY")
 ;
 ; -- Property LASTMRAR (Read/Write)
SETLSTMR(OREF,VAL) ; set LASTMRAR property
 D SET(OREF,"LASTMRAR",VAL)
 Q
GETLSTMR(OREF) ; get LASTMRAR property
 Q $$GET(OREF,"LASTMRAR")
 ;
 ; -- Property ISSTAFF (Read/Write)
SETSTAFF(OREF,VAL) ; set ISSTAFF property
 D SET(OREF,"ISSTAFF",VAL)
 Q
GETSTAFF(OREF) ; get ISSTAFF property
 Q $$GET(OREF,"ISSTAFF")
 ;
 ; -- Property ALLRNM (Read/Write)
SETALRNM(OREF,VAL) ; set ALLRNM (allergy name) property
 D SET(OREF,"ALLRNM",VAL)
 Q
GETALRNM(OREF) ; get ALLRNM property
 Q $$GET(OREF,"ALLRNM")
 ;
 ; -- Property PATRESP (Read/Write)
SETPATRP(OREF,VAL) ; set PATRESP (patient response) property
 D SET(OREF,"PATRESP",VAL)
 Q
GETPATRP(OREF) ; get PATRESP property
 Q $$GET(OREF,"PATRESP")
 ;
 ; -- Property STATION (Read/Write)
SETSTATN(OREF,VAL) ; set STATION property
 D SET(OREF,"STATION",VAL)
 Q
GETSTATN(OREF) ; get STATION property
 Q $$GET(OREF,"STATION")
 ;
 ; -- Property MARKFOL (Read/Write)
SETMKFOL(OREF,VAL) ; set MARKFOL property
 D SET(OREF,"MARKFOL",VAL)
 Q
GETMKFOL(OREF) ; get STATION property
 Q $$GET(OREF,"MARKFOL")
 ;
 ; -- Property ALLERGIES (Read/Write)
SETALLR(OREF,VAL) ; set array of ALLERGIES property
 K ^TMP("VPSOBJ",$J,OREF,"ALLERGIES")
 M ^TMP("VPSOBJ",$J,OREF,"ALLERGIES")=VAL
 Q
GETALLR(OREF,VAL) ; get array of ALLERGIES property
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"ALLERGIES")
 Q
 ;
 ; -- Property ADDALLERGY-DONTKNOW (Read/Write)
SETDKNW(OREF,VAL) ;
 D SET(OREF,"ADDALLERGY-DONTKNOW",VAL)
 Q
GETDKNW(OREF) ;
 Q $$GET(OREF,"ADDALLERGY-DONTKNOW")
 ;
 ; -- Property ADDALLERGY-VET (Read/Write)
SETADDVT(OREF,VAL) ;
 K ^TMP("VPSOBJ",$J,OREF,"ADDALLERGY-VET")
 M ^TMP("VPSOBJ",$J,OREF,"ADDALLERGY-VET")=VAL
 Q
GETADDVT(OREF,VAL) ;
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"ADDALLERGY-VET")
 Q
 ;
 ; -- Property ADDALLERGY-PROVIDER (Read/Write)
SETADDPR(OREF,VAL) ;
 K ^TMP("VPSOBJ",$J,OREF,"ADDALLERGY-PRV")
 M ^TMP("VPSOBJ",$J,OREF,"ADDALLERGY-PRV")=VAL
 Q
GETADDPR(OREF,VAL) ;
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"ADDALLERGY-PRV")
 Q
 ;
 ; -- Property ADDALLERGY-REACTION (Read/Write)
SETADRCT(OREF,VAL) ;
 D SET(OREF,"ADDALLERGY-REACTION",VAL)
 Q
GETADRCT(OREF) ;
 Q $$GET(OREF,"ADDALLERGY-REACTION")
 ;
 ; -- Property ADDALLERGY-MARKFOL (Read/Write)
SETADDMF(OREF,VAL) ;
 D SET(OREF,"ADDALLERGY-MARKFOL",VAL)
 Q
GETADDMF(OREF) ;
 Q $$GET(OREF,"ADDALLERGY-MARKFOL")
 ;
 ; -- Property FORMATTED ADDALLERGY-VET (Read/Write)
SETADDFV(OREF,VAL) ;
 K ^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-VET")
 M ^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-VET")=VAL
 Q
GETADDFV(OREF,VAL) ;
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-VET")
 Q
 ;
 ; -- Property FORMATTED ADDALLERGY-PROVIDER (Read/Write)
SETADDFP(OREF,VAL) ;
 K ^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-PROVIDER")
 M ^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-PROVIDER")=VAL
 Q
GETADDFP(OREF,VAL) ;
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-PROVIDER")
 Q
 ;
 ; -- Property FORMATTED ADDALLERGY-REACTION (Read/Write)
SETADDFR(OREF,VAL) ;
 K ^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-REACTION")
 M ^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-REACTION")=VAL
 Q
GETADDFR(OREF,VAL) ;
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"FORMATTED ADDALLERGY-REACTION")
 Q
 ; 
 ; -- Property NONVA med(Read/Write)
KILNONVA(OREF) ; Initialize prop
 K ^TMP("VPSOBJ",$J,OREF,"NONVA-MED")
 Q
APDNONVA(OREF,VAL) ; Append VAL
 M ^TMP("VPSOBJ",$J,OREF,"NONVA-MED")=VAL
 Q
GETNONVA(OREF,VAL) ;
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"NONVA-MED")
 Q
 ; 
 ; -- Property IS MED ACTIVE (Read/Write)
SETACTIV(OREF,VAL) ;
 D SET(OREF,"ISMEDACTIVE",VAL)
 Q
GETACTIV(OREF) ;
 Q $$GET(OREF,"ISMEDACTIVE")
 ;
 ; -- Property IS MED NONVA (Read/Write)
SETISNVA(OREF,VAL) ;
 D SET(OREF,"ISNONVA",VAL)
 Q
GETISNVA(OREF) ;
 Q $$GET(OREF,"ISNONVA")
 ;
 ; -- Property PATCOMM (Read/Write)
SETPATCM(OREF,VAL) ; Patient comments
 K ^TMP("VPSOBJ",$J,OREF,"PATCOMM")
 M ^TMP("VPSOBJ",$J,OREF,"PATCOMM")=VAL
 Q
GETPATCM(OREF,VAL) ; Patient comments
 K VAL M VAL=^TMP("VPSOBJ",$J,OREF,"PATCOMM")
 Q
 ;
 ; -- Property NEXTFILLDT (Read/Write)
SETNFILL(OREF,VAL) ; DATE NEXT FILLED
 D SET(OREF,"NEXTFILLDT",VAL)
 Q
GETNFILL(OREF) ; DATE NEXT FILLED
 Q $$GET(OREF,"NEXTFILLDT")
 ;
 ; -- Property PROVIDER (Read/Write)
SETPROV(OREF,VAL) ; PROVIDER
 D SET(OREF,"PROVIDER",VAL)
 Q
GETPROV(OREF) ; PROVIDER
 Q $$GET(OREF,"PROVIDER")
 ;
 ; -- Property SIG (Read/Write)
SETSIG(OREF,VAL) ; SIG INSTRUCTION
 D SET(OREF,"SIG",VAL)
 Q
GETSIG(OREF,VAL) ; SIG INSTRUCTION
 Q $$GET(OREF,"SIG")
 ;
 ; -- Property DAYS-SUPPLIED (Read/Write)
SETDSPLY(OREF,VAL) ; DAYS SUPPLIED
 D SET(OREF,"DAYSUPPLIED",VAL)
 Q
GETDSPLY(OREF) ; DAYS SUPPLIED
 Q $$GET(OREF,"DAYSUPPLIED")
 ;
 ; -- Property MEDFILL (Read/Write)
SETMFILL(OREF,VAL) ;
 D SET(OREF,"MEDFILL",VAL)
 Q
GETMFILL(OREF) ;
 Q $$GET(OREF,"MEDFILL")
 ;
 ; -- Property LEFTREFILL (Read/Write)
SETLREFL(OREF,VAL) ;
 D SET(OREF,"LEFTREFILL",VAL)
 Q
GETLREFL(OREF) ;
 Q $$GET(OREF,"LEFTREFILL")
 ;
 ; -- Property MAXREFILL (Read/Write)
SETMREFL(OREF,VAL) ;
 D SET(OREF,"MAXREFILL",VAL)
 Q
GETMREFL(OREF) ;
 Q $$GET(OREF,"MAXREFILL")
 ;
 ; -- Property MEDTYPE (Read/Write)
SETMTYPE(OREF,VAL) ; MEDICATION TYPE
 D SET(OREF,"MEDTYPE",VAL)
 Q
GETMTYPE(OREF) ; MEDICATION TYPE
 Q $$GET(OREF,"MEDTYPE")
 ;
 ; -- Property ISREMOTE (Read/Write)
SETREMOT(OREF,VAL) ;
 D SET(OREF,"ISREMOTE",VAL)
 Q
GETREMOT(OREF) ;
 Q $$GET(OREF,"ISREMOTE")
 ;
 ; -- Property MEDNAME (Read/Write)
SETMEDNM(OREF,VAL) ; Med name
 D SET(OREF,"MEDNAME",VAL)
 Q
GETMEDNM(OREF) ; Med Name
 Q $$GET(OREF,"MEDNAME")
 ;
 ; -- Property REMLOC (Read/Write)
SETRMLOC(OREF,VAL) ; REMOTE LOCATION
 D SET(OREF,"REMLOC",VAL)
 Q
GETRMLOC(OREF) ; REMOTE LOCATION
 Q $$GET(OREF,"REMLOC")
 ;
SETFORMT(OREF) ; Set column attributes when formatting the note
 N LN,LINE,STR,DEFS
 F LN=2:1 S LINE=$T(DISFLDS+LN),STR=$P(LINE,";;",2) Q:STR=""  S DEFS($P(STR,U))=$P(STR,U,2,4)
 K ^TMP("VPSOBJ",$J,OREF,"COLFORMAT")
 M ^TMP("VPSOBJ",$J,OREF,"COLFORMAT")=DEFS
 K DEFS
 Q
GETFORMT(OREF,DEFS) ;  get column attributes when formatting the note
 K DEFS M DEFS=^TMP("VPSOBJ",$J,OREF,"COLFORMAT")
 Q
 ;
 ; -- Property ERROR (Write Only)
SETERR(OREF,ERR) ; set error PROPERTY
 N PDOARY S PDOARY=$$GET(OREF,"PDOARY")
 S @PDOARY@(1,0)=ERR
 D SET(OREF,"ERROR",ERR)
 Q 
 ;
 ; ====== External Methods =============
ADDPDO(OREF,STRING) ; Add STRING to PDO array
 I STRING'="",$TR(STRING," ")="" Q
 N PDOARY S PDOARY=$$GETPDO(OREF)
 D ADDLN^VPSPUTL1(PDOARY,STRING)
 Q
 ;
ADDBLANK(OREF) ; add blank line to PDOARY
 N STRING S STRING=""
 D ADDPDO^VPSOBJ(OREF,STRING)
 Q
 ;
ADDUNDLN(OREF) ; add underline to PDOARY
 N STRING S STRING=$$REPEAT^XLFSTR("_",75)
 D ADDPDO^VPSOBJ(OREF,STRING)
 Q
 ;
ADDLJ(OREF,STRING) ; left justify the string before add to PDOARY
 N LJSTR S LJSTR=$$LJ^XLFSTR(STRING,75)
 D ADDPDO^VPSOBJ(OREF,LJSTR)
 Q
 ;
ADDCJ(OREF,STRING) ; Center justify the string before add to PDOARY
 N CJSTR S CJSTR=$$CJ^XLFSTR(STRING,75)
 D ADDPDO^VPSOBJ(OREF,CJSTR)
 Q
 ; -- internal Set/Get property (should not be used externally). Each property should have its own set get methods
SET(OREF,PROP,VAL) ; set property PROP with value VAL
 S ^TMP("VPSOBJ",$J,OREF,PROP)=VAL
 Q
GET(OREF,PROP) ; get value from property PROP
 Q $G(^TMP("VPSOBJ",$J,OREF,PROP))
 ;
DISFLDS ; get the attributes of each column when formatting and displaying the lines on the note
 ;;ITEM NAME^COL^WIDTH^DISPLAY TEXT^comments
 ;;FOLLOWUP^1^3^Followup
 ;;PATRESP^4^1^
 ;;ALLERNM^7^20^Name
 ;;REACTION^31^20^Reaction
 ;;SITE^55^20^Site
 ;;ACTION^55^10^Action
 ;;ADDALLERGY-VET^5^65
 ;;MEDNAME^7^20
 ;;DOSE^29^16
 ;;DOSEFORM^47^16
 ;;SIG^9^34
 ;;REFILLS^47^25
 ;;PROVIDER^9^34
 ;;DAYS SUPPLIED^47^25
 ;;MEDS ACTION^47^25
 ;;PENDING STMT^4^70
 ;;COMMENTS^9^34
 ;;REMOTE^9^34
 ;;FILLED^47^25
 ;;NEXTFILL^47^25
 ;;MRNAME^7^25^Name
 ;;MRDIR^35^20^Direction
 ;;MRFREQ^57^20^Frequency
 ;;ADDMED^7^25^Name/Directions/Frequency (Pt input)
 ;;ADDSTAFFCOMM^35^30^Staff Comments
 ;;ADDMEDSTAFF^7^25^Name/Dose/Indication
 ;;ADDSTAFFCOMM2^35^30^Comments
 ;;DISCUSS^7^70
 ;;