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

AUMSCBU.m

Go to the documentation of this file.
AUMSCBU  ;IHS/OIT/NKD - SCB UPDATE - UTILITY 12/07/2012 ;
 ;;19.0;TABLE MAINTENANCE;**1**;SEP 04,2018;Build 1
 ; 03/12/14 - Modified Inactivate processing for Education tables
 ; 05/28/14 - Added Tribe pre-routine for Inactivate processing
 ;          - Corrected condition to trigger Patient Current Community change
 ; 12/16/14 - Removed old/unused code
 ; 05/29/15 - Added Clinic Stop Inactivate processing
 ;          - Added Clinic report
 ; 12/22/15 - Added Health Factor tag for New processing
 ; 08/22/16 - Modified Inactivate processing for Patient Status Code
 ; 12/04/17 - Removed Health Factor IEN restriction
 ; 03/15/18 - Added Revenue Codes table Pre and New processing
 ;
 Q
 ; CUSTOM PRE-ROUTINES
CNTYPRE ; EP - COUNTY - INPUT TRANSFORMS
 S L1=P1_P2
 S:P1]"" P1A=$O(^DIC(5,"C",P1,0))
 S P7=$S(P7]"":P7-17000000,1:"")
 S:P7]"" AUMA="INA",INA=1
 I 'P1A,'INA D ERR^AUMSCBD("Invalid STATE code: "_P1)
 Q
COMPRE ; EP - COMMUNITY - INPUT TRANSFORMS
 N CNT,TEXT,AUMR
 S L1=P1_P2_P3
 S:P1]"" P1A=$O(^DIC(5,"C",P1,0))
 K AUMR F CNT=1:1 S TEXT=$P($T(CNTY+CNT^AUMSCBM),";;",2) Q:TEXT="END"  S:TEXT="SEA" AUMR=$P($T(CNTY+CNT^AUMSCBM),";;",3)
 I $D(AUMR) D
 . N L1
 . S L1=P1_P2
 . S:P2]"" P2A=$$SEARCH^AUMSCBD(AUMR)
 S:P5]"" P5A=$O(^AUTTAREA("C",P5,0))
 K AUMR F CNT=1:1 S TEXT=$P($T(SU+CNT^AUMSCBM),";;",2) Q:TEXT="END"  S:TEXT="SEA" AUMR=$P($T(SU+CNT^AUMSCBM),";;",3)
 I $D(AUMR) D
 . N L1
 . S L1=P5_P6
 . S:P6]"" P6A=$$SEARCH^AUMSCBD(AUMR)
 S P7=$S(P7]"":P7-17000000,1:"")
 S:P7]"" AUMA="INA",INA=1
 I 'P1A,'INA D ERR^AUMSCBD("Invalid STATE code: "_P1)
 I 'P2A,'INA D ERR^AUMSCBD("Invalid COUNTY code: "_P1_P2)
 I 'P5A,'INA D ERR^AUMSCBD("Invalid AREA code: "_P5)
 I 'P6A,'INA D ERR^AUMSCBD("Invalid SERVICE UNIT code: "_P5_P6)
 Q
EDTPRE ; EP - EDUCATION TOPIC - INPUT TRANSFORMS AND LOOKUP
 N CNT,AUMR
 S P1=$$CLEAN^AUMSCBD(P1),P2=$$CLEAN^AUMSCBD(P2),P3=$$CLEAN^AUMSCBD(P3),P7=$S(P7]"":P7-17000000,1:"")  ; IHS/OIT/NKD AUM*14.0*2
 S P1A=P3_"-"_P1,P2A=P3_"-"_P2,P3A=$O(^AUTTEDMT("B",P3,0))
 S:P7]"" AUMA="INA",INA=1  ; IHS/OIT/NKD AUM*14.0*2
 D FIND^DIC(9999999.09,"","@;.01","PX",P1A,,"B",,,"AUMR")
 S CNT=$P($G(AUMR("DILIST",0)),U,1)
 S AUMI=$S(CNT=1:$P($G(AUMR("DILIST",1,0)),U,1),CNT>1:$P($G(AUMR("DILIST",$P($G(AUMR("DILIST",0)),U,1),0)),U,1),1:"")
 I 'AUMI  D
 . K AUMR
 . D FIND^DIC(9999999.09,"","@;.01","PX",P2A,,"C","I ($P(^(0),U,3)'=1),($P(^(0),U)=$$UP^XLFSTR($P(^(0),U)))",,"AUMR")
 . S CNT=$P($G(AUMR("DILIST",0)),U,1)
 . S AUMI=$S(CNT=1:$P($G(AUMR("DILIST",1,0)),U,1),CNT>1:$P($G(AUMR("DILIST",$P($G(AUMR("DILIST",0)),U,1),0)),U,1),1:"")
 Q
