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

AQAQPR11.m

Go to the documentation of this file.
AQAQPR11 ;IHS/ANMC/LJF - ADMISSION BY PROVIDER; [ 05/27/92  11:21 AM ]
 ;;2.2;STAFF CREDENTIALS;;01 OCT 1992
 ;
 ;***> initialize variables
 S X="ERR^AQAQPR1",@^%ZOSF("TRAP") X ^%ZOSF("BRK")   ;allow break
 K ^UTILITY("AQAQPR1",$J)
 S AQAQDT=AQAQBDT-.0001,AQAQEND=AQAQEDT+.2400
 ;
 ;
ADM ;***> find admissions for specified date range
 S AQAQDT=$O(^DPT("AA",AQAQDT)) G NEXT:AQAQDT="",NEXT:AQAQDT>AQAQEND
 S DFN=0
ADM1 S DFN=$O(^DPT("AA",AQAQDT,DFN)) G ADM:DFN="" S AQAQA=0
ADM2 S AQAQA=$O(^DPT("AA",AQAQDT,DFN,AQAQA)) G ADM1:AQAQA=""
 ;
 S AQAQNM=$P(^DPT(DFN,0),U)  ;patient name
 G ADM2:'$D(^DPT(DFN,"DA",AQAQA,0))#2 S AQAQS=^(0)
 S AQAQW=$P(AQAQS,U,4),AQAQICU=$S($P(^DIC(42,AQAQW,"IHS"),U)="Y":1,1:0)
 S AQAQW=$P(^DIC(42,AQAQW,0),U)  ;ward
 S AQAQDX=$P(AQAQS,U,6)  ;admit dx
 G ADM2:'$D(^DPT(DFN,"DA",AQAQA,"T",1,0))
 S AQAQSV=$P(^(0),U,2),AQAQPRV=$P(^(0),U,3)
 S AQAQSRV=$S(AQAQSV="":"NO SERVICE",1:$P(^DIC(45.7,AQAQSV,0),U))  ;srv
 I AQAQTYP=1 G:AQAQPRV'=+AQAQPROV ADM2   ;wrong provider
 I AQAQTYP=2 G:$P($G(^DIC(6,+AQAQPRV,0)),U,4)'=+AQAQPROV ADM2  ;class
 I AQAQPRV="" S AQAQPRV="UNKNOWN"
 E  S AQAQPRV=$P(^DIC(16,AQAQPRV,0),U)  ;admit provider
 S AQAQSTR=AQAQNM_U_AQAQW_U_AQAQSRV_U_AQAQDX_U_AQAQICU
 ;
 ;***> sorted by date then alpha
 S ^UTILITY("AQAQPR1",$J,AQAQPRV,AQAQDT,DFN)=AQAQSTR G ADM2
 ;
 ;***> go to print rtn
NEXT G ^AQAQPR12