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

BPCRXSIG.m

Go to the documentation of this file.
BPCRXSIG ; IHS/OIT/MJL - EXPANDS SIG FOR BPC GUI ;
 ;;1.5;BPC;;MAY 26, 2005
GETSIG(BPCARRAY,BPCSIGV,BPCQTY) ;EP CALL FROM REMOTE PROC: BPC RX EXPAND SIG
TEST S BPCGUI=1,XWBWRAP=1 K ^TMP($J)
 S BPCARRAY="^TMP("_$J_")"
 ;S BPCSIGV="T3T TID"
 ;S BPCQTY=30
SIG ;checks SIG for RXs
 I $G(BPCSIGV)="" S ^TMP($J,1)=-1,^TMP($J,2)="No SIG DEFINED! " Q
 I $E(BPCSIGV)=" " S ^TMP($J,1)=-1,^TMP($J,2)="Leading spaces are not allowed in the SIG! " Q
 F BPCZ0=1:1:$L(BPCSIGV," ") S BPCZ1=$P(BPCSIGV," ",BPCZ0) I $L(BPCZ1)>32 S ^TMP($J,1)=-1,^TMP($J,2)="MAX OF 32 CHARACTERS ALLOWED BETWEEN SPACES." K BPCSIG,BPCZ0,BPCZ1 Q
 S BPCSIG="" F BPCZ0=1:1:$L(BPCSIGV," ") S BPCZ1=$P(BPCSIGV," ",BPCZ0) D:BPCZ1'=""  S BPCSIG=BPCSIG_" "_BPCZ1
 .S BPCY=$O(^PS(51,"B",BPCZ1,0)) Q:'BPCY  Q:$P($G(^PS(51,+BPCY,0)),"^",4)>1  S BPCZ1=$P(^PS(51,BPCY,0),"^",2) Q:'$D(^(9))  S BPCY=$P(BPCSIGV," ",BPCZ0-1),BPCY=$E(BPCY,$L(BPCY)) S:BPCY>1 BPCZ1=^(9)
 K BPCY,BPCZ1,BPCZ0
 I $L(BPCSIG)>100 S ^TMP($J,1)=-1,^TMP($J,2)="MAX OF 100 CHARACTERS ALLOWED IN SIG." K BPCSIG Q
 I +$G(BPCQTY) D DISPENSE
 S ^TMP($J,1)=2,^TMP($J,2)=BPCSIG,^TMP($J,3)=$G(PSOZDAY)
 K BPCSIG,PSOEXQTY,PSOEXSIG,BPCQTY,PSOZDAY
 Q
DFTSIG(BPCARRAY,BPCDRUG) ;EP CALL FROM REMOTE PROC: BPC RX DEFLT SIG
TESTA S BPCGUI=1,XWBWRAP=1 K ^TMP($J)
 S BPCARRAY="^TMP("_$J_")"
 S:'$D(U) U="^"
 S BPCDRUG=84103
 I $G(BPCDRUG)="" S ^TMP($J,1)=-1,^TMP($J,2)="No DRUG DEFINED! " Q
 S BPCDSIG=$P($G(^PSDRUG(BPCDRUG,0)),U,5)
 S BPCDPENS=$P($G(^PSDRUG(BPCDRUG,660)),U,8)
 S ^TMP($J,1)=2,^TMP($J,2)=BPCDSIG,^TMP($J,3)=BPCDPENS
 K BPCDRUG,BPCDPENS,BPCDRUG
 Q
