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

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1PXCAHF ;ISL/dee - Validates & Translates data from the PCE Device Interface into PCE's PXK format for Health Factors ;3/14/97
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**27**;Aug 12, 1996
3 Q
4 ; Variables
5 ; PXCAHF Copy of a HEALTH FACTORS node of the PXCA array
6 ; PXCAPRV Pointer to the provider (200)
7 ; PXCANUMB Count of the number if HFs
8 ; PXCAINDX Count of the number of HEALTH FACTORS for one provider
9 ; PXCAFTER Temp used to build ^TMP(PXCAGLB,$J,"HF",PXCANUMB,0,"AFTER")
10 ; PXCAPNAR Pointer to the provider narrative (9999999.27)
11 ;
12HF(PXCAHF,PXCANUMB,PXCAPRV,PXCAERRS) ;
13 N PXCAFTER
14 S PXCAFTER=$P(PXCAHF,"^",1)_"^"_PXCAPAT_"^"_PXCAVSIT_"^"
15 S PXCAFTER=PXCAFTER_$P(PXCAHF,"^",2)
16 S ^TMP(PXCAGLB,$J,"HF",PXCANUMB,"IEN")=""
17 S ^TMP(PXCAGLB,$J,"HF",PXCANUMB,0,"BEFORE")=""
18 S ^TMP(PXCAGLB,$J,"HF",PXCANUMB,0,"AFTER")=PXCAFTER
19 S ^TMP(PXCAGLB,$J,"HF",PXCANUMB,12,"BEFORE")=""
20 S ^TMP(PXCAGLB,$J,"HF",PXCANUMB,12,"AFTER")="^^^"_$S(PXCAPRV>0:PXCAPRV,1:"")
21 S ^TMP(PXCAGLB,$J,"HF",PXCANUMB,812,"BEFORE")=""
22 S ^TMP(PXCAGLB,$J,"HF",PXCANUMB,812,"AFTER")="^"_PXCAPKG_"^"_PXCASOR
23 Q
24 ;
25HFACTORS(PXCA,PXCABULD,PXCAERRS) ;Validation routine for HF
26 Q:'$D(PXCA("HEALTH FACTORS"))
27 N PXCAHF,PXCAPRV,PXCANUMB,PXCAINDX
28 N PXCAITEM
29 S PXCAPRV=""
30 S PXCANUMB=0
31 F S PXCAPRV=$O(PXCA("HEALTH FACTORS",PXCAPRV)) Q:PXCAPRV']"" D
32 . I PXCAPRV>0 D
33 .. I '$$ACTIVPRV^PXAPI(PXCAPRV,PXCADT) S PXCA("ERROR","HEALTH FACTORS",PXCAPRV,0,0)="Provider is not active or valid^"_PXCAPRV
34 .. E I PXCABULD!PXCAERRS D ANOTHPRV^PXCAPRV(PXCAPRV)
35 . S PXCAINDX=""
36 . F S PXCAINDX=$O(PXCA("HEALTH FACTORS",PXCAPRV,PXCAINDX)) Q:PXCAINDX']"" D
37 .. S PXCAHF=$G(PXCA("HEALTH FACTORS",PXCAPRV,PXCAINDX))
38 .. S PXCANUMB=PXCANUMB+1
39 .. I PXCAHF="" S PXCA("ERROR","HEALTH FACTORS",PXCAPRV,PXCAINDX,0)="HEALTH FACTORS data missing" Q
40 .. S PXCAITEM=+$P(PXCAHF,U,1)
41 .. I $G(^AUTTHF(PXCAITEM,0))="" S PXCA("ERROR","HEALTH FACTORS",PXCAPRV,PXCAINDX,1)="HEALTH FACTORS type not in file 9999999.14^"_PXCAITEM
42 .. S PXCAITEM=$P(PXCAHF,U,2)
43 .. I '(PXCAITEM=""!(PXCAITEM="M")!(PXCAITEM="MO")!(PXCAITEM="H")) S PXCA("ERROR","HEALTH FACTORS",PXCAPRV,PXCAINDX,2)="HEALTH FACTORS level/severity must be M|MO|H^"_PXCAITEM
44 .. I PXCABULD&'$D(PXCA("ERROR","HEALTH FACTORS",PXCAPRV,PXCAINDX))!PXCAERRS D HF(PXCAHF,.PXCANUMB,PXCAPRV,PXCAERRS)
45 Q
46 ;
Note: See TracBrowser for help on using the repository browser.