VPSPDO3M ;DALOI/KML,WOIFO/BT - PDO OUTPUT DISPLAY - Additional MEDS ;11/20/11 15:30
;;1.0;VA POINT OF SERVICE (KIOSKS);**3**;Oct 21, 2011;Build 64
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;IA #10103 - supported use of XLFDT functions
;IA #10104 - supported use of XLFSTR function
;
ADDMEDS(OREF) ;produce additional meds section
; INPUT
; OREF : Object Reference for the VPS PDO object
;
N PTIEN S PTIEN=$$GETDFN^VPSOBJ(OREF)
N LMRARDT S LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
N STAFF S STAFF=$$GETSTAFF^VPSOBJ(OREF)
;
N PFVIEW,SFSTVIEW,SFVTVIEW
N M1 S M1=0
N M2 S M2=0
;
F S M1=$O(^VPS(853.5,PTIEN,"MRAR",LMRARDT,"MEDSADD","B",M1)) Q:'M1 S M2=$O(^(M1,M2)) D
. N FLD1 S FLD1=$$GET1^DIQ(853.55,M2_","_LMRARDT_","_PTIEN_",",1) ; additional medication name entered by patient-facing (kiosk)
. N FLD2 S FLD2=$$GET1^DIQ(853.55,M2_","_LMRARDT_","_PTIEN_",",2) ; additional medication name entered by staff-facing staff view
. N FLD3 S FLD3=$$GET1^DIQ(853.55,M2_","_LMRARDT_","_PTIEN_",",3) ; additional medication name entered by staff-facing vet view
. S:FLD1]"" PFVIEW(M2)="" ; set up additional medication names array to be used in subsequent algorithm
. S:FLD2]"" SFSTVIEW(M2)=""
. S:FLD3]"" SFVTVIEW(M2)=""
;
N STAFMEDS M STAFMEDS=PFVIEW,STAFMEDS=SFSTVIEW,STAFMEDS=SFVTVIEW ; merge patient-facing and staff-facing added meds into a single array for the patient facilitated note logic
I 'STAFF,$D(PFVIEW) D GETAM(OREF,.PFVIEW)
I STAFF,$D(STAFMEDS) D GETAM(OREF,.STAFMEDS)
K PFVIEW,SFSTVIEW,SFVTVIEW
Q
;
GETAM(OREF,AMEDITMS) ; get the additional medications data for each sub-entry at 853.55
; INPUT
; OREF : Object Reference for the VPS PDO object
; AMEDITMS : passed in by reference. array represents the list of additional medications to display at a given section
;
N PTIEN S PTIEN=$$GETDFN^VPSOBJ(OREF)
N LMRARDT S LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
N STAFF S STAFF=$$GETSTAFF^VPSOBJ(OREF)
;
D ADDUNDLN^VPSOBJ(OREF)
D ADDCJ^VPSOBJ(OREF,"***ADDITIONAL MEDICATIONS/NOT IN SYSTEM***")
;
N FLD D GETAMDTA(PTIEN,LMRARDT,.AMEDITMS,.FLD) ; Build FLD array of Additional Med data
;
I 'STAFF D AMVET(OREF,.FLD) ; add additional med data (patient) to result array
I STAFF D AMSTAFF1(OREF,.FLD),AMSTAFF2(OREF,.FLD) ; add additional med data (staff) to result array
Q
;
AMVET(OREF,FLD) ; add additional med data (veteran-facing) to result array
; INPUT
; OREF : Object Reference for the VPS PDO object
; FLD : array of additional medication data by fieldname
;
N COL D GETFORMT^VPSOBJ(OREF,.COL)
N HDR S HDR=0
N MIEN S MIEN=0
N VPSX S VPSX=""
;
F S MIEN=$O(FLD(MIEN)) Q:'MIEN D
. I 'HDR D
. . S HDR=1
. . S VPSX=""
. . S VPSX=$$SETFLD^VPSPUTL1("Name",VPSX,COL("MRNAME"))
. . S VPSX=$$SETFLD^VPSPUTL1("Direction",VPSX,COL("MRDIR"))
. . S VPSX=$$SETFLD^VPSPUTL1("Frequency",VPSX,COL("MRFREQ"))
. . D ADDPDO^VPSOBJ(OREF,VPSX)
. S VPSX=""
. S VPSX=$$SETFLD^VPSPUTL1(FLD(MIEN,1,"E"),VPSX,COL("MRNAME"))
. S VPSX=$$SETFLD^VPSPUTL1(FLD(MIEN,6,"E"),VPSX,COL("MRDIR"))
. S VPSX=$$SETFLD^VPSPUTL1(FLD(MIEN,5,"E"),VPSX,COL("MRFREQ"))
. D ADDPDO^VPSOBJ(OREF,VPSX)
. S VPSX=""
. I FLD(MIEN,4,"I")="Y" S VPSX=$$SETFLD^VPSPUTL1("Patient wants to discuss this with the provider",VPSX,COL("DISCUSS"))
. D ADDPDO^VPSOBJ(OREF,VPSX)
Q
;
AMSTAFF1(OREF,FLD) ; add additional med data (staff-facing) to result array - first section
; INPUT
; OREF : Object Reference for the VPS PDO object
; FLD : array of additional medication data by fieldname
;
N COL D GETFORMT^VPSOBJ(OREF,.COL)
N PTIEN S PTIEN=$$GETDFN^VPSOBJ(OREF)
N LMRARDT S LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
;
; -- displays only the patient entered meds and any comments made
N HDR S HDR=0
N MIEN S MIEN=0
N VPSX S VPSX=""
;
F S MIEN=$O(FLD(MIEN)) Q:'MIEN D
. I 'HDR D
. . S VPSX=$$SETFLD^VPSPUTL1("Name/Directions/Frequency (Pt input)",VPSX,COL("ADDMED"))
. . S VPSX=$$SETFLD^VPSPUTL1("Staff Comments",VPSX,COL("ADDSTAFFCOMM"))
. . D ADDPDO^VPSOBJ(OREF,VPSX)
. . S HDR=1
. ;
. ; -- format name/directions/frequency
. N VETADD,NVETADD
. I FLD(MIEN,1,"E")]"" S VETADD(1)=FLD(MIEN,1,"E")_";"_FLD(MIEN,6,"E")_";"_FLD(MIEN,5,"E") ; fields to be displayed at Name/Directions/Frequency column
. I $D(VETADD) S ^TMP("VPSPUTL1",$J)=0 D FCOMM^VPSPUTL1(.VETADD,$P(COL("ADDMED"),U,2),.NVETADD)
. ;
. ; -- format staff comment
. N NSTFCMT
. N STFCMT S STFCMT=$$GET1^DIQ(853.55,MIEN_","_LMRARDT_","_PTIEN_",",7,"","STFCMT") ; comments to be displayed at Staff Comments column
. I STFCMT]"" S ^TMP("VPSPUTL1",$J)=0 D FCOMM^VPSPUTL1(.STFCMT,$P(COL("ADDSTAFFCOMM"),U,2),.NSTFCMT)
. ;
. ;-- add formatted name/directions/frequency and STAFF comment to result array
. N COL1 S COL1=$O(NVETADD(""),-1)
. N COL2 S COL2=$O(NSTFCMT(""),-1)
. N END S END=$S(COL1>COL2:COL1,1:COL2)
. N RSS
. ;
. F RSS=1:1:END D
. . S VPSX=""
. . S VPSX=$$SETFLD^VPSPUTL1($G(NVETADD(RSS)),VPSX,COL("ADDMED"))
. . S VPSX=$$SETFLD^VPSPUTL1($G(NSTFCMT(RSS)),VPSX,COL("ADDSTAFFCOMM"))
. . D ADDPDO^VPSOBJ(OREF,VPSX)
. ;
. K VETADD,NVETADD,STFCMT,NSTFCMT
. D ADDBLANK^VPSOBJ(OREF) ; add blank line between additional medications display
Q
;
AMSTAFF2(OREF,FLD) ; add additional med data (staff) to result array - first section
; INPUT
; OREF : Object Reference for the VPS PDO object
; FLD : array of additional medication data by fieldname
;
N COL D GETFORMT^VPSOBJ(OREF,.COL)
N PTIEN S PTIEN=$$GETDFN^VPSOBJ(OREF)
N LMRARDT S LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
;
; -- display staff entered meds and any comments made
N HDR S HDR=0
N MIEN S MIEN=0
N VPSX S VPSX=""
;
F S MIEN=$O(FLD(MIEN)) Q:'MIEN D
. I 'HDR D
. . S VPSX=""
. . S VPSX=$$SETFLD^VPSPUTL1("Name/Dose/Indication",VPSX,COL("ADDMEDSTAFF"))
. . S VPSX=$$SETFLD^VPSPUTL1("Comments",VPSX,COL("ADDSTAFFCOMM"))
. . D ADDPDO^VPSOBJ(OREF,VPSX)
. . S HDR=1
. ; -- format name/dose/indication
. N STAFFADD,NSTAFADD
. S STAFFADD(1)=FLD(MIEN,2,"E")_" "_FLD(MIEN,3,"E") ;fields to be displayed at Name/Dose/Indication column
. S ^TMP("VPSPUTL1",$J)=0 D FCOMM^VPSPUTL1(.STAFFADD,$P(COL("ADDMEDSTAFF"),U,2),.NSTAFADD)
. ;
. ; -- format staff comment
. N STFCMT,NSTFCMT
. S STFCMT=$$GET1^DIQ(853.55,MIEN_","_LMRARDT_","_PTIEN_",",12,"","STFCMT") ; comments to be displayed at Comments column
. I STFCMT]"" S ^TMP("VPSPUTL1",$J)=0 D FCOMM^VPSPUTL1(.STFCMT,$P(COL("ADDSTAFFCOMM"),U,2),.NSTFCMT)
. ;
. ; -- add name/dose/indication and staff comment to result array
. N COL1 S COL1=$O(NSTAFADD(""),-1)
. N COL2 S COL2=$O(NSTFCMT(""),-1)
. N END S END=$S(COL1>COL2:COL1,1:COL2)
. N RSS
. F RSS=1:1:END D
. . S VPSX=""
. . N ADMSTAFF S VPSX=$$SETFLD^VPSPUTL1($G(NSTAFADD(RSS)),VPSX,COL("ADDMEDSTAFF"))
. . N ADSTAFFC S VPSX=$$SETFLD^VPSPUTL1($G(NSTFCMT(RSS)),VPSX,COL("ADDSTAFFCOMM"))
. . D ADDPDO^VPSOBJ(OREF,VPSX)
. ;
. K STAFFADD,NSTAFADD,STFCMT,NSTFCMT
. D ADDBLANK^VPSOBJ(OREF) ; add blank line between additional medications display
Q
;
GETAMDTA(PTIEN,LMRARDT,AMEDITMS,FLD) ; Build FLD array of Additional Med data
; INPUT
; AMEDITMS : passed in by reference. array represents the list of additional medications to display at a given section
; OUTPUT
; FLD : array of additional medication data by fieldname
;
N MIEN S MIEN=0
F S MIEN=$O(AMEDITMS(MIEN)) Q:'MIEN D
. N ADMEDLST D GETS^DIQ(853.55,MIEN_","_LMRARDT_","_PTIEN_",","1;2;3;4;5;6;8;9;10;11","IE","ADMEDLST") ;refer to routine VPSMRAR2 for field references at subfile 853.55
. ; assign data to a simpler array for ease of handling
. S FLD=0 F S FLD=$O(ADMEDLST(853.55,MIEN_","_LMRARDT_","_PTIEN_",",FLD)) Q:'FLD F EXTINT="E","I" S FLD(MIEN,FLD,EXTINT)=ADMEDLST(853.55,MIEN_","_LMRARDT_","_PTIEN_",",FLD,EXTINT)
. K ADMEDLST
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVPSPDO3M 7981 printed Oct 16, 2024@18:43:54 Page 2
VPSPDO3M ;DALOI/KML,WOIFO/BT - PDO OUTPUT DISPLAY - Additional MEDS ;11/20/11 15:30
+1 ;;1.0;VA POINT OF SERVICE (KIOSKS);**3**;Oct 21, 2011;Build 64
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;IA #10103 - supported use of XLFDT functions
+6 ;IA #10104 - supported use of XLFSTR function
+7 ;
ADDMEDS(OREF) ;produce additional meds section
+1 ; INPUT
+2 ; OREF : Object Reference for the VPS PDO object
+3 ;
+4 NEW PTIEN
SET PTIEN=$$GETDFN^VPSOBJ(OREF)
+5 NEW LMRARDT
SET LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
+6 NEW STAFF
SET STAFF=$$GETSTAFF^VPSOBJ(OREF)
+7 ;
+8 NEW PFVIEW,SFSTVIEW,SFVTVIEW
+9 NEW M1
SET M1=0
+10 NEW M2
SET M2=0
+11 ;
+12 FOR
SET M1=$ORDER(^VPS(853.5,PTIEN,"MRAR",LMRARDT,"MEDSADD","B",M1))
if 'M1
QUIT
SET M2=$ORDER(^(M1,M2))
Begin DoDot:1
+13 ; additional medication name entered by patient-facing (kiosk)
NEW FLD1
SET FLD1=$$GET1^DIQ(853.55,M2_","_LMRARDT_","_PTIEN_",",1)
+14 ; additional medication name entered by staff-facing staff view
NEW FLD2
SET FLD2=$$GET1^DIQ(853.55,M2_","_LMRARDT_","_PTIEN_",",2)
+15 ; additional medication name entered by staff-facing vet view
NEW FLD3
SET FLD3=$$GET1^DIQ(853.55,M2_","_LMRARDT_","_PTIEN_",",3)
+16 ; set up additional medication names array to be used in subsequent algorithm
if FLD1]""
SET PFVIEW(M2)=""
+17 if FLD2]""
SET SFSTVIEW(M2)=""
+18 if FLD3]""
SET SFVTVIEW(M2)=""
End DoDot:1
+19 ;
+20 ; merge patient-facing and staff-facing added meds into a single array for the patient facilitated note logic
NEW STAFMEDS
MERGE STAFMEDS=PFVIEW,STAFMEDS=SFSTVIEW,STAFMEDS=SFVTVIEW
+21 IF 'STAFF
IF $DATA(PFVIEW)
DO GETAM(OREF,.PFVIEW)
+22 IF STAFF
IF $DATA(STAFMEDS)
DO GETAM(OREF,.STAFMEDS)
+23 KILL PFVIEW,SFSTVIEW,SFVTVIEW
+24 QUIT
+25 ;
GETAM(OREF,AMEDITMS) ; get the additional medications data for each sub-entry at 853.55
+1 ; INPUT
+2 ; OREF : Object Reference for the VPS PDO object
+3 ; AMEDITMS : passed in by reference. array represents the list of additional medications to display at a given section
+4 ;
+5 NEW PTIEN
SET PTIEN=$$GETDFN^VPSOBJ(OREF)
+6 NEW LMRARDT
SET LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
+7 NEW STAFF
SET STAFF=$$GETSTAFF^VPSOBJ(OREF)
+8 ;
+9 DO ADDUNDLN^VPSOBJ(OREF)
+10 DO ADDCJ^VPSOBJ(OREF,"***ADDITIONAL MEDICATIONS/NOT IN SYSTEM***")
+11 ;
+12 ; Build FLD array of Additional Med data
NEW FLD
DO GETAMDTA(PTIEN,LMRARDT,.AMEDITMS,.FLD)
+13 ;
+14 ; add additional med data (patient) to result array
IF 'STAFF
DO AMVET(OREF,.FLD)
+15 ; add additional med data (staff) to result array
IF STAFF
DO AMSTAFF1(OREF,.FLD)
DO AMSTAFF2(OREF,.FLD)
+16 QUIT
+17 ;
AMVET(OREF,FLD) ; add additional med data (veteran-facing) to result array
+1 ; INPUT
+2 ; OREF : Object Reference for the VPS PDO object
+3 ; FLD : array of additional medication data by fieldname
+4 ;
+5 NEW COL
DO GETFORMT^VPSOBJ(OREF,.COL)
+6 NEW HDR
SET HDR=0
+7 NEW MIEN
SET MIEN=0
+8 NEW VPSX
SET VPSX=""
+9 ;
+10 FOR
SET MIEN=$ORDER(FLD(MIEN))
if 'MIEN
QUIT
Begin DoDot:1
+11 IF 'HDR
Begin DoDot:2
+12 SET HDR=1
+13 SET VPSX=""
+14 SET VPSX=$$SETFLD^VPSPUTL1("Name",VPSX,COL("MRNAME"))
+15 SET VPSX=$$SETFLD^VPSPUTL1("Direction",VPSX,COL("MRDIR"))
+16 SET VPSX=$$SETFLD^VPSPUTL1("Frequency",VPSX,COL("MRFREQ"))
+17 DO ADDPDO^VPSOBJ(OREF,VPSX)
End DoDot:2
+18 SET VPSX=""
+19 SET VPSX=$$SETFLD^VPSPUTL1(FLD(MIEN,1,"E"),VPSX,COL("MRNAME"))
+20 SET VPSX=$$SETFLD^VPSPUTL1(FLD(MIEN,6,"E"),VPSX,COL("MRDIR"))
+21 SET VPSX=$$SETFLD^VPSPUTL1(FLD(MIEN,5,"E"),VPSX,COL("MRFREQ"))
+22 DO ADDPDO^VPSOBJ(OREF,VPSX)
+23 SET VPSX=""
+24 IF FLD(MIEN,4,"I")="Y"
SET VPSX=$$SETFLD^VPSPUTL1("Patient wants to discuss this with the provider",VPSX,COL("DISCUSS"))
+25 DO ADDPDO^VPSOBJ(OREF,VPSX)
End DoDot:1
+26 QUIT
+27 ;
AMSTAFF1(OREF,FLD) ; add additional med data (staff-facing) to result array - first section
+1 ; INPUT
+2 ; OREF : Object Reference for the VPS PDO object
+3 ; FLD : array of additional medication data by fieldname
+4 ;
+5 NEW COL
DO GETFORMT^VPSOBJ(OREF,.COL)
+6 NEW PTIEN
SET PTIEN=$$GETDFN^VPSOBJ(OREF)
+7 NEW LMRARDT
SET LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
+8 ;
+9 ; -- displays only the patient entered meds and any comments made
+10 NEW HDR
SET HDR=0
+11 NEW MIEN
SET MIEN=0
+12 NEW VPSX
SET VPSX=""
+13 ;
+14 FOR
SET MIEN=$ORDER(FLD(MIEN))
if 'MIEN
QUIT
Begin DoDot:1
+15 IF 'HDR
Begin DoDot:2
+16 SET VPSX=$$SETFLD^VPSPUTL1("Name/Directions/Frequency (Pt input)",VPSX,COL("ADDMED"))
+17 SET VPSX=$$SETFLD^VPSPUTL1("Staff Comments",VPSX,COL("ADDSTAFFCOMM"))
+18 DO ADDPDO^VPSOBJ(OREF,VPSX)
+19 SET HDR=1
End DoDot:2
+20 ;
+21 ; -- format name/directions/frequency
+22 NEW VETADD,NVETADD
+23 ; fields to be displayed at Name/Directions/Frequency column
IF FLD(MIEN,1,"E")]""
SET VETADD(1)=FLD(MIEN,1,"E")_";"_FLD(MIEN,6,"E")_";"_FLD(MIEN,5,"E")
+24 IF $DATA(VETADD)
SET ^TMP("VPSPUTL1",$JOB)=0
DO FCOMM^VPSPUTL1(.VETADD,$PIECE(COL("ADDMED"),U,2),.NVETADD)
+25 ;
+26 ; -- format staff comment
+27 NEW NSTFCMT
+28 ; comments to be displayed at Staff Comments column
NEW STFCMT
SET STFCMT=$$GET1^DIQ(853.55,MIEN_","_LMRARDT_","_PTIEN_",",7,"","STFCMT")
+29 IF STFCMT]""
SET ^TMP("VPSPUTL1",$JOB)=0
DO FCOMM^VPSPUTL1(.STFCMT,$PIECE(COL("ADDSTAFFCOMM"),U,2),.NSTFCMT)
+30 ;
+31 ;-- add formatted name/directions/frequency and STAFF comment to result array
+32 NEW COL1
SET COL1=$ORDER(NVETADD(""),-1)
+33 NEW COL2
SET COL2=$ORDER(NSTFCMT(""),-1)
+34 NEW END
SET END=$SELECT(COL1>COL2:COL1,1:COL2)
+35 NEW RSS
+36 ;
+37 FOR RSS=1:1:END
Begin DoDot:2
+38 SET VPSX=""
+39 SET VPSX=$$SETFLD^VPSPUTL1($GET(NVETADD(RSS)),VPSX,COL("ADDMED"))
+40 SET VPSX=$$SETFLD^VPSPUTL1($GET(NSTFCMT(RSS)),VPSX,COL("ADDSTAFFCOMM"))
+41 DO ADDPDO^VPSOBJ(OREF,VPSX)
End DoDot:2
+42 ;
+43 KILL VETADD,NVETADD,STFCMT,NSTFCMT
+44 ; add blank line between additional medications display
DO ADDBLANK^VPSOBJ(OREF)
End DoDot:1
+45 QUIT
+46 ;
AMSTAFF2(OREF,FLD) ; add additional med data (staff) to result array - first section
+1 ; INPUT
+2 ; OREF : Object Reference for the VPS PDO object
+3 ; FLD : array of additional medication data by fieldname
+4 ;
+5 NEW COL
DO GETFORMT^VPSOBJ(OREF,.COL)
+6 NEW PTIEN
SET PTIEN=$$GETDFN^VPSOBJ(OREF)
+7 NEW LMRARDT
SET LMRARDT=$$GETLSTMR^VPSOBJ(OREF)
+8 ;
+9 ; -- display staff entered meds and any comments made
+10 NEW HDR
SET HDR=0
+11 NEW MIEN
SET MIEN=0
+12 NEW VPSX
SET VPSX=""
+13 ;
+14 FOR
SET MIEN=$ORDER(FLD(MIEN))
if 'MIEN
QUIT
Begin DoDot:1
+15 IF 'HDR
Begin DoDot:2
+16 SET VPSX=""
+17 SET VPSX=$$SETFLD^VPSPUTL1("Name/Dose/Indication",VPSX,COL("ADDMEDSTAFF"))
+18 SET VPSX=$$SETFLD^VPSPUTL1("Comments",VPSX,COL("ADDSTAFFCOMM"))
+19 DO ADDPDO^VPSOBJ(OREF,VPSX)
+20 SET HDR=1
End DoDot:2
+21 ; -- format name/dose/indication
+22 NEW STAFFADD,NSTAFADD
+23 ;fields to be displayed at Name/Dose/Indication column
SET STAFFADD(1)=FLD(MIEN,2,"E")_" "_FLD(MIEN,3,"E")
+24 SET ^TMP("VPSPUTL1",$JOB)=0
DO FCOMM^VPSPUTL1(.STAFFADD,$PIECE(COL("ADDMEDSTAFF"),U,2),.NSTAFADD)
+25 ;
+26 ; -- format staff comment
+27 NEW STFCMT,NSTFCMT
+28 ; comments to be displayed at Comments column
SET STFCMT=$$GET1^DIQ(853.55,MIEN_","_LMRARDT_","_PTIEN_",",12,"","STFCMT")
+29 IF STFCMT]""
SET ^TMP("VPSPUTL1",$JOB)=0
DO FCOMM^VPSPUTL1(.STFCMT,$PIECE(COL("ADDSTAFFCOMM"),U,2),.NSTFCMT)
+30 ;
+31 ; -- add name/dose/indication and staff comment to result array
+32 NEW COL1
SET COL1=$ORDER(NSTAFADD(""),-1)
+33 NEW COL2
SET COL2=$ORDER(NSTFCMT(""),-1)
+34 NEW END
SET END=$SELECT(COL1>COL2:COL1,1:COL2)
+35 NEW RSS
+36 FOR RSS=1:1:END
Begin DoDot:2
+37 SET VPSX=""
+38 NEW ADMSTAFF
SET VPSX=$$SETFLD^VPSPUTL1($GET(NSTAFADD(RSS)),VPSX,COL("ADDMEDSTAFF"))
+39 NEW ADSTAFFC
SET VPSX=$$SETFLD^VPSPUTL1($GET(NSTFCMT(RSS)),VPSX,COL("ADDSTAFFCOMM"))
+40 DO ADDPDO^VPSOBJ(OREF,VPSX)
End DoDot:2
+41 ;
+42 KILL STAFFADD,NSTAFADD,STFCMT,NSTFCMT
+43 ; add blank line between additional medications display
DO ADDBLANK^VPSOBJ(OREF)
End DoDot:1
+44 QUIT
+45 ;
GETAMDTA(PTIEN,LMRARDT,AMEDITMS,FLD) ; Build FLD array of Additional Med data
+1 ; INPUT
+2 ; AMEDITMS : passed in by reference. array represents the list of additional medications to display at a given section
+3 ; OUTPUT
+4 ; FLD : array of additional medication data by fieldname
+5 ;
+6 NEW MIEN
SET MIEN=0
+7 FOR
SET MIEN=$ORDER(AMEDITMS(MIEN))
if 'MIEN
QUIT
Begin DoDot:1
+8 ;refer to routine VPSMRAR2 for field references at subfile 853.55
NEW ADMEDLST
DO GETS^DIQ(853.55,MIEN_","_LMRARDT_","_PTIEN_",","1;2;3;4;5;6;8;9;10;11","IE","ADMEDLST")
+9 ; assign data to a simpler array for ease of handling
+10 SET FLD=0
FOR
SET FLD=$ORDER(ADMEDLST(853.55,MIEN_","_LMRARDT_","_PTIEN_",",FLD))
if 'FLD
QUIT
FOR EXTINT="E","I"
SET FLD(MIEN,FLD,EXTINT)=ADMEDLST(853.55,MIEN_","_LMRARDT_","_PTIEN_",",FLD,EXTINT)
+11 KILL ADMEDLST
End DoDot:1
+12 QUIT