LOCPRE ; EP - LOCATION - INPUT TRANSFORMS
 N CNT,TEXT,AUMR
 S L1=P1_P2_P3
 S:P1]"" P1A=$O(^AUTTAREA("C",P1,0))
 F CNT=1:1 S TEXT=$P($T(SU+CNT^AUMSCBM),";;",2) Q:TEXT="END"  S:TEXT="SEA" AUMR=$P($T(SU+CNT^AUMSCBM),";;",3)
 I $D(AUMR) D
 . N L1
 . S L1=P1_P2
 . S:P2]"" P2A=$$SEARCH^AUMSCBD(AUMR)
 S P7=$S(P7]"":P7-17000000,1:"")
 S:P7]"" AUMA="INA",INA=1
 I 'P1A,'INA D ERR^AUMSCBD("Invalid AREA code: "_P1)
 I 'P2A,'INA D ERR^AUMSCBD("Invalid SERVICE UNIT code: "_P1_P2)
 Q
MEASPRE ; EP - MEASUREMENT TYPE - INPUT TRANSFORMS
 S P6=$TR(P6,"|",U)
 Q
MJTPRE ; EP - EDUCATION MAJOR TOPIC - INPUT TRANSFORMS
 S P1=$$CLEAN^AUMSCBD(P1),P2=$$CLEAN^AUMSCBD(P2),P7=$S(P7]"":P7-17000000,1:"")  ; IHS/OIT/NKD AUM*14.0*2
 S:P7]"" AUMA="INA",INA=1  ; IHS/OIT/NKD AUM*14.0*2
 Q
RESPRE ; EP - RESERVATION - INPUT TRANSFORMS
 S:P3]"" P3A=$O(^AUTTAREA("C",P3,0))
 S:P4]"" P4A=$O(^DIC(5,"C",P4,0))
 I 'P3A,'INA D ERR^AUMSCBD("Invalid AREA code: "_P3)
 I 'P4A,'INA D ERR^AUMSCBD("Invalid STATE code: "_P4)
 Q
STNMPRE ; EP - STATION NUMBER - INPUT TRANSFORMS AND LOOKUP
 S:P2]"" P2A=$O(^AUTTLOC("C",P2,0))
 Q:'P2A&INA
 I 'P2A D ERR^AUMSCBD("LOCATION not found: "_P2) Q
 Q:'$D(^DIC(4,P2A,0))&INA
 I '$D(^DIC(4,P2A,0)) D ERR^AUMSCBD("INSTITUTION not found: "_P2) Q
 S AUMI=P2A
 Q
SUPRE ; EP - SERVICE UNIT - INPUT TRANSFORMS
 S L1=P1_P2
 S:P1]"" P1A=$O(^AUTTAREA("C",P1,0))
 S P7=$S(P7]"":P7-17000000,1:"")
 S:P7]"" AUMA="INA",INA=1
 I 'P1A,'INA D ERR^AUMSCBD("Invalid AREA code: "_P1)
 Q
STPRE ; EP - STATE - LOOKUP
 N CNT,AUMR
 S P7=$S(P7]"":P7-17000000,1:"")
 S:P7]"" AUMA="INA",INA=1
 D FIND^DIC(5,"","@;.01","PX",P1,,"B",,,"AUMR")
 S CNT=$P($G(AUMR("DILIST",0)),U,1)
 S AUMI=$S(CNT=1:$P($G(AUMR("DILIST",1,0)),U,1),CNT>1:$P($G(AUMR("DILIST",$P($G(AUMR("DILIST",0)),U,1),0)),U,1),1:"")
 I 'AUMI  D
 . K AUMR
 . D FIND^DIC(5,"","@;.01","PX",P3,,"C","I $P(^(0),U,3)=P3",,"AUMR") ; SCREEN TO REMOVE ENTRIES THAT DON'T MATCH
 . S CNT=$P($G(AUMR("DILIST",0)),U,1)
 . S AUMI=$S(CNT=1:$P($G(AUMR("DILIST",1,0)),U,1),CNT>1:$P($G(AUMR("DILIST",$P($G(AUMR("DILIST",0)),U,1),0)),U,1),1:"")
 Q
