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

PXAISC.m

Go to the documentation of this file.
PXAISC ;SLC/PKR - Set V STANDARD CODES and Problem List. ;04/03/2018
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**211**;Aug 12, 1996;Build 454
 ;
 Q
SC ;--Create V STANDRD CODES entry
 ;
SET ;--SET AND NEW VARIABLES
 N AFTER0,AFTER12,AFTER220,AFTER801,AFTER802,AFTER811,AFTER812
 N BEFOR0,BEFOR12,BEFOR220,BEFOR801,BEFOR802,BEFOR811,BEFOR812
 N IENB,NODE,PXAA,STOP,SUB
 ;
 K PXAERR
 S PXAERR(8)=PXAK
 S PXAERR(7)="STD CODES"
 ;
 S SUB="" F  S SUB=$O(@PXADATA@("STD CODES",PXAK,SUB)) Q:SUB=""  D
 .S PXAA(SUB)=@PXADATA@("STD CODES",PXAK,SUB)
 ;
 ;--VALIDATE ENOUGH DATA
 D VAL^PXAISCV Q:$G(STOP)
 ;
SETVARA ;--SET VISIT VARIABLES
 S $P(AFTER0,"^",1)=$G(PXAA("CODE"))
 I $G(PXAA("DELETE")) S $P(AFTER0,"^",1)="@"
 S $P(AFTER0,"^",2)=$G(PATIENT),PXAA("PATIENT")=$G(PATIENT)
 S $P(AFTER0,"^",3)=$G(PXAVISIT)
 S $P(AFTER0,"^",5)=$G(PXAA("CODING SYSTEM"))
 S $P(AFTER12,"^",1)=$G(PXAA("EVENT D/T"))
 S $P(AFTER12,"^",2)=$G(PXAA("ORD PROVIDER"))
 S $P(AFTER12,"^",4)=$G(PXAA("ENC PROVIDER"))
 ;
 ;Magnitude and UCUM code
 S $P(AFTER220,U,1)=$G(PXAA("MAGNITUDE"))
 S $P(AFTER220,U,2)=$G(PXAA("UCUM CODE"))
 ;
 I $G(PXAA("ENC PROVIDER"))]"",'$G(PXAA("DELETE")) D
 .S ^TMP("PXAIADDPRV",$J,$G(PXAA("ENC PROVIDER")))=""
 ;
 S $P(AFTER811,"^",1)=$G(PXAA("COMMENT"))
 ;
 S $P(AFTER812,"^",2)=$S($G(PXAA("PKG"))'="":PXAA("PKG"),1:$G(PXAPKG))
 S $P(AFTER812,"^",3)=$S($G(PXAA("SOURCE"))'="":PXAA("SOURCE"),1:$G(PXASOURC))
 ;
 ;How do we make this work?
 ;D PL^PXAIPL
 ;
 ;
SETPXKA ;--SET PXK ARRAY AFTER
 S ^TMP("PXK",$J,"SC",PXAK,0,"AFTER")=$G(AFTER0)
 S ^TMP("PXK",$J,"SC",PXAK,12,"AFTER")=$G(AFTER12)
 S ^TMP("PXK",$J,"SC",PXAK,220,"AFTER")=$G(AFTER220)
 S ^TMP("PXK",$J,"SC",PXAK,802,"AFTER")=$G(AFTER802)
 S ^TMP("PXK",$J,"SC",PXAK,811,"AFTER")=$G(AFTER811)
 S ^TMP("PXK",$J,"SC",PXAK,812,"AFTER")=$G(AFTER812)
 ;
SETVARB ;--SET VARIABLES BEFORE
 ;
 ;--GET LIST OF POSSIBLE BEFORE ENTRIES
 N SCIENLST
 D SC^PXBGSC(PXAVISIT,.SCIENLST)
 ;
BEFOR ;
 S IEN=""
 I $D(SCIENLST) S IEN=$O(SCIENLST(PXAA("CODE"),PXAA("CODING SYSTEM"),""))
 I IEN="" S (BEFOR0,BEFOR12,BEFOR220,BEFOR800,BEFOR802,BEFOR811,BEFOR812)=""
 I +IEN>0 D
 . S BEFOR0=^AUPNVSC(IEN,0)
 . S BEFOR12=$G(^AUPNVSC(IEN,12))
 . S BEFOR220=$G(^AUPNVSC(IEN,220))
 . S BEFOR800=$G(^AUPNVSC(IEN,800))
 . S BEFOR811=$G(^AUPNVSC(IEN,811))
 . S BEFOR812=$G(^AUPNVSC(IEN,812))
 .;
SETPXKB ;--SET PXK ARRAY BEFORE
 S ^TMP("PXK",$J,"SC",PXAK,0,"BEFORE")=$G(BEFOR0)
 S ^TMP("PXK",$J,"SC",PXAK,12,"BEFORE")=$G(BEFOR12)
 S ^TMP("PXK",$J,"SC",PXAK,220,"BEFORE")=$G(BEFOR220)
 S ^TMP("PXK",$J,"SC",PXAK,800,"BEFORE")=$G(BEFOR800)
 S ^TMP("PXK",$J,"SC",PXAK,802,"BEFORE")=$G(BEFOR802)
 S ^TMP("PXK",$J,"SC",PXAK,811,"BEFORE")=$G(BEFOR811)
 S ^TMP("PXK",$J,"SC",PXAK,812,"BEFORE")=$G(BEFOR812)
 S ^TMP("PXK",$J,"SC",PXAK,"IEN")=IEN
 ;
 ;Package and Data Source cannot be edited.
 S BEFOR812=^TMP("PXK",$J,"SC",PXAK,812,"BEFORE")
 I BEFOR812'="" D
 . I AFTER812=BEFOR812 Q
 . I $P(BEFOR812,U,2)'="" S $P(AFTER812,U,2)=$P(BEFOR812,U,2)
 . I $P(BEFOR812,U,3)'="" S $P(AFTER812,U,3)=$P(BEFOR812,U,3)
 . S ^TMP("PXK",$J,"SC",PXAK,812,"AFTER")=AFTER812
 ;
 Q