- PSJDPT ;BIR/JLC - CENTRALIZED PATIENT LOOKUP FOR IPM ;29-May-2012 14:38;PLS
- ;;5.0; INPATIENT MEDICATIONS ;**53,1003,124,166,160,198,1015**;16 DEC 97;Build 62
- ;
- ; Reference to ^DPT is supported by DBIA 10035
- ; Reference to ^DGSEC4 is supported by DBIA 3027
- ; Reference to ^DIC is supported by DBIA 10006
- ; Reference to ^DICN is supported by DBIA 10009
- ; Reference to ^DPTLK is supported by DBIA 3787
- ; Reference to ^DPTLK1 is supported by DBIA 3266
- ; Reference to DISPPRF^DGPFAPI is supported by DBIA 4563
- ; Reference to GETACT^DGPFAPI is supported by DBIA 3860
- ; Reference to ^ORRDI1 is supported by DBIA 4659.
- ; Reference to ^XTMP("ORRDI" is supported by DBIA 4660.
- ;
- ; Modified - IHS/MSC/PLS - 05/10/10 - Line EN+1
- EN ; MAIN ENTRY POINT FOR PATIENT LOOKUP
- ;K DIC S DIC="^DPT(",DIC("W")="D DPT^PSJDPT",DIC(0)="QEMZ" D ^DPTLK K DIC ;IHS/MSC/PLS - 05/10/10 - Commented out
- K DIC S DIC="^DPT(",DIC("W")="D DPT^PSJDPT",DIC(0)="QEMZ" D ^DIC K DIC
- I $$BADADR^DGUTL3(+Y) H 2
- N Y
- D
- . ;PSJ*5.0*198;GMZ;Don't print remote data msg on view profile only menu options
- . I $T(HAVEHDR^ORRDI1)]"",$$HAVEHDR^ORRDI1,$D(^XTMP("ORRDI","OUTAGE INFO","DOWN")),'$G(PSJNODIS) W !,"Remote data not available - Only local order checks processed." D PAUSE^PSJLMUT1
- Q
- CHK(Y,DISP,PAUSE) N RESULT,RES,CHKY,PSGTEMP
- S DISP=$G(DISP),PAUSE=$G(PAUSE)
- I $G(XQY0)["PSJI COMPLETE",$$GETACT^DGPFAPI(+Y,"PSGTEMP") K PSGTEMP W @IOF,"PATIENT: ",$P(Y,U,2)
- S CHKY=Y D DISPPRF^DGPFAPI(Y) S Y=CHKY K CHKY
- D PTSEC^DGSEC4(.RESULT,$P(Y,"^"),1)
- I RESULT(1)'=0 D
- . W !! I DISP W ?(80-$L($P(Y,"^",2)))\2,$P(Y,"^",2),!
- . F I=2:1:9 I $D(RESULT(I)) W ?(80-$L(RESULT(I)))\2,RESULT(I),!
- . I RESULT(1)'=0,RESULT(1)'=2,PAUSE H 2
- . Q:RESULT(1)=1
- . I RESULT(1)=-1!(RESULT(1)=3)!(RESULT(1)=4) S Y=-1 Q
- . I RESULT(1)=2 D ENCONT I Y=-1 Q
- . D NOTICE^DGSEC4(.RES,Y,XQY0,$S(RESULT(1)=1:1,1:3)) I RES=0 S Y=-1 Q
- Q
- ENCONT W !,"Do you want to continue processing this patient record"
- S %=2 D YN^DICN I %<0!(%=2) S Y=-1
- I '% W !!,"Enter 'YES' to continue processing, or 'NO' to quit processing this record." G ENCONT
- Q
- DPT I $$DOB^DPTLK1(Y)["*SENSITIVE" G SENS
- S ND=$S($D(^DPT(Y,0)):^(0),1:""),NB=$P(ND,"^",3),NS=$P(ND,"^",9)
- I NS W ?42,$E(NS,1,3),"-",$E(NS,4,5),"-",$E(NS,6,10)," "
- I NB W ?55,$E(NB,4,5),"/",$E(NB,6,7),"/",$E(NB,2,3)," "
- I $D(^DPT(Y,.1)) W ?67,$P(^(.1),"^")
- Q
- SENS W ?42,"*SENSITIVE* ",?55,"*SENSITIVE* ",?67,"*SENSITIVE*" Q
- PSJDPT ;BIR/JLC - CENTRALIZED PATIENT LOOKUP FOR IPM ;29-May-2012 14:38;PLS
- +1 ;;5.0; INPATIENT MEDICATIONS ;**53,1003,124,166,160,198,1015**;16 DEC 97;Build 62
- +2 ;
- +3 ; Reference to ^DPT is supported by DBIA 10035
- +4 ; Reference to ^DGSEC4 is supported by DBIA 3027
- +5 ; Reference to ^DIC is supported by DBIA 10006
- +6 ; Reference to ^DICN is supported by DBIA 10009
- +7 ; Reference to ^DPTLK is supported by DBIA 3787
- +8 ; Reference to ^DPTLK1 is supported by DBIA 3266
- +9 ; Reference to DISPPRF^DGPFAPI is supported by DBIA 4563
- +10 ; Reference to GETACT^DGPFAPI is supported by DBIA 3860
- +11 ; Reference to ^ORRDI1 is supported by DBIA 4659.
- +12 ; Reference to ^XTMP("ORRDI" is supported by DBIA 4660.
- +13 ;
- +14 ; Modified - IHS/MSC/PLS - 05/10/10 - Line EN+1
- EN ; MAIN ENTRY POINT FOR PATIENT LOOKUP
- +1 ;K DIC S DIC="^DPT(",DIC("W")="D DPT^PSJDPT",DIC(0)="QEMZ" D ^DPTLK K DIC ;IHS/MSC/PLS - 05/10/10 - Commented out
- +2 KILL DIC
- SET DIC="^DPT("
- SET DIC("W")="D DPT^PSJDPT"
- SET DIC(0)="QEMZ"
- DO ^DIC
- KILL DIC
- +3 IF $$BADADR^DGUTL3(+Y)
- HANG 2
- +4 NEW Y
- +5 Begin DoDot:1
- +6 ;PSJ*5.0*198;GMZ;Don't print remote data msg on view profile only menu options
- +7 IF $TEXT(HAVEHDR^ORRDI1)]""
- IF $$HAVEHDR^ORRDI1
- IF $DATA(^XTMP("ORRDI","OUTAGE INFO","DOWN"))
- IF '$GET(PSJNODIS)
- WRITE !,"Remote data not available - Only local order checks processed."
- DO PAUSE^PSJLMUT1
- End DoDot:1
- +8 QUIT
- CHK(Y,DISP,PAUSE) NEW RESULT,RES,CHKY,PSGTEMP
- +1 SET DISP=$GET(DISP)
- SET PAUSE=$GET(PAUSE)
- +2 IF $GET(XQY0)["PSJI COMPLETE"
- IF $$GETACT^DGPFAPI(+Y,"PSGTEMP")
- KILL PSGTEMP
- WRITE @IOF,"PATIENT: ",$PIECE(Y,U,2)
- +3 SET CHKY=Y
- DO DISPPRF^DGPFAPI(Y)
- SET Y=CHKY
- KILL CHKY
- +4 DO PTSEC^DGSEC4(.RESULT,$PIECE(Y,"^"),1)
- +5 IF RESULT(1)'=0
- Begin DoDot:1
- +6 WRITE !!
- IF DISP
- WRITE ?(80-$LENGTH($PIECE(Y,"^",2)))\2,$PIECE(Y,"^",2),!
- +7 FOR I=2:1:9
- IF $DATA(RESULT(I))
- WRITE ?(80-$LENGTH(RESULT(I)))\2,RESULT(I),!
- +8 IF RESULT(1)'=0
- IF RESULT(1)'=2
- IF PAUSE
- HANG 2
- +9 IF RESULT(1)=1
- QUIT
- +10 IF RESULT(1)=-1!(RESULT(1)=3)!(RESULT(1)=4)
- SET Y=-1
- QUIT
- +11 IF RESULT(1)=2
- DO ENCONT
- IF Y=-1
- QUIT
- +12 DO NOTICE^DGSEC4(.RES,Y,XQY0,$SELECT(RESULT(1)=1:1,1:3))
- IF RES=0
- SET Y=-1
- QUIT
- End DoDot:1
- +13 QUIT
- ENCONT WRITE !,"Do you want to continue processing this patient record"
- +1 SET %=2
- DO YN^DICN
- IF %<0!(%=2)
- SET Y=-1
- +2 IF '%
- WRITE !!,"Enter 'YES' to continue processing, or 'NO' to quit processing this record."
- GOTO ENCONT
- +3 QUIT
- DPT IF $$DOB^DPTLK1(Y)["*SENSITIVE"
- GOTO SENS
- +1 SET ND=$SELECT($DATA(^DPT(Y,0)):^(0),1:"")
- SET NB=$PIECE(ND,"^",3)
- SET NS=$PIECE(ND,"^",9)
- +2 IF NS
- WRITE ?42,$EXTRACT(NS,1,3),"-",$EXTRACT(NS,4,5),"-",$EXTRACT(NS,6,10)," "
- +3 IF NB
- WRITE ?55,$EXTRACT(NB,4,5),"/",$EXTRACT(NB,6,7),"/",$EXTRACT(NB,2,3)," "
- +4 IF $DATA(^DPT(Y,.1))
- WRITE ?67,$PIECE(^(.1),"^")
- +5 QUIT
- SENS WRITE ?42,"*SENSITIVE* ",?55,"*SENSITIVE* ",?67,"*SENSITIVE*"
- QUIT