HFPRE ; EP - HEALTH FACTOR - INPUT TRANSFORMS
 N CNT,AUMR
 ; SEARCH FOR ACTIVE CATEGORIES MATCHING NAME
 D FIND^DIC(9999999.64,"","@;.01","PX",P3,,"B","I $P(^(0),U,10)'=""F"",$P(^(0),U,13)'=""1""",,"AUMR")
 S CNT=$P($G(AUMR("DILIST",0)),U,1)
 S P3A=$S(CNT=1:$P($G(AUMR("DILIST",1,0)),U,1),CNT>1:$P($G(AUMR("DILIST",$P($G(AUMR("DILIST",0)),U,1),0)),U,1),1:"")
 ; IF NO MATCHES FOUND, SEARCH FOR CATEGORIES MATCHING NAME
 I 'P3A  D
 . K AUMR
 . D FIND^DIC(9999999.64,"","@;.01","PX",P3,,"B","I $P(^(0),U,10)'=""F""",,"AUMR")
 . S CNT=$P($G(AUMR("DILIST",0)),U,1)
 . S P3A=$S(CNT=1:$P($G(AUMR("DILIST",1,0)),U,1),CNT>1:$P($G(AUMR("DILIST",$P($G(AUMR("DILIST",0)),U,1),0)),U,1),1:"")
 ;I 'P3A,'INA D ERR^AUMSCBD("Invalid CATEGORY code: "_P3)  ; IHS/OIT/NKD AUM*16.0*1 - LOGIC CHANGE FOR HF CATEGORY CREATION
 I 'P3A,'INA,P4'="C" D ERR^AUMSCBD("Invalid CATEGORY code: "_P3)
 Q
LANGPRE ; EP - LANGUAGES - INPUT TRANSFORMS
 S P2=$$UP^XLFSTR(P2),P3=$$UP^XLFSTR(P3)
 Q
PSCPRE ; EP - PATIENT STATUS CODE - INPUT TRANSFORMS
 S P1A=P1_" "
 S:P4]"" AUMA="INA",INA=1  ; IHS/OIT/NKD AUM*16.0*4 - INACTIVATE PROCESSING
 Q
AREAPRE ; EP - AREA - INPUT TRANSFORMS
 S P7=$S(P7]"":P7-17000000,1:"")
 S:P7]"" AUMA="INA",INA=1
 Q
CLINPRE ; EP - CLINIC STOP - INPUT TRANSFORMS
 S P4A=$S(P4="Y":ONE,P4="N":AT,1:"")
 S P7=$S(P7]"":P7-17000000,1:"")  ; IHS/OIT/NKD AUM*15.0*3 - INACTIVATE PROCESSING
 S:P7]"" AUMA="INA",INA=1,P2="x"_P2
 Q
 ; IHS/OIT/NKD AUM*14.0*3 - ADDED TRIBE PRE
TRIPRE ; EP - TRIBE - INPUT TRANSFORMS
 S P7=$S(P7]"":"Y",1:"")
 S:P7]"" AUMA="INA",INA=1
 Q
 ; IHS/OIT/NKD AUM*18.0*2 - ADDED REVENUE CODES PRE
REVPRE ; EP - REVENUE CODES - CREATE REVENUE CODES ENTRY
 S P1A=+P1 S:P1A AUMI=$S($D(^AUTTREVN(P1A)):P1A,1:0)
 S:P7 AUMA="INA",INA=1
 Q
 ; CUSTOM NEW-ROUTINES
