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

WIILM01.m

Go to the documentation of this file.
  1. WIILM01 ;VISN20/WDE/WHN - WII List Manager Actions ; 21-JUN-2008
  1. ;;1.0;Wounded Injured and Ill Warriors;**1**;06/26/2008;Build 28
  1. ;
  1. TR ; mark entry as approved for submission to DFAS
  1. Q:VALMCNT<1 ; quit if there aren't any entries on the current list
  1. K DIR S DIR(0)="LO^"_VALMBG_":"_VALMLST,DIR("A")="Select records to Transmit" D ^DIR K DIR Q:$D(DIRUT)
  1. S WIIY=Y ; save the DIR processed response
  1. ; check if multiple records were selected by counting the number of "," pieces using WIIX
  1. ; if WIIX has more than one comma delimited value ForLoop through the WIIY setting WIIZ to
  1. ; the next number in list. WIILN set to reference LM line number and WIIEN to the file 987.5
  1. ; IEN set in LM array "IDX" x-ref.
  1. ; FM API called to update the status field to "2:Transmission Approved"
  1. S WIIX=$L(WIIY,",")-1
  1. I WIIX=1 S WIIEN=$O(@VALMAR@("IDX",+WIIY,"")) D FILE(WIIEN,2)
  1. I WIIX>1 F WIIZ=1:1:WIIX S WIILN=$P(WIIY,",",WIIZ),WIIEN=$O(@VALMAR@("IDX",+WIILN,"")) D FILE(WIIEN,2)
  1. W !,"Record"_$S(WIIX>1:"s ",1:" "),WIIY," will be put in the transmit queue"
  1. ; clean up the LM display variables and reload the list
  1. D CLEAN^VALM10,INIT^WIILM Q
  1. Q
  1. PL ; print delimited list of all records in current list for export spread sheet
  1. ; using WIIY to $Order through LM "IDX" list x-ref set WIIEN to the file IEN and WIINODE to
  1. ; the zer0th node of the entry. Build delimited "^" file with DFAS info to export.
  1. D FULL^VALM1
  1. W @IOF
  1. W !!,"NAME",U,"SSN",U,"ADMISSION DATE",U,"DISCHARGE DATE",U,"FACILITY #"
  1. S (WIIY,WIIEN)="" F S WIIY=$O(@VALMAR@("IDX",WIIY)) Q:WIIY="" F S WIIEN=$O(@VALMAR@("IDX",WIIY,WIIEN)) Q:WIIEN="" D
  1. . S WIINODE=$G(^WII(987.5,WIIEN,0))
  1. . W !,$P(WIINODE,U,2),U,$P(WIINODE,U,3),U,$P(WIINODE,U,6),U,$P(WIINODE,U,7),U,$P(WIINODE,U,5)
  1. D PAUSE^VALM1
  1. Q
  1. RM ; set status field to not approved and remove from displayed list
  1. Q:VALMCNT<1 ; quit if there aren't any entries on the current list
  1. K DIR S DIR(0)="LO^"_VALMBG_":"_VALMLST,DIR("A")="Select records to remove" D ^DIR K DIR Q:$D(DIRUT)
  1. S WIIY=Y ; save the DIR processed response
  1. ; check if multiple records were selected by counting the number of "," pieces using WIIX
  1. ; if WIIX has more than one comma delimited value ForLoop through the WIIY setting WIIZ to
  1. ; the next number in list. WIILN set to reference LM line number and WIIEN to the file 987.5
  1. ; IEN set in LM array "IDX" x-ref.
  1. ; FM API called to update the status field to "3:Transmission Not Approved"
  1. S WIIX=$L(WIIY,",")-1
  1. I WIIX=1 S WIIEN=$O(@VALMAR@("IDX",+WIIY,"")) D FILE(WIIEN,3)
  1. I WIIX>1 F WIIZ=1:1:WIIX S WIILN=$P(WIIY,",",WIIZ),WIIEN=$O(@VALMAR@("IDX",+WIILN,"")) D FILE(WIIEN,3)
  1. W !,"Record"_$S(WIIX>1:"s ",1:" "),WIIY," will be removed from the list"
  1. ; clean up the LM display variables and reload the list
  1. D CLEAN^VALM10,INIT^WIILM Q
  1. Q
  1. PD ; reset status to pending from approved
  1. Q:VALMCNT<1 ; quit if there aren't any entries on the current list
  1. K DIR S DIR(0)="LO^"_VALMBG_":"_VALMLST,DIR("A")="Select records to remove" D ^DIR K DIR Q:$D(DIRUT)
  1. S WIIY=Y ; save the DIR processed response
  1. ; check if multiple records were selected by counting the number of "," pieces using WIIX
  1. ; if WIIX has more than one comma delimited value ForLoop through the WIIY setting WIIZ to
  1. ; the next number in list. WIILN set to reference LM line number and WIIEN to the file 987.5
  1. ; IEN set in LM array "IDX" x-ref.
  1. ; FM API called to update the status field to "1:Pending facility approval"
  1. S WIIX=$L(WIIY,",")-1
  1. I WIIX=1 S WIIEN=$O(@VALMAR@("IDX",+WIIY,"")) D FILE(WIIEN,1)
  1. I WIIX>1 F WIIZ=1:1:WIIX S WIILN=$P(WIIY,",",WIIZ),WIIEN=$O(@VALMAR@("IDX",+WIILN,"")) D FILE(WIIEN,1)
  1. W !,"Record"_$S(WIIX>1:"s ",1:" "),WIIY," will be marked pending"
  1. ; clean up the LM display variables and reload the list
  1. D CLEAN^VALM10,INIT^WIILM03 Q
  1. Q
  1. PD3 ; reset status to pending from deleted
  1. Q:VALMCNT<1 ; quit if there aren't any entries on the current list
  1. K DIR S DIR(0)="LO^"_VALMBG_":"_VALMLST,DIR("A")="Select records to remove" D ^DIR K DIR Q:$D(DIRUT)
  1. S WIIY=Y ; save the DIR processed response
  1. ; check if multiple records were selected by counting the number of "," pieces using WIIX
  1. ; if WIIX has more than one comma delimited value ForLoop through the WIIY setting WIIZ to
  1. ; the next number in list. WIILN set to reference LM line number and WIIEN to the file 987.5
  1. ; IEN set in LM array "IDX" x-ref.
  1. ; FM API called to update the status field to "1:Pending facility approval"
  1. S WIIX=$L(WIIY,",")-1
  1. I WIIX=1 S WIIEN=$O(@VALMAR@("IDX",+WIIY,"")) D FILE(WIIEN,1)
  1. I WIIX>1 F WIIZ=1:1:WIIX S WIILN=$P(WIIY,",",WIIZ),WIIEN=$O(@VALMAR@("IDX",+WIILN,"")) D FILE(WIIEN,1)
  1. W !,"Records ",WIIY," will be marked pending"
  1. ; clean up the LM display variables and reload the list
  1. D CLEAN^VALM10,INIT^WIILM04 Q
  1. Q
  1. FILE(DA,STATUS) ; file status change
  1. Q:'+DA
  1. S DIE="^WII(987.5,",DR="8///"_+STATUS_";10///"_$G(DUZ)_";11///"_DT L +^WII(987.5,DA):0 I $T D ^DIE L -^WII(987.5,DA)
  1. Q
  1. ZAP ;
  1. K DIE,DIRUT,DA,Y,X,DR,STATUS,WIILN,VALMAR,VALMBG,VALMCNT,VALMLST,WIIEN,WIILN,WIINODE,WIIX,WIIY,WIIZ,Y