[613] | 1 | VSITCK1 ;ISD/RJP - Visit Field Check (continued) ;6/20/96
|
---|
| 2 | ;;1.0;PCE PATIENT CARE ENCOUNTER;**76**;Aug 12, 1996
|
---|
| 3 | ; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
|
---|
| 4 | ; the incorporation of the module into PCE. For historical reference,
|
---|
| 5 | ; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
|
---|
| 6 | ; patches.
|
---|
| 7 | ;
|
---|
| 8 | ;;2.0;VISIT TRACKING;;Aug 12, 1996;
|
---|
| 9 | ;
|
---|
| 10 | Q ; - not an entry point
|
---|
| 11 | ;
|
---|
| 12 | IP(VDT,PAT) ; - check inpatient status
|
---|
| 13 | ;
|
---|
| 14 | ; - rtns <ien of patient movement>
|
---|
| 15 | ;
|
---|
| 16 | N VADMVT,VAINDT,VAERR
|
---|
| 17 | N IPM,DFN
|
---|
| 18 | S VDT=$G(VDT),PAT=$G(PAT)
|
---|
| 19 | S VAINDT=VDT,DFN=+$G(PAT) D ADM^VADPT2
|
---|
| 20 | S IPM=$S(+VADMVT>0:+VADMVT,1:"")
|
---|
| 21 | ; - dom pt is not an inpatient (from ^SDAM2)
|
---|
| 22 | I $P(^DG(43,1,0),"^",21),$P($G(^DIC(42,+$P($G(^DGPM(+VADMVT,0)),"^",6),0)),"^",3)="D" S IPM=""
|
---|
| 23 | Q IPM
|
---|
| 24 | ;
|
---|
| 25 | INS4LOC(LOC) ; - Get Institution for a given Location
|
---|
| 26 | ;
|
---|
| 27 | N INS S LOC=$G(LOC),INS=""
|
---|
| 28 | D:+LOC
|
---|
| 29 | . S INS=$P(^SC(LOC,0),"^",15)
|
---|
| 30 | . S:+INS INS=$P($G(^DG(40.8,INS,0)),"^",7)
|
---|
| 31 | . S INS=$S(+INS&$D(^DIC(4,+INS,0)):INS,1:"")
|
---|
| 32 | Q INS
|
---|
| 33 | ;
|
---|
| 34 | DSS4LOC(LOC) ; - Get Clinic Stop Code for a given Location
|
---|
| 35 | ;
|
---|
| 36 | N DSS S LOC=$G(LOC),DSS=""
|
---|
| 37 | D:+LOC
|
---|
| 38 | . S DSS=$P($G(^SC(LOC,0)),"^",7) S:DSS'=+DSS DSS=""
|
---|
| 39 | Q DSS
|
---|
| 40 | ;
|
---|