source: WorldVistAEHR/trunk/r/GENERIC_CODE_SHEET-GEC/GECSENTR.m@ 1593

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

initial load of WorldVistAEHR

File size: 2.3 KB
RevLine 
[613]1GECSENTR ;WISC/RFJ-stuff data into template map automatically ;08 Nov 93
2 ;;2.0;GCS;;MAR 14, 1995
3 ; the following needs to be defined for automatic stuffing of data:
4 ; GECS("STRING",0) or GECS("STRING",1), etc.=String to be stuffed delimited by ^
5 ; GECSSYS=Batch type name from file 2101.1
6 ; GECS("TTF")=Transaction/Segment name from file 2101.2
7 ; GECS("SITENOASK")=Station number_Suffix (from field 99 in the institution file)
8 ; GECS("AMIS")=month/year of amis in form 2890800
9 ; set the variable GECSAUTO="BATCH" to auto-mark for batch without asking
10 ; set the variable GECSAUTO="SAVE" to save code sheet for edit
11 ;
12 ; check for variables passed
13 I '$D(GECS("STRING",0)) Q
14 I '$G(GECS("SITENOASK")) Q
15 I '$L($G(GECSSYS)) Q
16 ;
17 N %X,D,D0,DA,DI,DQ,GECSAMIS,GECSDATA,GECSEDIT,GECSI,GECSMAP,GECSNASK,GECSNEXT,GECSPCNT,GECSPIEC,GECSTT,N,P,X,Y
18 ;
19 ; set passed data in temporary variable to prevent killing
20 S %X="GECS(""STRING"",",%Y="GECSDATA(" D %XY^%RCR
21 S GECSTT=$G(GECS("TTF"))
22 S GECSAMIS=$G(GECS("AMIS"))
23 S GECSNASK=$G(GECS("SITENOASK"))
24 ;
25 N GECS
26 ;
27 ; get transaction type and input template
28 S GECSEDIT=$P($G(^GECS(2101.2,+$O(^GECS(2101.2,"B",GECSTT,0)),0)),"^",3) I GECSEDIT="" Q
29 S GECSEDIT=$E(GECSEDIT,2,$L(GECSEDIT)-1)
30 S %=$O(^DIE("B",GECSEDIT,0)) I '% Q
31 D GETMAP^GECSXMAP(%) I '$D(GECSMAP) Q
32 ;
33 I GECSNASK S GECS("SITENOASK")=GECSNASK
34 D ^GECSSITE I '$G(GECS("SITE")) Q
35 D BATTYPE^GECSUSEL(GECSSYS,1) I '$G(GECS("BATDA")) Q
36 S GECS("TT")=GECSTT,GECS("EDIT")="["_GECSEDIT_"]"
37 W !,"Transaction Type: ",GECSTT
38 D NEWCS^GECSEDIT I '$D(GECS("CSDA")) Q
39 ;
40 W !,"Stuffing data into the following fields:"
41 ; stuff amis
42 I $G(GECSAMIS) S Y=GECSAMIS D DD^%DT W !,"AMIS MONTH/YEAR: ",Y D
43 . N DA,DIC,DIE,DR
44 . S (DIC,DIE)="^GECS(2100,",DA=GECS("CSDA"),DR="9.1///"_GECSAMIS D ^DIE
45 ;
46 S GECSNEXT=0,GECSPIEC=1,DA=GECS("CSDA")
47 S GECSI=0 F S GECSI=$O(GECSMAP(GECSI)) Q:'GECSI D
48 . F GECSPCNT=1:1 S Y=$P(GECSMAP(GECSI),"\",GECSPCNT) Q:Y="" D
49 . . I $P($G(GECSDATA(GECSNEXT)),"^",GECSPIEC,255)="" S GECSNEXT=GECSNEXT+1,GECSPIEC=1 Q:'$D(GECSDATA(GECSNEXT))
50 . . S X=$P(GECSDATA(GECSNEXT),"^",GECSPIEC),P=$P(Y,";",3),N=$P(Y,";",2),$P(^GECS(2100,DA,N),"^",P)=X,GECSPIEC=GECSPIEC+1
51 . . W !,$P(^DD(2100,+$P(Y,"^"),0),"^"),": ",X
52 I $$MAPDATA^GECSXBLD(DA) D ASKTOBAT^GECSXBL1(DA)
53 Q
Note: See TracBrowser for help on using the repository browser.