Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PXCAXAM

PXCAXAM.m

Go to the documentation of this file.
  1. PXCAXAM ;ISL/dee - Validates & Translates data from the PCE Device Interface into PCE's PXK format for Exams ;3/14/97
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**27**;Aug 12, 1996
  1. Q
  1. ; Variables
  1. ; PXCAXAM Copy of a EXAM node of the PXCA array
  1. ; PXCAPRV Pointer to the provider (200)
  1. ; PXCANUMB Count of the number if XAMs
  1. ; PXCAINDX Count of the number of EXAM for one provider
  1. ; PXCAFTER Temp used to build ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,0,"AFTER")
  1. ; PXCAPNAR Pointer to the provider narrative (9999999.27)
  1. ;
  1. XAM(PXCAXAM,PXCANUMB,PXCAPRV,PXCAERRS) ;
  1. N PXCAFTER
  1. S PXCAFTER=$P(PXCAXAM,"^",1)_"^"_PXCAPAT_"^"_PXCAVSIT_"^"
  1. S PXCAFTER=PXCAFTER_$P(PXCAXAM,"^",2)
  1. S ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,"IEN")=""
  1. S ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,0,"BEFORE")=""
  1. S ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,0,"AFTER")=PXCAFTER
  1. S ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,12,"BEFORE")=""
  1. S ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,12,"AFTER")="^^^"_$S(PXCAPRV>0:PXCAPRV,1:"")
  1. S ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,812,"BEFORE")=""
  1. S ^TMP(PXCAGLB,$J,"XAM",PXCANUMB,812,"AFTER")="^"_PXCAPKG_"^"_PXCASOR
  1. Q
  1. ;
  1. EXAM(PXCA,PXCABULD,PXCAERRS) ;Validation routine for XAM
  1. Q:'$D(PXCA("EXAM"))
  1. N PXCAXAM,PXCAPRV,PXCANUMB,PXCAINDX
  1. N PXCAITEM
  1. S PXCAPRV=""
  1. S PXCANUMB=0
  1. F S PXCAPRV=$O(PXCA("EXAM",PXCAPRV)) Q:PXCAPRV']"" D
  1. . I PXCAPRV>0 D
  1. .. I '$$ACTIVPRV^PXAPI(PXCAPRV,PXCADT) S PXCA("ERROR","EXAM",PXCAPRV,0,0)="Provider is not active or valid^"_PXCAPRV
  1. .. E I PXCABULD!PXCAERRS D ANOTHPRV^PXCAPRV(PXCAPRV)
  1. . S PXCAINDX=0
  1. . F S PXCAINDX=$O(PXCA("EXAM",PXCAPRV,PXCAINDX)) Q:PXCAINDX']"" D
  1. .. S PXCAXAM=$G(PXCA("EXAM",PXCAPRV,PXCAINDX))
  1. .. S PXCANUMB=PXCANUMB+1
  1. .. I PXCAXAM="" S PXCA("ERROR","EXAM",PXCAPRV,PXCAINDX,0)="EXAM data missing" Q
  1. .. S PXCAITEM=+$P(PXCAXAM,U,1)
  1. .. I $G(^AUTTEXAM(PXCAITEM,0))="" S PXCA("ERROR","EXAM",PXCAPRV,PXCAINDX,1)="EXAM type not in file 9999999.15^"_PXCAITEM
  1. .. S PXCAITEM=$P(PXCAXAM,U,2) I '(PXCAITEM=""!(PXCAITEM="A")!(PXCAITEM="N")) S PXCA("ERROR","EXAM",PXCAPRV,PXCAINDX,2)="EXAM results must be A|N^"_PXCAITEM
  1. .. I PXCABULD&'$D(PXCA("ERROR","EXAM",PXCAPRV,PXCAINDX))!PXCAERRS D XAM(PXCAXAM,.PXCANUMB,PXCAPRV,PXCAERRS)
  1. Q
  1. ;