STANDARD DATA DICTIONARY #818 -- COMPACT ACT EPISODE OF CARE FILE                                                 6/27/25    PAGE 1
STORED IN ^PXCOMP(818,  *** NO DATA STORED YET ***   SITE: WWW.BMIRWIN.COM   UCI: VISTA,VISTA                      (VERSION 1.0)   

DATA          NAME                  GLOBAL        DATA
ELEMENT       TITLE                 LOCATION      TYPE
-----------------------------------------------------------------------------------------------------------------------------------
This file tracks a patient's Acute Suicidal Crisis episodes. It contains locks for the inpatient, outpatient, and extension
periods, as needed.  This file also points to PTF and VISIT records that were marked as related to an Acute Suicidal Crisis, which
are covered benefits, under the COMPACT Act.  


              DD ACCESS: @
              RD ACCESS: @
              WR ACCESS: @
             DEL ACCESS: @
           LAYGO ACCESS: @
           AUDIT ACCESS: @

CROSS
REFERENCED BY: PATIENT(B)

    LAST MODIFIED: NOV 21,2024@17:19:37

818,.01       PATIENT                0;1 POINTER TO PATIENT FILE (#2) (Required)

              LAST EDITED:      SEP 12, 2023 
              HELP-PROMPT:      Enter the patient that is in acute suicidal crisis. 
              DESCRIPTION:
                                The patient receiving acute suicidal crisis treatment for this episode of care.  

              TECHNICAL DESCR:
                                (Required) Pointer to Patient File (#2).  

              PRE-LOOKUP:       I '$D(^XUSEC("PX EOC EDIT",DUZ)) K X D EN^DDIOL("** This file can only be edited by PCE menu option
                                s **.","","!?5,$C(7)")
              CROSS-REFERENCE:  818^B 
                                1)= S ^PXCOMP(818,"B",$E(X,1,30),DA)=""
                                2)= K ^PXCOMP(818,"B",$E(X,1,30),DA)


818,2         ACUTE SUICIDAL CRISIS FLAG 0;2 SET (BOOLEAN Data Type)

              LAST EDITED:      MAY 03, 2024 
              DESCRIPTION:
                                Flag is set to Yes if the patient is in acute suicidal crisis.  

              TECHNICAL DESCR:
                                Set of codes.  


818,3         BENEFIT TYPE           0;3 SET

                                'I' FOR INPATIENT; 
                                'O' FOR OUTPATIENT; 
              LAST EDITED:      DEC 08, 2023 
              HELP-PROMPT:      Enter the current benefit type that is open. 
              DESCRIPTION:      This is the current benefit clock that is open, e.g. Inpatient 30 day clock or Outpatient 90 day
                                clock.  

              TECHNICAL DESCR:  This field keeps track of the benefit that is currently open and in force e.g. "I" for inpatient or
                                "O" for outpatient.  
                                 
                                 
                                Example: The Admission event would start the patient's Episode of care and also the inpatient 30
                                day benefit clock.  An extension could occur and would be recorded as an extension to the inpatient
                                benefit period. A discharge event would close the current inpatient benefit and then open the
                                outpatient 90 day benefit clock.  An extension could occur and this would be recorded as an
                                extension to the outpatient benefit period.  


818,10        EPISODES OF CARE       10;0 DATE Multiple #818.01

              LAST EDITED:      AUG 17, 2023 
              TECHNICAL DESCR:
                                Multiple file.  


818.01,.01      EPISODE START DATE     0;1 DATE

                INPUT TRANSFORM:  S %DT="E" D ^%DT S X=Y K:Y<1 X
                LAST EDITED:      JAN 04, 2024 
                HELP-PROMPT:      Enter the date the patient was determined to be in acute suicidal crisis. 
                DESCRIPTION:
                                  The date the patient was determined to be in acute suicidal crisis.  

                TECHNICAL DESCR:
                                  Fileman date only, no time.  

                CROSS-REFERENCE:  818.01^B 
                                  1)= S ^PXCOMP(818,DA(1),10,"B",$E(X,1,30),DA)=""
                                  2)= K ^PXCOMP(818,DA(1),10,"B",$E(X,1,30),DA)


