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

BMC4P2.m

Go to the documentation of this file.
  1. BMC4P2 ;IHS/OIT/FCJ - BMC 4.0 PATCH 2 ;
  1. ;;4.0;REFERRED CARE INFO SYSTEM;**2**;NOV 03, 2006
  1. ;
  1. ;
  1. I '$G(IOM) D HOME^%ZIS
  1. ;
  1. I '$G(DUZ) W !,"DUZ UNDEFINED OR 0." D SORRY(2) Q
  1. ;
  1. I '$L($G(DUZ(0))) W !,"DUZ(0) UNDEFINED OR NULL." D SORRY(2) Q
  1. ;
  1. I '(DUZ(0)["@") W:'$D(ZTQUEUED) !,"DUZ(0) DOES NOT CONTAIN AN '@'." D SORRY(2) Q
  1. ;
  1. S X=$$GET1^DIQ(200,DUZ,.01)
  1. W !!,$$CJ^XLFSTR("Hello, "_$P(X,",",2)_" "_$P(X,","),IOM)
  1. W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" V "_$P($T(+2),";",3)_".",IOM)
  1. ;
  1. NEW IORVON,IORVOFF
  1. S X="IORVON;IORVOFF"
  1. D ENDR^%ZISS
  1. ;
  1. I $$VCHK("BMC","4.0",2,"'=")
  1. I $$VCHK("XU","8.0",2,"<")
  1. I $$VCHK("DI","21.0",2,"<")
  1. I $$VCHK("ATX","5.1",2,"<")
  1. I $$VCHK("AUPN","99.1",2,"<")
  1. ;
  1. NEW DA,DIC
  1. S X="BMC",DIC="^DIC(9.4,",DIC(0)="",D="C"
  1. D IX^DIC
  1. I Y<0,$D(^DIC(9.4,"C","BMC")) D
  1. . W !!,*7,*7,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM),!,$$CJ^XLFSTR("PACKAGE File with an ""BMC"" prefix.",IOM)
  1. . W !,$$CJ^XLFSTR(IORVON_"One entry needs to be deleted."_IORVOFF,IOM)
  1. . D SORRY(2)
  1. ;
  1. I $G(XPDQUIT) W !,$$CJ^XLFSTR(IORVON_"FIX IT! Before Proceeding."_IORVOFF,IOM),!!,*7,*7,*7 Q
  1. ;
  1. W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
  1. ;
  1. D HELP^XBHELP("INTROE","BMC4P2")
  1. I '$$DIR^XBDIR("E","","","","","",1) D SORRY(2) Q
  1. ;
  1. I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0 D HELP^XBHELP("INTROI","BMC4P2") I '$$DIR^XBDIR("E","","","","","",1) D SORRY(2)
  1. ;
  1. Q
  1. ;
  1. SORRY(X) ;
  1. KILL DIFQ
  1. S XPDQUIT=X
  1. W *7,!,$$CJ^XLFSTR("Sorry....FIX IT!",IOM)
  1. Q
  1. ;
  1. VCHK(BMCPRE,BMCVER,BMCQUIT,BMCCOMP) ; Check versions needed.
  1. ;
  1. NEW BMCV
  1. S BMCV=$$VERSION^XPDUTL(BMCPRE)
  1. W !,$$CJ^XLFSTR("Need "_$S(BMCCOMP="<":"at least ",1:"")_BMCPRE_" v "_BMCVER_"....."_BMCPRE_" v "_BMCV_" Present",IOM)
  1. I @(BMCV_BMCCOMP_BMCVER) D SORRY(BMCQUIT) Q 0
  1. Q 1
  1. ;
  1. PRE ;EP - From KIDS.
  1. I $$NEWCP^XPDUTL("PRE1","AUDS^BMC4P2")
  1. ; The following line prevents the "Disable Options..." and "Move
  1. ; Routines..." questions from being asked during the install.
  1. I $G(XPDENV)=1 S (XPDDIQ("XPZ1"),XPDDIQ("XPZ2"))=0
  1. ;
  1. Q
  1. ;
  1. POST ;EP - From KIDS.
  1. ;
  1. ; --- Restore dd audit settings.
  1. S %="AUDR^BMC4P2"
  1. I $$NEWCP^XPDUTL("POS1-"_%,%)
  1. ;
  1. ; --- Set new Index "BA" and "BB"
  1. S %="INDX^BMC4P2"
  1. I $$NEWCP^XPDUTL("POS2-"_%,%)
  1. ;
  1. ; --- Send mail message of install.
  1. S %="MAIL^BMC4P2"
  1. I $$NEWCP^XPDUTL("POS3-"_%,%)
  1. ;
  1. Q
  1. ;
  1. MAIL ;
  1. D BMES^XPDUTL("BEGIN Delivering MailMan message to select users.")
  1. NEW DIFROM,XMSUB,XMDUZ,XMTEXT,XMY
  1. KILL ^TMP("BMC4P2",$J)
  1. D RSLT(" --- BMC v 4.0 Patch 1, has been installed into this uci ---")
  1. F %=1:1 D RSLT($P($T(GREET+%),";",3)) Q:$P($T(GREET+%+1),";",3)="###"
  1. S %=0
  1. F S %=$O(^XTMP("XPDI",XPDA,"BLD",XPDBLD,1,%)) Q:'% D RSLT(^(%,0))
  1. S XMSUB=$P($P($T(+1),";",2)," ",3,99),XMDUZ=$S($G(DUZ):DUZ,1:.5),XMTEXT="^TMP(""BMC4P2"",$J,",XMY(1)="",XMY(DUZ)=""
  1. F %="BMCZMENU","XUMGR","XUPROG","XUPROGMODE" D SINGLE(%)
  1. D ^XMD
  1. KILL ^TMP("BMC4P2",$J)
  1. D MES^XPDUTL("END Delivering MailMan message to select users.")
  1. Q
  1. ;
  1. RSLT(%) S ^(0)=$G(^TMP("BMC4P2",$J,0))+1,^(^(0))=%
  1. Q
  1. ;
  1. SINGLE(K) ; Get holders of a single key K.
  1. NEW Y
  1. S Y=0
  1. Q:'$D(^XUSEC(K))
  1. F S Y=$O(^XUSEC(K,Y)) Q:'Y S XMY(Y)=""
  1. Q
  1. ;
  1. INTROE ; Intro text during KIDS Environment check.
  1. ;;In this distribution:
  1. ;;(1) CHS Appeal link:
  1. ;; a.CHS Link will transfer latest appeal information to Referral
  1. ;; b.Appeal parameter will update Ref Status to Active if reveresed
  1. ;;(2) T-Log report
  1. ;; a. Moved discharge comments after the Case review comments
  1. ;; b. Added Date Discharge Consult Rec'd
  1. ;;(3) Secondary Referral populate POV from Primary referral
  1. ;; a. New parameter added; must be set to yes to auto populate
  1. ;;(4) Removed "A"-Active as an option when closing a referral
  1. ;;(5) Mailman message:
  1. ;; a. Added Case Review notes to the Message
  1. ;; b. Added Date of Service to the Message
  1. ;; c. Added parameter to print patient name on subject line
  1. ;; c. Added Type of referral to subject line
  1. ;;(6) Physician notes are no longer editable
  1. ;;(7) Changed under display a referral the sequence of Indian decent,
  1. ;; CHS residency, chs alternate resources and 72 hr notification
  1. ;; to reflect order of the Medical priority
  1. ;;(8) Consultation Letter: New letter to be sent with patient to
  1. ;; provide feedback from Physician referred to.
  1. ;; a. Letter is located under print all option of referral letters
  1. ;; b. Parameter added to prompt during printing of standard letter
  1. ;;(9)API for New Women's Health package; allows data entry of both
  1. ;; primary and secondary referrals, referral edit & display options.
  1. ;;(10)Auto Close Option: added ability to close by type of referral, by
  1. ;; inpatient or outpatient and by date referral initiated or date
  1. ;; of service
  1. ;;
  1. ;;###
  1. ;
  1. INTROI ; Intro text during KIDS Install.
  1. ;;A standard message will be produced by this update.
  1. ;;
  1. ;;If you run interactively, results will be displayed on your screen,
  1. ;;as well as in the mail message and the entry in the INSTALL file.
  1. ;;If you queue to TaskMan, please read the mail message for results of
  1. ;;this update, and remember not to Q to the HOME device.
  1. ;;###
  1. ;
  1. GREET ;;To add to mail message.
  1. ;;
  1. ;;Greetings.
  1. ;;
  1. ;;Standard data dictionaries on your RPMS system have been updated.
  1. ;;
  1. ;;You are receiving this message because of the particular RPMS
  1. ;;security keys that you hold. This is for your information, only.
  1. ;;You need do nothing in response to this message.
  1. ;;
  1. ;;Questions about this patch, which is a product of the RPMS DBA
  1. ;;,
  1. ;;can be directed to the Help Desk,
  1. ;;.
  1. ;;Please refer to patch "bmc*4.0*2".
  1. ;;
  1. ;;###;NOTE: This line indicates the end of text in this message.
  1. ;
  1. ; -----------------------------------------------------
  1. ; The global location for dictionary audit is:
  1. ; ^DD(FILE,0,"DDA")
  1. ; If the valuey is "Y", dd audit is on. Any other value, or the
  1. ; absence of the node, means dd audit is off.
  1. ; -----------------------------------------------------
  1. AUDS ;EP - From KIDS.
  1. D BMES^XPDUTL("Saving current DD AUDIT settings for files in this patch")
  1. D MES^XPDUTL("and turning DD AUDIT to 'Y'.")
  1. S ^XTMP("BMC4P2",0)=$$FMADD^XLFDT(DT,10)_"^"_DT_"^"_$P($P($T(+1),";",2)," ",3,99)
  1. NEW BMC
  1. S BMC=0
  1. F S BMC=$O(^XTMP("XPDI",XPDA,"FIA",BMC)) Q:'BMC D
  1. . I '$D(^XTMP("BMC4P2",BMC,"DDA")) S ^XTMP("BMC4P2",BMC,"DDA")=$G(^DD(BMC,0,"DDA"))
  1. . D MES^XPDUTL(" File "_$$RJ^XLFSTR(BMC,12)_" - "_$$LJ^XLFSTR(^XTMP("XPDI",XPDA,"FIA",BMC),30)_"- DD audit was '"_$G(^XTMP("BMC4P2",BMC,"DDA"))_"'"),MES^XPDUTL($$RJ^XLFSTR("Set to 'Y'",69))
  1. . S ^DD(BMC,0,"DDA")="Y"
  1. .Q
  1. D MES^XPDUTL("DD AUDIT settings saved in ^XTMP(.")
  1. Q
  1. ; -----------------------------------------------------
  1. AUDR ; Restore the file data audit values to their original values.
  1. D BMES^XPDUTL("Restoring DD AUDIT settings for files in this patch.")
  1. NEW BMC
  1. S BMC=0
  1. F S BMC=$O(^XTMP("BMC4P2",BMC)) Q:'BMC D
  1. . S ^DD(BMC,0,"DDA")=^XTMP("BMC4P2",BMC,"DDA")
  1. . D MES^XPDUTL(" File "_$$RJ^XLFSTR(BMC,12)_" - "_$$LJ^XLFSTR($$GET1^DID(BMC,"","","NAME"),30)_"- DD AUDIT Set to '"_^DD(BMC,0,"DDA")_"'")
  1. .Q
  1. KILL ^XTMP("BMC4P2")
  1. D MES^XPDUTL("DD AUDIT settings restored.")
  1. Q
  1. ; -----------------------------------------------------
  1. INDX ;INDEX NEW INDECIES "BA", "BB" AND "CD"
  1. D BMES^XPDUTL("BEGIN Indexing Expected Begining Date of Service.")
  1. S DIK="^BMCREF("
  1. S DIK(1)="1105^BA"
  1. D ENALL^DIK
  1. D BMES^XPDUTL("BEGIN Indexing Actual Appointment/begin DOS.")
  1. S DIK(1)="1106^BB"
  1. D ENALL^DIK
  1. D BMES^XPDUTL("BEGIN Indexing CHS Denial Number.")
  1. S DIK(1)="1128^CD"
  1. D ENALL^DIK
  1. D BMES^XPDUTL("Completed updating new indexes.")
  1. K DA,DIC,DIK,X
  1. Q
  1. ; -----------------------------------------------------
  1. INSTALLD(BMC) ; Determine if patch BMC was installed, where BMC is
  1. ; the name of the INSTALL. E.g "AVA*93.2*12".
  1. ;
  1. NEW DIC,X,Y
  1. ; lookup package.
  1. S X=$P(BMC,"*",1)
  1. S DIC="^DIC(9.4,",DIC(0)="FM",D="C"
  1. D IX^DIC
  1. I Y<1 Q 0
  1. ; lookup version.
  1. S DIC=DIC_+Y_",22,",X=$P(BMC,"*",2)
  1. D ^DIC
  1. I Y<1 Q 0
  1. ; lookup patch.
  1. S DIC=DIC_+Y_",""PAH"",",X=$P(BMC,"*",3)
  1. D ^DIC
  1. Q $S(Y<1:0,1:1)
  1. ;
  1. ; -----------------------------------------------------