source: FOIAVistA/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXCAPED.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1PXCAPED ;ISL/dee - Validates & Translates data from the PCE Device Interface into PCE's PXK format for Patient Ed ;3/14/97
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**27**;Aug 12, 1996
3 Q
4 ; Variables
5 ; PXCAPED Copy of a PATIENT ED node of the PXCA array
6 ; PXCAPRV Pointer to the provider (200)
7 ; PXCANUMB Count of the number if PEDs
8 ; PXCAINDX Count of the number of PATIENT ED for one provider
9 ; PXCAPNAR Pointer to the provider narrative (9999999.27)
10 ;
11PED(PXCAPED,PXCANUMB,PXCAPRV,PXCAERRS) ;
12 S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,"IEN")=""
13 S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,0,"BEFORE")=""
14 S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,0,"AFTER")=$P(PXCAPED,"^",1)_"^"_PXCAPAT_"^"_PXCAVSIT_"^^^"_$P(PXCAPED,"^",2)
15 S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,12,"BEFORE")=""
16 S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,12,"AFTER")="^^^"_$S(PXCAPRV>0:PXCAPRV,1:"")
17 S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,812,"BEFORE")=""
18 S ^TMP(PXCAGLB,$J,"PED",PXCANUMB,812,"AFTER")="^"_PXCAPKG_"^"_PXCASOR
19 Q
20 ;
21PATED(PXCA,PXCABULD,PXCAERRS) ;Validation routine for PED
22 Q:'$D(PXCA("PATIENT ED"))
23 N PXCAPED,PXCAPRV,PXCANUMB,PXCAINDX
24 N PXCAITEM
25 S PXCAPRV=""
26 S PXCANUMB=0
27 F S PXCAPRV=$O(PXCA("PATIENT ED",PXCAPRV)) Q:PXCAPRV']"" D
28 . I PXCAPRV>0 D
29 .. I '$$ACTIVPRV^PXAPI(PXCAPRV,PXCADT) S PXCA("ERROR","PATIENT ED",PXCAPRV,0,0)="Provider is not active or valid^"_PXCAPRV
30 .. E I PXCABULD!PXCAERRS D ANOTHPRV^PXCAPRV(PXCAPRV)
31 . S PXCAINDX=""
32 . F S PXCAINDX=$O(PXCA("PATIENT ED",PXCAPRV,PXCAINDX)) Q:PXCAINDX']"" D
33 .. S PXCAPED=$G(PXCA("PATIENT ED",PXCAPRV,PXCAINDX))
34 .. S PXCANUMB=PXCANUMB+1
35 .. I PXCAPED="" S PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,0)="PATIENT ED data missing" Q
36 .. S PXCAITEM=+$P(PXCAPED,U,1)
37 .. I $G(^AUTTEDT(PXCAITEM,0))="" S PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,1)="PATIENT ED type not in file 9999999.09^"_PXCAITEM
38 .. S PXCAITEM=$P(PXCAPED,U,2) I '((PXCAITEM=(PXCAITEM\1)&(PXCAITEM>0)&(PXCAITEM<6))!(PXCAITEM="")) S PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX,2)="PATIENT ED level of understanding must be an integer form 1 to 5^"_PXCAITEM
39 .. I PXCABULD&'$D(PXCA("ERROR","PATIENT ED",PXCAPRV,PXCAINDX))!PXCAERRS D PED(PXCAPED,.PXCANUMB,PXCAPRV,PXCAERRS)
40 Q
41 ;
Note: See TracBrowser for help on using the repository browser.