LOCNEW ; EP - LOCATION - CREATE INSTITUTION AND LOCATION ENTRIES
 N FDA,NEWIEN,ERR,DINUM
 F DINUM=+$P(^DIC(4,0),U,3):1 Q:'$D(^DIC(4,DINUM))&('$D(^AUTTLOC(DINUM)))  I DINUM>99999 D ERR^AUMSCBD("SYSTEM ERROR - DINUM FOR LOC/INSTITUTION TOO BIG") Q
 Q:DINUM>99999
 S FDA(4,"+1,",.01)=P4
 S NEWIEN(1)=DINUM
 D UPDATE^DIE(,"FDA","NEWIEN","ERR")
 I $D(ERR) D ERR^AUMSCBD("SYSTEM ERROR - New INSTITUTION failed") Q
 S AUMI=NEWIEN(1)
 I '$D(^AUTTLOC(AUMI)) D
 . K FDA,NEWIEN,ERR
 . S FDA(9999999.06,"+1,",.01)=AUMI
 . S FDA(9999999.06,"+1,",.04)=P1A
 . S FDA(9999999.06,"+1,",.07)=P3
 . S FDA(9999999.06,"+1,",.32)=P6
 . S NEWIEN(1)=AUMI
 . D UPDATE^DIE(,"FDA","NEWIEN","ERR")
 . I $D(ERR) D ERR^AUMSCBD("SYSTEM ERROR - New LOCATION failed") Q
 . I AUMI'=NEWIEN(1) D ERR^AUMSCBD("SYSTEM ERROR - INSTITUTION/LOCATION IEN mismatch") Q
 Q
 ; IHS/OIT/NKD AUM*16.0*1 - ADDED HEALTH FACTORS NEW
