source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJDPT.m@ 1259

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1PSJDPT ;BIR/JLC - CENTRALIZED PATIENT LOOKUP FOR IPM ; 07 Nov 00
2 ;;5.0; INPATIENT MEDICATIONS ;**53,124,166,160**;16 DEC 97;Build 12
3 ;
4 ; Reference to ^DPT is supported by DBIA 10035
5 ; Reference to ^DGSEC4 is supported by DBIA 3027
6 ; Reference to ^DIC is supported by DBIA 10006
7 ; Reference to ^DICN is supported by DBIA 10009
8 ; Reference to ^DPTLK is supported by DBIA 3787
9 ; Reference to ^DPTLK1 is supported by DBIA 3266
10 ; Reference to DISPPRF^DGPFAPI is supported by DBIA 4563
11 ; Reference to GETACT^DGPFAPI is supported by DBIA 3860
12 ; Reference to ^ORRDI1 is supported by DBIA 4659.
13 ; Reference to ^XTMP("ORRDI" is supported by DBIA 4660.
14 ;
15EN ; MAIN ENTRY POINT FOR PATIENT LOOKUP
16 K DIC S DIC="^DPT(",DIC("W")="D DPT^PSJDPT",DIC(0)="QEMZ" D ^DPTLK K DIC
17 I $$BADADR^DGUTL3(+Y) H 2
18 N Y
19 D
20 . I $T(HAVEHDR^ORRDI1)]"",$$HAVEHDR^ORRDI1,$D(^XTMP("ORRDI","OUTAGE INFO","DOWN")) W !,"Remote data not available - Only local order checks processed." D PAUSE^PSJLMUT1
21 Q
22CHK(Y,DISP,PAUSE) N RESULT,RES,CHKY,PSGTEMP
23 S DISP=$G(DISP),PAUSE=$G(PAUSE)
24 I $G(XQY0)["PSJI COMPLETE",$$GETACT^DGPFAPI(+Y,"PSGTEMP") K PSGTEMP W @IOF,"PATIENT: ",$P(Y,U,2)
25 S CHKY=Y D DISPPRF^DGPFAPI(Y) S Y=CHKY K CHKY
26 D PTSEC^DGSEC4(.RESULT,$P(Y,"^"),1)
27 I RESULT(1)'=0 D
28 . W !! I DISP W ?(80-$L($P(Y,"^",2)))\2,$P(Y,"^",2),!
29 . F I=2:1:9 I $D(RESULT(I)) W ?(80-$L(RESULT(I)))\2,RESULT(I),!
30 . I RESULT(1)'=0,RESULT(1)'=2,PAUSE H 2
31 . Q:RESULT(1)=1
32 . I RESULT(1)=-1!(RESULT(1)=3)!(RESULT(1)=4) S Y=-1 Q
33 . I RESULT(1)=2 D ENCONT I Y=-1 Q
34 . D NOTICE^DGSEC4(.RES,Y,XQY0,$S(RESULT(1)=1:1,1:3)) I RES=0 S Y=-1 Q
35 Q
36ENCONT W !,"Do you want to continue processing this patient record"
37 S %=2 D YN^DICN I %<0!(%=2) S Y=-1
38 I '% W !!,"Enter 'YES' to continue processing, or 'NO' to quit processing this record." G ENCONT
39 Q
40DPT I $$DOB^DPTLK1(Y)["*SENSITIVE" G SENS
41 S ND=$S($D(^DPT(Y,0)):^(0),1:""),NB=$P(ND,"^",3),NS=$P(ND,"^",9)
42 I NS W ?42,$E(NS,1,3),"-",$E(NS,4,5),"-",$E(NS,6,10)," "
43 I NB W ?55,$E(NB,4,5),"/",$E(NB,6,7),"/",$E(NB,2,3)," "
44 I $D(^DPT(Y,.1)) W ?67,$P(^(.1),"^")
45 Q
46SENS W ?42,"*SENSITIVE* ",?55,"*SENSITIVE* ",?67,"*SENSITIVE*" Q
Note: See TracBrowser for help on using the repository browser.