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

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

initial load of WorldVistAEHR

File size: 3.0 KB
RevLine 
[613]1PXBAPI22 ;ISL/DCM - API for Classification check out ; 16 Oct 2006 9:42 PM
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**1,26,184**;Aug 12, 1996;Build 30
3ONE(TYPI,DATA,ENCOWNTR,SQUIT) ;Process One Classification
4 ; Input -- TYPI Outpatient Classification Type IEN
5 ; DATA Null or 409.42 IEN^Internal Value^1=n/a^1=unedt
6 ; ENCOWNTR Outpatient Encounter file IEN (optional)
7 ; Output -- SQUIT User entered '^' or timeout
8 N SDCT0,SDVAL
9 S SDCT0=$G(^SD(409.41,TYPI,0)) I SDCT0']"" S PXBDATA("ERR",TYPI)=1 Q ;Bad entry
10 I $P(DATA,"^",3) D:DATA S PXBDATA("ERR",TYPI)=2 Q ;Not applicable
11 .W !,$C(7),">>> "_$P(SDCT0,"^",6)_" is no longer applicable..."
12 .S DA=+DATA,DIK="^SDD(409.42," D ^DIK W "deleted."
13 I DATA,$P(DATA,"^",4) D S PXBDATA("ERR",TYPI)=3 Q ;Uneditable data
14 . W !,$P(SDCT0,"^",6)_": "_$$VAL^SDCODD(TYPI,$P(DATA,"^",2))_" <Uneditable>"
15 S SDVAL=$$VAL(TYPI,SDCT0,DATA) ;Get field value
16 I SDVAL="^" S SQUIT="",PXBDATA("ERR",TYPI)=4 Q ;user ^ out
17 D STORE(+DATA,SDVAL,TYPI)
18 Q
19VAL(TYPI,SDCT0,DATA) ;Get Outpatient Classification
20 N DIR,DA,Y,SDXS,SDEF
21 I TYPI=1,$P($G(^DPT(DFN,.321)),"^",2)'="Y" G VALQ
22 I TYPI=2,$P($G(^DPT(DFN,.321)),"^",3)'="Y" G VALQ
23 I TYPI=4,$P($G(^DPT(DFN,.322)),"^",13)'="Y",'$$EC^SDCO22(DFN,ENCOWNTR) G VALQ
24 I TYPI=3,$P($G(^SCE(+$G(ENCOWNTR),0)),"^",10)=2 S Y=1 G VALQ ;Change SC to 'yes'
25 ;Automation of the SC response
26 I TYPI=3,(+$G(PXD)!(+$G(PXDX))) D I Y'="",'$G(SDSCEDIT) G VALQ
27 .S SDXS($S(+$G(PXD):+PXD,1:+$G(PXDX)))=""
28 .S Y=$$SC^SDSCAPI(DFN,.SDXS,ENCOWNTR,$G(VISIT)) Q:Y=""
29 .S Y=+Y,SDEF=$S(Y:"YES",1:"NO")
30 .I '$G(SDSCEDIT) D
31 ..W !,$S($P(SDCT0,"^",2)]"":$P(SDCT0,"^",2),1:$P(SDCT0,"^")),"? "
32 ..W $S(Y:"YES",1:"NO")
33REASK S DIR("A")=$S($P(SDCT0,"^",2)]"":$P(SDCT0,"^",2),1:$P(SDCT0,"^"))
34 I $P(DATA,"^",2)]""!($P(SDCT0,"^",4)]"") S DIR("B")=$S($D(SDEF):SDEF,$P(DATA,"^",2)]"":$$VAL^SDCODD(TYPI,$P(DATA,"^",2)),1:$P(SDCT0,"^",4))
35 S DIR(0)=$P(SDCT0,"^",3)_"O" S:$D(SDEF) DIR("B")=SDEF
36 I $D(^SD(409.41,TYPI,2)) S DIR(0)=DIR(0)_"^"_^(2)
37 I TYPI=3 S DIR("?")="^D SC^SDCO23(DFN)"
38 D ^DIR
39 I $P(SDCT0,"^",5),'$D(DTOUT),$P(DATA,"^",2)="",Y=""!(Y["^"&('$P($G(^DG(43,1,"SCLR")),"^",24))) D G REASK
40 .W !,$C(7),"This is a required response." W:Y["^" " An '^' is not allowed."
41 .K DIRUT,DUOUT
42 I $D(DIRUT) S Y="^"
43VALQ K DIRUT,DTOUT,DUOUT
44 Q $G(Y)
45 ;
46STORE(SDCNI,SDCNV,TYPI) ;File Outpatient Classification
47 ; Input -- SDCNI Outpatient Classification IEN
48 ; SDCNV Outpatient Classification Value
49 ; TYPI Classification type 1 - Agent Orange
50 ; 2 - Ionizing Radiation
51 ; 3 - Service Connected
52 ; 4 - Environmental Contaminants
53 ; Output -- PXBDATA array
54 ; Error codes -- PXBDATA("ERR",TYPI)=1 - Bad ptr to 409.41 in TYPI
55 ; 2 - DATA entry not applicable
56 ; 3 - DATA entry uneditable
57 ; 4 - User ^ out of prompt
58 S PXBDATA(TYPI)=SDCNI_"^"_SDCNV
59 Q
Note: See TracBrowser for help on using the repository browser.