source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQPST40.m@ 1696

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

initial load of WorldVistAEHR

File size: 1.8 KB
Line 
1VAQPST40 ;JRP/ALB - UPDATE DATA SEGMENT FILE;09-SEP-93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3UPDATE ;MAIN ENTRY POINT
4 ;INPUT : NONE
5 ;OUTPUT : NONE
6 ;
7 ;DECLARE VARIABLES
8 N NODE,SEGPTR,HLTHSEG,DEFTIM,DEFOCC,TIMLIM,OCCLIM,TMP
9 N HLTHPTR,HLTHABB,CURTIM,CUROCC,COUNT
10 S DEFTIM=""
11 S DEFOCC=""
12 ;GET DEFAULT TIME & OCCURANCE LIMIT FROM PARAMETER FILE
13 S TMP=+$O(^VAT(394.81,0))
14 I (TMP) D
15 .S NODE=$G(^VAT(394.81,TMP,"LIMITS"))
16 .S DEFTIM=$P(NODE,"^",1)
17 .S DEFOCC=$P(NODE,"^",2)
18 ;DEFAULTS NOT SET - USE 1 YEAR & 10 OCCURRENCES
19 S:(DEFTIM="") DEFTIM="1Y"
20 S:('DEFOCC) DEFOCC=10
21 ;LOOP THROUGH HEALTH SUMMARY COMPONENTS
22 W !!!,"Updating pointers to Health Summary components and initializing"
23 W !,"maximum time and occurrence limits (when appropriate) "
24 S COUNT=0
25 S HLTHABB=""
26 F S HLTHABB=$O(^GMT(142.1,"C",HLTHABB)) Q:(HLTHABB="") D
27 .S HLTHPTR=+$O(^GMT(142.1,"C",HLTHABB,0))
28 .Q:('HLTHPTR)
29 .S COUNT=COUNT+1
30 .W:('(COUNT#5)) "."
31 .;FIND ENTRY IN DATA SEGMENT FILE
32 .S SEGPTR=+$O(^VAT(394.71,"C",HLTHABB,0))
33 .Q:('SEGPTR)
34 .;DETERMINE IF LIMITS ARE APPLICABLE
35 .S TMP=$$LIMITS^VAQDBIH1(HLTHPTR)
36 .S TIMLIM=+$P(TMP,"^",1)
37 .S OCCLIM=+$P(TMP,"^",2)
38 .;GET DATA SEGMENT NODE CONTAINING HEALTH SUMMARY INFO
39 .S NODE=$G(^VAT(394.71,SEGPTR,0))
40 .;SET POINTER TO HEALTH SUMMARY COMPONENT
41 .S $P(NODE,"^",4)=HLTHPTR
42 .;GET CURRENT TIME & OCCURRENCE MAX VALUES
43 .S CURTIM=$P(NODE,"^",5)
44 .S CUROCC=$P(NODE,"^",6)
45 .;SET MAXIMUM TIME LIMIT - USE CURRENT VALUE IF THERE
46 .I (TIMLIM) S:(CURTIM="") CURTIM=DEFTIM
47 .;TIME LIMIT NOT APPLICABLE
48 .I ('TIMLIM) S CURTIM=""
49 .;SET MAXIMUM OCCURRENCE LIMIT - USE CURRENT VALUE IF THERE
50 .I (OCCLIM) S:(CUROCC="") CUROCC=DEFOCC
51 .;OCCURRENCE LIMIT NOT APPLICABLE
52 .I ('OCCLIM) S CUROCC=""
53 .;STORE MAXIMUM LIMITS
54 .S $P(NODE,"^",5)=CURTIM
55 .S $P(NODE,"^",6)=CUROCC
56 .S ^VAT(394.71,SEGPTR,0)=NODE
57 ;DONE
58 W !!,"Updating completed",!!!
59 Q
Note: See TracBrowser for help on using the repository browser.