818.01,2        EPISODE END DATE       0;2 DATE

                INPUT TRANSFORM:  S %DT="E" D ^%DT S X=Y K:Y<1 X
                LAST EDITED:      SEP 12, 2023 
                HELP-PROMPT:      Enter the date the patient was determined to be non-acute. 
                DESCRIPTION:
                                  The date the patient was determined to be non-acute.  

                TECHNICAL DESCR:
                                  Fileman date only, no time.  


818.01,3        SOURCE OF CRISIS END   0;3 SET

                                  'PR' FOR PROVIDER; 
                                  'PA' FOR PATIENT; 
                                  'TE' FOR TIME EXPIRED; 
                LAST EDITED:      JAN 03, 2024 
                HELP-PROMPT:      Select the code that identifies the source of how the acute suicidal crisis was ended.  
                DESCRIPTION:
                                  This is the source of the acute suicidal crisis end.  

                TECHNICAL DESCR:
                                  Set of codes.  


818.01,3.1      CRISIS END AUTHORIZED BY 1;1 POINTER TO NEW PERSON FILE (#200)

                LAST EDITED:      SEP 12, 2023 
                HELP-PROMPT:      Enter the person that authorized the end of the crisis. 
                DESCRIPTION:
                                  Person that authorized the End of the Acute Suicidal Crisis.  

                TECHNICAL DESCR:
                                  (Required) Pointer to NEW PERSON file (#200).  


818.01,3.2      CRISIS END OTHER COMMENT 1;2 FREE TEXT

                INPUT TRANSFORM:  K:$L(X)>245!($L(X)<1) X
                MAXIMUM LENGTH:   245
                LAST EDITED:      SEP 20, 2023 
                HELP-PROMPT:      Enter other comments about the end of the acute suicidal crisis episode. Answer must be 1-245 
                                  characters in length. 
                DESCRIPTION:
                                  Enter other information about the source of the End of this Acute Suicidal Crisis.  

                TECHNICAL DESCR:
                                  Other free text comments about the end of the acute suicidal crisis episode. (1-245) 


818.01,4        INPATIENT BENEFIT END DATE 0;4 DATE

                INPUT TRANSFORM:  S %DT="E" D ^%DT S X=Y K:X<1 X
                LAST EDITED:      FEB 02, 2024 
                HELP-PROMPT:      Enter the inpatient benefit end date. Date should be 30 days after the initial start of the 
                                  inpatient period. Calculated by the system and user entry is discouraged for this field. 

818.01,5        OUTPATIENT BENEFIT END DATE 0;5 DATE

                INPUT TRANSFORM:  S %DT="E" D ^%DT S X=Y K:Y<1 X
                LAST EDITED:      JAN 22, 2024 
                HELP-PROMPT:      Enter the outpatient benefit end date. Date should be 90 days after the initial start of the 
                                  outpatient period. Calculated by the system and user entry is discouraged for this field. 
                DESCRIPTION:
                                  The date that the outpatient COMPACT Act benefit has ended.  

                TECHNICAL DESCR:  Fileman date only, no time. This is a date to be calculated by the system and is 90 days total
                                  benefit starting on the day the outpatient period began.  


818.01,6        EPISODE FINAL STATUS   0;6 SET

                                  'R' FOR Rollback; 
                                  'E' FOR Entered in Error ; 
                LAST EDITED:      SEP 20, 2023 
                HELP-PROMPT:      Enter 'R' to rollback this episode or 'E' if this episode was entered in error for this patient. 
                DESCRIPTION:      This status will be Null upon creation and marked 'R' if it has been rolled back or 'E' if it was
                                  entered in error. Rollback indicates that the patient was later determined as Not Eligible for
                                  COMPACT Act.  Entered in  error indicates that this episode was started and entered for this
                                  patient by mistake.  

                TECHNICAL DESCR:  Null for a valid Acute Suicidal Crisis episode,  else use 'R' when rollback conditions are met or
                                  'E' if entered in error.  


818.01,7        EPISODE SOURCE         0;7 SET

                                  'A' FOR Auto Adjudication; 
                                  'V' FOR VistA; 
                LAST EDITED:      SEP 18, 2023 
                HELP-PROMPT:      Enter 'A' for Auto adjudication or 'V' for VistA manual adjudication. 
                DESCRIPTION:      Episode source will show if the system uses auto adjudicating algorithms to create this episode
                                  of care for Acute Suicidal Crisis or if the end user manually created this episode of care and it
                                  was saved in VistA.  

                TECHNICAL DESCR:
                                  System enters 'A' for Auto adjudicating or 'V' is entered for a VistA user manual edit.  


818.01,8        LAST COMPACT ACT ADMIN ELIG 0;8 SET

                                  'E' FOR ELIGIBLE; 
                                  'N' FOR NOT ELIGIBLE; 
                                  'U' FOR UNDETERMINED; 
                LAST EDITED:      APR 11, 2024 
                HELP-PROMPT:      Enter the last COMPACT ACT eligibility code from VES. 
                DESCRIPTION:      This is the last COMPACT ACT eligibility status retrieved from the Veterans Health Administration
                                  Enrollment System (VES) for this patient.  

                TECHNICAL DESCR:  This is a set of codes that match the valid entries that VES returns from their VES Web Service
                                  class API call.  Values are Eligible, Not Eligible, or Undetermined.  


818.01,20       INPATIENT EXTENSION    20;0 DATE Multiple #818.02

                DESCRIPTION:
                                  This multiple is used to extend the inpatient benefit.  

                TECHNICAL DESCR:
                                  Multiple file.  


818.02,.01        IP EXTN START DATE     0;1 DATE

                  INPUT TRANSFORM:  S %DT="E" D ^%DT S X=Y K:Y<1 X
                  LAST EDITED:      SEP 20, 2023 
                  HELP-PROMPT:      Enter the date the authorized inpatient extension began. 
                  DESCRIPTION:
                                    The date the authorized inpatient extension began.  

                  TECHNICAL DESCR:
                                    Fileman date only, no time.  The date the extension began.  

                  CROSS-REFERENCE:  818.02^B 
                                    1)= S ^PXCOMP(818,DA(2),10,DA(1),20,"B",$E(X,1,30),DA)=""
                                    2)= K ^PXCOMP(818,DA(2),10,DA(1),20,"B",$E(X,1,30),DA)


