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

AUMDO1C.m

Go to the documentation of this file.
AUMDO1C ; IHS/OIRM/DSD/JCM,AEF - UPDATE MULTIPLE SUBFILES FOR ICD9 AND ICD0 ;  [ 12/03/1998   2:35 PM ]
 ;;99.1;ICD UPDATE;;DEC 03, 1998
 W !!,"ENTRY NOT PERMITTED HERE (^AUMDO1C)",! Q
SPECNOTE ; SPECIAL NOTE FOR PROGRAMMERS
 ; ***NOTE - ALL VARIABLES ARE IN THE AUMDO("variable name') ARRAY
 ;
EN ; ENTRY POINT FROM CALLSUB+1^AUMDO1B
 F AUMDO("MULT")="9999999.21","""DR""","""MDC""" D:$D(@(AUMDO("UPD GL REF")_AUMDO("UPD DFN")_","_AUMDO("MULT")_")")) MULT
 Q  ; RETURN TO ^AUMDO1B
MULT ; UPDATE MULTIPLE IN ICD GLOBAL DETERMINED BY AUMDO("MULT")
 ; REMOVE OLD ENTRIES IF THEY EXIST
 S AUMDO("MULT LIT")=$S(AUMDO("MULT")[9:"KWD",AUMDO("MULT")["M":"MDC",1:"DRG") ; SET MULTIPLE NAME
 I '+AUMDO("MULT"),$D(@(AUMDO("ICD GL REF")_AUMDO("ICD DFN")_","_AUMDO("MULT")_")")) D MULTRMV
 ; LOOP THROUGH UPDATE MULTIPLE
 D:$Y>55 HDR^AUMDO W !,?27,"Adding new "_AUMDO("MULT LIT")_" entries"
 S AUMDO("MULT DFN")=0
 F AUMDO("L")=0:0 S AUMDO("MULT DFN")=$O(@(AUMDO("UPD GL REF")_AUMDO("UPD DFN")_","_AUMDO("MULT")_","_AUMDO("MULT DFN")_")")) Q:'+AUMDO("MULT DFN")  D MULTSET
 Q
MULTSET ;
 S (X,AUMDO("MULT VAL"))=$P(@(AUMDO("UPD GL REF")_AUMDO("UPD DFN")_","_AUMDO("MULT")_","_AUMDO("MULT DFN")_",0)"),U)
 S:+X X="`"_X
 I $D(@(AUMDO("ICD GL REF")_AUMDO("ICD DFN")_",9999999.21,""B"","""_AUMDO("MULT VAL")_""")")) D:$Y>55 HDR^AUMDO W !,?30,AUMDO("MULT VAL")_" exists, skipped" Q
 S DIC=AUMDO("ICD GL REF")_AUMDO("ICD DFN")_","_AUMDO("MULT")_","
 S DIC(0)="LF",DA(1)=AUMDO("ICD DFN")
 S DIC("P")=$S(AUMDO("MULT")[9:+$P(@(AUMDO("DIC(P) KWD")),U,2),AUMDO("MULT")["DR":+$P(@(AUMDO("DIC(P) DRG")),U,2),1:+$P(@(AUMDO("DIC(P) MDC")),U,2))
 S DLAYGO=$S(AUMDO("MULT")[9:AUMDO("DLAYGO KWD"),AUMDO("MULT")["DR":AUMDO("DLAYGO DRG"),1:AUMDO("DLAYGO MDC"))
 S DIADD=1
 ; I AUMDO("ICD9"),$P(@(AUMDO("UPD GL REF")_AUMDO("UPD DFN")_","_AUMDO("MULT")_","_AUMDO("MULT DFN")_",0)"),U,2)]"" S DIC("DR")="1////"_$P(^(0),U,2)
 I AUMDO("MULT")["M" D
 . Q:$G(^AUMDOTMP(AUMDO("UPD DFN"),"MDC",AUMDO("MULT DFN"),"DRG"))=""  ;AEF 2981030
 . S DIC("DR")=""
 . F AUMDO("DRG FLD")=1:1:6 D
 .. S DIC("DR")=DIC("DR")_AUMDO("DRG FLD")_"///"_$S($P($G(^AUMDOTMP(AUMDO("UPD DFN"),"MDC",AUMDO("MULT DFN"),"DRG")),U,AUMDO("DRG FLD"))]"":"/"_$P($G(^("DRG")),U,AUMDO("DRG FLD")),1:"@")_";"  ;AEF 2981030
 . S DIC("DR")=$E(DIC("DR"),1,$L(DIC("DR"))-1) ; REMOVE SEMICOLON
 D ^DIC
 K DIC,DLAYGO,DIADD,DR
 I Y<1 D:$Y>55 HDR^AUMDO W !,?30,AUMDO("MULT VAL")_" not added" Q
 D:$Y>55 HDR^AUMDO W:AUMDO("MULT")[9 !,?30,AUMDO("MULT VAL")_" added"
 I AUMDO("MULT")["M" D
 . W !,?30,"MDC "_AUMDO("MULT VAL")_" added"
 . Q:$G(^AUMDOTMP(AUMDO("UPD DFN"),"MDC",AUMDO("MULT DFN"),"DRG"))=""  ;AEF 2981030
 . W !,?30,"Adding related DRG entries for MDC code "_AUMDO("MULT DFN")
 . F AUMDO("DRG FLD")=1:1:6 D
 .. Q:$P($G(^AUMDOTMP(AUMDO("UPD DFN"),"MDC",AUMDO("MULT DFN"),"DRG")),U,AUMDO("DRG FLD"))=""  ;AEF 2981030
 .. W !,?33,"DRG "_$P($G(^AUMDOTMP(AUMDO("UPD DFN"),"MDC",AUMDO("MULT DFN"),"DRG")),U,AUMDO("DRG FLD"))_" added"  ;AEF 2981030
 Q
MULTRMV ; REMOVE THE ICD SUBFILE ENTRIES FOR THIS ENTRY(DRG OR MDC)
 D:$Y>55 HDR^AUMDO W !,?27,"Removing old "_AUMDO("MULT LIT")_" entries"
 S DA=0
 F AUMDO("L")=0:0 S DA=$O(@(AUMDO("ICD GL REF")_AUMDO("ICD DFN")_","_AUMDO("MULT")_","_DA_")")) Q:'+DA  S DA(1)=AUMDO("ICD DFN"),DIK=AUMDO("ICD GL REF")_AUMDO("ICD DFN")_","_AUMDO("MULT")_"," D ^DIK
 Q