source: WorldVistAEHR/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YSASSN.m@ 1073

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1YSASSN ;692/DCL-ASI SIGNATURE AND NARRATIVE ;4/7/98 14:08
2 ;;5.01;MENTAL HEALTH;**24,39**;Dec 30, 1994
3 Q
4ES(YSASS) ;Electronc Signature - Pass flag by reference
5 ;YSASS= 0-FAILED, 1-SUCCESS
6 N X,X1
7 S YSASS=0
8 D SIG^XUSESIG
9 I X1="" D Q
10 .W $C(7),!,"SIGNATURE FAILED"
11 .W !,"< ASI SAVED - WITHOUT SIGNATURE >"
12 .Q
13 S YSASS=1 ;signature ok
14 Q
15 ;
16NARYN(YSAS1) ;Narrative Yes or No
17 N YSAS2,DIR,X,Y
18 S YSAS1=""
19 S DIR(0)="Y"
20 S DIR("A")="ENTER A NARRATIVE FOR THIS ASI "
21 S DIR("B")="YES"
22 D ^DIR
23 S YSAS1=Y
24 Q
25 ;
26EN(YSAIEN) ;Entry point
27 N YSAS,YSAS,YSASFLG,YSASINTV,DIC,DIE,DA,DR,X,Y,YSASPN,YSASPT,YSASPIEN
28 N YSASSGNT,YSASSPL,YSASTRS,YSASBUL
29 ;YSASSGNT=DATE/TIME SIGNED
30 ;YSASFLG=to determine if any important fields are missing.
31 ;YSASTRS=Transcriber -
32 ;YSASBUL=Send Bulletin via e-mail informing the interviewer of the ASI to sign, which was transcribed by someonelse
33 ;YSASINTV=Interviewer - can only be signed by interviewer or an ASI Manager
34 S YSASCL=$$F(.04,"I")
35 D:YSASCL'=2 OUT2^YSASO1(YSAIEN,.YSASFLG)
36 D:YSASCL=2 OUT3^YSASO2(YSAIEN,.YSASFLG)
37 S YSASSPL=$$F(.11,"I"),YSASPN=$P($G(^YSTX(604.8,1,0)),"^",5)
38 D CHECKALL^YSASO2(YSAIEN,.YSASFLG) ;FULL REQUIREMENT CHECK
39 I YSASSPL?1N&(YSASFLG=0) D
40 .W $C(7),!!,"< ASI NOT COMPLETE - SPECIAL CODE:",$$F(.11)," >",!
41 . K DIR S DIR(0)="Y",DIR("A")="Do you want to sign this ASI as complete even though the patient "_$S(YSASSPL=1:"terminated",YSASSPL=2:"refused",1:"was unable to respond")
42 . D ^DIR S:Y=1 YSASFLG=1
43 .Q
44 I YSASFLG=0 D Q
45 .W $C(7),!!,"< NO SIGNATURE REQUESTED, ASI HAS MISSING DATA >"
46 .W !,"< MUST COMPLETE REQUIRED FIELDS >"
47 .W !,"< ASI SAVED - WITHOUT SIGNATURE AND WITHOUT PROGRESS NOTE >"
48 . K DIR S DIR(0)="Y",DIR("A")="Display missing required fields",DIR("B")="NO"
49 . D ^DIR I Y=1 D REPTMSG^YSASO2(YSAIEN) Q
50 .Q
51 S YSASINTV=$$F(.09,"I"),YSASPT=$$F(.02,"I") ; $$GET1^DIQ(604,YSAIEN_",",.09,"I")
52 S YSASTRS=$$F(.14,"I")
53 I YSASINTV'>0 D Q
54 . W $C(7),!!,"< NO SIGNATURE REQUESTED, ASI HAS MISSING DATA >"
55 .W !,"< MUST COMPLETE NAME OF INTERVIEWER >"
56 .W !,"< ASI SAVED - WITHOUT SIGNATURE AND WITHOUT PROGRESS NOTE >"
57 .W !!,"<press <cr> to continue>"
58 .R X:DTIME
59 .Q
60XN ;
61 D:YSASFLG=2
62 . K DIR S DIR(0)="Y",DIR("A")="Display required fields answered X or N",DIR("B")="NO"
63 . D ^DIR I Y=1 D REPTMSG^YSASO2(YSAIEN)
64 ;
65 I YSASFLG!(YSASSPL) D
66 .I YSASINTV=YSASTRS,YSASTRS=DUZ,YSASTRS>0 D ES(.YSAS) Q
67 .I $D(^YSTX(604.8,"AB",DUZ)) D Q
68 ..W !,$$AS("ASI Package Manager")
69 ..D ES(.YSAS)
70 ..Q
71 .I YSASINTV=DUZ D ES(.YSAS) Q
72 .I YSASTRS=DUZ,YSASINTV'=DUZ D Q
73 ..W !,$$AS("Transcriber")
74 ..D ES(.YSAS)
75 ..S:$G(YSAS) YSASBUL=1
76 ..Q
77 .Q
78 I $G(YSAS),$G(YSASBUL) D Q
79 .;send bulletin and change turn over responsibility for ASI to interviewer, who will be able to sign/create progress note
80 .W !,"...Sending bulletin to Interviewer..."
81 .D BUL^YSASBUL(YSAIEN,YSASTRS,YSASINTV)
82 .W !,"...Turning over ASI to Interviewer for action..."
83 .D CONV^YSASCR(YSAIEN,YSASINTV)
84 .Q
85 I '$G(YSAS),YSASPN>0 W !,"< NO PROGRESS NOTE >"
86 Q:$G(YSAS)'>0
87 S YSASSGNT=$$FMADD^XLFDT($$NOW^XLFDT,0,0,-1)
88 I YSASPN>0 D
89 .;W !!,"...Creating ASI Progress Note..."
90 . ;D PN^YSASPN(YSAIEN,YSASPT,DUZ,YSASPN,.YSASPIEN,YSASSGNT)
91 . D MAIN^YSASPNT(YSAIEN) ;TIU Pnotes
92 .Q
93 W !,"...Closing ASI Record..."
94 D CR^YSASCR(YSAIEN,DUZ,$G(YSASPIEN))
95 W "done!",!
96 W !!,"<press <cr> to continue>"
97 R X:DTIME
98 Q
99 ;other wise check id duz is interviewer and or transcriber and file in record
100 ;
101 ;
102F(YSASFLD,YSASFLG) ;Pass field name - IEN is expected to be in YSASIEN
103 N DIERR
104 Q:$G(YSASFLD)=""
105 Q $$GET1^DIQ(604,YSAIEN_",",YSASFLD,$G(YSASFLG))
106 ;
107AS(X) ;Requesting Electronic Signature as - passed in X
108 Q "Requesting Electronic Signature as "_X
Note: See TracBrowser for help on using the repository browser.