818.02,4          IP EXTN BENEFIT END DATE 0;4 DATE

                  INPUT TRANSFORM:  S %DT="E" D ^%DT S X=Y K:Y<1 X
                  LAST EDITED:      JAN 22, 2024 
                  HELP-PROMPT:      Enter the inpatient extension benefit end date. This should be 30 days after the initial start 
                                    of this extension period. Calculated by the system and user entry is discouraged for this 
                                    field. 
                  DESCRIPTION:
                                    The date the patient's inpatient extension period ended.  

                  TECHNICAL DESCR:  Fileman date only, no time. This should be a date calculated by the system and is 30 days total
                                    inpatient extension benefit from the day the extension period began.  


818.02,5          IP EXTN REMAINING DAYS  ;  COMPUTED

                  MUMPS CODE:   X ^DD(818.02,5,9.5) S Y(818.02,5,10)=$G(X) S X=1,Y(818.02,5,11)=$G(X) S X=0,X=$S(Y(818.02,5,3):Y(81
                                8.02,5,10),Y(818.02,5,11):X)
                                9.2 = S Y(818.02,5,1)=$S($D(^PXCOMP(818,D0,10,D1,20,D2,0)):^(0),1:"") S X=$P(Y(818.02,5,1),U,4),Y(8
                                18.02,5,2)=$G(X) N %I,%H,% D NOW^%DTC S X=% S Y=X,X=Y(818.02,5,2),X=X S X=X
                                9.3 = X ^DD(818.02,5,9.2) S X=X>Y,Y(818.02,5,3)=$G(X),Y(818.02,5,4)=$G(X) S X=$P(Y(818.02,5,1),U,4)
                                ,Y(818.02,5,5)=$G(X),Y(818.02,5,6)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.4 = X ^DD(818.02,5,9.3) S Y(818.02,5,7)=$G(X) S X=$P(Y(818.02,5,1),U,4),Y(818.02,5,8)=$G(X),Y(818
                                .02,5,9)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.5 = X ^DD(818.02,5,9.4) S X1=Y(818.02,5,8) S X2=Y(818.02,5,7) S X3=Y(818.02,5,5) S %Y=X3,Y=X2,X2=
                                X S:X>X1 X2=X1,X1=X S:Y>%Y %Y=Y,Y=X3 S:Y>X2 X2=Y S:%YNOW:RANGEDATE(IP EXTN BENEFIT END DATE,NOW,IP EXTN BENEFIT END DATE,NOW
                                ),1:0)
                  LAST EDITED:  SEP 12, 2023 
                  DESCRIPTION:
                                Remaining days in the inpatient extension period.  

                  TECHNICAL DESCR:
                                Computed field for Inpatient extension period days remaining till the Benefit End Date.  


