- DGENUPL6 ;ISA/KWP - PROCESS INCOMING (Z11 EVENT TYPE) HL7 MESSAGES ; 05/07/99
- ;;5.3;REGISTRATION;**232,1015**;Aug 13,1993;Build 21
- ;Phase II Process EGT Consistency Checks before uploading (SRS 6.5.1.3)
- ;
- CHECK(ERRMSG) ;
- ;Description: Check the enrollment record received from HEC
- ;against the current EGT setting,setting type and effective date.
- ;Input:
- ; ERRMSG -passed by reference, if 0 is returned(EGT checks fail) then the ERRMSG "THE ENROLLMENT RECORD DID NOT PASS THE EGT CONSISTENCY CHECKS" is also returned
- ; DGENR -Enrollment array
- ;Output:
- ; if did not pass (1-5) then return error message
- ;Returns
- ; 1 if no current EGT settings
- ; 0 if the EGT checks fail
- ; 2 Enrollment Category of Enrolled (E),status of Verified (2), priority above the current EGT and the enrollment end date is null
- ; 3 Enrollment category of "NOT ENROLLED", status of "Rejected - Fiscal Year", and a priority below the current EGT, and an EGT type of Fiscal Year Change, or "Stop New Enrollments", and enrollment end date > = to the EGT effective date.
- ; 4 Enrollment category of "NOT ENROLLED",status of "Rejected - Mid-Cycle", and priority below the current EGT, and EGT type of Fiscal Year Change, "Mid-Cycle Change", or "Stop New Enrollments", and enrollment end >= to the EGT effective date.
- ; 5 An Enrollment Category of "NOT ENROLLED"; and an enrollment status of "Rejected-Stop Enrolling New Applicants"; and an enrollment priority below the Enrollment Group Threshold (EGT) value; and an EGT setting type of
- ; (2) "Stop New Enrollments During Cycle"; and an enrollment end date >=to the effective date and equal to the application date
- ;
- S ERRMSG=""
- ;get current EGT settings If no current EGT settings return success
- I '$$GET^DGENEGT($$FINDCUR^DGENEGT,.DGEGT) Q 1
- ;
- ;get category for status
- N DGENCAT
- S DGENCAT=$$CATEGORY^DGENA4(,DGENR("STATUS"))
- ;
- ;The following 4 conditions must be met to return success
- ;a) Enrollment Category of Enrolled (E),status of Verified (2), priority above the current EGT and the enrollment end date is null
- I DGENCAT="E",DGENR("STATUS")=2,$$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP")),DGENR("END")="" Q 2
- ;
- ;b) Enrollment category of "NOT ENROLLED", status of "Rejected - Fiscal Year", and a priority below the current EGT, and an EGT type of Fiscal Year Change, or "Stop New Enrollments", and enrollment end date > = to the EGT effective date.
- I DGENCAT="N",DGENR("STATUS")=11,'$$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP")),DGEGT("TYPE")<3,(DGENR("END")+1)>DGEGT("EFFDATE") Q 3
- ;
- ;c) Enrollment category of "NOT ENROLLED",status of "Rejected - Mid-Cycle", and priority below the current EGT, and EGT type of Fiscal Year Change, "Mid-Cycle Change", or "Stop New Enrollments", and enrollment end >= to the
- ;EGT effective date.-
- I DGENCAT="N",DGENR("STATUS")=12,'$$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP")),DGEGT("TYPE"),(DGENR("END")+1)>DGEGT("EFFDATE") Q 4
- ;
- ;d) An Enrollment Category of "NOT ENROLLED"; and an enrollment status of "Rejected-Stop Enrolling New Applicants"; and an enrollment priority below the Enrollment Group Threshold (EGT) value; and an EGT setting type of
- ;(2) "Stop New Enrollments During Cycle"; and an enrollment end date >= to the effective date and equal to the application date
- N DGRESVAL
- I DGENCAT="N",DGENR("STATUS")=13 S DGRESVAL=0 D I DGRESVAL Q 5
- .I '$$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP")),DGEGT("TYPE")=2,(DGENR("END")+1)>DGEGT("EFFDATE"),$P(DGENR("END"),".")=$P(DGENR("APP"),".") S DGRESVAL=1
- ;
- ; return failure because a-d checks were not meet
- EXIT S ERRMSG="THE ENROLLMENT RECORD DID NOT PASS THE EGT CONSISTENCY CHECKS."
- Q 0
- DGENUPL6 ;ISA/KWP - PROCESS INCOMING (Z11 EVENT TYPE) HL7 MESSAGES ; 05/07/99
- +1 ;;5.3;REGISTRATION;**232,1015**;Aug 13,1993;Build 21
- +2 ;Phase II Process EGT Consistency Checks before uploading (SRS 6.5.1.3)
- +3 ;
- CHECK(ERRMSG) ;
- +1 ;Description: Check the enrollment record received from HEC
- +2 ;against the current EGT setting,setting type and effective date.
- +3 ;Input:
- +4 ; ERRMSG -passed by reference, if 0 is returned(EGT checks fail) then the ERRMSG "THE ENROLLMENT RECORD DID NOT PASS THE EGT CONSISTENCY CHECKS" is also returned
- +5 ; DGENR -Enrollment array
- +6 ;Output:
- +7 ; if did not pass (1-5) then return error message
- +8 ;Returns
- +9 ; 1 if no current EGT settings
- +10 ; 0 if the EGT checks fail
- +11 ; 2 Enrollment Category of Enrolled (E),status of Verified (2), priority above the current EGT and the enrollment end date is null
- +12 ; 3 Enrollment category of "NOT ENROLLED", status of "Rejected - Fiscal Year", and a priority below the current EGT, and an EGT type of Fiscal Year Change, or "Stop New Enrollments", and enrollment end date > = to the EGT effective date.
- +13 ; 4 Enrollment category of "NOT ENROLLED",status of "Rejected - Mid-Cycle", and priority below the current EGT, and EGT type of Fiscal Year Change, "Mid-Cycle Change", or "Stop New Enrollments", and enrollment end >= to the EGT effective date.
- +14 ; 5 An Enrollment Category of "NOT ENROLLED"; and an enrollment status of "Rejected-Stop Enrolling New Applicants"; and an enrollment priority below the Enrollment Group Threshold (EGT) value; and an EGT setting type of
- +15 ; (2) "Stop New Enrollments During Cycle"; and an enrollment end date >=to the effective date and equal to the application date
- +16 ;
- +17 SET ERRMSG=""
- +18 ;get current EGT settings If no current EGT settings return success
- +19 IF '$$GET^DGENEGT($$FINDCUR^DGENEGT,.DGEGT)
- QUIT 1
- +20 ;
- +21 ;get category for status
- +22 NEW DGENCAT
- +23 SET DGENCAT=$$CATEGORY^DGENA4(,DGENR("STATUS"))
- +24 ;
- +25 ;The following 4 conditions must be met to return success
- +26 ;a) Enrollment Category of Enrolled (E),status of Verified (2), priority above the current EGT and the enrollment end date is null
- +27 IF DGENCAT="E"
- IF DGENR("STATUS")=2
- IF $$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP"))
- IF DGENR("END")=""
- QUIT 2
- +28 ;
- +29 ;b) Enrollment category of "NOT ENROLLED", status of "Rejected - Fiscal Year", and a priority below the current EGT, and an EGT type of Fiscal Year Change, or "Stop New Enrollments", and enrollment end date > = to the EGT effective date.
- +30 IF DGENCAT="N"
- IF DGENR("STATUS")=11
- IF '$$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP"))
- IF DGEGT("TYPE")<3
- IF (DGENR("END")+1)>DGEGT("EFFDATE")
- QUIT 3
- +31 ;
- +32 ;c) Enrollment category of "NOT ENROLLED",status of "Rejected - Mid-Cycle", and priority below the current EGT, and EGT type of Fiscal Year Change, "Mid-Cycle Change", or "Stop New Enrollments", and enrollment end >= to the
- +33 ;EGT effective date.-
- +34 IF DGENCAT="N"
- IF DGENR("STATUS")=12
- IF '$$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP"))
- IF DGEGT("TYPE")
- IF (DGENR("END")+1)>DGEGT("EFFDATE")
- QUIT 4
- +35 ;
- +36 ;d) An Enrollment Category of "NOT ENROLLED"; and an enrollment status of "Rejected-Stop Enrolling New Applicants"; and an enrollment priority below the Enrollment Group Threshold (EGT) value; and an EGT setting type of
- +37 ;(2) "Stop New Enrollments During Cycle"; and an enrollment end date >= to the effective date and equal to the application date
- +38 NEW DGRESVAL
- +39 IF DGENCAT="N"
- IF DGENR("STATUS")=13
- SET DGRESVAL=0
- Begin DoDot:1
- +40 IF '$$ABOVE^DGENEGT1(DGENR("PRIORITY"),DGENR("SUBGRP"),DGEGT("PRIORITY"),DGEGT("SUBGRP"))
- IF DGEGT("TYPE")=2
- IF (DGENR("END")+1)>DGEGT("EFFDATE")
- IF $PIECE(DGENR("END"),".")=$PIECE(DGENR("APP"),".")
- SET DGRESVAL=1
- End DoDot:1
- IF DGRESVAL
- QUIT 5
- +41 ;
- +42 ; return failure because a-d checks were not meet
- EXIT SET ERRMSG="THE ENROLLMENT RECORD DID NOT PASS THE EGT CONSISTENCY CHECKS."
- +1 QUIT 0