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

A1VSLPD1.m

Go to the documentation of this file.
  1. A1VSLPD1 ;Albany FO/GTS - VistA Package Sizing Manager - Caption display APIs; 12-JUL-2016
  1. ;;1.0;VistA Package Sizing;;Oct 10, 2016;Build 25
  1. ;
  1. ;APIs
  1. EDITPRFX(DATELEMT,LISTDATA,UPDATLST) ; Update Prefix list
  1. NEW DIR,DIRUT,DTOUT,DUOUT,X,Y,EDTELEMT,PCE
  1. SET PCE=0
  1. IF (LISTDATA["|"_DATELEMT_"|")!($P(LISTDATA,"|")=DATELEMT) SET PCE=$$PCEPOS(LISTDATA,DATELEMT)
  1. SET DIR("A")=" Prefix: "
  1. SET DIR("B")=DATELEMT
  1. SET DIR("?")=" Enter/Edit a Prefix."
  1. SET DIR(0)="FAO^2:6^K:(X'?1U1.5NU) X"
  1. DO ^DIR
  1. DO LSTEDT(X,PCE,DATELEMT,.LISTDATA,.UPDATLST)
  1. QUIT
  1. ;
  1. EDITFNUM(DATELEMT,LISTDATA,UPDATLST) ; Update File list
  1. NEW DIR,DIRUT,DTOUT,DUOUT,EDTELEMT,PCE
  1. SET PCE=0
  1. IF (LISTDATA["|"_DATELEMT_"|")!($P(LISTDATA,"|")=DATELEMT) SET PCE=$$PCEPOS(LISTDATA,DATELEMT)
  1. SET DIR("A")=" File Number: "
  1. SET DIR("B")=DATELEMT
  1. SET DIR("?")=" Enter/Edit a File Number."
  1. SET DIR(0)="NAO^1.9999:99999999.999999:6"
  1. DO ^DIR
  1. DO LSTEDT(X,PCE,DATELEMT,.LISTDATA,.UPDATLST)
  1. QUIT
  1. ;
  1. EDITFRNG(DATELEMT,LISTDATA,UPDATLST) ; Update File Range
  1. NEW DIR,DIRUT,DTOUT,DUOUT,EDTELEMT,PCE
  1. SET PCE=0
  1. IF (LISTDATA["|"_DATELEMT_"|")!($P(LISTDATA,"|")=DATELEMT) SET PCE=$$PCEPOS(LISTDATA,DATELEMT)
  1. SET DIR("A")=" File Number Range: "
  1. SET DIR("B")=DATELEMT
  1. SET DIR("?",1)=" Enter a new File Number Range or one from the list."
  1. SET DIR("?")="New file number ranges only between 1.9999 and 99999999.999999"
  1. SET DIR(0)="FAO^3:31^K:$$BADRNG^A1VSLPD1(X) X"
  1. DO ^DIR
  1. DO LSTEDT(X,PCE,DATELEMT,.LISTDATA,.UPDATLST)
  1. QUIT
  1. ;
  1. LSTEDT(EDTELEMT,PCE,DATELEMT,LISTDATA,UPDATLST) ;Edit List dialog
  1. IF (PCE>0),(EDTELEMT'="@") SET $P(LISTDATA,"|",PCE)=EDTELEMT SET UPDATLST=1 ;EDIT ENTRY
  1. IF (PCE>0),(EDTELEMT="@") DO
  1. . IF +$$YNCHK^A1VSLAPI("DELETE ENTRY") SET LISTDATA=$P(LISTDATA,DATELEMT_"|",1)_$P(LISTDATA,DATELEMT_"|",2) SET UPDATLST=1
  1. IF PCE'>0 DO
  1. . IF EDTELEMT="@" W !,"?? ...Element not in list, cannot delete!" SET EDTELEMT=DATELEMT
  1. . SET:+$$YNCHK^A1VSLAPI("ADD ENTRY") LISTDATA=LISTDATA_EDTELEMT_"|" SET UPDATLST=1
  1. QUIT
  1. ;
  1. UPDTNODE(UPDIRUT,EDITARY,DATANUM,DATANAME,UPDX,CHNGMADE) ;Update ^TMP("A1VS-PARAM-EDIT") array node
  1. IF ('$D(UPDIRUT)) SET @EDITARY@(DATANUM,DATANAME)=UPDX SET CHNGMADE=1
  1. IF $D(UPDIRUT) DO
  1. . IF (UPDX="@"),(@EDITARY@(DATANUM,DATANAME)'="") DO
  1. .. IF +$$YNCHK^A1VSLAPI("DELETE ENTRY") SET @EDITARY@(DATANUM,DATANAME)="" SET CHNGMADE=1
  1. . IF (UPDX'="@"),(@EDITARY@(DATANUM,DATANAME)'=UPDX) SET @EDITARY@(DATANUM,DATANAME)=UPDX SET CHNGMADE=1
  1. QUIT
  1. ;
  1. SPLITOUT(DATANAME,LISTDATA) ; -- Split list data to separate lines as needed and output
  1. ; DATANAME - Data element name
  1. ; LISTDATA - Data element list
  1. ;
  1. NEW LINE,PCENUM,LISTPCE,NXSTPCE
  1. WRITE !!!,DATANAME_":"
  1. IF LISTDATA']"" W !,"{no data list}"
  1. IF LISTDATA]"" DO
  1. . IF $L(LISTDATA)'>79 W !,LISTDATA
  1. . IF $L(LISTDATA)>79 DO
  1. .. SET LINE=""
  1. .. SET NXSTPCE=1
  1. .. FOR PCENUM=1:1 SET LISTPCE=$P(LISTDATA,"|",PCENUM) Q:LISTPCE="" DO
  1. ... IF $L($P(LISTDATA,"|",NXSTPCE,PCENUM))>79 W !,$P(LISTDATA,"|",NXSTPCE,PCENUM-1) SET NXSTPCE=PCENUM
  1. .. W !,$P(LISTDATA,"|",NXSTPCE,999)
  1. WRITE !
  1. QUIT
  1. ;
  1. BADRNG(X) ;Checks user entered File Range (used by DIR call)
  1. SET RESULT=0
  1. IF ((X'?1.N."."0.6N1"-"1.N."."0.6N)!($P(X,"-",2)<$P(X,"-"))) SET RESULT=1
  1. QUIT RESULT
  1. ;
  1. SETSTR(PKGARY) ;Return a string of Package File Lineitem (Concatonate fields to 1 HDR line)
  1. NEW LINEITM,LPCNT,FLD
  1. SET LINEITM=""
  1. SET LPCNT=0
  1. FOR SET LPCNT=$O(@CAPARY@(LPCNT)) Q:LPCNT="" DO
  1. . SET FLD=$O(@CAPARY@(LPCNT,""))
  1. . SET LINEITM=LINEITM_@CAPARY@(LPCNT,FLD)_$S(LPCNT<9:"^",1:"")
  1. QUIT LINEITM
  1. ;
  1. PCEPOS(LISTDATA,DATELEMT) ; Return the piece position number of DATELEMT in LISTDATA
  1. NEW PCE,DELIMPOS,ITEM
  1. FOR PCE=1:1 SET ITEM=$P(LISTDATA,"|",PCE) Q:ITEM=DATELEMT IF ITEM="" SET PCE=0 QUIT
  1. QUIT PCE