GETDPENS(BPCARRAY,BPCSIGV,BPCQTY) ;EP CALL FROM REMOTE PROC: BPC RX EXPAND SIG
TEST1 S BPCGUI=1 K ^TMP($J)
 S BPCARRAY="^TMP("_$J_")"
 S BPCSIGV="T3T TID"
 S BPCQTY=30
 ;checks SIG for RXs
 I $G(BPCSIGV)="" S ^TMP($J,1)=-1,^TMP($J,2)="No SIG DEFINED! " Q
 I $E(BPCSIGV)=" " S ^TMP($J,1)=-1,^TMP($J,2)="Leading spaces are not allowed in the SIG! " Q
 I $G(BPCQTY)="" S ^TMP($J,1)=-1,^TMP($J,2)="No QUANTITY DEFINED! " Q
 F BPCZ0=1:1:$L(BPCSIGV," ") S BPCZ1=$P(BPCSIGV," ",BPCZ0) I $L(BPCZ1)>32 S ^TMP($J,1)=-1,^TMP($J,2)="MAX OF 32 CHARACTERS ALLOWED BETWEEN SPACES." K BPCSIG,BPCZ0,BPCZ1 Q
 S BPCSIG="" F BPCZ0=1:1:$L(BPCSIGV," ") S BPCZ1=$P(BPCSIGV," ",BPCZ0) D:BPCZ1'=""  S BPCSIG=BPCSIG_" "_BPCZ1
 .S BPCY=$O(^PS(51,"B",BPCZ1,0)) Q:'BPCY  Q:$P($G(^PS(51,+BPCY,0)),"^",4)>1  S BPCZ1=$P(^PS(51,BPCY,0),"^",2) Q:'$D(^(9))  S BPCY=$P(BPCSIGV," ",BPCZ0-1),BPCY=$E(BPCY,$L(BPCY)) S:BPCY>1 BPCZ1=^(9)
 K BPCY,BPCZ1,BPCZ0
 I $L(BPCSIG)>100 S ^TMP($J,1)=-1,^TMP($J,2)="MAX OF 100 CHARACTERS ALLOWED IN SIG." K BPCSIG Q
 I +BPCQTY D DISPENSE
 I '$L(PSOZDAY) S ^TMP($J,1)=1,^TMP($J,2)=BPCSIG K BPCSIG Q
 I $L(PSOZDAY) S ^TMP($J,1)=2,^TMP($J,2)=BPCSIG,^TMP($J,3)=PSOZDAY K BPCSIG,PSOEXQTY,PSOEXSIG,BPCQTY Q
 Q
DISPENSE ;GETS DISPENSING UNITS
 S (X,PSOEXSIG)=BPCSIG
 S PSOEXQTY=BPCQTY
 ;SET EXPANDED SIG EQUAL TO PSOEXSIG
 ;SET QTY EQUAL TO PSOEXQTY
 ;GET BACK PSOZDAY AS THE DAYS SUPPLY-IF VALUE NULL COULDNT CALCULATE
 ;
 D CHANGER
 D CHANGES
 D FUZZY
 D CHANGEN
 D CHANGET
 D CHANGEH
 D DAY
 D END
 Q
END ;CLEAN UP
 D EN^XBVK("PSOEX")
 K Q,Z,X,I,J,K,P,PART,QUIT,REPLANEW,SIG,TEXT,TIMES,TR,TRTO
 K CHECK,QUT,FIRST,SECOND,FIND,LOOP,MANY,PSOSIGS
 Q
 ;
NTEXT ;;NUMBERS FOR TEXT
 ;;TABLESPOON;BIGSPOON;SO IT WONT GET MESSED UP BY TAB
 ;;1&1/2;1.5
 ;;2&1/2;2.5
 ;;3&1/2;3.5
 ;;4&1/2;4.5
 ;;&;AND
 ;;1/3;.33;ADDED 3/10/98
 ;;2/3;.66;ADDED 3/10/98
 ;;3/4;.75;ADDED 3/10/98
 ;;1/2;.5
 ;;1/4;.25
 ;;ONE AND THREE FOURTHS;1.75
 ;;ONE AND THREE-FOURTHS;1.75
 ;;ONE AND ONE HALF;1.5
 ;;ONE AND ONE-HALF;1.5
 ;;ONE AND ONE FOURTH;1.25
 ;;ONE AND ONE-FOURTH;1.25
 ;;TWO AND ONE HALF;2.5
 ;;TWO AND ONE-HALF;2.5
 ;;THREE AND ONE HALF;3.5
 ;;THREE AND ONE-HALF;3.5
 ;;FOUR AND ONE HALF;4.5
 ;;FOUR AND ONE-HALF;4.5
 ;;FIVE AND ONE HALF;5.5
 ;;FIVE AND ONE-HALF;5.5
 ;;SIX AND ONE HALF;6.5
 ;;SIX AND ONE-HALF;6.5
 ;;SEVEN AND ONE HALF;7.5
 ;;SEVEN AND ONE-HALF;7.5
 ;;ONE;1
 ;;TWO;2
 ;;THREE;3
 ;;FOUR;4
 ;;FIVE;5
 ;;SIX;6
 ;;SEVEN;7
 ;;EIGHT;8
 ;;NINE;9
 ;;TEN;10
 ;;TWELVE;12
 ;;TWENTY FOUR;24
 ;;ONE HALF;.5
 ;;ONE-HALF;.5
 ;;ONE THIRD;.33
 ;;ONE-THIRD;.33
 ;;TWO THIRDS;.66
 ;;TWO-THIRDS;.66
 ;;THREE FOURTHS;.75
 ;;THREE-FOURTHS;.75
 ;;ONE FOURTH;.25
 ;;ONE-FOURTH;.25
 ;;QUIT
