Skip to content

Commit 550971f

Browse files
authored
Merge pull request #2 from codaco/feature/bettter-external-data
Feature/bettter external data
2 parents 7d8600f + ac60ea9 commit 550971f

File tree

3 files changed

+190
-39
lines changed

3 files changed

+190
-39
lines changed

assets/previousInterview.csv

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
type,name,nickname,age
2+
person,John,John,71
3+
person,William,William,50
4+
person,James,James,47
5+
person,Charles,Charles,31
6+
person,George,George,46
7+
person,Frank,Frank,25
8+
person,Joseph,Joseph,46
9+
person,Thomas,Thomas,61
10+
person,Henry,Henry,62
11+
person,Robert,Robert,51
12+
person,Edward,Edward,49
13+
person,Harry,Harry,26
14+
person,Walter,Walter,19
15+
person,Arthur,Arthur,49
16+
person,Fred,Fred,21
17+
person,Albert,Albert,49
18+
person,Samuel,Samuel,21
19+
person,David,David,32
20+
person,Louis,Louis,59
21+
person,Joe,Joe,61
22+
person,Charlie,Charlie,32
23+
person,Clarence,Clarence,51
24+
person,Richard,Richard,36
25+
person,Andrew,Andrew,26
26+
person,Daniel,Daniel,74
27+
person,Ernest,Ernest,34
28+
person,Will,Will,46
29+
person,Jesse,Jesse,20
30+
person,Oscar,Oscar,32
31+
person,Lewis,Lewis,43
32+
person,Peter,Peter,24
33+
person,Benjamin,Benjamin,67
34+
person,Frederick,Frederick,49
35+
person,Willie,Willie,21
36+
person,Alfred,Alfred,65
37+
person,Sam,Sam,52
38+
person,Roy,Roy,25
39+
person,Herbert,Herbert,71
40+
person,Jacob,Jacob,24
41+
person,Tom,Tom,35
42+
person,Elmer,Elmer,62
43+
person,Carl,Carl,57
44+
person,Lee,Lee,70
45+
person,Howard,Howard,62
46+
person,Martin,Martin,55
47+
person,Michael,Michael,38
48+
person,Bert,Bert,40
49+
person,Herman,Herman,21
50+
person,Jim,Jim,33
51+
person,Francis,Francis,54
52+
person,Harvey,Harvey,53
53+
person,Earl,Earl,44
54+
person,Eugene,Eugene,51
55+
person,Ralph,Ralph,57
56+
person,Ed,Ed,19
57+
person,Claude,Claude,32
58+
person,Edwin,Edwin,66
59+
person,Ben,Ben,36
60+
person,Charley,Charley,18
61+
person,Paul,Paul,50
62+
person,Edgar,Edgar,30
63+
person,Isaac,Isaac,60
64+
person,Otto,Otto,54
65+
person,Luther,Luther,63
66+
person,Lawrence,Lawrence,32
67+
person,Ira,Ira,41
68+
person,Patrick,Patrick,59
69+
person,Guy,Guy,25
70+
person,Oliver,Oliver,54
71+
person,Theodore,Theodore,69
72+
person,Hugh,Hugh,47
73+
person,Clyde,Clyde,23
74+
person,Alexander,Alexander,53
75+
person,August,August,18
76+
person,Floyd,Floyd,42
77+
person,Homer,Homer,29
78+
person,Jack,Jack,75
79+
person,Leonard,Leonard,36
80+
person,Horace,Horace,58
81+
person,Marion,Marion,64
82+
person,Philip,Philip,27
83+
person,Allen,Allen,25
84+
person,Archie,Archie,50
85+
person,Stephen,Stephen,49
86+
person,Chester,Chester,47
87+
person,Willis,Willis,28
88+
person,Raymond,Raymond,44
89+
person,Rufus,Rufus,55
90+
person,Warren,Warren,55
91+
person,Jessie,Jessie,66
92+
person,Milton,Milton,50
93+
person,Alex,Alex,70
94+
person,Leo,Leo,67
95+
person,Julius,Julius,42
96+
person,Ray,Ray,60
97+
person,Sidney,Sidney,66
98+
person,Bernard,Bernard,64
99+
person,Dan,Dan,29
100+
person,Joshua,Joshua,43

