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

WVCMGR.m

Go to the documentation of this file.
  1. WVCMGR ;HCIOFO/FT,JR - ADD/EDIT CASE MANAGER ;07/22/2016 14:35
  1. ;;1.0;WOMEN'S HEALTH;**24**;Sep 30, 1998;Build 582
  1. ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER *
  1. ;; CALLED BY OPTION: "WV ADD/EDIT CASE MANAGERS" TO ADD AND EDIT
  1. ;; CASE MANAGERS.
  1. ;
  1. ;---> DIE ADD/EDIT CASE MANAGERS LOOP.
  1. D SETVARS^WVUTL5
  1. N Y,WVDD,WVPER
  1. D SETVARS
  1. Q:'$G(WVDD)
  1. F D Q:$G(Y)<0
  1. .D TITLE^WVUTL5("ADD/EDIT "_$P(WVPER,U))
  1. .S WVDICW="S WVY=Y N Y S Y=$P($G(^WV("_$P(WVDD,U)_",+WVY,0)),U,2) D DD^%DT W:$L(Y)>10 ?32,""DATE INACTIVATED: "",Y"
  1. .D DIC^WVFMAN($P(WVDD,U),"QEMAL",.Y," Select "_$P(WVPER,U,2)_": ","","","","",WVDICW)
  1. .K WVDICW Q:Y<0
  1. .D DIE^WVFMAN($P(WVDD,U),$P(WVDD,U,2),+Y,.WVPOP)
  1. .S:WVPOP Y=-1
  1. ;
  1. EXIT ;EP
  1. D KILLALL^WVUTL8
  1. Q
  1. ;
  1. SETVARS ;INITIALIZE VARIABLES USED IN THIS ROUTINE
  1. ;WVDD=PERSON FILE #^INACTIVATION DATE FIELD #^FILE 790 INDEX^FILE 790 FIELD
  1. I $G(WVTYPE)="CM" S WVDD=790.01_U_.02_U_"C"_U_.1,WVPER="CASE MANAGERS"_U_"CASE MANAGER"
  1. I $G(WVTYPE)="MCC" S WVDD=790.011_U_2_U_"D"_U_.29,WVPER="MATERNITY CARE COORDINATORS"_U_"MATERNITY CARE COORDINATOR"
  1. Q
  1. ;
  1. TRANS ;EP
  1. ;---> TRANSFER ONE CASE MANAGER'S PATIENTS TO ANOTHER CASE MANAGER.
  1. ;
  1. D TRANS1
  1. D EXIT
  1. Q
  1. ;
  1. TRANS1 ;EP
  1. N WVDD,WVPER
  1. D SETVARS
  1. Q:'$G(WVDD)
  1. D TITLE^WVUTL5("TRANSFER A "_$P(WVPER,U,2)_"'S PATIENTS")
  1. D:$G(WVTYPE)="CM" TEXT1
  1. D:$G(WVTYPE)="MCC" TEXT2
  1. S WVJOPEN=1
  1. S WVDICW="S WVY=Y N Y S Y=$P($G(^WV("_$P(WVDD,U)_",+WVY,0)),U,2) D DD^%DT W:$L(Y)>10 ?32,""DATE INACTIVATED: "",Y"
  1. D DIC^WVFMAN($P(WVDD,U),"QEMA",.Y," Select OLD "_$P(WVPER,U,2)_": ","","","","",WVDICW)
  1. K WVJOPEN,WVDICW
  1. Q:Y<0
  1. S WVCMGR=+Y
  1. S WVDICW="S WVY=Y N Y S Y=$P($G(^WV("_$P(WVDD,U)_",+WVY,0)),U,2) D DD^%DT W:$L(Y)>10 ?32,""DATE INACTIVATED: "",Y"
  1. S WVDICS="I $P($G(^WV("_$P(WVDD,U)_",+Y,0)),U,2)="""""
  1. D DIC^WVFMAN($P(WVDD,U),"QEMA",.Y," Select NEW "_$P(WVPER,U,2)_": ","",WVDICS,"","",WVDICW)
  1. K WVDICW,WVDICS Q:Y<0
  1. S WVCMGR1=+Y
  1. W !!?3,"All patients currently assigned to: ",$$PERSON^WVUTL1(WVCMGR)
  1. W !?3,"will be reassigned to.............: ",$$PERSON^WVUTL1(WVCMGR1)
  1. ;
  1. ;---> YES/NO
  1. W !!?3,"Do you wish to proceed?"
  1. S DIR("?")=" Enter YES to swap "_$$TITLE^XLFSTR($P(WVPER,U))_"."
  1. S DIR(0)="Y",DIR("A")=" Enter Yes or No"
  1. D ^DIR W !
  1. Q:$D(DIRUT)!('Y)
  1. N M,N
  1. S N=0,M=0
  1. F S N=$O(^WV(790,$P(WVDD,U,3),WVCMGR,N)) Q:'N D
  1. .D DIE^WVFMAN(790,$P(WVDD,U,4)_"////"_WVCMGR1,N,.WVPOP)
  1. .Q:WVPOP S M=M+1
  1. W !?3,M," patients transferred from ",$$PERSON^WVUTL1(WVCMGR)
  1. W " to ",$$PERSON^WVUTL1(WVCMGR1),"." D DIRZ^WVUTL3
  1. Q
  1. ;
  1. TEXT1 ;EP
  1. ;;The purpose of this utility is to aid in the transfer of all of one
  1. ;;Case Manager's patients to another Case Manager, such as when there
  1. ;;is a turnover in staff. The program will ask you for an "OLD" Case
  1. ;;Manager and then for a "NEW" Case Manager. All patients who were
  1. ;;previously assigned to the "OLD" Case Manager will be reassigned to
  1. ;;the "NEW" Case Manager.
  1. ;;
  1. ;;If the "NEW" Case Manager you are looking for cannot be selected,
  1. ;;that person must first be added to the file of Case Managers by
  1. ;;using the "Add/Edit Case Managers" option.
  1. ;;
  1. S WVTAB=5,WVLINL="TEXT1" D PRINTX
  1. Q
  1. ;
  1. TEXT2 ;HELP TEXT
  1. ;;The purpose of this utility is to aid in the transfer of all of one
  1. ;;Maternity Care Coordinator's patients to another Maternity Care
  1. ;;Coordinator, such as when there is a turnover in staff.
  1. ;;The program will ask you for an "OLD" Maternity Care Coordinator
  1. ;;and then for a "NEW" Maternity Care Coordinator. All patients who
  1. ;;were previously assigned to the "OLD" Maternity Care Coordinator
  1. ;;will be reassigned to the "NEW" Maternity Care Coordinator.
  1. ;;
  1. ;;If the "NEW" Maternity Care Coordinator you are looking for cannot
  1. ;;be selected, that person must first be added to the file of
  1. ;;Maternity Care Coordinators by using the "Add/Edit Maternity Care
  1. ;;Coordinators" option.
  1. ;;
  1. S WVTAB=5,WVLINL="TEXT2" D PRINTX
  1. Q
  1. ;
  1. PRINTX ;EP
  1. N I,T,X S T=$$REPEAT^XLFSTR(" ",WVTAB)
  1. F I=1:1 S X=$T(@WVLINL+I) Q:X'[";;" W !,T,$P(X,";;",2)
  1. Q