New Routine BSDXGPRV to get providers associated with hospital location

This commit is contained in:
sam 2010-06-19 16:30:08 +00:00
parent a358427378
commit 4ef1070117
2 changed files with 62 additions and 2 deletions

View File

@ -1,4 +1,4 @@
BSDX07 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ;
BSDX07 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; ; 6/7/10 2:19pm
;;2.0;IHS WINDOWS SCHEDULING;;NOV 01, 2007
;
;
@ -167,7 +167,8 @@ ADDEVT3(BSDXRES) ;
Q
;
ERR(BSDXI,BSDXERR) ;Error processing
S BSDXI=BSDXI+1
D ^%ZTER ;XXX: remove after we figure out the cause of error
S BSDXI=BSDXI+1
S BSDXERR=$TR(BSDXERR,"^","~")
TROLLBACK
S ^BSDXTMP($J,BSDXI)="0^"_BSDXERR_$C(30)

59
m/BSDXGPRV.m Normal file
View File

@ -0,0 +1,59 @@
BSDXGPRV ; WV/SMH - WINDOWS SCHEDULING RPCS ; 6/10/10 9:01pm
;;1.1;IHS WINDOWS SCHEDULING;;NOV 01, 2007
;
;
ERROR ;
D ERR("RPMS Error")
Q
;
ERR(BSDXERR) ;Error processing
D ^%ZTER
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=BSDXERR
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
Q
;
PD(BSDXY,HLIEN) ;EP Debugging entry point
;
D DEBUG^%Serenji("P^BSDXGPRV(.BSDXY,HLIEN)","192.168.254.130")
;
Q
;
P(BSDXY,HLIEN) ; Public Entry point; Get Providers for Hosp Location
; Input: HLIEN - Hospital Location IEN
; Output: ADO Datatable with columns:
; - HOSPITAL_LOCATION_ID, BMXIEN, PROV_NAME, DEFAULT
; If there are providers in the PROVIDER multiple of file 44
; (Hospital Location) return them;
; If no providers in PROVIDER multiple of file 44, return nothing
; Called by BSDX HOSP LOC PROVIDERS
;
S BSDXI=0
I '$D(^SC(HLIEN,0)) D ERR("HOSPITAL LOCATION NOT FOUND") QUIT
D ^XBKVAR
N $ET S $ET="G ERROR^BSDXGPRV"
K ^BSDXTMP($J)
S BSDXY=$NA(^BSDXTMP($J))
S $P(^BSDXTMP($J,BSDXI),U,1)="I00020HOSPITAL_LOCATION_ID"
S $P(^BSDXTMP($J,BSDXI),U,2)="I00020BMXIEN"
S $P(^BSDXTMP($J,BSDXI),U,3)="T00030NAME"
S $P(^BSDXTMP($J,BSDXI),U,4)="T00005DEFAULT"
S ^BSDXTMP($J,BSDXI)=^BSDXTMP($J,BSDXI)_$C(30)
;
N OUTPUT
D GETS^DIQ(44,HLIEN_",","2600*","IE","OUTPUT") ; Provider Multiple
; No results
I '$D(OUTPUT) S ^BSDXTMP($J,BSDXI+1)=$C(31) QUIT
; if results, get them
N I S I=""
F S I=$O(OUTPUT(44.1,I)) Q:I="" D
. S BSDXI=BSDXI+1
. S $P(^BSDXTMP($J,BSDXI),U,1)=HLIEN ; HL IEN
. S $P(^BSDXTMP($J,BSDXI),U,2)=$P(OUTPUT(44.1,I,.01,"I"),",") ; PROV IEN
. S $P(^BSDXTMP($J,BSDXI),U,3)=$E(OUTPUT(44.1,I,.01,"E"),1,30) ; PROV NAME
. S $P(^BSDXTMP($J,BSDXI),U,4)=OUTPUT(44.1,I,.02,"E") ; Default - YES, NO
. S ^BSDXTMP($J,BSDXI)=^BSDXTMP($J,BSDXI)_$C(30)
S BSDXI=BSDXI+1
S ^BSDXTMP($J,BSDXI)=$C(31)
QUIT