HFNEW ; EP - HEALTH FACTORS - CREATE HEALTH FACTOR ENTRY
 N FDA,NEWIEN,ERR,DINUM
 ;F DINUM=+$P($G(^AUTTHF(0)),U,3):1:100000 Q:'$D(^AUTTHF(DINUM))  I DINUM>99999 D ERR^AUMSCBD("SYSTEM ERROR - DINUM FOR HEALTH FACTOR TOO BIG") Q
 F DINUM=+$P($G(^AUTTHF(0)),U,3):1 Q:'$D(^AUTTHF(DINUM))  ;IHS/OIT/NKD AUM*18.0*1 REMOVED IEN RESTRICTION
 ;Q:DINUM>99999
 S FDA(9999999.64,"+1,",.01)=P1
 S FDA(9999999.64,"+1,",.03)=$S('P3A:DINUM,1:P3A)
 S FDA(9999999.64,"+1,",.1)=P4
 S NEWIEN(1)=DINUM
 D UPDATE^DIE(,"FDA","NEWIEN","ERR")
 I $D(ERR) D ERR^AUMSCBD("SYSTEM ERROR - New HEALTH FACTOR failed") Q
 S AUMI=NEWIEN(1)
 Q
 ; IHS/OIT/NKD AUM*18.0*2 - ADDED REVENUE CODES NEW
REVNEW ; EP - REVENUE CODES - CREATE REVENUE CODES ENTRY
 N FDA,NEWIEN,ERR,DINUM
 S FDA(9999999.72,"+1,",.01)=P1
 S FDA(9999999.72,"+1,",1)=P2
 S FDA(9999999.72,"+1,",2)=P7
 S FDA(9999999.72,"+1,",3)=P3
 S NEWIEN(1)=$S($G(AUMI):AUMI,1:P1A)
 D UPDATE^DIE(,"FDA","NEWIEN","ERR")
 I $D(ERR) D ERR^AUMSCBD("SYSTEM ERROR - New REVENUE CODES failed") Q
 S AUMI=NEWIEN(1)
 Q
 ; CUSTOM POST-ROUTINES
COMPOST ; EP - COMMUNITY - UPDATE PATIENT FILE CURRENT COMMUNITY IF NAME CHANGE
 N CNT,CNT2,CNT3,AUMR
 I $D(AUMD("DSP")) D DISP^AUMSCBD
 ;F CNT=1:1:$L(AUML,U) S AUMR=$P(AUML,U,CNT) Q:'AUMR  D  ; IHS/OIT/NKD AUM*14.0*3 - CORRECTED CONDITION
 F CNT=1:1:$L(AUML,U) S AUMR=$P(AUML,U,CNT) Q:AUMR']""  D
 . Q:$P(AUMR,"|",1)'="NAME"
 . Q:$P(AUMR,"|",2)']""  ; IHS/OIT/NKD AUM*14.0*3 - CORRECTED CONDITION
 . S (CNT2,CNT3)=0
 . F  S CNT2=$O(^AUPNPAT("AC",$P(AUMR,"|",2),CNT2)) Q:'CNT2  D
 . . Q:$$COMMRES^AUPNPAT(CNT2)'=L1
 . . N FDA,ERR
 . . S FDA(9000001,CNT2_",",1118)=P4
 . . D UPDATE^DIE(,"FDA",,"ERR")
 . . S CNT3=CNT3+1
 . I CNT3 D RSLT^AUMSCBD("  Updated "_CNT3_" PATIENT(s) Current Community due to COMMUNITY name change")
 Q
EDTPOST ; EP - EDUCATION TOPIC - INACTIVATE LOCAL DUPLICATES
 N FDA,CNT,CNT2,AUMR
 I $D(AUMD("DSP")) D DISP^AUMSCBD
 D FIND^DIC(9999999.09,"","@;.01;1;.06","PX",P1A,,"B","I ($P(^(0),U,3)'=1),(Y'=AUMI)",,"AUMR")
 S CNT=$P($G(AUMR("DILIST",0)),U,1)
 I CNT>0 D RSLT^AUMSCBD("Duplicate Names found") ; FOR : "_P3_$J("",13-$L(P3))_P2)
 F CNT2=1:1:CNT  D
 . N L
 . S L=$P(AUMR("DILIST",CNT2,0),U,3)_$J("",13-$L($P(AUMR("DILIST",CNT2,0),U,3)))_$P(AUMR("DILIST",CNT2,0),U,2)
 . S FDA(9999999.09,$P(AUMR("DILIST",CNT2,0),U,1)_",",.03)="1" ; Inactive Flag (.03)
 . D RSLT^AUMSCBD($J("",2)_"Local duplicate inactivated : "_L)
 I CNT D UPDATE^DIE(,"FDA",)
 K FDA,AUMR
 D FIND^DIC(9999999.09,"","@;.01;1;.06","PX",P2A,,"C","I ($P(^(0),U,3)'=1),(Y'=AUMI)",,"AUMR")
 S CNT=$P($G(AUMR("DILIST",0)),U,1)
 I CNT>0 D RSLT^AUMSCBD("Duplicate Mnemonics found") ; FOR : "_P3_$J("",13-$L(P3))_P2)
 F CNT2=1:1:CNT  D
 . N L
 . S L=$P(AUMR("DILIST",CNT2,0),U,3)_$J("",13-$L($P(AUMR("DILIST",CNT2,0),U,3)))_$P(AUMR("DILIST",CNT2,0),U,2)
 . S FDA(9999999.09,$P(AUMR("DILIST",CNT2,0),U,1)_",",.03)="1" ; Inactive Flag (.03)
 . D RSLT^AUMSCBD($J("",2)_"Local duplicate inactivated : "_L)
 I CNT D UPDATE^DIE(,"FDA",)
 Q
LOCPOST ; EP - LOCATION - UPDATE INSTITUTION NAME
 N FDA,ERR,AUMR,AUMI2
 S AUMI2=$P(^AUTTLOC(AUMI,0),U,1)
 I '$D(^DIC(4,AUMI2,0)) D ERR^AUMSCBD("INSTITUTION not found") Q
 S AUMR=$$GET1^DIQ(4,AUMI2,.01,"I")
 S FDA(4,AUMI2_",",.01)=P4
 D UPDATE^DIE(,"FDA",,"ERR")
 I $D(ERR) D ERR^AUMSCBD("SYSTEM ERROR - Update failed") Q
 S:AUMR'=$$GET1^DIQ(4,AUMI2,.01,"I") AUMM=$S(AUMM']"":"MOD :",1:AUMM),AUML=AUML_"NAME|"_AUMR_"|"_P4_U
 I $D(AUMD("DSP")) D DISP^AUMSCBD
 Q
PSCPOST ; EP - PATIENT STATUS CODE - (TEMPORARY FIX) REMOVE INACTIVE FLAG IN OLD GLOBAL
 I $D(AUMD("DSP")) D DISP^AUMSCBD
 Q:'$D(^AUTPSC(AUMI,0))
 ;S $P(^AUTPSC(AUMI,0),U,3)=""  ; IHS/OIT/NKD AUM*16.0*4 - INACTIVATE PROCESSING
 S $P(^AUTPSC(AUMI,0),U,3)=$S(INA:1,1:"")
 Q
