source: WorldVistAEHR/trunk/r/OCCURRENCE_SCREEN-QAO/QAOEDT3.m@ 1722

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

initial load of WorldVistAEHR

File size: 1.9 KB
Line 
1QAOEDT3 ;HISC/DAD-BASIC OCCURRENCE SCREEN DATA EDIT ;6/11/93 15:45
2 ;;3.0;Occurrence Screen;;09/14/1993
3EN2 ; *** BASIC OS DATA
4 S QALIMIT="I $P(^(0),""^"",11)'>0",QAOSPROG="EN3^QAOEDT3" D EN2^QAOEDT
5EXIT ;
6 K %,DA,DIC,DIE,DR,I,LINE,LOC,QA,QADATE,QALIMIT,QAOPCENT,QAOS,QAOSD0
7 K QAOSDATE,QAOSQUIT,QAOSWHAT,QAOSSCRN,QAUDIT,QAOSWHO,X,Y,QAOSDEAD
8 K QAOSDATE,QAOSSCRN,QAOSDFN,QAOSIEN,QAOS109,QAORESET,QAOSONE,QAOSPROG
9 Q
10EN3 ; MAIN LOOP
11 S QAOSWHAT="REVIEWED" D ENDISP^QAOUTL0 S (QAOSQUIT,QAORESET)=0
12 S X=$G(^QA(741,QAOSD0,0)),QAOSSCRN(0)=+$G(^("SCRN"))
13 S QAOSDATE(0)=+$P(X,"^",3),QAOSDFN=+X
14EDIT K DR S DIE="^QA(741,",DR="19;1;3",DA=QAOSD0 D ^DIE S:$D(Y) QAOSQUIT=1
15 S QAOSDATE(1)=+$P($G(^QA(741,QAOSD0,0)),"^",3),QAOSSCRN(1)=+$G(^("SCRN"))
16 S QAOS109=+$O(^QA(741.1,"B",109,0))
17 D 21,23:QAOSDEAD(0)>1 G:QAOSQUIT=1 AUDIT
18 I QAORESET S QAOSQUIT=0 G EDIT
19 K DR S DIE="^QA(741,",DR="4;5;6;7;8;9",DA=QAOSD0
20 D ^DIE S:$D(Y) QAOSQUIT=1
21AUDIT S QAUDIT("FILE")="741^27",QAUDIT("DA")=QAOSD0,QAUDIT("ACTION")="e"
22 S QAUDIT("COMMENT")="CHANGE BASIC OCCURRENCE DATA" D ^QAQAUDIT
23 K QAOSDEAD,QAOSDATE,QAOSSCRN,QAOSDFN,QAOSIEN
24 Q
2521 N Y S (QAORESET,QAOSDEAD,QAOSDEAD(0))=0
26 S QA=$S(QAOSDATE(0)<QAOSDATE(1):QAOSDATE(0),1:QAOSDATE(1))-.0000001
27 F QAOSDATE=QA:0 S QAOSDATE=$O(^QA(741,"AA",QAOS109,QAOSDATE)) Q:QAOSDATE'>0 F QAOSIEN=0:0 S QAOSIEN=$O(^QA(741,"AA",QAOS109,QAOSDATE,QAOSDFN,QAOSIEN)) Q:QAOSIEN'>0 D 22
28 Q
2922 S X=$G(^QA(741,QAOSIEN,0)) Q:$P(X,"^",11)=2 S Y=+$G(^("SCRN"))
30 Q:Y'=QAOS109 S QAOSDEAD=X,QAOSDEAD(0)=QAOSDEAD(0)+1
31 Q:QAOSDATE(1)'>$P(QAOSDEAD,"^",3) S QAOSDEAD(0)=0
32 W *7,!!?5,"You cannot enter an occurrence date after the date of death "
33 S Y=$P(QAOSDEAD,"^",3)\1 X ^DD("DD") W Y,".",*7 D RESET
34 Q
3523 N Y W *7
36 W !!?5,"You cannot enter more than one death for the same patient.",*7
37 D RESET
38 Q
39RESET W !?5,"Resetting the occurrence date and screen to their original values.",!
40 K DR S DIE="^QA(741,",DA=QAOSD0
41 S DR="1///"_QAOSDATE(0)_";3///`"_QAOSSCRN(0)
42 D ^DIE S QAORESET=1
43 Q
Note: See TracBrowser for help on using the repository browser.