- AMHRSR3 ; IHS/CMI/LAB - list SUICIDE RISK ASSESSMENT screenings ;
- ;;4.0;IHS BEHAVIORAL HEALTH;**8**;JUN 02, 2010;Build 7
- ;
- ;
- INFORM ;
- W !,$$CTR($$USR)
- W !,$$LOC()
- W !!,$$CTR("LISTING OF PATIENTS RECEIVING SUICIDE RISK ASSESSMENT,INCLUDING REFUSALS",80)
- W !!,"This report will tally and optionally list all patients who have had"
- W !,"Suicide Risk Assessments or a refusal documeted in the time frame specified"
- W !,"by the user. Suicide Risk Assessment is defined as any of the following"
- W !,"documented:"
- W !?10,"- Suicide Risk Assessment (Exam code 43)"
- W !?10,"- refusal of exam code 43"
- W !,"This report will tally the patients by age, gender, screening exam result, "
- W !,"provider (either exam provider, if available, or primary provider on the visit),"
- W !,"clinic, date of screening, designated PCP, MH Provider, SS Provider and A/SA"
- W !,"Provider."
- W !," Notes: "
- W !?10,"- the last screening/refusal for each patient is used. If a patient"
- W !?10," was screened more than once in the time period, only the latest"
- W !?10," is used in this report."
- W !?10,"- this report will optionally, look at both PCC and the Behavioral"
- W !?10," Health databases for evidence of screening/refusal"
- W !?10,"- this is a tally of Patients, not visits or screenings"
- W !!,"You will be able to choose the patients by age, gender, clinic, primary "
- W !,"provider or result of the screening."
- W !
- D DBHUSR^AMHUTIL
- D XIT
- S AMHREXC=$O(^AUTTEXAM("C",43,0))
- I 'AMHREXC W !!,"Exam code 43 is missing from the EXAM table. Cannot run report.",! H 3 D XIT Q
- ;
- DATES K AMHRED,AMHRBD
- W !,"Please enter the date range during which the screening was done.",!,"To get all screenings ever put in a long date range like 01/01/1980",!,"to the present date.",!
- K DIR W ! S DIR(0)="DO^::EXP",DIR("A")="Enter Beginning Date for Screening"
- D ^DIR Q:Y<1 S AMHRBD=Y
- K DIR S DIR(0)="DO^:DT:EXP",DIR("A")="Enter Ending Date for Screening"
- D ^DIR Q:Y<1 S AMHRED=Y
- ;
- I AMHRED<AMHRBD D G DATES
- . W !!,$C(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
- ;
- EXCL ;
- S AMHREXPC=""
- W !!,"Would you like to include screenings documented in non-behavioral health"
- S DIR(0)="Y",DIR("A")="clinics (those documented in PCC)",DIR("B")="N" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G DATES
- S AMHREXPC=Y
- SEX ;
- S AMHRSEX=""
- S DIR(0)="S^F:FEMALES Only;M:MALES Only;B:Both MALE and FEMALES",DIR("A")="Include which patients in the list",DIR("B")="F" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G EXCL
- S AMHRSEX=Y
- I AMHRSEX="B" S AMHRSEX="MF"
- AGE ;Age Screening
- K AMHRAGE,AMHRAGET
- W ! S DIR(0)="YO",DIR("A")="Would you like to restrict the report by Patient age range",DIR("B")="YES"
- S DIR("?")="If you wish to include visits from ALL age ranges, anwser No. If you wish to list visits for only patients within a particular age range, enter Yes."
- D ^DIR K DIR
- G:$D(DIRUT) SEX
- I 'Y G RESULT
- ;
- AGER ;Age Screening
- W !
- S DIR(0)="FO^1:7",DIR("A")="Enter an Age Range (e.g. 5-12,1-1)" D ^DIR
- I Y="" W !!,"No age range entered." G AGE
- I Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter a numeric range in the format nnn-nnn. e.g. 0-5, 0-99, 5-20." G AGER
- S AMHRAGET=Y
- RESULT ;result screenig
- K AMHRREST
- W !!,"You can limit the list to only patients who have had a screening"
- W !,"in the time period on which the result was any combination of the"
- W !,"following: (e.g. to get only those patients who have had a result of "
- W !,"Present enter 2 to get all patients who have had a screening result of"
- W !,"Past or Present, enter 2,3)",!
- W !?3,"1) Low"
- W !?3,"2) Moderate"
- W !?3,"3) High"
- W !?3,"4) Refused"
- W !?3,"5) Unable to Screen"
- w !?3,"6) Referral Needed"
- W !?3,"7) Screenings done with no result entered"
- W !
- K DIR S DIR(0)="L^1:7",DIR("A")="Which result values do you want included on this list",DIR("B")="" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G AGE
- I Y="" G AGE
- S AMHRREST=Y
- S A=Y,C="" F I=1:1 S C=$P(A,",",I) Q:C="" S AMHRREST(C)=""
- CLINIC ;
- K AMHRCLNT
- W ! S DIR(0)="Y",DIR("A")="Include visits to ALL clinics",DIR("B")="Yes" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- G:$D(DIRUT) RESULT
- I Y=1 G PRIMPRV
- CLINIC1 ;
- S X="CLINIC",DIC="^AMQQ(5,",DIC(0)="FM",DIC("S")="I $P(^(0),U,14)" D ^DIC K DIC,DA I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" G XIT
- D PEP^AMQQGTX0(+Y,"AMHRCLNT(")
- I '$D(AMHRCLNT) G CLINIC
- I $D(AMHRCLNT("*")) K AMHRCLNT
- PRIMPRV ;
- S (AMHRDISC,AMHRPSRT,AMHRPPUN)="" K AMHRPROV
- S DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
- S DIR("A")="Report should include visits whose PRIMARY PROVIDER on the visit is"
- S DIR("?")="If you wish to count only one primary provider of service enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'." D ^DIR K DIR
- G:$D(DIRUT) XIT
- S AMHRPSRT=Y
- I Y="P" K AMHRPROV G PRVSCR
- I Y="U" S AMHRPPUN=1 G PRVSCR
- PRV1 ;
- I $P(^DD(9000010.06,.01,0),U,2)[200 S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
- I $P(^DD(9000010.06,.01,0),U,2)[6 S DIC="^DIC(6,",DIC(0)="AEMQ",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D ^DIC K DIC
- I $D(DTOUT)!(Y=-1) G PRIMPRV
- S AMHRPROV=+Y
- PRVSCR ;
- S (AMHRSSRT,AMHRSPUN)="" K AMHRSPRV
- S DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
- S DIR("A")="Select which providers who performed the screening should be included"
- S DIR("?")="If you wish to count only one Provider enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'." D ^DIR K DIR
- G:$D(DIRUT) XIT
- S AMHRSSRT=Y
- I Y="P" K AMHRSPRV G DESPRV
- I Y="U" S AMHRSPUN=1 G DESPRV
- SCRPRV1 ;
- S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
- I $D(DTOUT)!(Y=-1) G PRVSCR
- S AMHRSPRV=+Y
- DESPRV ;
- S AMHRDESP=""
- W !!,"Would you like to limit the list to just patients who have"
- S DIR(0)="Y",DIR("A")="a particular designated Mental Health provider",DIR("B")="N" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G PRIMPRV
- I 'Y S AMHRDESP="" G SSPRV
- DESPRV1 ;
- S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
- I $D(DTOUT)!(Y=-1) G DESPRV
- S AMHRDESP=+Y
- SSPRV ;
- S AMHRSSP=""
- W !!,"Would you like to limit the list to just patients who have"
- S DIR(0)="Y",DIR("A")="a particular designated Social Services provider",DIR("B")="N" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G DESPRV
- I 'Y S AMHRSSP="" G CDPRV
- SSPRV1 ;
- S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
- I $D(DTOUT)!(Y=-1) G SSPRV
- S AMHRSSP=+Y
- CDPRV ;
- S AMHRCDP=""
- W !!,"Would you like to limit the list to just patients who have"
- S DIR(0)="Y",DIR("A")="a particular designated ASA/CD provider",DIR("B")="N" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G SSPRV
- I 'Y S AMHRCDP="" G TEMP
- CDPRV1 ;
- S DIC="^VA(200,",DIC(0)="AEMQ",D="AK.PROVIDER",DIC("A")="Enter PROVIDER (Lastname,Firstname): " D MIX^DIC1 K DIC,D
- I $D(DTOUT)!(Y=-1) G CDPRV
- S AMHRCDP=+Y
- TEMP ;TEMPLATE OR LIST
- S AMHRTMPL="",AMHRSTMP=""
- S DIR(0)="SO^L:List of Patient Screenings;S:Create a Search Template of Patients",DIR("B")="L",DIR("A")="Select Report Type"
- D ^DIR K DIR
- I $D(DIRUT) G DESPRV
- S AMHRTMPL=Y
- I AMHRTMPL="S" D ^AMHRSTMP G:AMHRSTMP="" TEMP G DEMO
- LIST1 ;
- S AMHRSORT=""
- W !
- S DIR(0)="S^H:Health Record Number;N:Patient Name;P:Provider who screened;C:Clinic;R:Result of Exam;D:Date Screened;A:Age of Patient at Screening;G:Gender of Patient;T:Terminal Digit HRN"
- S DIR("A")="How would you like the list to be sorted",DIR("B")="H"
- KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G PRIMPRV
- S AMHRSORT=Y
- DP ;
- S AMHRDP=""
- W !
- S DIR(0)="Y",DIR("A")="Display the Patient's Designated Providers on the list",DIR("B")="N" KILL DA D ^DIR KILL DIR
- I $D(DIRUT) G LIST1
- S AMHRDP=Y
- DEMO ;
- D DEMOCHK^AMHUTIL1(.AMHDEMO)
- I AMHDEMO=-1 G TEMP
- ZIS ;
- S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to ",DIR("B")="P" K DA D ^DIR K DIR
- I $D(DIRUT) G XIT
- I $G(Y)="B" D BROWSE,XIT Q
- S XBRP="PRINT^AMHRSR3P",XBRC="PROC^AMHRSR31",XBRX="XIT^AMHRSR3",XBNS="AMH"
- D ^XBDBQUE
- D XIT
- Q
- BROWSE ;
- S XBRP="VIEWR^XBLM(""^AMHRSR3P"")"
- S XBNS="AMH",XBRC="PROC^AMHRSR31",XBRX="XIT^AMHRSR3",XBIOP=0 D ^XBDBQUE
- Q
- XIT ;
- D EN^XBVK("AMHR")
- D ^XBFMK
- Q
- CTR(X,Y) ;EP - Center X in a field Y wide.
- Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
- ;----------
- EOP ;EP - End of page.
- Q:$E(IOST)'="C"
- Q:IO'=IO(0)
- Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
- NEW DIR
- K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
- W !
- S DIR("A")="End of Report. Press Enter",DIR(0)="E" D ^DIR
- Q
- ;----------
- USR() ;EP - Return name of current user from ^VA(200.
- Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
- ;----------
- LOC() ;EP - Return location name from file 4 based on DUZ(2).
- Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
- ;----------
- AMHRSR3 ; IHS/CMI/LAB - list SUICIDE RISK ASSESSMENT screenings ;
- +1 ;;4.0;IHS BEHAVIORAL HEALTH;**8**;JUN 02, 2010;Build 7
- +2 ;
- +3 ;
- INFORM ;
- +1 WRITE !,$$CTR($$USR)
- +2 WRITE !,$$LOC()
- +3 WRITE !!,$$CTR("LISTING OF PATIENTS RECEIVING SUICIDE RISK ASSESSMENT,INCLUDING REFUSALS",80)
- +4 WRITE !!,"This report will tally and optionally list all patients who have had"
- +5 WRITE !,"Suicide Risk Assessments or a refusal documeted in the time frame specified"
- +6 WRITE !,"by the user. Suicide Risk Assessment is defined as any of the following"
- +7 WRITE !,"documented:"
- +8 WRITE !?10,"- Suicide Risk Assessment (Exam code 43)"
- +9 WRITE !?10,"- refusal of exam code 43"
- +10 WRITE !,"This report will tally the patients by age, gender, screening exam result, "
- +11 WRITE !,"provider (either exam provider, if available, or primary provider on the visit),"
- +12 WRITE !,"clinic, date of screening, designated PCP, MH Provider, SS Provider and A/SA"
- +13 WRITE !,"Provider."
- +14 WRITE !," Notes: "
- +15 WRITE !?10,"- the last screening/refusal for each patient is used. If a patient"
- +16 WRITE !?10," was screened more than once in the time period, only the latest"
- +17 WRITE !?10," is used in this report."
- +18 WRITE !?10,"- this report will optionally, look at both PCC and the Behavioral"
- +19 WRITE !?10," Health databases for evidence of screening/refusal"
- +20 WRITE !?10,"- this is a tally of Patients, not visits or screenings"
- +21 WRITE !!,"You will be able to choose the patients by age, gender, clinic, primary "
- +22 WRITE !,"provider or result of the screening."
- +23 WRITE !
- +24 DO DBHUSR^AMHUTIL
- +25 DO XIT
- +26 SET AMHREXC=$ORDER(^AUTTEXAM("C",43,0))
- +27 IF 'AMHREXC
- WRITE !!,"Exam code 43 is missing from the EXAM table. Cannot run report.",!
- HANG 3
- DO XIT
- QUIT
- +28 ;
- DATES KILL AMHRED,AMHRBD
- +1 WRITE !,"Please enter the date range during which the screening was done.",!,"To get all screenings ever put in a long date range like 01/01/1980",!,"to the present date.",!
- +2 KILL DIR
- WRITE !
- SET DIR(0)="DO^::EXP"
- SET DIR("A")="Enter Beginning Date for Screening"
- +3 DO ^DIR
- IF Y<1
- QUIT
- SET AMHRBD=Y
- +4 KILL DIR
- SET DIR(0)="DO^:DT:EXP"
- SET DIR("A")="Enter Ending Date for Screening"
- +5 DO ^DIR
- IF Y<1
- QUIT
- SET AMHRED=Y
- +6 ;
- +7 IF AMHRED<AMHRBD
- Begin DoDot:1
- +8 WRITE !!,$CHAR(7),"Sorry, Ending Date MUST not be earlier than Beginning Date."
- End DoDot:1
- GOTO DATES
- +9 ;
- EXCL ;
- +1 SET AMHREXPC=""
- +2 WRITE !!,"Would you like to include screenings documented in non-behavioral health"
- +3 SET DIR(0)="Y"
- SET DIR("A")="clinics (those documented in PCC)"
- SET DIR("B")="N"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- GOTO DATES
- +5 SET AMHREXPC=Y
- SEX ;
- +1 SET AMHRSEX=""
- +2 SET DIR(0)="S^F:FEMALES Only;M:MALES Only;B:Both MALE and FEMALES"
- SET DIR("A")="Include which patients in the list"
- SET DIR("B")="F"
- KILL DA
- DO ^DIR
- KILL DIR
- +3 IF $DATA(DIRUT)
- GOTO EXCL
- +4 SET AMHRSEX=Y
- +5 IF AMHRSEX="B"
- SET AMHRSEX="MF"
- AGE ;Age Screening
- +1 KILL AMHRAGE,AMHRAGET
- +2 WRITE !
- SET DIR(0)="YO"
- SET DIR("A")="Would you like to restrict the report by Patient age range"
- SET DIR("B")="YES"
- +3 SET DIR("?")="If you wish to include visits from ALL age ranges, anwser No. If you wish to list visits for only patients within a particular age range, enter Yes."
- +4 DO ^DIR
- KILL DIR
- +5 IF $DATA(DIRUT)
- GOTO SEX
- +6 IF 'Y
- GOTO RESULT
- +7 ;
- AGER ;Age Screening
- +1 WRITE !
- +2 SET DIR(0)="FO^1:7"
- SET DIR("A")="Enter an Age Range (e.g. 5-12,1-1)"
- DO ^DIR
- +3 IF Y=""
- WRITE !!,"No age range entered."
- GOTO AGE
- +4 IF Y'?1.3N1"-"1.3N
- WRITE !!,$CHAR(7),$CHAR(7),"Enter a numeric range in the format nnn-nnn. e.g. 0-5, 0-99, 5-20."
- GOTO AGER
- +5 SET AMHRAGET=Y
- RESULT ;result screenig
- +1 KILL AMHRREST
- +2 WRITE !!,"You can limit the list to only patients who have had a screening"
- +3 WRITE !,"in the time period on which the result was any combination of the"
- +4 WRITE !,"following: (e.g. to get only those patients who have had a result of "
- +5 WRITE !,"Present enter 2 to get all patients who have had a screening result of"
- +6 WRITE !,"Past or Present, enter 2,3)",!
- +7 WRITE !?3,"1) Low"
- +8 WRITE !?3,"2) Moderate"
- +9 WRITE !?3,"3) High"
- +10 WRITE !?3,"4) Refused"
- +11 WRITE !?3,"5) Unable to Screen"
- +12 WRITE !?3,"6) Referral Needed"
- +13 WRITE !?3,"7) Screenings done with no result entered"
- +14 WRITE !
- +15 KILL DIR
- SET DIR(0)="L^1:7"
- SET DIR("A")="Which result values do you want included on this list"
- SET DIR("B")=""
- KILL DA
- DO ^DIR
- KILL DIR
- +16 IF $DATA(DIRUT)
- GOTO AGE
- +17 IF Y=""
- GOTO AGE
- +18 SET AMHRREST=Y
- +19 SET A=Y
- SET C=""
- FOR I=1:1
- SET C=$PIECE(A,",",I)
- IF C=""
- QUIT
- SET AMHRREST(C)=""
- CLINIC ;
- +1 KILL AMHRCLNT
- +2 WRITE !
- SET DIR(0)="Y"
- SET DIR("A")="Include visits to ALL clinics"
- SET DIR("B")="Yes"
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +3 IF $DATA(DIRUT)
- GOTO RESULT
- +4 IF Y=1
- GOTO PRIMPRV
- CLINIC1 ;
- +1 SET X="CLINIC"
- SET DIC="^AMQQ(5,"
- SET DIC(0)="FM"
- SET DIC("S")="I $P(^(0),U,14)"
- DO ^DIC
- KILL DIC,DA
- IF Y=-1
- WRITE "OOPS - QMAN NOT CURRENT - QUITTING"
- GOTO XIT
- +2 DO PEP^AMQQGTX0(+Y,"AMHRCLNT(")
- +3 IF '$DATA(AMHRCLNT)
- GOTO CLINIC
- +4 IF $DATA(AMHRCLNT("*"))
- KILL AMHRCLNT
- PRIMPRV ;
- +1 SET (AMHRDISC,AMHRPSRT,AMHRPPUN)=""
- KILL AMHRPROV
- +2 SET DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
- +3 SET DIR("A")="Report should include visits whose PRIMARY PROVIDER on the visit is"
- +4 SET DIR("?")="If you wish to count only one primary provider of service enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'."
- DO ^DIR
- KILL DIR
- +5 IF $DATA(DIRUT)
- GOTO XIT
- +6 SET AMHRPSRT=Y
- +7 IF Y="P"
- KILL AMHRPROV
- GOTO PRVSCR
- +8 IF Y="U"
- SET AMHRPPUN=1
- GOTO PRVSCR
- PRV1 ;
- +1 IF $PIECE(^DD(9000010.06,.01,0),U,2)[200
- SET DIC="^VA(200,"
- SET DIC(0)="AEMQ"
- SET D="AK.PROVIDER"
- SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
- DO MIX^DIC1
- KILL DIC,D
- +2 IF $PIECE(^DD(9000010.06,.01,0),U,2)[6
- SET DIC="^DIC(6,"
- SET DIC(0)="AEMQ"
- SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
- DO ^DIC
- KILL DIC
- +3 IF $DATA(DTOUT)!(Y=-1)
- GOTO PRIMPRV
- +4 SET AMHRPROV=+Y
- PRVSCR ;
- +1 SET (AMHRSSRT,AMHRSPUN)=""
- KILL AMHRSPRV
- +2 SET DIR(0)="SO^O:One Provider Only;P:Any/All Providers (including unknown);U:Unknown Provider Only"
- +3 SET DIR("A")="Select which providers who performed the screening should be included"
- +4 SET DIR("?")="If you wish to count only one Provider enter a 'O'. To include ALL providers enter an 'A'. To include all providers of one discipline enter a 'D'."
- DO ^DIR
- KILL DIR
- +5 IF $DATA(DIRUT)
- GOTO XIT
- +6 SET AMHRSSRT=Y
- +7 IF Y="P"
- KILL AMHRSPRV
- GOTO DESPRV
- +8 IF Y="U"
- SET AMHRSPUN=1
- GOTO DESPRV
- SCRPRV1 ;
- +1 SET DIC="^VA(200,"
- SET DIC(0)="AEMQ"
- SET D="AK.PROVIDER"
- SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
- DO MIX^DIC1
- KILL DIC,D
- +2 IF $DATA(DTOUT)!(Y=-1)
- GOTO PRVSCR
- +3 SET AMHRSPRV=+Y
- DESPRV ;
- +1 SET AMHRDESP=""
- +2 WRITE !!,"Would you like to limit the list to just patients who have"
- +3 SET DIR(0)="Y"
- SET DIR("A")="a particular designated Mental Health provider"
- SET DIR("B")="N"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- GOTO PRIMPRV
- +5 IF 'Y
- SET AMHRDESP=""
- GOTO SSPRV
- DESPRV1 ;
- +1 SET DIC="^VA(200,"
- SET DIC(0)="AEMQ"
- SET D="AK.PROVIDER"
- SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
- DO MIX^DIC1
- KILL DIC,D
- +2 IF $DATA(DTOUT)!(Y=-1)
- GOTO DESPRV
- +3 SET AMHRDESP=+Y
- SSPRV ;
- +1 SET AMHRSSP=""
- +2 WRITE !!,"Would you like to limit the list to just patients who have"
- +3 SET DIR(0)="Y"
- SET DIR("A")="a particular designated Social Services provider"
- SET DIR("B")="N"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- GOTO DESPRV
- +5 IF 'Y
- SET AMHRSSP=""
- GOTO CDPRV
- SSPRV1 ;
- +1 SET DIC="^VA(200,"
- SET DIC(0)="AEMQ"
- SET D="AK.PROVIDER"
- SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
- DO MIX^DIC1
- KILL DIC,D
- +2 IF $DATA(DTOUT)!(Y=-1)
- GOTO SSPRV
- +3 SET AMHRSSP=+Y
- CDPRV ;
- +1 SET AMHRCDP=""
- +2 WRITE !!,"Would you like to limit the list to just patients who have"
- +3 SET DIR(0)="Y"
- SET DIR("A")="a particular designated ASA/CD provider"
- SET DIR("B")="N"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- GOTO SSPRV
- +5 IF 'Y
- SET AMHRCDP=""
- GOTO TEMP
- CDPRV1 ;
- +1 SET DIC="^VA(200,"
- SET DIC(0)="AEMQ"
- SET D="AK.PROVIDER"
- SET DIC("A")="Enter PROVIDER (Lastname,Firstname): "
- DO MIX^DIC1
- KILL DIC,D
- +2 IF $DATA(DTOUT)!(Y=-1)
- GOTO CDPRV
- +3 SET AMHRCDP=+Y
- TEMP ;TEMPLATE OR LIST
- +1 SET AMHRTMPL=""
- SET AMHRSTMP=""
- +2 SET DIR(0)="SO^L:List of Patient Screenings;S:Create a Search Template of Patients"
- SET DIR("B")="L"
- SET DIR("A")="Select Report Type"
- +3 DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- GOTO DESPRV
- +5 SET AMHRTMPL=Y
- +6 IF AMHRTMPL="S"
- DO ^AMHRSTMP
- IF AMHRSTMP=""
- GOTO TEMP
- GOTO DEMO
- LIST1 ;
- +1 SET AMHRSORT=""
- +2 WRITE !
- +3 SET DIR(0)="S^H:Health Record Number;N:Patient Name;P:Provider who screened;C:Clinic;R:Result of Exam;D:Date Screened;A:Age of Patient at Screening;G:Gender of Patient;T:Terminal Digit HRN"
- +4 SET DIR("A")="How would you like the list to be sorted"
- SET DIR("B")="H"
- +5 KILL DA
- DO ^DIR
- KILL DIR
- +6 IF $DATA(DIRUT)
- GOTO PRIMPRV
- +7 SET AMHRSORT=Y
- DP ;
- +1 SET AMHRDP=""
- +2 WRITE !
- +3 SET DIR(0)="Y"
- SET DIR("A")="Display the Patient's Designated Providers on the list"
- SET DIR("B")="N"
- KILL DA
- DO ^DIR
- KILL DIR
- +4 IF $DATA(DIRUT)
- GOTO LIST1
- +5 SET AMHRDP=Y
- DEMO ;
- +1 DO DEMOCHK^AMHUTIL1(.AMHDEMO)
- +2 IF AMHDEMO=-1
- GOTO TEMP
- ZIS ;
- +1 SET DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen"
- SET DIR("A")="Do you wish to "
- SET DIR("B")="P"
- KILL DA
- DO ^DIR
- KILL DIR
- +2 IF $DATA(DIRUT)
- GOTO XIT
- +3 IF $GET(Y)="B"
- DO BROWSE
- DO XIT
- QUIT
- +4 SET XBRP="PRINT^AMHRSR3P"
- SET XBRC="PROC^AMHRSR31"
- SET XBRX="XIT^AMHRSR3"
- SET XBNS="AMH"
- +5 DO ^XBDBQUE
- +6 DO XIT
- +7 QUIT
- BROWSE ;
- +1 SET XBRP="VIEWR^XBLM(""^AMHRSR3P"")"
- +2 SET XBNS="AMH"
- SET XBRC="PROC^AMHRSR31"
- SET XBRX="XIT^AMHRSR3"
- SET XBIOP=0
- DO ^XBDBQUE
- +3 QUIT
- XIT ;
- +1 DO EN^XBVK("AMHR")
- +2 DO ^XBFMK
- +3 QUIT
- CTR(X,Y) ;EP - Center X in a field Y wide.
- +1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
- +2 ;----------
- EOP ;EP - End of page.
- +1 IF $EXTRACT(IOST)'="C"
- QUIT
- +2 IF IO'=IO(0)
- QUIT
- +3 IF $DATA(ZTQUEUED)!'(IOT="TRM")!$DATA(IO("S"))
- QUIT
- +4 NEW DIR
- +5 KILL DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
- +6 WRITE !
- +7 SET DIR("A")="End of Report. Press Enter"
- SET DIR(0)="E"
- DO ^DIR
- +8 QUIT
- +9 ;----------
- USR() ;EP - Return name of current user from ^VA(200.
- +1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
- +2 ;----------
- LOC() ;EP - Return location name from file 4 based on DUZ(2).
- +1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
- +2 ;----------