source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXRRPCE1.m@ 1484

Last change on this file since 1484 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1PXRRPCE1 ;HIN/MjK - Clinic Specfic Workload Reports ;9/23/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**3**;Aug 12, 1996
3EN ;_._._._._._._._._._._._.Total Appt By Type_._._._._._._._._._._._._.
4 ;THIS ROUTINE EXECUTES THE SCHEDULING PACKAGE ROUTINES @ (SET^SDCWL3)
5 ;FOR CLINIC APPT DATA WHICH IS RETURNED IN THE FOLLOWING TMP GLOBALS
6 ;^TMP($J,"CL",CLINIC TEXT NAME ;TOTAL ENCOUNTERS
7 ;^TMP($J,1,CLINIC TEXT NAME,APPT DATE,"SD" ;# SCHEDULED APPTS
8 ;^TMP($J,1,CLINIC TEXT NAME,APPT DATE,"OB" ;# OVERBOOKED APPTS
9 ;^TMP($J,1,CLINIC TEXT NAME,APPT DATE,"IN" ;# INPATIENT APPTS
10 ;^TMP($J,1,CLINIC TEXT NAME,APPT DATE,"UN" ;# UNSCHEDULED APPTS
11 ;^TMP($J,1,CLINIC TEXT NAME,APPT DATE,"NS" ;# NO SHOWED APPTS
12 ;^TMP($J,1,CLINIC TEXT NAME,APPT DATE,"CA" ;# CANCELLED APPTS
13 ;THE PCE DATA FILES ARE SEPARATELY CHECKED,
14 ;BY DATE RANGE ; ^AUPNVSIT("B",
15 ;AND THEN HOSPITAL LOCATION ; $P(^AUPNVSIT(D0,0),U,22)
16 ;THE ASSOCIATED V CPT RECORDS ARE REVIEWED ; ^AUPNVCPT("AD",
17 ;AGAINST THE IBE TYPE OF VISIT FILE ; ^IBE(357.60,
18 ;TO DISTINGUISH E&M CODES FROM OTHER NON-E&M CPT CODES
19ALL S (PXRR,PXRRCN)=0 F S PXRR=$O(PXRRCLIN(PXRR)) Q:'PXRR S PXRRCL=$P(PXRRCLIN(PXRR),U) D SETUP I $D(^TMP($J,1,PXRRCL)) S PXRRCN=PXRRCN+1,PXRRCLIN=$P(PXRRCLIN(PXRR),U,2) D
20SDDATA . ;_._._._._._.Initialize Appt Types from Scheduling data_._._._._.
21 . F X="UN","CA","NS" S Y=0 F S Y=$O(^TMP($J,1,PXRRCL,Y)) Q:'Y S ^TMP($J,PXRRCL,X)=^TMP($J,PXRRCL,X)+$G(^TMP($J,1,PXRRCL,Y,X))
22SDTOTAL . ;_._._._._._._.Total Visits per Clinic & All Clinics_._._._._._._.
23 . S ^TMP($J,PXRRCL,"TOT")=$S($P(^TMP($J,"CL",1,PXRRCL),U,2)="":0,1:$P(^TMP($J,"CL",1,PXRRCL),U,2))
24PCEDATA ;_._._._._._._._._._._._Patient Encounters_._._._._._._._._._._
25 ;F= visit ifn ;C= enctr counter
26 N F
27 F S PXRR=$O(PXRRCLIN(PXRR)) Q:'PXRR S PXRRCL=$P(PXRRCLIN(PXRR),U),PXRRCLIN=$P(PXRRCLIN(PXRR),U,2) S PXRRVDT=PXRRBDT,(C,PXRRNVCP)=0 F S PXRRVDT=$O(^AUPNVSIT("B",PXRRVDT)) Q:'PXRRVDT!(PXRRVDT>PXRREDT) D
28 . S F=0 F S F=$O(^AUPNVSIT("B",PXRRVDT,F)) Q:'F I $P(^AUPNVSIT(F,0),U,22)=PXRRCLIN S X=$P($G(^AUPNVSIT(F,0)),U,7) I (X="A")!(X="I")!(X="S") S C=C+1,^TMP($J,PXRRCL,"ENT")=C D
29 .. ;_.If no x-ref exists, there are no associated CPTs for the enctr_.
30 .. I '$D(^AUPNVCPT("AD",F)) S PXRRNVCP=PXRRNVCP+1,^TMP($J,PXRRCL,"NVCPT")=PXRRNVCP Q
31PCEPROC .. ;_._._._._._._._._._.Encounter Visit Codes_._._._._._._._._._.
32 .. S G=0 F S G=$O(^AUPNVCPT("AD",F,G)) Q:'G S PXRRVCPT=$P(^AUPNVCPT(G,0),U) I $D(^IBE(357.69,PXRRVCPT)) S PXRVST=1
33 .. ;_.If none of the associated procedures is a Type of Visit code_.
34 .. I '$D(PXRVST) S ^TMP($J,PXRRCL,"OTHER CPT")=^TMP($J,PXRRCL,"OTHER CPT")+1 Q
35 .. K PXRVST
36PCEENM .. ;_._._._._._._._.All Procedures Which Are Visit Codes_._._._._._.
37 .. S G=0 F S G=$O(^AUPNVCPT("AD",F,G)) Q:'G S PXRRVCPT=$P(^AUPNVCPT(G,0),U) D:$D(^IBE(357.69,PXRRVCPT))&('$D(PXRVST))
38 ... ;_._._.Category of Type of Visit (i.e. NEW,EST,CONSULT,OTHER)_._._.
39 ... ;_._._.Use the First Type of Visit Code Found for Encounter_._._._.
40 ... S X=$P(^IBE(357.69,PXRRVCPT,0),U,5),X=$S(X=1:"NEW",X=2:"ESTABLISHED",X=3:"CONSULT",1:"OTHER"),^TMP($J,PXRRCL,X)=^TMP($J,PXRRCL,X)+1,PXRVST=1
41 .. K PXRVST
42PCETOT ;_._._._._._._.Total PCE Enctrs for All Selected Clinics_._._._._._.
43 S (^TMP($J,"TVCO"),X)=0 F S X=$O(PXRRCLIN(X)) Q:'X S ^TMP($J,"TVCO")=^TMP($J,"TVCO")+$G(^TMP($J,$P(PXRRCLIN(X),U),"ENT"))
44EXIT Q
45SETUP ;_._._.TMP Array_._._.
46 F I="UN","CA","NS","NEW","ESTABLISHED","CONSULT","OTHER","OTHER CPT","ENT","NVCPT","TOT" S ^TMP($J,PXRRCL,I)=0
47 Q
48
Note: See TracBrowser for help on using the repository browser.