PKLST ; EP - Check to see what EHR pick lists might be affected
 N PKNAM,PK1,PK2,PK3,PXEDT,AUMDSP
 D RSLT^AUMSCBD(""),RSLT^AUMSCBD("Displaying EHR PICKLISTS containing inactive EDUCATION TOPICS")
 S PKNAM="",PK1=0
 F  S PK1=$O(^BGOEDTPR(PK1)) Q:PK1'?1N.N  D
 . S AUMDSP=1
 . S PK2="" F  S PK2=$O(^BGOEDTPR(PK1,PK2)) Q:PK2'?1N.N  D
 . . S:PK2=0 PKNAM=$P(^BGOEDTPR(PK1,PK2),U,1)
 . . S PK3=0 F  S PK3=$O(^BGOEDTPR(PK1,PK2,PK3)) Q:PK3'?1N.N  D
 . . . S PXEDT=$P($G(^BGOEDTPR(PK1,PK2,PK3,0)),U,1)
 . . . Q:PXEDT=""
 . . . Q:$P($G(^AUTTEDT(PXEDT,0)),U,3)'=1
 . . . N AUMMNE,AUMNAM,AUMINA
 . . . S AUMMNE=$P(^AUTTEDT(PXEDT,0),U,2),AUMNAM=$P(^AUTTEDT(PXEDT,0),U,1),AUMINA=$$FMTE^XLFDT($P(^AUTTEDT(PXEDT,0),U,5))
 . . . I AUMDSP D RSLT^AUMSCBD(""),RSLT^AUMSCBD("Inactive topic(s) found in EHR PICKLIST: "_$P(^BGOEDTPR(PK1,0),U,1)) S AUMDSP=0
 . . . D RSLT^AUMSCBD($J("",4)_AUMMNE_$J("",13-$L(AUMMNE))_"'"_$E(AUMNAM,1,47)_"'"_$J("",49-$L($E(AUMNAM,1,47)))_AUMINA)
 . . . Q
 . . Q
 . Q
 Q
 ; IHS/OIT/NKD AUM*15.0*3 - ADDED CLINIC REPORT
CLINIC  ; EP - Check to see what HOSPITAL LOCATIONS might be affected by inactive CLINIC STOP codes
 N STOP,DATE,CLINIC,RES
 D RSLT^AUMSCBD(""),RSLT^AUMSCBD("  The following report displays CLINIC STOP file (#40.7) entries next to their")
 D RSLT^AUMSCBD("inactivation date. Appropriate measures should be taken to review this list and")
 D RSLT^AUMSCBD("make any necessary local modifications. For example, if visits are created using")
 D RSLT^AUMSCBD("inactive CLINIC STOP codes, it might require a review of the CLINIC STOP field")
 D RSLT^AUMSCBD("in the HOSPITAL LOCATION file (#44). This particular scenario is included in the")
 D RSLT^AUMSCBD("report and displays after each CLINIC STOP code.")
 D RSLT^AUMSCBD(""),RSLT^AUMSCBD("***  This report also runs at the programmer prompt with: D CLINIC^AUMSCBU   ***")
 D RSLT^AUMSCBD(""),RSLT^AUMSCBD("       CODE NAME (INACTIVATION DATE)")
 D RSLT^AUMSCBD("              HOSPITAL LOCATION - DIVISION (IEN)")
 D RSLT^AUMSCBD("       ==== ========================")
 S STOP=0 F  S STOP=$O(^DIC(40.7,STOP)) Q:'STOP  D
 . S DATE=$$GET1^DIQ(40.7,STOP,2,"I") Q:'DATE
 . S RES=$J("",7)_$$GET1^DIQ(40.7,STOP,1,"I"),$E(RES,13,80)=$$GET1^DIQ(40.7,STOP,.01,"I")_" ("_$$FMTE^XLFDT(DATE,5)_")"
 . D RSLT^AUMSCBD(RES)
 . S CLINIC=0 F  S CLINIC=$O(^SC("ASTOP",STOP,CLINIC)) Q:'CLINIC  D
 . . Q:$P($G(^SC(CLINIC,0)),U,7)'=STOP  Q:$$GET1^DIQ(44,CLINIC,2,"I")'="C"
 . . Q:$S($P($G(^SC(CLINIC,"I")),U)="":1,$P(^("I"),U)>DATE:1,$P(^("I"),U,2)="":0,$P(^("I"),U,2)'>DATE:1,1:0)
 . . S RES=$J("",14)_$$GET1^DIQ(44,CLINIC,.01,"I")_" - "_$$GET1^DIQ(44,CLINIC,3)_" (IEN "_CLINIC_")"
 . . D RSLT^AUMSCBD(RES)
 Q