assets/previousInterview.json

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,63 @@
11
{
22
"nodes": [
33
{
4-
"type": "4aebf73e-95e3-4fd1-95e7-237dcc4a4466",
4+
"type": "person",
55
"attributes": {
66
"6be95f85-c2d9-4daf-9de1-3939418af888": "Anita",
7-
"0ff25001-a2b8-46de-82a9-53143aa00d10": "Li",
8-
"0e75ec18-2cb1-4606-9f18-034d28b07c19": "Annie",
9-
"c5fee926-855d-4419-b5bb-54e89010cea6": 23
7+
"last_name": "Li",
8+
"nickname": "Annie",
9+
"variableNotInRegistry": "tomato",
10+
"age": 23
1011
}
1112
},
1213
{
13-
"type": "4aebf73e-95e3-4fd1-95e7-237dcc4a4466",
14+
"type": "person",
1415
"attributes": {
15-
"6be95f85-c2d9-4daf-9de1-3939418af888": "Barry",
16-
"0ff25001-a2b8-46de-82a9-53143aa00d10": "Smith",
17-
"0e75ec18-2cb1-4606-9f18-034d28b07c19": "Baz",
18-
"c5fee926-855d-4419-b5bb-54e89010cea6": 23
16+
"name": "Barry",
17+
"last_name": "Smith",
18+
"nickname": "Baz",
19+
"variableNotInRegistry": "tomato",
20+
"age": 23
1921
}
2022
},
2123
{
2224
"type": "4aebf73e-95e3-4fd1-95e7-237dcc4a4466",
2325
"attributes": {
2426
"6be95f85-c2d9-4daf-9de1-3939418af888": "Carlito",
25-
"0ff25001-a2b8-46de-82a9-53143aa00d10": "González",
26-
"0e75ec18-2cb1-4606-9f18-034d28b07c19": "Carl",
27-
"c5fee926-855d-4419-b5bb-54e89010cea6": 23
27+
"last_name": "González",
28+
"nickname": "Carl",
29+
"variableNotInRegistry": "tomato",
30+
"age": 23
2831
}
2932
},
3033
{
31-
"type": "4aebf73e-95e3-4fd1-95e7-237dcc4a4466",
34+
"type": "person",
3235
"attributes": {
33-
"6be95f85-c2d9-4daf-9de1-3939418af888": "Dee",
34-
"0ff25001-a2b8-46de-82a9-53143aa00d10": "Zhang",
35-
"0e75ec18-2cb1-4606-9f18-034d28b07c19": "Dee",
36-
"c5fee926-855d-4419-b5bb-54e89010cea6": 23
36+
"name": "Dee",
37+
"last_name": "Zhang",
38+
"nickname": "Dee",
39+
"variableNotInRegistry": "tomato",
40+
"age": 23
3741
}
3842
},
3943
{
4044
"type": "4aebf73e-95e3-4fd1-95e7-237dcc4a4466",
4145
"attributes": {
42-
"6be95f85-c2d9-4daf-9de1-3939418af888": "Eugine",
43-
"0ff25001-a2b8-46de-82a9-53143aa00d10": "Müller",
44-
"0e75ec18-2cb1-4606-9f18-034d28b07c19": "Eu",
45-
"c5fee926-855d-4419-b5bb-54e89010cea6": 23
46+
"name": "Eugine",
47+
"last_name": "Müller",
48+
"nickname": "Eu",
49+
"variableNotInRegistry": "tomato",
50+
"age": 23
4651
}
4752
},
4853
{
49-
"type": "4aebf73e-95e3-4fd1-95e7-237dcc4a4466",
54+
"type": "person",
5055
"attributes": {
51-
"6be95f85-c2d9-4daf-9de1-3939418af888": "Eustace",
52-
"0ff25001-a2b8-46de-82a9-53143aa00d10": "Nguyễn",
53-
"0e75ec18-2cb1-4606-9f18-034d28b07c19": "Eu",
54-
"c5fee926-855d-4419-b5bb-54e89010cea6": 24
56+
"name": "Eustace",
57+
"last_name": "Nguyễn",
58+
"nickname": "Eu",
59+
"variableNotInRegistry": "tomato",
60+
"age": 24
5561
}
5662
}
5763
]

protocol.json

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"node": {
88
"4aebf73e-95e3-4fd1-95e7-237dcc4a4466": {
99
"name": "person",
10-
"label": "Person",
1110
"color": "node-color-seq-1",
1211
"displayVariable": "0e75ec18-2cb1-4606-9f18-034d28b07c19",
1312
"iconVariant": "add-a-person",
@@ -260,7 +259,6 @@
260259
},
261260
"c93af3fe-9f84-4e85-acb5-5b15f30788c7": {
262261
"name": "dummytype",
263-
"label": "Dummy Type",
264262
"color": "node-color-seq-6",
265263
"displayVariable": "2377af3f-3c79-41da-9b0b-6570fb519b93",
266264
"variables": {
@@ -386,7 +384,6 @@
386384
},
387385
"eda5e3bb-8e1c-4216-9e06-adc0ff6b7f73": {
388386
"name": "venue",
389-
"label": "Venue",
390387
"displayVariable": "1e9ce62c-44c5-484d-9c26-0d20cc7d7238",
391388
"color": "node-color-seq-4",
392389
"iconVariant": "add-a-place",
@@ -589,7 +586,6 @@
589586
"edge": {
590587
"77199445-9d50-4646-b0bc-6d6b0c0e06bd": {
591588
"name": "friend",
592-
"label": "Friend",
593589
"color": "edge-color-seq-1",
594590
"variables": {
595591
"e343a91f-628d-4175-870c-957beffa0002": {
@@ -650,7 +646,6 @@
650646
},
651647
"867127d9-086b-403a-a3e7-2c7d32126546": {
652648
"name": "professional",
653-
"label": "Professional",
654649
"color": "edge-color-seq-2",
655650
"variables": {
656651
"d343a91f-628d-4175-870c-957beffa0002": {
@@ -672,11 +667,16 @@
672667
}
673668
},
674669
"assetManifest": {
675-
"previousInterview": {
670+
"previousInterview-json": {
676671
"source": "previousInterview.json",
677-
"name": "Previous Interview",
672+
"name": "Previous Interview with names not UUIDs",
678673
"type": "network"
679674
},
675+
"previousInterview-csv": {
676+
"source": "previousInterview.csv",
677+
"name": "Previous Interview in CSV format.",
678+
"type": "network"
679+
},
680680
"HIVServices": {
681681
"source": "HIVServices.json",
682682
"name": "HIVServices",
@@ -747,7 +747,7 @@
747747
{
748748
"id": "namegen1",
749749
"type": "NameGenerator",
750-
"label": "NG Closeness",
750+
"label": "NG with external data",
751751
"form": {
752752
"title": "Add A Person",
753753
"fields": [
@@ -791,8 +791,8 @@
791791
},
792792
{
793793
"id": "another-unique-id",
794-
"title": "People from your previous visit",
795-
"dataSource": "previousInterview",
794+
"title": "External data not using UUIDs",
795+
"dataSource": "previousInterview-json",
796796
"filter": {
797797
"join": "OR",
798798
"rules": [
@@ -846,6 +846,51 @@
846846
}
847847
]
848848
},
849+
{
850+
"id": "namegen1a",
851+
"type": "NameGenerator",
852+
"label": "NG CSV File",
853+
"form": {
854+
"title": "Add A Person",
855+
"fields": [
856+
{
857+
"variable": "6be95f85-c2d9-4daf-9de1-3939418af888",
858+
"component": "Text",
859+
"prompt": "What is this person's name?"
860+
},
861+
{
862+
"variable": "0e75ec18-2cb1-4606-9f18-034d28b07c19",
863+
"component": "Text",
864+
"prompt": "What is this person's nickname?"
865+
},
866+
{
867+
"variable": "c5fee926-855d-4419-b5bb-54e89010cea6",
868+
"component": "Number",
869+
"prompt": "What is this person's age?",
870+
"validation": {
871+
"maxValue": 99
872+
}
873+
}
874+
]
875+
},
876+
"subject": {
877+
"entity": "node",
878+
"type": "4aebf73e-95e3-4fd1-95e7-237dcc4a4466"
879+
},
880+
"panels": [
881+
{
882+
"id": "another-unique-id-123",
883+
"title": "External data from CSV",
884+
"dataSource": "previousInterview-csv"
885+
}
886+
],
887+
"prompts": [
888+
{
889+
"id": "2wedwee",
890+
"text": "NameGen with CSV external data"
891+
}
892+
]
893+
},
849894
{
850895
"id": "namegen2",
851896
"type": "NameGenerator",
@@ -956,7 +1001,7 @@
9561001
"b6f2c4b9-e42f-459b-8f59-a11a685f460d": 56,
9571002
"ae44b6ba-ad49-4ecf-bf38-b65decfce000": true
9581003
},
959-
"dataSource": "previousInterview",
1004+
"dataSource": "previousInterview-json",
9601005
"cardOptions": {
9611006
"displayLabel": "0e75ec18-2cb1-4606-9f18-034d28b07c19",
9621007
"additionalProperties": [
@@ -1189,7 +1234,7 @@
11891234
"b6f2c4b9-e42f-459b-8f59-a11a685f460d": 46,
11901235
"ae44b6ba-ad49-4ecf-bf38-b65decfce000": true
11911236
},
1192-
"dataSource": "previousInterview",
1237+
"dataSource": "previousInterview-json",
11931238
"cardOptions": {
11941239
"displayLabel": "0e75ec18-2cb1-4606-9f18-034d28b07c19",
11951240
"additionalProperties": [
@@ -1214,7 +1259,7 @@
12141259
"additionalAttributes": {
12151260
"94e2dee9-1c25-4b64-b8bb-4946465c3c07": true
12161261
},
1217-
"dataSource": "previousInterview",
1262+
"dataSource": "previousInterview-json",
12181263
"cardOptions": {
12191264
"displayLabel": "0e75ec18-2cb1-4606-9f18-034d28b07c19",
12201265
"additionalProperties": [

0 commit comments

Comments
 (0)