source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSRM.m@ 862

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

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1GMTSRM ; SLC/KER - Edit HS Type ; 01/06/2003
2 ;;2.7;Health Summary;**30,35,29,47,56,58**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 10076 ^XUSEC(
6 ; DBIA 10076 ^XUSEC("GMTSMGR"
7 ; DBIA 10018 ^DIE
8 ; DBIA 10010 EN1^DIP
9 ; DBIA 10026 ^DIR
10 ;
11MAIN ; Main loop to modify multiple health summary types
12 N %,DTOUT,DUOUT,DIRUT,EXISTS,GMTSFUNC,GMTSQIT,P
13 S GMTSQIT=0 F S EXISTS=0 D SELTYP Q:GMTSQIT
14 Q
15SELTYP ; Select Health Summary Type to Edit
16 N CHANGE,DA,DIC,DIE,DLAYGO,DR,DUOUT,EXISTS,GMTSUM,GMTSNEW,GMTSMGR,GMTSEG,GMTSIFN,SELCNT,X,Y
17 W ! S U="^",DIC="^GMT(142,",DIC(0)="AEMQL"
18 S DIC("A")="Select Health Summary Type: "
19 S DIC("S")="I +($$AHST^GMTSULT(+($G(Y))))" S DLAYGO=142
20 S Y=$$TYPE^GMTSULT K DIC S:+Y'>0 GMTSQIT=1 Q:+Y'>0 S (GMTSIFN,DA)=+Y
21 S GMTSUM=$P(Y,U,2),GMTSNEW=+$P(Y,U,3),GMTSMGR=$S($D(^XUSEC("GMTSMGR",DUZ)):1,1:0)
22 I 'GMTSMGR,($P(^GMT(142,+DA,0),U,2)]"") D Q:'GMTSMGR
23 . S GMTSMGR=$D(^XUSEC($P(^(0),U,2),DUZ))
24 . W:'GMTSMGR !,$C(7),"This summary report is currently locked to prevent alteration.",!
25 I 'GMTSMGR,'GMTSNEW,($P(^GMT(142,+DA,0),U,3)'=DUZ) W !,$C(7),"Alteration of this summary report is restricted to its owner.",!,"See the Clinical Coordinator if you need additional help." Q
26 I $D(^GMT(142.5,"AC",+DA)) D Q:+DA'>0
27 . W !!,$C(7),"WARNING: You are about to edit a Health Summary Type that is being used"
28 . W !,"by a Health Summary Object. Changing the structure of this Health Summary"
29 . W !,"Type will alter how the Object will display.",! H 1
30 . N DIR,DTOUT,DUOUT,DIROUT,X,Y S DIR(0)="YAO",DIR("B")="NO"
31 . S DIR("A")="Do want to continue? " D ^DIR S:+Y'>0 DA=0
32 . I $D(DTOUT)!($D(DUOUT))!($D(DIROUT)) S DA=0,GMTSQIT=1
33 S DIE="^GMT(142,",(GMTSIFN,DA)=+Y,DR="[GMTS EDIT HLTH SUM TYPE]" D ^DIE
34 I '$D(^GMT(142,+GMTSIFN,0))!$D(Y)!$D(DUOUT)!$D(DIROUT)!$D(DTOUT) D Q
35 . S GMTSQIT=1 D CHKDEL Q
36 I 'GMTSNEW,($O(^GMT(142,+GMTSIFN,1,0))) S EXISTS=1 D LIST,EXISTS Q
37 D SELCMP^GMTSRM5 Q:GMTSQIT D LIST:EXISTS,EXISTS D CHKDEL
38 Q
39CHKDEL ; Check for Possible Deletion (New Type without Component)
40 Q:+($G(GMTSIFN))'>0 Q:'$D(^GMT(142,+($G(GMTSIFN)),0)) D:GMTSMGR!(GMTSNEW)!($P(^GMT(142,+GMTSIFN,0),U,3)'=$G(DUZ)) ADEL^GMTSRM2(+($G(GMTSIFN)))
41 Q
42ENADHOC ; Entry point for AD HOC edit
43 N %,C,CHANGE,DA,DIC,DIE,DR,DUOUT,EXISTS,I,GMTSIFN,GMTSN,GMTSNCNT,GMTSNEW
44 N GMTSIFN,GMTSUM,P,SELCNT
45 N GMTSQIT,GMTSFUNC,X,Y
46 W !!,">>> EDITING the GMTS HS ADHOC OPTION Health Summary Type"
47 S (GMTSNEW,GMTSQIT)=0
48 S DIC=142,DIC(0)="XZF",X="GMTS HS ADHOC OPTION"
49 S Y=$$TYPE^GMTSULT I +Y'>0 D ^GMTSLOAD Q:$D(DIRUT)!$D(DIROUT) G ENADHOC
50 S GMTSIFN=+Y,GMTSUM=$P(Y,U,2),EXISTS=1
51 S DIE="^GMT(142,",DA=GMTSIFN,DR=".08T" D ^DIE
52 Q:$D(Y)
53 D LIST,EXISTS
54 Q
55EXISTS ; Edit an existing health summary type
56 N CNT,NXTCMP Q:$D(DUOUT) S NXTCMP=0,NXTCMP(0)=0
57 F CNT=$$GETCNT(GMTSIFN):0 D NXTCMP^GMTSRM1,LIST:GMTSQIT Q:GMTSQIT!($D(DUOUT)) K GMTSQIT,GMTSNEW,TWEENER,SOACTION
58 I NXTCMP>0 W !,"Please hold on while I resequence the summary order" D COPY^GMTSRN,RNMBR^GMTSRN:CHANGE
59 Q
60LIST ; Lists existing summary parameters
61 N B,DIC,DIR,IOP,Y,FR,TO,BY,DHD,FLDS,L
62 I GMTSQIT'=2 Q:($D(DUOUT)!(GMTSQIT=1))
63 I GMTSQIT=2,(NXTCMP=0) S GMTSQIT=0 Q
64 I 'GMTSNEW W ! S DIC=142,DIR(0)="Y",DIR("A")="Do you wish to review the Summary Type structure before continuing",DIR("B")="NO" D ^DIR K DIR I 'Y S:GMTSQIT=2 DUOUT="" S:GMTSQIT=2 GMTSQIT="D" S:$D(DUOUT) GMTSQIT=1 Q
65 I $D(GMTSQIT),GMTSQIT=2 S GMTSQIT=0
66 S IOP="HOME",DIC=142,(FR,TO)=GMTSUM,BY=".01",DHD="[GMTS TYPE INQ HEADER]-[GMTS TYPE INQ FOOTER]",FLDS="[GMTS TYPE INQ]",L=0 D EN1^DIP
67 Q
68GETCNT(GMTSIFN) ; Determine default summary order for new component
69 N LI,LCNT S LI=0,LCNT=5 F S LI=$O(^GMT(142,+GMTSIFN,1,LI)) Q:+LI'>0 S LCNT=$P(LI,".")+5
70 Q LCNT
Note: See TracBrowser for help on using the repository browser.