818.02,6          IP EXTN DATE TIME CREATED 0;5 DATE

                  INPUT TRANSFORM:S %DT="ETR" D ^%DT S X=Y K:Y<1 X
                  LAST EDITED:  APR 22, 2024 
                  HELP-PROMPT:  Enter the current date and time this extension is being created. 
                  DESCRIPTION:
                                Date and time this inpatient extension was created.  

                  TECHNICAL DESCR:
                                Fileman date and time.  


818.02,7          IP EXTN START CREATED BY 0;6 POINTER TO NEW PERSON FILE (#200)

                  LAST EDITED:  SEP 12, 2023 
                  HELP-PROMPT:  Enter the person creating this inpatient extension. 
                  DESCRIPTION:
                                Person that created this inpatient extension.  

                  TECHNICAL DESCR:
                                (Required) Pointer to NEW PERSON file (#200).  


818.02,8          IP EXTN START AUTHORIZED BY 0;7 POINTER TO NEW PERSON FILE (#200)

                  LAST EDITED:  SEP 12, 2023 
                  HELP-PROMPT:  If first extension, enter the provider.  All subsequent extensions, enter the Chief of Staff.  
                  DESCRIPTION:  Person that authorized this inpatient extension.  The first extension must be authorized by the
                                provider and all subsequent extensions must be authorized by the Chief of Staff.  

                  TECHNICAL DESCR:
                                (Required) Pointer to NEW PERSON file (#200).  


818.02,9          IP EXTN TYPE OF CARE 0;8 SET

                                '1' FOR MEDICAL; 
                                '2' FOR MENTAL; 
                                '3' FOR BOTH MEDICAL AND MENTAL; 
                  LAST EDITED:  SEP 12, 2023 
                  HELP-PROMPT:  Select the code for the type of care needed, Medical or Mental. 
                  DESCRIPTION:
                                Type of care needed for this inpatient extension.  

                  TECHNICAL DESCR:
                                Set of Codes.  


818.02,10         IP EXTN COMMENT    0;9 FREE TEXT

                  INPUT TRANSFORM:K:$L(X)>245!($L(X)<1) X
                  MAXIMUM LENGTH:   245
                  LAST EDITED:  SEP 20, 2023 
                  HELP-PROMPT:  Enter other comments about this extension. Answer must be 1-245 characters in length. 
                  DESCRIPTION:
                                A free text field for comments about this inpatient extension.  

                  TECHNICAL DESCR:
                                Free text. (1-245) 




818.01,30       OUTPATIENT EXTENSION 30;0 DATE Multiple #818.03

                  DESCRIPTION:
                                This multiple is used to extend the outpatient benefit. 


818.03,.01        OP EXTN START DATE   0;1 DATE

                    INPUT TRANSFORM:S %DT="E" D ^%DT S X=Y K:X<1 X
                    LAST EDITED:  SEP 20, 2023 
                    HELP-PROMPT:  Enter the date the authorized outpatient extension began. 
                    DESCRIPTION:
                                  The date the authorized outpatient extension began.  

                    TECHNICAL DESCR:
                                  Fileman date only, no time.  The date the extension began.  

                    CROSS-REFERENCE:818.03^B 
                                  1)= S ^PXCOMP(818,DA(2),10,DA(1),30,"B",$E(X,1,30),DA)=""
                                  2)= K ^PXCOMP(818,DA(2),10,DA(1),30,"B",$E(X,1,30),DA)


818.03,4          OP EXTN BENEFIT END DATE 0;4 DATE

                    INPUT TRANSFORM:S %DT="E" D ^%DT S X=Y K:Y<1 X
                    LAST EDITED:  JAN 22, 2024 
                    HELP-PROMPT:  Date computed is 30 days from outpatient extension start date. Calculated by the system and user 
                                  entry is discouraged for this field. 
                    DESCRIPTION:
                                  The date the patient's outpatient extension period ended.  

                    TECHNICAL DESCR:
                                  Enter the outpatient extension benefit end date. This should be 90 days after the initial start
                                  of this extension period. Calculated by the system and user entry is discouraged for this field.  


818.03,5          OP EXTN REMAINING DAYS  ;  COMPUTED

                    MUMPS CODE: X ^DD(818.03,5,9.5) S Y(818.03,5,10)=$G(X) S X=1,Y(818.03,5,11)=$G(X) S X=0,X=$S(Y(818.03,5,3):Y(81
                                8.03,5,10),Y(818.03,5,11):X)
                                9.2 = S Y(818.03,5,1)=$S($D(^PXCOMP(818,D0,10,D1,30,D2,0)):^(0),1:"") S X=$P(Y(818.03,5,1),U,4),Y(8
                                18.03,5,2)=$G(X) N %I,%H,% D NOW^%DTC S X=% S Y=X,X=Y(818.03,5,2),X=X S X=X
                                9.3 = X ^DD(818.03,5,9.2) S X=X>Y,Y(818.03,5,3)=$G(X),Y(818.03,5,4)=$G(X) S X=$P(Y(818.03,5,1),U,4)
                                ,Y(818.03,5,5)=$G(X),Y(818.03,5,6)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.4 = X ^DD(818.03,5,9.3) S Y(818.03,5,7)=$G(X) S X=$P(Y(818.03,5,1),U,4),Y(818.03,5,8)=$G(X),Y(818
                                .03,5,9)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.5 = X ^DD(818.03,5,9.4) S X1=Y(818.03,5,8) S X2=Y(818.03,5,7) S X3=Y(818.03,5,5) S %Y=X3,Y=X2,X2=
                                X S:X>X1 X2=X1,X1=X S:Y>%Y %Y=Y,Y=X3 S:Y>X2 X2=Y S:%YNOW:RANGEDATE(OP EXTN BENEFIT END DATE,NOW,OP EXTN BENEFIT END DATE,NOW
                                ),1:0)
                    LAST EDITED: SEP 12, 2023 
                    DESCRIPTION:
                                Remaining days in the outpatient extension period.  

                    TECHNICAL DESCR:
                                Computed field for outpatient extension period days remaining till Benefit end date.  


818.03,6          OP EXTN DATE TIME CREATED 0;5 DATE

                    INPUT TRANSFORM:S %DT="ETR" D ^%DT S X=Y K:Y<1 X
                    LAST EDITED: JUN 06, 2023 
                    HELP-PROMPT:Enter the current date and time this extension is being created. 
                    DESCRIPTION:
                                Date and time this outpatient extension was created.  

                    TECHNICAL DESCR:
                                Fileman date and time.  


818.03,7          OP EXTN START CREATED BY 0;6 POINTER TO NEW PERSON FILE (#200)

                    LAST EDITED: SEP 12, 2023 
                    HELP-PROMPT:Enter the person creating this outpatient extension. 
                    DESCRIPTION:
                                Person that created this outpatient extension.  

                    TECHNICAL DESCR:
                                (Required) Pointer to NEW PERSON file (#200).  


818.03,8          OP EXTN START AUTHORIZED BY 0;7 POINTER TO NEW PERSON FILE (#200)

                    LAST EDITED: AUG 17, 2023 
                    HELP-PROMPT:Enter the provider that is authorizing the first extension or the Chief of Staff that is 
                                authorizing all subsequent extensions.  
                    DESCRIPTION:Person that authorized this outpatient extension.  The first extension must be authorized by the
                                provider and all subsequent extensions must be authorized by the Chief of Staff.  

                    TECHNICAL DESCR:
                                (Required) Pointer to NEW PERSON file (#200).  


818.03,9          OP EXTN TYPE OF CARE 0;8 SET

                                '1' FOR MEDICAL; 
                                '2' FOR MENTAL; 
                                '3' FOR BOTH MEDICAL AND MENTAL; 
                    LAST EDITED: SEP 12, 2023 
                    HELP-PROMPT:Select the code for the type of care needed, Medical or Mental.  
                    DESCRIPTION:
                                Type of care needed for this outpatient extension.  

                    TECHNICAL DESCR:
                                Set of Codes.  


818.03,10         OP EXTN COMMENT    0;9 FREE TEXT

                    INPUT TRANSFORM:K:$L(X)>245!($L(X)<1) X
                    MAXIMUM LENGTH:   245
                    LAST EDITED: SEP 20, 2023 
                    HELP-PROMPT:Enter other comments about this extension. Answer must be 1-245 characters in length. 
                    DESCRIPTION:
                                A free text field for comments about this outpatient extension.  

                    TECHNICAL DESCR:
                                Free text. (245 Characters) 




818.01,40       TREATMENT            40;0 POINTER Multiple #818.04

                    DESCRIPTION:This multiple is used to track all PTF treatment entries that were marked as related to an Acute
                                Suicidal Crisis episode.  

                    TECHNICAL DESCR:
                                Multiple file.  


818.04,.01        PTF                  0;1 POINTER TO PTF FILE (#45)

                      LAST EDITED: SEP 20, 2023 
                      HELP-PROMPT:Enter the PTF record that is related to acute suicidal crisis. 
                      DESCRIPTION:
                                  This PTF file entry was marked as 'YES' this is for an Acute Suicidal Crisis.  

                      CROSS-REFERENCE:818.04^B 
                                  1)= S ^PXCOMP(818,DA(2),10,DA(1),40,"B",$E(X,1,30),DA)=""
                                  2)= K ^PXCOMP(818,DA(2),10,DA(1),40,"B",$E(X,1,30),DA)




818.01,41       VISIT                  41;0 POINTER Multiple #818.141

                      DESCRIPTION:This multiple is used to track VISIT file entries that are related to an Acute Suicidal Crisis
                                  episode.  

                      TECHNICAL DESCR:
                                  Multiple file.  


818.141,.01       VISIT                  0;1 POINTER TO VISIT FILE (#9000010)

                        LAST EDITED: SEP 20, 2023 
                        HELP-PROMPT:Enter the Visit file record that is related to acute suicidal crisis. 
                        DESCRIPTION:
                                    This VISIT file entry was marked as 'YES' this is for an Acute Suicidal Crisis.  

                        TECHNICAL DESCR:
                                    (Required) Pointer to VISIT FILE (#9000010).  

                        CROSS-REFERENCE:818.141^B 
                                    1)= S ^PXCOMP(818,DA(2),10,DA(1),41,"B",$E(X,1,30),DA)=""
                                    2)= K ^PXCOMP(818,DA(2),10,DA(1),41,"B",$E(X,1,30),DA)


818.141,2         TREATMENT FOR FLAG     0;2 SET (BOOLEAN Data Type)

                        LAST EDITED: JAN 03, 2024 
                        HELP-PROMPT:Enter the Treatment For value - Yes/No that this treatment is related to Acute Suicidal Crisis. 
                        DESCRIPTION:This field is a Yes/No value for the Treatment Related - Acute Suicidal Crisis. Enter the
                                    Treatment For value - Yes/No that this treatment is related to Acute Suicidal Crisis.  

                        TECHNICAL DESCR:
                                    This Outpatient encounter by encounter value is captured to share with Integrated Billing and
                                    automate the ability to cancel the first party copays for care furnished for Acute Suicidal
                                    Crisis.  




818.01,42       REMAINING INPATIENT DAYS  ;  COMPUTED

                        MUMPS CODE: X ^DD(818.01,42,9.5) S Y(818.01,42,10)=$G(X) S X=1,Y(818.01,42,11)=$G(X) S X=0,X=$S(Y(818.01,42
                                ,3):Y(818.01,42,10),Y(818.01,42,11):X)
                                9.2 = S Y(818.01,42,1)=$S($D(^PXCOMP(818,D0,10,D1,0)):^(0),1:"") S X=$P(Y(818.01,42,1),U,4),Y(818.0
                                1,42,2)=$G(X) N %I,%H,% D NOW^%DTC S X=% S Y=X,X=Y(818.01,42,2),X=X S X=X
                                9.3 = X ^DD(818.01,42,9.2) S X=X>Y,Y(818.01,42,3)=$G(X),Y(818.01,42,4)=$G(X) S X=$P(Y(818.01,42,1),
                                U,4),Y(818.01,42,5)=$G(X),Y(818.01,42,6)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.4 = X ^DD(818.01,42,9.3) S Y(818.01,42,7)=$G(X) S X=$P(Y(818.01,42,1),U,4),Y(818.01,42,8)=$G(X),Y
                                (818.01,42,9)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.5 = X ^DD(818.01,42,9.4) S X1=Y(818.01,42,8) S X2=Y(818.01,42,7) S X3=Y(818.01,42,5) S %Y=X3,Y=X2
                                ,X2=X S:X>X1 X2=X1,X1=X S:Y>%Y %Y=Y,Y=X3 S:Y>X2 X2=Y S:%YNOW:RANGEDATE(INPATIENT BENEFIT END DATE,NOW,INPATIENT BENEFIT EN
                                D DATE,NOW),1:0)
                        LAST EDITED: SEP 12, 2023 
                        DESCRIPTION:
                                Remaining days of the inpatient benefit.  

                        TECHNICAL DESCR:
                                Computed field for inpatient benefit days remaining.  


818.01,43       REMAINING OUTPATIENT DAYS  ;  COMPUTED

                        MUMPS CODE: X ^DD(818.01,43,9.5) S Y(818.01,43,10)=$G(X) S X=1,Y(818.01,43,11)=$G(X) S X=0,X=$S(Y(818.01,43
                                ,3):Y(818.01,43,10),Y(818.01,43,11):X)
                                9.2 = S Y(818.01,43,1)=$S($D(^PXCOMP(818,D0,10,D1,0)):^(0),1:"") S X=$P(Y(818.01,43,1),U,5),Y(818.0
                                1,43,2)=$G(X) N %I,%H,% D NOW^%DTC S X=% S Y=X,X=Y(818.01,43,2),X=X S X=X
                                9.3 = X ^DD(818.01,43,9.2) S X=X>Y,Y(818.01,43,3)=$G(X),Y(818.01,43,4)=$G(X) S X=$P(Y(818.01,43,1),
                                U,5),Y(818.01,43,5)=$G(X),Y(818.01,43,6)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.4 = X ^DD(818.01,43,9.3) S Y(818.01,43,7)=$G(X) S X=$P(Y(818.01,43,1),U,5),Y(818.01,43,8)=$G(X),Y
                                (818.01,43,9)=$G(X) N %I,%H,% D NOW^%DTC S X=% S X=X
                                9.5 = X ^DD(818.01,43,9.4) S X1=Y(818.01,43,8) S X2=Y(818.01,43,7) S X3=Y(818.01,43,5) S %Y=X3,Y=X2
                                ,X2=X S:X>X1 X2=X1,X1=X S:Y>%Y %Y=Y,Y=X3 S:Y>X2 X2=Y S:%YNOW:RANGEDATE(OUTPATIENT BENEFIT END DATE,NOW,OUTPATIENT BENEFIT
                                 END DATE,NOW),1:0)
                        LAST EDITED: SEP 12, 2023 
                        DESCRIPTION:
                                Remaining days of the outpatient benefit.  

                        TECHNICAL DESCR:
                                Computed field for outpatient benefit days remaining.  





      FILES POINTED TO                      FIELDS

NEW PERSON (#200)                 EPISODES OF CARE:CRISIS END AUTHORIZED BY (#3.1)
                                  INPATIENT EXTENSION:IP EXTN START CREATED BY (#7)
                                  IP EXTN START AUTHORIZED BY (#8)
                                  OUTPATIENT EXTENSION:OP EXTN START CREATED BY (#7)
                                  OP EXTN START AUTHORIZED BY (#8)

PATIENT (#2)                      PATIENT (#.01)

PTF (#45)                         TREATMENT:PTF (#.01)

VISIT (#9000010)                  VISIT:VISIT (#.01)



INPUT TEMPLATE(S):

PRINT TEMPLATE(S):

SORT TEMPLATE(S):

FORM(S)/BLOCK(S):