ECTPSRV ;B'ham ISC/PTD-Identify Local Services from National File ;01/29/91 08:00
V ;;1.05;INTERIM MANAGEMENT SUPPORT;**3**;
;SELECT ENTER/EDIT CHOICE
CHS W !!,"At this time, you may:",!!,"1. Enter/Edit Station's Services",!,"2. List 'National' Services",!,"3. List Identified Local Services",!,"4. Edit a Single Service"
W !,"5. Add OPC to National Service File",!!,"Select a number (1 - 5): "
R CHS:DTIME G:'$T!("^"[CHS) EXIT I CHS'?1N!(CHS<1)!(CHS>5) W !!,*7,"You MUST answer with a number between 1 and 5." G CHS
;BRANCH BASED ON ENTER/EDIT CHOICE
I (CHS=2)!(CHS=3) D DIP G EXIT
I CHS=4 D DIC G EXIT
I CHS=5 D OPC G EXIT
LOC W !!,"If your station has the following SERVICE,",!,"respond with a ""Y"". If you DO NOT HAVE the service,",!,"respond with a ""N"" or press <RETURN>.",!!
S RESP="" F SRDA=0:0 S SRDA=$O(^ECC(730,SRDA)) Q:'SRDA!(RESP="^") S SRNM=$P(^ECC(730,SRDA,0),"^") D LOOP
EXIT K %,%Y,BY,CHS,D,D0,DA,DHD,DIC,DIE,DIR,DR,DTOUT,DUOUT,FLDS,FR,I,L,OPC,P,RESP,SRDA,SRNM,TO,X,Y
Q
;
DIP S DIC="^ECC(730,",L=0,BY=".01",(FR,TO)="" S FLDS=$S(CHS=3:".01;""NATIONAL SERVICE"",2",1:".01,1"),DHD=$S(CHS=3:"LOCAL SERVICE LIST",1:"NATIONAL SERVICE LIST")
D EN1^DIP
Q
;
LOOP S (DIC,DIE)="^ECC(730,",DIC(0)="M",X=SRNM D ^DIC K DIC S DA=+Y W !!,SRNM S DR="2" D ^DIE K DIE I $D(Y) S RESP="^"
Q
;
DIC S (DIC,DIE)="^ECC(730,",DIC(0)="QEAM",DIC("A")="Select NATIONAL service: " D ^DIC Q:Y<0 S DA=+Y,DR="2" D ^DIE K DIE
Q
;
OPC W *7,!!?30,"* * W A R N I N G * *",!?20,"Use this functionality with caution!",!?20,"Add the Outpatient Clinic names for which",!?20,"you wish to track management data."
W ! S DIR(0)="Y",DIR("A")="Are you SURE you wish to continue",DIR("B")="NO",DIR("?")="Enter 'Y' or 'YES' to continue; press <RETURN> to exit." D ^DIR
Q:$D(DTOUT) Q:$D(DUOUT) Q:Y=0
W !!,"Name must be 3-35 characters in length,",!,"must not begin with punctuation,",!,"and must be all upper case."
ASK K OPC R !!,"Enter OUTPATIENT CLINIC name: ",OPC:DTIME Q:'$T!("^"[OPC) I $L(OPC)>35!($L(OPC)<3)!'(OPC'?1P.E)!(OPC?.E1L.E) W *7,!,"Answer must be 3-35 upper case characters; not beginning with punctuation." G ASK
I $D(^ECC(730,"B",OPC)) W *7,!!,OPC," is already in the file!" G ASK
W !!,"This is the ONLY opportunity you will be given to verify the name.",!,"Please check for correct spelling and accuracy.",!!,"OUTPATIENT CLINIC name: ",OPC,!
S DIR(0)="Y",DIR("A")="Are you SURE name is correct",DIR("B")="NO",DIR("?")="Enter 'Y' or 'YES' if name is correct; press <RETURN> to re-enter name." D ^DIR
Q:$D(DTOUT) Q:$D(DUOUT) G:Y=0 ASK
L ^ECC(730) F I=1000:1 Q:'$D(^ECC(730,I,0))
S ^ECC(730,I,0)=OPC_"^^1",^ECC(730,"B",($E(OPC,1,30)),I)="",$P(^ECC(730,0),"^",3)=I,$P(^ECC(730,0),"^",4)=$P(^ECC(730,0),"^",4)+1,^ECC(730,"ALS",I)="" L
W *7,!!,OPC," has been ADDED to National Service File!",!! G ASK
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECTPSRV 2861 printed Dec 13, 2024@02:02:47 Page 2
ECTPSRV ;B'ham ISC/PTD-Identify Local Services from National File ;01/29/91 08:00
V ;;1.05;INTERIM MANAGEMENT SUPPORT;**3**;
+1 ;SELECT ENTER/EDIT CHOICE
CHS WRITE !!,"At this time, you may:",!!,"1. Enter/Edit Station's Services",!,"2. List 'National' Services",!,"3. List Identified Local Services",!,"4. Edit a Single Service"
+1 WRITE !,"5. Add OPC to National Service File",!!,"Select a number (1 - 5): "
+2 READ CHS:DTIME
if '$TEST!("^"[CHS)
GOTO EXIT
IF CHS'?1N!(CHS<1)!(CHS>5)
WRITE !!,*7,"You MUST answer with a number between 1 and 5."
GOTO CHS
+3 ;BRANCH BASED ON ENTER/EDIT CHOICE
+4 IF (CHS=2)!(CHS=3)
DO DIP
GOTO EXIT
+5 IF CHS=4
DO DIC
GOTO EXIT
+6 IF CHS=5
DO OPC
GOTO EXIT
LOC WRITE !!,"If your station has the following SERVICE,",!,"respond with a ""Y"". If you DO NOT HAVE the service,",!,"respond with a ""N"" or press <RETURN>.",!!
+1 SET RESP=""
FOR SRDA=0:0
SET SRDA=$ORDER(^ECC(730,SRDA))
if 'SRDA!(RESP="^")
QUIT
SET SRNM=$PIECE(^ECC(730,SRDA,0),"^")
DO LOOP
EXIT KILL %,%Y,BY,CHS,D,D0,DA,DHD,DIC,DIE,DIR,DR,DTOUT,DUOUT,FLDS,FR,I,L,OPC,P,RESP,SRDA,SRNM,TO,X,Y
+1 QUIT
+2 ;
DIP SET DIC="^ECC(730,"
SET L=0
SET BY=".01"
SET (FR,TO)=""
SET FLDS=$SELECT(CHS=3:".01;""NATIONAL SERVICE"",2",1:".01,1")
SET DHD=$SELECT(CHS=3:"LOCAL SERVICE LIST",1:"NATIONAL SERVICE LIST")
+1 DO EN1^DIP
+2 QUIT
+3 ;
LOOP SET (DIC,DIE)="^ECC(730,"
SET DIC(0)="M"
SET X=SRNM
DO ^DIC
KILL DIC
SET DA=+Y
WRITE !!,SRNM
SET DR="2"
DO ^DIE
KILL DIE
IF $DATA(Y)
SET RESP="^"
+1 QUIT
+2 ;
DIC SET (DIC,DIE)="^ECC(730,"
SET DIC(0)="QEAM"
SET DIC("A")="Select NATIONAL service: "
DO ^DIC
if Y<0
QUIT
SET DA=+Y
SET DR="2"
DO ^DIE
KILL DIE
+1 QUIT
+2 ;
OPC WRITE *7,!!?30,"* * W A R N I N G * *",!?20,"Use this functionality with caution!",!?20,"Add the Outpatient Clinic names for which",!?20,"you wish to track management data."
+1 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Are you SURE you wish to continue"
SET DIR("B")="NO"
SET DIR("?")="Enter 'Y' or 'YES' to continue; press <RETURN> to exit."
DO ^DIR
+2 if $DATA(DTOUT)
QUIT
if $DATA(DUOUT)
QUIT
if Y=0
QUIT
+3 WRITE !!,"Name must be 3-35 characters in length,",!,"must not begin with punctuation,",!,"and must be all upper case."
ASK KILL OPC
READ !!,"Enter OUTPATIENT CLINIC name: ",OPC:DTIME
if '$TEST!("^"[OPC)
QUIT
IF $LENGTH(OPC)>35!($LENGTH(OPC)<3)!'(OPC'?1P.E)!(OPC?.E1L.E)
WRITE *7,!,"Answer must be 3-35 upper case characters; not beginning with punctuation."
GOTO ASK
+1 IF $DATA(^ECC(730,"B",OPC))
WRITE *7,!!,OPC," is already in the file!"
GOTO ASK
+2 WRITE !!,"This is the ONLY opportunity you will be given to verify the name.",!,"Please check for correct spelling and accuracy.",!!,"OUTPATIENT CLINIC name: ",OPC,!
+3 SET DIR(0)="Y"
SET DIR("A")="Are you SURE name is correct"
SET DIR("B")="NO"
SET DIR("?")="Enter 'Y' or 'YES' if name is correct; press <RETURN> to re-enter name."
DO ^DIR
+4 if $DATA(DTOUT)
QUIT
if $DATA(DUOUT)
QUIT
if Y=0
GOTO ASK
+5 LOCK ^ECC(730)
FOR I=1000:1
if '$DATA(^ECC(730,I,0))
QUIT
+6 SET ^ECC(730,I,0)=OPC_"^^1"
SET ^ECC(730,"B",($EXTRACT(OPC,1,30)),I)=""
SET $PIECE(^ECC(730,0),"^",3)=I
SET $PIECE(^ECC(730,0),"^",4)=$PIECE(^ECC(730,0),"^",4)+1
SET ^ECC(730,"ALS",I)=""
LOCK
+7 WRITE *7,!!,OPC," has been ADDED to National Service File!",!!
GOTO ASK