-
Notifications
You must be signed in to change notification settings - Fork 6
/
VPRJPMR.m
71 lines (71 loc) · 1.94 KB
/
VPRJPMR.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
VPRJPMR ;SLC/KCM -- Meta data for VPR object relations
;;1.0;JSON DATA STORE;;Sep 01, 2012
;
;;relationshipName
;; collections: collection{, collection, ...}
;; ref: {targetFieldName>}sourceFieldName
;; rev: {reverseRelationFieldName}
LINKED ;; describes relationships (linkages) between collection types
;;utest-multiple
;; collections: utestc
;; ref: dest[].obj>items[].uid
;; rev: testItems
;;utest-single
;; collections: utestc
;; ref: from
;; rev: testFroms
;;utest-ods
;; collections: utestods
;; ref: from[]>items[].uid
;; rev: testFroms
;;task-link
;; collections: task
;; ref: link>linkUid
;; rev: tasks
;;task-pat-link
;; collections: patient
;; ref: patient>pid
;;order-link
;; collections: order
;; ref: results[].result>results[].uid
;;document-parent
;; collections: document
;; ref: parent>parentUid
;; rev: childDocs
;;procedure-result
;; collections: consult,visit,procedure,surgery,image
;; ref: results[]>results[].uid
;; rev: procedures
;;team-category-link
;; collections: team
;; ref: categories[]>categories[].uid
;; rev: teams
;;team-positions-link
;; collections: team
;; ref: staff[].position>staff[].positionUid
;; rev: teams
;;team-boards-link
;; collections: team
;; ref: staff[].board>staff[].boardUid
;; rev: teams
;;team-people-link
;; collections: team
;; ref: staff[].person>staff[].personUid
;; rev: teams
;;zzzzz
;
;
BROKEN(LINK) ;
N LINKEE,LINKER,PID,JPID
;
S JPID="" F S JPID=$O(^VPRPTI(JPID)) Q:'$L(JPID) D
. S PID="" F S PID=$O(^VPRPTI(JPID,PID)) Q:'$L(PID) D
. . S LINKEE="" F S LINKEE=$O(^VPRPTI(JPID,PID,"rev",LINKEE)) Q:'$L(LINKEE) D
. . . Q:'$D(^VPRPTI(JPID,PID,"rev",LINKEE,LINK))
. . . I '$D(^VPRPT(JPID,PID,LINKEE)) W !,"Missing: ",LINKEE I 1
. . . E W !,"Good: ",LINKEE
Q
;N SPEC,CLTN
;S CLTN="" F S CLTN=$O(^VPRMETA("link",LINK,"collection",CLTN)) Q:CLTN="" D
;. N SPEC
;. M SPEC=^VPRMETA("link",LINK,"collection",CLTN,1)