BKMVA51 ;PRXM/HC/JGH - HMS PATIENT REGISTER; [ 1/19/2005 7:16 PM ] ; 09 Jun 2005 12:55 PM
;;2.1;HIV MANAGEMENT SYSTEM;;Feb 07, 2011
;
Q
;
EN ;ENTRY POINT -- ListMan template BKMV PCC MED REVIEW
; Assumes existence of DFN,DUZ
N HIVIEN
S HIVIEN=$$HIVIEN^BKMIXX3()
I HIVIEN="" W !,"There is no HMS register defined." H 2 Q
I '$$VALID^BKMIXX3(DUZ) Q
K ^TMP("BKMVA51",$J)
D ^XBFMK
D EN^VALM("BKMV PCC MED REVIEW")
D ^XBFMK
D EXIT
Q
;
HDR ; EP - Header code
; Assumes existence of DUZ
N DA,IENS,SITE,RCRDHDR,BKMDOD
S DA=$G(DUZ(2)),IENS=$$IENS^DILF(.DA),SITE=$$GET1^DIQ(4,IENS,.01,"E")
S VALMHDR(1)=$$PAD^BKMIXX4("",">"," ",(80-($L(SITE)+2))\2)_"["_$G(SITE)_"]"
S RCRDHDR=$$PAD^BKMIXX4(" Patient: ",">"," ",10)_$$PAD^BKMIXX4($$GET1^DIQ(2,DFN,".01","E"),">"," ",30)_$$PAD^BKMIXX4(" HRN: ",">"," ",6)_$$PAD^BKMIXX4($$HRN^BKMVA1(DFN),">"," ",9)
S BKMDOD=$$GET1^DIQ(2,DFN,".351","I")
I BKMDOD'="" S RCRDHDR=RCRDHDR_$$PAD^BKMIXX4(" DOD: ",">"," ",6)_$$PAD^BKMIXX4($$FMTE^XLFDT(BKMDOD,1),">"," ",15)
S VALMHDR(2)=RCRDHDR
Q
;
INIT ; -- init variables and list array
; Assumes existence of DFN
D GETALL(DFN)
Q
;
GETALL(DFN) ; Build ListMan display array of patient medication information
; Input variables:
; DFN - IEN for File 2
; Output variables:
; VALMAR - Builds ListMan array
; VALMCNT - List array count
; VALM0
N TEXT,MEDDT,PMEDDT,MEDIEN,IENS,TEXT,RMEDDT
D ^XBFMK
S VALMCNT=0,VALMAR="^TMP(""BKMVA51"","""_$J_""")",VALM0=""
;
S (RMEDDT,PMEDDT)=""
F S RMEDDT=$O(^AUPNVMED("AA",DFN,RMEDDT)) Q:RMEDDT="" D
. S MEDIEN=""
. F S MEDIEN=$O(^AUPNVMED("AA",DFN,RMEDDT,MEDIEN)) Q:MEDIEN="" D
. . S DA=MEDIEN
. . S MEDDT=9999999-RMEDDT
. . S IENS=$$IENS^DILF(.DA)
. . S TEXT=""
. . S TEXT=$$SETFLD^VALM1($S(MEDDT'=PMEDDT:$$FMTE^XLFDT(MEDDT,"5Z"),1:""),TEXT,"Visit")
. . S TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".01","E"),TEXT,"Medication")
. . S TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".05","E"),TEXT,"Instructions")
. . S TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".06","E"),TEXT,"Qty")
. . S TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".07","E"),TEXT,"Days")
. . S VALMCNT=$G(VALMCNT)+1 D SET^VALM10(VALMCNT,TEXT)
. . S PMEDDT=MEDDT
D ^XBFMK
Q
;
HELP ; -- help code
N X
S X="?" D DISP^XQORM1 W !
Q
;
EXIT ;clean up used variables.
K ^TMP("BKMVA51",$J)
K VALM0,VALMAR,VALMHDR,VALMCNT
Q
;
;
BKMVA51 ;PRXM/HC/JGH - HMS PATIENT REGISTER; [ 1/19/2005 7:16 PM ] ; 09 Jun 2005 12:55 PM
+1 ;;2.1;HIV MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
+3 QUIT
+4 ;
EN ;ENTRY POINT -- ListMan template BKMV PCC MED REVIEW
+1 ; Assumes existence of DFN,DUZ
+2 NEW HIVIEN
+3 SET HIVIEN=$$HIVIEN^BKMIXX3()
+4 IF HIVIEN=""
WRITE !,"There is no HMS register defined."
HANG 2
QUIT
+5 IF '$$VALID^BKMIXX3(DUZ)
QUIT
+6 KILL ^TMP("BKMVA51",$JOB)
+7 DO ^XBFMK
+8 DO EN^VALM("BKMV PCC MED REVIEW")
+9 DO ^XBFMK
+10 DO EXIT
+11 QUIT
+12 ;
HDR ; EP - Header code
+1 ; Assumes existence of DUZ
+2 NEW DA,IENS,SITE,RCRDHDR,BKMDOD
+3 SET DA=$GET(DUZ(2))
SET IENS=$$IENS^DILF(.DA)
SET SITE=$$GET1^DIQ(4,IENS,.01,"E")
+4 SET VALMHDR(1)=$$PAD^BKMIXX4("",">"," ",(80-($LENGTH(SITE)+2))\2)_"["_$GET(SITE)_"]"
+5 SET RCRDHDR=$$PAD^BKMIXX4(" Patient: ",">"," ",10)_$$PAD^BKMIXX4($$GET1^DIQ(2,DFN,".01","E"),">"," ",30)_$$PAD^BKMIXX4(" HRN: ",">"," ",6)_$$PAD^BKMIXX4($$HRN^BKMVA1(DFN),">"," ",9)
+6 SET BKMDOD=$$GET1^DIQ(2,DFN,".351","I")
+7 IF BKMDOD'=""
SET RCRDHDR=RCRDHDR_$$PAD^BKMIXX4(" DOD: ",">"," ",6)_$$PAD^BKMIXX4($$FMTE^XLFDT(BKMDOD,1),">"," ",15)
+8 SET VALMHDR(2)=RCRDHDR
+9 QUIT
+10 ;
INIT ; -- init variables and list array
+1 ; Assumes existence of DFN
+2 DO GETALL(DFN)
+3 QUIT
+4 ;
GETALL(DFN) ; Build ListMan display array of patient medication information
+1 ; Input variables:
+2 ; DFN - IEN for File 2
+3 ; Output variables:
+4 ; VALMAR - Builds ListMan array
+5 ; VALMCNT - List array count
+6 ; VALM0
+7 NEW TEXT,MEDDT,PMEDDT,MEDIEN,IENS,TEXT,RMEDDT
+8 DO ^XBFMK
+9 SET VALMCNT=0
SET VALMAR="^TMP(""BKMVA51"","""_$JOB_""")"
SET VALM0=""
+10 ;
+11 SET (RMEDDT,PMEDDT)=""
+12 FOR
SET RMEDDT=$ORDER(^AUPNVMED("AA",DFN,RMEDDT))
IF RMEDDT=""
QUIT
Begin DoDot:1
+13 SET MEDIEN=""
+14 FOR
SET MEDIEN=$ORDER(^AUPNVMED("AA",DFN,RMEDDT,MEDIEN))
IF MEDIEN=""
QUIT
Begin DoDot:2
+15 SET DA=MEDIEN
+16 SET MEDDT=9999999-RMEDDT
+17 SET IENS=$$IENS^DILF(.DA)
+18 SET TEXT=""
+19 SET TEXT=$$SETFLD^VALM1($SELECT(MEDDT'=PMEDDT:$$FMTE^XLFDT(MEDDT,"5Z"),1:""),TEXT,"Visit")
+20 SET TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".01","E"),TEXT,"Medication")
+21 SET TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".05","E"),TEXT,"Instructions")
+22 SET TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".06","E"),TEXT,"Qty")
+23 SET TEXT=$$SETFLD^VALM1($$GET1^DIQ(9000010.14,IENS,".07","E"),TEXT,"Days")
+24 SET VALMCNT=$GET(VALMCNT)+1
DO SET^VALM10(VALMCNT,TEXT)
+25 SET PMEDDT=MEDDT
End DoDot:2
End DoDot:1
+26 DO ^XBFMK
+27 QUIT
+28 ;
HELP ; -- help code
+1 NEW X
+2 SET X="?"
DO DISP^XQORM1
WRITE !
+3 QUIT
+4 ;
EXIT ;clean up used variables.
+1 KILL ^TMP("BKMVA51",$JOB)
+2 KILL VALM0,VALMAR,VALMHDR,VALMCNT
+3 QUIT
+4 ;
+5 ;