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

ACKQUTL7.m

Go to the documentation of this file.
  1. ACKQUTL7 ;HCIOFO/BH - Template Inquire - A&SP Patient/Visit ;18 Jun 2013 10:54 AM
  1. ;;3.0;QUASAR;**8,22,21**;Feb 11, 2000;Build 40
  1. ;
  1. ; Reference/IA
  1. ; $$CSI^ICDEX - 5747
  1. ;
  1. INP ; PRINT INPATIENT INFO
  1. W !,"WARD: ",ACK(6),?20,"ROOM/BED: ",ACK(7),?40,"TREATING SPEC:"
  1. W $E(ACK(8),1,25)
  1. Q
  1. ;
  1. ;
  1. EN ; Get Demographics
  1. N I,X,Y K ACKDIRUT
  1. D DEM^VADPT,INP^VADPT,ELIG^VADPT
  1. S ACKIVD=$$NUMDT^ACKQUTL($P(^ACK(509850.2,ACKPAT,0),U,2))
  1. K ACK S ACK(1)=VADM(1),ACK(2)=$P(VADM(3),U,2),ACK(3)=$P(VADM(2),U,2)
  1. S ACK(4)=VADM(7),ACK(6)=$P(VAIN(4),U,2)
  1. S ACKINP=$S($L(ACK(6)):1,1:0),ACK(5)="Patient is "_$S(ACKINP:"",1:"not ")_"currently an inpatient."
  1. S ACK(7)=VAIN(5),ACK(8)=$P(VAIN(3),U,2),ACK(9)=$P(VAEL(1),U,2)
  1. PRINT ;
  1. W @IOF
  1. S X="QUASAR V.3. "_ACKVISIT_" VISIT ENTRY" D CNTR^ACKQUTL(X)
  1. ;
  1. ;
  1. D TPLTE
  1. ;
  1. ;
  1. ; D RATDIS^ACKQNQ ; Display any Rated Disabilities
  1. ;
  1. W !!,"Patient Diagnostic History",!
  1. W $S($P(VADM(5),U)="F":"Ms. ",1:"Mr. "),$P(VADM(1),",")
  1. W " has been seen for the following:",!
  1. I $Y>(IOSL-8) S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT) W @IOF
  1. D DIHEAD,ICDSORT
  1. K DIRUT W !
  1. I $D(ACKICD)'=11 W !,"No A&SP Diagnostic Data for this Patient" G EXIT
  1. S ACKI=""
  1. ;F S ACKI=$O(ACKICD(ACKI)) Q:ACKI="" D:$Y>(IOSL-5) WAIT Q:$D(DIRUT) W !,$P(ACKICD(ACKI),U),?15,$P(ACKICD(ACKI),U,3),?60,$$NUMDT^ACKQUTL($P(ACKICD(ACKI),U,4))
  1. S ACKICDX=""
  1. F S ACKI=$O(ACKICD(ACKI)) Q:ACKI="" D:$Y>(IOSL-5) WAIT Q:$D(DIRUT) D
  1. . S ACKICDX=""
  1. . S ACKICDX=$O(ACKICD(ACKI,ACKICDX))
  1. . S ACKCDST(ACKICDX)=ACKICDX
  1. I $D(ACKCDST(1)),$D(ACKCDST(30)) D
  1. . S ACKI="",CNTR9=0,CNTR0=0
  1. . F S ACKI=$O(ACKICD(ACKI)) Q:ACKI="" D
  1. . . S ACKICD=""
  1. . . F S ACKICD=$O(ACKICD(ACKI,ACKICD)) Q:ACKICD="" D
  1. . . . S ACKDX=$P(ACKICD(ACKI,ACKICD),U)
  1. . . . S ACKDESC=$P(ACKICD(ACKI,ACKICD),U,3)
  1. . . . S ACKDATE=$$NUMDT^ACKQUTL($P(ACKICD(ACKI,ACKICD),U,4))
  1. . . . I ACKICD=1 S CNTR9=CNTR9+1 S ACKICD9(CNTR9)=ACKDX_U_ACKDESC_U_ACKDATE
  1. . . . I ACKICD=30 S CNTR0=CNTR0+1 S ACKICD0(CNTR0)=ACKDX_U_ACKDESC_U_ACKDATE
  1. . D PRTHEAD,EXIT Q
  1. S ACKI="" F S ACKI=$O(ACKICD(ACKI)) Q:ACKI="" D:$Y>(IOSL-5) WAIT Q:$D(DIRUT) D
  1. . S ACKICDX=""
  1. . S ACKICDX=$O(ACKICD(ACKI,ACKICDX)) D
  1. . . W !,$P(ACKICD(ACKI,ACKICDX),U),?10,$P(ACKICD(ACKI,ACKICDX),U,3),?72,$$NUMDT^ACKQUTL($P(ACKICD(ACKI,ACKICDX),U,4))
  1. EXIT ;
  1. I $G(DIRUT)=1 S ACKDIRUT=1 ; Quit flag for template
  1. W !!
  1. K %ZIS,ACK,ACKCDST,ACKDC,ACKDD,ACKDESC,ACKDFN,ACKDN,ACKDX,ACKI,ACKICD,ACKINP,ACKIVD,ACKLINE
  1. K ACKRD,ACKDATE,ACKICD0,ACKICD9,ACKICDX,ACKINFO
  1. K CNTR0,CNTR9,DATA,DIRUT,DTOUT,DUOUT,VA,VADM,VAEL,VAERR,VAIN,X,X1,Y,ZTDESC,ZTIO
  1. K ZTRTN,ZTSAVE
  1. W:$E(IOST)'="C" @IOF D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. ;
  1. WAIT ;
  1. K DIRUT I $E(IOST)'="C" W @IOF Q
  1. S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT) W @IOF,"Patient Diagnostic History (Cont'd)"," (",ACK(1),")" D DIHEAD
  1. Q
  1. DIHEAD ;
  1. W ?72,"DATE"
  1. W !,"DIAGNOSIS",?72,"ENTERED" S ACKLINE="",$P(ACKLINE,"-",IOM)="" W !,ACKLINE
  1. Q
  1. ICDSORT ;
  1. S ACKI=0 F S ACKI=$O(^ACK(509850.2,DFN,1,ACKI)) Q:'ACKI D
  1. . S ACKDC=^ACK(509850.2,DFN,1,ACKI,0),ACKDD=$P(ACKDC,U,2)
  1. . S ACKICD=$$CSI^ICDEX(80,+ACKDC) ; returns 1 for ICD9 and 30 for ICD10
  1. . S ACKINFO=$$ICDDATA^ICDXCODE(ACKICD,+ACKDC,ACKDD,"I")
  1. . S ACKTGT=$P(ACKINFO,U,3)
  1. . S ACKDN=$P(ACKINFO,U,2)
  1. . S ACKICD(ACKDN,ACKICD)=ACKDN_U_ACKTGT_U_$$DIAGTXT^ACKQUTL8(+ACKDC,ACKDD)_U_ACKDD
  1. K ACKTGT,ACKMSG
  1. Q
  1. ;
  1. TPLTE ; Display Visit Clinic and Division
  1. N ACKTMPE
  1. W !!,"CLINIC: ",$$GET1^DIQ(509850.6,ACKVIEN,"2.6")
  1. W ?45,"DIVISION: ",$$GET1^DIQ(509850.6,ACKVIEN,60),!
  1. ; Display more Patient data
  1. W "PATIENT: ",ACK(1),?45,"DOB: ",ACK(2),?63,"SSN: ",ACK(3)
  1. ; If no Visit Eligibility on visit file display Primary Elig.
  1. S ACKTMPE=$$GET1^DIQ(509850.6,ACKVIEN_",",80,"E")
  1. I ACKTMPE D
  1. . W !,"VISIT ELIGIBILITY: "_ACKTMPE
  1. ;
  1. I 'ACKTMPE D
  1. .W !,"ELIGIBILITY: ",ACK(9)
  1. W ?45,"INITIAL VISIT DATE: ",ACKIVD
  1. W:$L(ACK(4)) !,ACK(4) W !,ACK(5) D:ACKINP INP
  1. ; D VISIT
  1. ;
  1. Q
  1. ;
  1. VISIT ; Displays Service connected data
  1. ;
  1. I 'ACKSC Q ; If Patient not service connected QUIT
  1. I 'ACKPCE Q ; If system not set up for PCE then QUIT
  1. ;
  1. N ACKX,ACKVV,ACKPP,ACKVSC,ACKAAO,ACKEENV,ACKRRAD,ACK,ACKSTR
  1. ;
  1. D GETDATA
  1. I ACKVISIT="NEW",$G(ACKPCENO)="" D UNKNOWN Q
  1. I 'ACKVSC D NOT("This Visit's Treatment :",ACKAAO,ACKRRAD,ACKEENV) Q
  1. I ACKVSC D CONNECT
  1. Q
  1. ;
  1. ;
  1. GETDATA ; Get visit data
  1. ;
  1. K ACK
  1. D GETS^DIQ(509850.6,ACKVIEN,"20;25;30;35","I","ACK")
  1. S ACKVSC=ACK(509850.6,ACKVIEN_",",20,"I")
  1. S ACKAAO=ACK(509850.6,ACKVIEN_",",25,"I")
  1. S ACKEENV=ACK(509850.6,ACKVIEN_",",35,"I")
  1. S ACKRRAD=ACK(509850.6,ACKVIEN_",",30,"I")
  1. K ACK
  1. Q
  1. ;
  1. CONNECT W !!,"This visit's Treatment is Service Connected.",!
  1. Q
  1. ;
  1. NOT(ACKSTR,ACKAAO,ACKRRAD,ACKEENV) ;
  1. W !!,ACKSTR,!
  1. W "------------------------------------------------------------------------------"
  1. ;
  1. W !,"Related to AGENT ORANGE ? : "_$S(ACKAAO="1":"YES",1:"NO") W ?50,"Service Connected ? : NO"
  1. ;
  1. W !,"Related to RADIATION EXPOSURE ? : "_$S(ACKRRAD="1":"YES",1:"NO")
  1. ;
  1. W !,"Related to ENVIRONMENTAL CONTAMINANTS ? : "_$S(ACKEENV="1":"YES",1:"NO")
  1. Q
  1. ;
  1. UNKNOWN N ACKPASS
  1. S ACKPASS=0
  1. W !!,"This visit's Treatment:",!
  1. W "------------------------------------------------------------------------------",!
  1. I ACKAO W "Related to AGENT ORANGE ? : UNKNOWN" D:'ACKPASS SERV
  1. I ACKRAD W !,"Related to RADIATION EXPOSURE ? : UNKNOWN" D:'ACKPASS SERV
  1. I ACKENV W !,"Related to ENVIRONMENTAL CONTAMINANTS ? : UNKNOWN" D:'ACKPASS SERV
  1. D:'ACKPASS SERV
  1. W !
  1. Q
  1. ;
  1. SERV ;
  1. W ?50,"Service Connected ? : UNKNOWN" S ACKPASS=1
  1. Q
  1. ;
  1. ERROR ; Display error message if registration returns error that indicates
  1. ; that the Appointment Management database is not available.
  1. ;
  1. N ACKERR
  1. W !!!!," ** The Appointment Management Data Base is unavailable. **"
  1. W !!," ** Please report this problem to IRM as soon as possible. **",!!!
  1. W " Press any key to continue."
  1. R ACKERR:DTIME
  1. ;
  1. Q
  1. ;
  1. PRTHEAD ;
  1. S CNTR9=0,CNTR0=0
  1. W !,"ICD-9-CM",!
  1. F CNTR9=1:1 S DATA=$G(ACKICD9(CNTR9)) Q:'$D(ACKICD9(CNTR9)) D
  1. . S ACKDX=$P(DATA,U)
  1. . S ACKDESC=$P(DATA,U,2)
  1. . S ACKDATE=$P(DATA,U,3)
  1. . K ACKICDDS,ACKARNUM S ACKICDDS=ACKDESC D BRKDESC^ACKQR3(57)
  1. . ;W !,ACKDX,?10,ACKDESC,?72,ACKDATE
  1. . W !,ACKDX,?10,ACKICDDS(1),?71,ACKDATE
  1. . F ACKARNM2=2:1:ACKARNUM W !?10,ACKICDDS(ACKARNM2)
  1. . K ACKICDDS,ACKARNUM,ACKARNM2
  1. W !!,"ICD-10-CM",!
  1. F CNTR0=1:1 S DATA=$G(ACKICD0(CNTR0)) Q:'$D(ACKICD0(CNTR0)) D
  1. . S ACKDX=$P(DATA,U)
  1. . S ACKDESC=$P(DATA,U,2)
  1. . S ACKDATE=$P(DATA,U,3)
  1. . K ACKICDDS,ACKARNUM S ACKICDDS=ACKDESC D BRKDESC^ACKQR3(57)
  1. . ;W !,ACKDX,?10,ACKDESC,?72,ACKDATE
  1. . W !,ACKDX,?10,ACKICDDS(1),?71,ACKDATE
  1. . F ACKARNM2=2:1:ACKARNUM W !?10,ACKICDDS(ACKARNM2)
  1. . K ACKICDDS,ACKARNUM,ACKARNM2
  1. Q
  1. ;