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

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

initial load of WorldVistAEHR

File size: 5.7 KB
RevLine 
[613]1PXCAVST ;ISL/dee & LEA/Chylton - Validates data from the PCE Device Interface for the Visit and Providers ;11/19/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**14,33,74,111,116,130**;Aug 12, 1996
3 Q
4 ;
5ENCOUNT(PXCA,PXCABULD,PXCAERRS,PXCAEVAL) ;
6 I '($D(PXCA("ENCOUNTER"))#2) S PXCA("ERROR","ENCOUNTER",0,0,0)="ENCOUNTER node of the local data array is missing" Q
7 N PXCAENC
8 N PXCAITEM,PXCAITM2,PXCAOUT,PXCAERR
9 S PXCAENC=$G(PXCA("ENCOUNTER"))
10 I PXCAENC="" S PXCA("ERROR","ENCOUNTER",0,0,0)="ENCOUNTER data missing" Q
11 I '($D(^DPT(PXCAPAT,0))#2) S PXCA("ERROR","ENCOUNTER",0,0,2)="Patient missing or invalid in file 2^"_PXCAPAT
12 I '($D(^AUPNPAT(PXCAPAT,0))#2) S PXCA("ERROR","ENCOUNTER",0,0,2)="Patient missing or invalid in file 9000001^"_PXCAPAT
13 S PXCAITEM=+$P(PXCAENC,"^",1)
14 I 'PXCAITEM S PXCA("ERROR","ENCOUNTER",0,0,1)="Encounter Data/Time Missing^"_PXCAITEM
15 E I $D(^DPT(PXCAPAT,"S",PXCAITEM,0)),$D(^SC(+PXCAHLOC,0)),^DPT(PXCAPAT,"S",PXCAITEM,0),PXCAHLOC D
16 . ;Have an appointment at this time
17 . N VASD,VAERR
18 . S VASD("W")=345678
19 . S VASD("F")=PXCAITEM-.0000001
20 . S VASD("T")=PXCAITEM+.0000001
21 . S VASD("C",PXCAHLOC)=""
22 . D SDA^VADPT
23 . I $D(^UTILITY("VASD",$J)) S PXCA("ERROR","ENCOUNTER",0,0,1)="Appointment is No Show or Canceled^"_PXCAITEM
24 I '$D(^DPT(PXCAPAT,"S",PXCAITEM,0))!(+$G(^DPT(PXCAPAT,"S",PXCAITEM,0))'=PXCAHLOC),'(+$P(PXCAENC,"^",5)),'$D(PXCA("PROCEDURE")),'$D(^AUPNVCPT("AD",+PXCAVSIT)) D
25 . S PXCA("ERROR","ENCOUNTER",0,0,1)="Encounters that do not have an appointment must have a procedure^"
26 E I PXCAITEM>(DT+.7) S PXCA("ERROR","ENCOUNTER",0,0,1)="Encounter Date/Time is later that today^"_PXCAITEM
27 I '$D(^SC(PXCAHLOC,0)) S PXCA("ERROR","ENCOUNTER",0,0,3)="HOSPITAL LOCATION Missing is not in file 44^"_PXCAHLOC
28 ;Allow a disposition clinic to be used as HOSPITAL LOCATION ;PX*1.0*116
29 ;I $D(^PX(815,1,"DHL","B",PXCAHLOC)) S PXCA("ERROR","ENCOUNTER",0,0,3)="HOSPITAL LOCATION Can not be a disposition clinic^"_PXCAHLOC
30 D EVALCODE^PXCAVST2(.PXCAEVAL)
31 D SCC^PXUTLSCC(PXCAPAT,PXCADT,PXCAHLOC,PXCAVSIT,$P(PXCAENC,"^",6,11),.PXCAOUT,.PXCAERR)
32 S PXCAITEM=$P(PXCAERR,"^",1)
33 I PXCAITEM=-1 S PXCA("ERROR","ENCOUNTER",0,0,6)="SC flag bad^"_$P(PXCAENC,"^",6)
34 I PXCAITEM=-2,$P(PXCAENC,"^",6)=1 S PXCA("WARNING","ENCOUNTER",0,0,6)="SC flag must be N/A not YES for this patient^"_$P(PXCAENC,"^",6)
35 I PXCAITEM=1,$P($G(^PX(815,1,"DI")),"^",1) S PXCA("WARNING","ENCOUNTER",0,0,6)="SC flag is missing^"_$P(PXCAENC,"^",6)
36 S PXCAITEM=$P(PXCAERR,"^",2)
37 I PXCAITEM=-1 S PXCA("ERROR","ENCOUNTER",0,0,7)="AO flag bad^"_$P(PXCAENC,"^",7)
38 I PXCAITEM=-2,$P(PXCAENC,"^",7)=1 S PXCA("WARNING","ENCOUNTER",0,0,7)="AO flag must be N/A not YES for this patient^"_$P(PXCAENC,"^",7)
39 I PXCAITEM=-3,$P(PXCAENC,"^",7)=1 S PXCA("WARNING","ENCOUNTER",0,0,7)="AO flag must be N/A not YES because SC flag is true^"_$P(PXCAENC,"^",7)
40 I PXCAITEM=1,$P($G(^PX(815,1,"DI")),"^",1) S PXCA("WARNING","ENCOUNTER",0,0,7)="AO flag is missing^"_$P(PXCAENC,"^",7)
41 S PXCAITEM=$P(PXCAERR,"^",3)
42 I PXCAITEM=-1 S PXCA("ERROR","ENCOUNTER",0,0,8)="IR flag bad^"_$P(PXCAENC,"^",8)
43 I PXCAITEM=-2,$P(PXCAENC,"^",8)=1 S PXCA("WARNING","ENCOUNTER",0,0,8)="IR flag must be N/A not YES for this patient^"_$P(PXCAENC,"^",8)
44 I PXCAITEM=-3,$P(PXCAENC,"^",8)=1 S PXCA("WARNING","ENCOUNTER",0,0,8)="IR flag must be N/A not YES because SC flag is true^"_$P(PXCAENC,"^",8)
45 I PXCAITEM=1,$P($G(^PX(815,1,"DI")),"^",1) S PXCA("WARNING","ENCOUNTER",0,0,8)="IR flag is missing^"_$P(PXCAENC,"^",8)
46 S PXCAITEM=$P(PXCAERR,"^",4)
47 I PXCAITEM=-1 S PXCA("ERROR","ENCOUNTER",0,0,9)="EC flag bad^"_$P(PXCAENC,"^",9)
48 I PXCAITEM=-2,$P(PXCAENC,"^",9)=1 S PXCA("WARNING","ENCOUNTER",0,0,9)="EC flag must be N/A not YES for this patient^"_$P(PXCAENC,"^",9)
49 I PXCAITEM=-3,$P(PXCAENC,"^",9)=1 S PXCA("WARNING","ENCOUNTER",0,0,9)="EC flag must be N/A not YES because SC flag is true^"_$P(PXCAENC,"^",9)
50 I PXCAITEM=1,$P($G(^PX(815,1,"DI")),"^",1) S PXCA("WARNING","ENCOUNTER",0,0,9)="EC flag is missing^"_$P(PXCAENC,"^",9)
51 S PXCAITEM=$P(PXCAERR,"^",5)
52 I PXCAITEM=-1 S PXCA("ERROR","ENCOUNTER",0,0,10)="MST flag bad^"_$P(PXCAENC,"^",10)
53 I PXCAITEM=-2,$P(PXCAENC,"^",10)=1 S PXCA("WARNING","ENCOUNTER",0,0,10)="MST flag must be N/A not YES for this patient^"_$P(PXCAENC,"^",10)
54 S PXCAITEM=$P(PXCAERR,"^",17)
55 I PXCAITEM=-1 S PXCA("ERROR","ENCOUNTER",0,0,17)="HNC flag bad^"_$P(PXCAENC,"^",17)
56 I PXCAITEM=-2,$P(PXCAENC,"^",11)=1 S PXCA("WARNING","ENCOUNTER",0,0,17)="HNC flag must be N/A not YES for this patient^"_$P(PXCAENC,"^",17)
57 S PXCAITEM=$P(PXCAERR,"^",18)
58 I PXCAITEM=-1 S PXCA("ERROR","ENCOUNTER",0,0,18)="CV flag bad^"_$P(PXCAENC,"^",18)
59 I PXCAITEM=-2,$P(PXCAENC,"^",11)=1 S PXCA("WARNING","ENCOUNTER",0,0,18)="CV flag must be N/A not YES for this patient^"_$P(PXCAENC,"^",18)
60 S $P(PXCAENC,"^",6,11)=PXCAOUT
61 S PXCAITEM=+$P(PXCAENC,"^",13)
62 I PXCAITEM D
63 . N PXCADILF,DIERR
64 . S PXCAITM2=$$EXTERNAL^DILFD(9000010,.21,"",PXCAITEM,"PXCADILF")
65 . I $D(DIERR) S PXCA("ERROR","ENCOUNTER",0,0,13)="Eligibility code not in File 8^"_PXCAITEM
66 . E I PXCAITEM=$P($G(PXCAPAT("ELIG")),"^",1)
67 . E I $D(PXCAPAT("ELIG",PXCAITEM))=1
68 . E S PXCA("ERROR","ENCOUNTER",0,0,13)="Eligibility code is not one of this patient's Eligibilities^"_PXCAITEM
69 S PXCAITEM=+$P(PXCAENC,"^",14)
70 I PXCAITEM=0
71 E I PXCAITEM>(DT+.7) S PXCA("ERROR","ENCOUNTER",0,0,14)="Check-out Date and Time is later that today^"_PXCAITEM
72 E I PXCAITEM#1=0 S PXCA("ERROR","ENCOUNTER",0,0,14)="Time is required for Check-out Date and Time^"_PXCAITEM
73 I PXCACSTP'="" D
74 . I '$D(^DIC(40.7,+PXCACSTP,0)) S PXCA("ERROR","ENCOUNTER",0,0,17)="Optional CREDIT STOP not in File 40.7^"_PXCACSTP
75 . E I $P(^DIC(40.7,+PXCACSTP,0),"^",3),PXCADT'<$P(^(0),"^",3) S PXCA("ERROR","ENCOUNTER",0,0,17)="Optional CREDIT STOP is inactive in file 40.7^"_PXCACSTP
76 ;
77 I PXCABULD&'$D(PXCA("ERROR","ENCOUNTER"))!PXCAERRS D VST^PXCAVST1(PXCAENC)
78 ;
79 D PROVIDER^PXCAVST2
80 ;
81 Q
82 ;
Note: See TracBrowser for help on using the repository browser.