TTEXT ;;CHANGE TIME AROUND
 ;;EVERY OTHER DAY;EVERYOTHERDAY
 ;;EVERY 12 HOURS;TWOTIMESDAILY
 ;;EVERY 24 HOURS;ONCEDAILY
 ;;EVERY 8 HOURS;THREETIMESDAILY
 ;;EVERY 6 HOURS;FOURTIMESDAILY
 ;;EVERY 5 HOURS;FIVETIMESDAILY
 ;;EVERY 4 HOURS;SIXTIMESDAILY
 ;;EVERY 3 HOURS;EIGHTTIMESDAILY
 ;;EVERY 2 HOURS;TWELVETIMESDAILY
 ;;EVERY 1 HOUR;TWENTYFOURTIMESDAILY
 ;;EVERY 1 HOURS;TWENTYFOURTIMESDAILY
 ;;TIMES A DAY;TIMES DAILY
 ;;TIMES EACH DAY;TIMES DAILY
 ;;8 TIMES DAILY;EIGHTTIMESDAILY
 ;;6 TIMES DAILY;SIXTIMESDAILY
 ;;5 TIMES DAILY;FIVETIMESDAILY
 ;;6 TIMES DAILY;SIXTIMESDAILY
 ;;4 TIMES DAILY;FOURTIMESDAILY
 ;;3 TIMES DAILY;THREETIMESDAILY
 ;;2 TIMES DAILY;TWOTIMESDAILY
 ;;TWICE DAILY;TWOTIMESDAILY
 ;;AFTER MEALS AND AT BEDTIME;FOURTIMESDAILY
 ;;AFTER EACH MEAL AND AT BEDTIME;FOURTIMESDAILY
 ;;BEFORE MEALS AND AT BEDTIME;FOURTIMESDAILY
 ;;BEFORE EACH MEAL AND AT BEDTIME;FOURTIMESDAILY
 ;;MORNING, NOON, EVENING, AND AT BEDTIME;FOURTIMESDAILY
 ;;MORNING NOON EVENING AND AT BEDTIME;FOURTIMESDAILY
 ;;MORNING, NOON, AND EVENING;THREETIMESDAILY
 ;;MORNING NOON AND EVENING;THREETIMESDAILY
 ;;MORNING, NOON, AND NIGHT;THREETIMESDAILY
 ;;MORNING NOON AND NIGHT;THREETIMESDAILY
 ;;MORNING AND AT BEDTIME;TWOTIMESDAILY
 ;;MORNING AND BEDTIME;TWOTIMESDAILY
 ;;MORNING AND EVENING;TWOTIMESDAILY
 ;;AT BEDTIME;ONCEDAILY
 ;;ONCE DAILY;ONCEDAILY
 ;;A DAY;ONCEDAILY
 ;;ONCE A DAY;ONCEDAILY
 ;;IN THE EVENING;ONCEDAILY
 ;;EVERY NIGHT;ONCEDAILY
 ;;NIGHTLY;ONCEDAILY
 ;;IN THE MORNING;ONCEDAILY
 ;;EVERY MORNING;ONCEDAILY
 ;;EVERY PM;ONCEDAILY
 ;;EVERY EVENING;ONCEDAILY
 ;;EVERY AM;ONCEDAILY
 ;;EACH DAY;ONCEDAILY;LEAVE AT BOTTOM 3/10/98
 ;;EVERY DAY;ONCEDAILY;LEAVE AT BOTTOM 3/10/98
 ;;AT NOON;ONCEDAILY
 ;;MLS;ZGLOB
 ;;ML;ZGLOB
 ;;CCS;ZGLOB
 ;;CC;ZGLOB
 ;;CAPSULES;ZGLOB
 ;;TABLETS;ZGLOB
 ;;CAPSULE;ZGLOB
 ;;TABLET;ZGLOB
 ;;SUPPOSITORY;ZGLOB
 ;;CAPS;ZGLOB
 ;;TABS;ZGLOB
 ;;TAB;ZGLOB
 ;;CAP;ZGLOB
 ;;ZGLOB DAILY;ZGLOB ONCEDAILY;THIS IS A SPECIAL CASE PROBLEM WITH DAILY
 ;;QUIT
 ;
