source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGGECSB.m@ 836

Last change on this file since 836 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.5 KB
RevLine 
[613]1DGGECSB ;ALB/DMK/CMM - MAS PRINT A CODE SHEET ; 07/20/89
2 ;;5.3;REGISTRATION;**47**;Aug 13, 1993
3 ;
4PRINT N DIC
5 S DIC="^GECS(2100,",DIC(0)="AEQMZ",DIC("A")="Select MAS Code Sheet ID: "
6 S DIC("S")="I $P(^(0),U,8)>333&($P(^(0),U,8)<342)!($P(^(0),U,8)>400)&($P(^(0),U,8)<421)!($P(^(0),U,8)=223)!($P(^(0),U,8)=345)!($P(^(0),U,8)=346)!($P(^(0),U,8)=167)!($P(^(0),U,8)=290)"
7 W ! D ^DIC G END:X=""!(X="^"),PRINT:Y<0
8 S HY=Y(0,0),CSDA=+Y,(FR,TO)=Y(0,0),BY="@.01",FLDS="[GECS TRANSMIT LIST]"
9 S GECS("TTF")=$P(Y(0),"^",8)
10 I $D(^GECS(2100,+Y,"KEY")) G KEY
11 K DIC,Y,X
12 D FIELD
13 S L=0,DHD="MAS CODE SHEET ID # : "_FR,DIC="^GECS(2100,",DIOEND="D READ^DGGECSB",ZTSAVE("^UTILITY(""DIQ1"",$J,")="",ZTSAVE("HDR")="",ZTSAVE("CSDA")=""
14 D EN1^DIP G PRINT
15END K CSDA,TO,FR,BY,FLDS,HY,L,DHD,DA,DR,DIQ,HDR,GECSMAP,GECSTT,GECS,HY
16 K GECSEDIT,DIOEND
17 K ^UTILITY("DIQ1",$J)
18 Q
19FIELD S GECSTT=$G(GECS("TTF"))
20 S GECSEDIT=$P($G(^GECS(2101.2,+$O(^GECS(2101.2,"B",GECSTT,0)),0)),"^",3) I GECSEDIT="" Q
21 S GECSEDIT=$E(GECSEDIT,2,$L(GECSEDIT)-1)
22 ;strip off [ ]
23 N ENT
24 S ENT=$O(^DIE("B",GECSEDIT,0)) I 'ENT Q
25 D GETMAP^GECSXMAP(ENT) I '$D(GECSMAP) Q
26 ;Build DR string from GECSMAP
27 N DIC,DA,DR,FR,TO,Y,BY,FLDS,L,DHD,SLASH,PP,NEXT,SEMI,LOOP
28 S DIC="^GECS(2100,",DA=CSDA,DR="9.1;1;"
29 F LOOP=1:1:GECSMAP D
30 .S NEXT=GECSMAP(LOOP)
31 .I LOOP>1 S N1=GECSMAP(LOOP-1),N1=$E(N1,$L(N1)-2,$L(N1)),NEXT=N1_NEXT K N1
32 .S SLASH=$F(NEXT,"\"),SEMI=$F(NEXT,";",SLASH)
33 .F S PP=$E(NEXT,SLASH,SEMI-2) Q:PP="" D
34 ..S DR=DR_PP_";"
35 ..S NEXT=$E(NEXT,SEMI,$L(NEXT))
36 ..S SLASH=$F(NEXT,"\"),SEMI=$F(NEXT,";",SLASH)
37 S DR=$E(DR,1,$L(DR)-1),DIQ(0)="E",HDR=DR
38 K ^UTILITY("DIQ1",$J)
39 D EN^DIQ1
40 Q
41READ ;
42 N ENT,ADAT,LOOP,PRT,HEAD
43 F LOOP=1:1 S ENT=$P(HDR,";",LOOP) Q:ENT="" D
44 .W !,$P(^DD(2100,ENT,0),"^")_": "_^UTILITY("DIQ1",$J,2100,CSDA,ENT,"E")
45 .I LOOP=1 W !
46 K ^UTILITY("DIQ1",$J)
47 Q
48KEY ;PRINT KEYPUNCH CODE SHEET
49 K ^UTILITY("DIQ1",$J)
50 D H1
51 S BY="@.01",FLDS="51;C1;""",L=0,DIC="^GECS(2100,"
52 S DHD="W ?0 D HEAD^DGGECSB W ?0 ;PRINT KEYPUNCH CODESHEET"
53 S ZTSAVE("^UTILITY(""DIQ1"",$J,")="",ZTSAVE("DHD")="",ZTSAVE("CSDA")="",ZTSAVE("DIOEND")=""
54 D EN1^DIP G PRINT
55H1 ;
56 N DR,DIC,DA K ^UTILITY("DIQ1",$J)
57 S DR="9.1",DIC="^GECS(2100,",DA=CSDA,DIQ(0)="E"
58 D EN^DIQ1
59 S HDR=DR
60 Q
61HEAD ;
62 S QQ="",$P(QQ,"+",79)="+"
63 S MD=$O(^UTILITY("DIQ1",$J,2100,CSDA,0)),MD=^UTILITY("DIQ1",$J,2100,CSDA,MD,"E") K ^UTILITY("DIQ1",$J,2100,CSDA,MD,"E") S HDR=$P(HDR,";",2)
64 W !!,?5,"MAS KEYPUNCH CODE SHEET ID#: "_HY
65 W ?50,$P(^DD(2100,"9.1",0),"^")_": "_MD,!,QQ,!
66 D READ W !
67 K QQ,MD
68 Q
Note: See TracBrowser for help on using the repository browser.