HTEXT ;;THIS PART CHANGES 2ND PARTO FO SIG FOURTIMESDAILY=4
 ;;EVERYOTHERDAY,.5
 ;;ONCEDAILY,1
 ;;TWOTIMESDAILY,2
 ;;THREETIMESDAILY,3
 ;;FOURTIMESDAILY,4
 ;;FIVETIMESDAILY,5
 ;;SIXTIMESDAILY,6
 ;;EIGHTTIMESDAILY,8
 ;;TWELVETIMESDAILY,12
 ;;TWENTYFOURTIMESDAILY,24
 ;;DAILY,1
 ;;QUIT
 ;
CHANGEN ;CHANGE TEXT TO NUMBERS
 ;N X,Y,STRING,TEXT,LOOK,REPLACE,NUMBER
 N X,Y
 S X=PSOEXSIG X ^%ZOSF("UPPERCASE") S PSOEXSIG=Y
 S PSOEXSIG=$TR(PSOEXSIG,"()")
 ;S PSOEXSIG=$TR(PSOEXSIG,"-"," ") ;IHS/OKCAO/POC 3/10/98
 S STRING=PSOEXSIG
 ;S STRING=X
 F I=1:1 S TEXT=$P($T(NTEXT+I),";;",2) Q:TEXT="QUIT"  D
 .S LOOK=$P(TEXT,";",1)
 .S REPLACE=$P(TEXT,";",2)
 .S NUMBER=$L(STRING,LOOK)-1
 .Q:NUMBER<1
 .F J=1:1:NUMBER D
 ..S STRING=$P(STRING,LOOK,1)_REPLACE_$P(STRING,LOOK,2,999)
 ..;W !,"MY TEXT= ",STRING," TEXT= ",TEXT H 2 ;****DELETE
 S PSOEXSIG=STRING
 K STRING,TEXT,LOOK,REPLACE,NUMBER
 Q
CHANGET ;CHANGE TIME AROUND
 S STRING=PSOEXSIG
 ;S STRING=X
 F I=1:1 S TEXT=$P($T(TTEXT+I),";;",2) Q:TEXT="QUIT"  D
 .S LOOK=$P(TEXT,";",1)
 .S REPLACE=$P(TEXT,";",2)
 .S NUMBER=$L(STRING,LOOK)-1
 .Q:NUMBER<1
 .F J=1:1:NUMBER D
 ..S STRING=$P(STRING,LOOK,1)_REPLACE_$P(STRING,LOOK,2,999)
 ..;W !,"MY TEXT= ",STRING," TEXT= ",TEXT H 2 ;****DELETE
 S PSOEXSIG=STRING
 K STRING,TEXT,LOOK,REPLACE,NUMBER
 Q
CHANGEH ;CHANGE TIME TO NUMBERS 
 S PSOEXMX=0
 ;S (PIECE(1),PIECE(2))=""
 S (QUIT(1),QUIT(2))="" ;TO STOP WHEN FIND SOMETHING
 ;PSOEXSIG DEFINED
 ;1 THE BELOW DEFINES TYPE OF ITEM TABLET, TEASPOON ETC
 ;2 LOOP THRU T2T BID AND T1T HS AND BREAKS UP
 ;3 CALCULATES FIRST PART OF SIG-THE NUMBER OF TABLETS ETC
 ;4 CALCULATES THE TIME PERIOD OF SIG-THE SECOND PORTION 4XDAILY ETC
LOOP S (FIRST,SECOND,FIND)=0,PSOSIGS=PSOEXSIG
 I $L(PSOEXSIG,"ZGLOB")>1 S DELIMIT="ZGLOB",MANY=$L(PSOEXSIG,"ZGLOB")-1,MULT=1 F LOOP=1:1:MANY D A Q:$G(QUT)
 I $L(PSOEXSIG,"TEASPOON")>1 S DELIMIT="TEASPOON",MANY=$L(PSOEXSIG,"TEASPOON")-1,MULT=5 F LOOP=1:1:MANY D A Q:$G(QUT)
 I $L(PSOEXSIG,"BIGSPOON")>1 S DELIMIT="BIGSPOON",MANY=$L(PSOEXSIG,"BIGSPOON")-1,MULT=15 F LOOP=1:1:MANY D A Q:$G(QUT)
 I $L(PSOEXSIG,"UNIT")>1 S DELIMIT="UNIT",MANY=$L(PSOEXSIG,"UNIT")-1,MULT=.01 F LOOP=1:1:MANY D A Q:$G(QUT)
 D KILLH
 Q
 ;
A S (PIECE(1),PIECE(2))=""
 ;TAKE 1 WHATEVER TWOTIMESDAILY AND TAKE 2 WHATEVER ONETIMESDAILY
 ;SEPARATE THE PARTS TAKE 1 WHATEVER TWOTIMESDAILY
 ;S FIRST=FIRST+FIND
 S FIRST=FIND
 S FIND=$F(PSOSIGS,"DAILY",FIRST)
 S SECOND=FIND-1
 S PSOEXSIG=$E(PSOSIGS,FIRST,SECOND)
 ;W !,"EACH SECTION IS= ",PSOEXSIG ;****DELETE
 ;
 S STRING(1)=$P(PSOEXSIG,DELIMIT),STRING(2)=$P(PSOEXSIG,DELIMIT,2)
 ;W !,"LOOP= ",LOOP H 2 ;****DELETE
 F Q=1:1:20 D  ;
 .F P=1:1:20 D  ;
 ..S CHECK=Q_" TO "_P,PART=Q_" TO"
 ..I STRING(1)[CHECK D
 ...;W !,STRING(1)," BECOMES " ;****DELETE
 ...S STRING(1)=$P(STRING(1),PART,2) ;SO 1 TO 2 BECOMES 2
 ...;W STRING(1) ;****DELETE
B ;B ADDED 3/10/98 NEXT 7 LINES
 F Q=1:1:5,.25,.33,.5,.66,.75 D  ;
 .F P=1:1:5,.25,.33,.5,.66,.75 D  ;
 ..S CHECK=Q_" TO "_P,PART=Q_" TO"
 ..I STRING(1)[CHECK D
 ...;W !,STRING(1)," BECOMES " ;****DELETE
 ...S STRING(1)=$P(STRING(1),PART,2) ;SO .25 TO .33 BECOMES .33
 ...;W STRING(1) ;****DELETE
 ;COMMENTED OUT 3/10/98
 S LENGTH=$L(STRING(1))
 F K=1:1:LENGTH S TEST=$E(STRING(1),K) IF TEST?1N!(TEST?1".") S PIECE(1)=PIECE(1)_TEST ;W !,"PIECE(1) BECOMES ",PIECE(1)
 ;G:PIECE(1)="" KILLH
 ;NOTE SECOND HALF OF SIG
 F I=1:1 S TEXT=$P($T(HTEXT+I),";;",2) Q:TEXT="QUIT"!QUIT(2)  D
 .S COMPARE(2)=$P(TEXT,",",1)
 .S REPLACE(2)=$P(TEXT,",",2)
 .I STRING(2)[COMPARE(2) S PIECE(2)=REPLACE(2),QUIT(2)=1 Q
 ;ADDED NEXT 4 LINES 3/10/98
 ;W !,"PIECE(1) ",PIECE(1)," BECOMES " ;****DELETE
 S PIECE(1)=+PIECE(1) ;W PIECE(1) ;****DELETE
 ;W !,"PIECE(2) ",PIECE(2)," BECOMES ";****DELETE
 S PIECE(2)=+PIECE(2) ;W PIECE(2) ;****DELETE
 ;3/10/98 POC ABOVE 4 LINES
 I PIECE(1),PIECE(2) S PSOEXMX=PIECE(1)*PIECE(2)*MULT
 ;W !,"PIECE(1)= ",PIECE(1)," PIECE(2)= ",PIECE(2)," MULT= ",MULT H 2 
 S (QUIT(1),QUIT(2))="" ;RESET QUIT VARIABLES
 S PSOEXMXT=$G(PSOEXMXT)+PSOEXMX ;PSOEXMXT IS TOTAL OF ALL PSOEXMX
 ;IF 'PSOEXMX W !,*7,*7,"I DONT KNOW THE DAYS SUPPLY-GO FIGURE!" S PSOZDAY="",QUT=1 Q
 I 'PSOEXMX S PSOEXMXT=0,QUT=1 Q
 S PSOEXMX=0
 ;DELETE THE ABOVE LATER ****DELETE
 Q
KILLH ;KILL VARIABLES
 K TEST,LENGTH,PIECE,STRING,DELIMIT,COMPARE,REPLACE,MULT
 Q
 ;
DAY ;CALCULATE THE DAYS SUPPLY
 I '$G(PSOEXMXT) S PSOZDAY=""  ;W !,*7,*7,"I DONT KNOW THE DAYS SUPPLY-GO FIGURE!"
 E  S PSOZDAY=PSOEXQTY\PSOEXMXT ;W !,"PSOZDAY= ",PSOZDAY ;****DELETE
 Q
CHANGER ;GOES LIKE THIS '4 TO 6' GETS CHANGED TO '4 OR 6'
 ;VARIABLE
 F Z=1:1 S TEXT=$P($T(TRTEXT+Z),";;",2) QUIT:TEXT="QUIT"  S TR=$P(TEXT,";",1),TRTO=$P(TEXT,";",2) D TRA
 Q
TRA F I=1:1:20 D
 .F J=1:1:20 D
 ..S REPLACE=I_" "_TR_" "_J
 ..S REPLANEW=I_" "_TRTO_" "_J
 ..S TIMES=$L(PSOEXSIG,REPLACE)-1
 ..Q:TIMES=0
 ..F K=1:1:TIMES D
 ...S SAVE(K)=$P(PSOEXSIG,REPLACE,K)
 ...S CUT(K)=$L(SAVE(K))+1
 ..S SAVE(K+1)=$P(PSOEXSIG,REPLACE,K+1)
 ..S CONVERT=""
 ..F C=1:1:TIMES D
 ...S CONVERT=CONVERT_SAVE(C)_REPLANEW
 ..S CONVERT=CONVERT_SAVE(C+1)
 ..;W !,"MY TEXT= ",CONVERT," TEXT= ",TEXT ;****DELETE
 ..S PSOEXSIG=CONVERT
 QUIT
TRTEXT ;REPLACES SOME MORE STUFF
 ;;OR;TO
 ;;-;TO
 ;;QUIT
CHANGES ;GOES LIKE THIS '1-2' GETS CHANGED TO '1 OR 2'
 ;VARIABLE
 F Z=1:1 S TEXT=$P($T(TSTEXT+Z),";;",2) QUIT:TEXT="QUIT"  S TR=$P(TEXT,";",1),TRTO=$P(TEXT,";",2) D TRS
 Q
TRS F I=1:1:20 D
 .F J=1:1:20 D
 ..S REPLACE=I_TR_J
 ..S REPLANEW=I_" "_TRTO_" "_J
 ..S TIMES=$L(PSOEXSIG,REPLACE)-1
 ..Q:TIMES=0
 ..F K=1:1:TIMES D
 ...S SAVE(K)=$P(PSOEXSIG,REPLACE,K)
 ...S CUT(K)=$L(SAVE(K))+1
 ..S SAVE(K+1)=$P(PSOEXSIG,REPLACE,K+1)
 ..S CONVERT=""
 ..F C=1:1:TIMES D
 ...S CONVERT=CONVERT_SAVE(C)_REPLANEW
 ..S CONVERT=CONVERT_SAVE(C+1)
 ..;W !,"MY TEXT= ",CONVERT," TEXT= ",TEXT ;****DELETE
 ..S PSOEXSIG=CONVERT
 QUIT
TSTEXT ;REPLACES SOME MORE STUFF
 ;;-;TO
 ;;QUIT
 ;
FUZZY ;CHANGES EVERY 4 TO 6 HOURS - EVERY 4 HOURS
 ;CHANGES 4 TO 6 TIMES - TO 4 TIMES
 F I=1:1 S TEXT=$P($T(TEXTF+I),";;",2) Q:TEXT="QUIT"  S FIRST=$P(TEXT,";"),SECOND=$P(TEXT,";",2) D 
 .F Q=1:1:24 D
 ..F P=1:1:24 D
 ...S CHECK=FIRST_" "_Q_" TO "_P_" "_SECOND,PART=FIRST_" "_Q_" "_SECOND
 ...I PSOEXSIG[CHECK D  ; 
 ....;W !,PSOEXSIG," BECOMES "
 ....S PSOEXSIG=$P(PSOEXSIG,CHECK,1)_PART_$P(PSOEXSIG,CHECK,2)
 ....;W PSOEXSIG H 2 
 QUIT
TEXTF ;;FIRST WORD;LAST WORD
 ;;EVERY;HOURS
 ;;;TIMES
 ;;QUIT