Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 37f0ea8

Browse files
committed
Support sample transcripts, starting w/ Atlas. Uses query param.
1 parent 8372d11 commit 37f0ea8

File tree

2 files changed

+225
-3
lines changed

2 files changed

+225
-3
lines changed

app/components/samples/atlas.json

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://purl.kinexis.com:8888/ctx/cbe/v1/record_of_performance/"
4+
},
5+
"@id": "http://purl.kinexis.com:8888/6675c410-1d03-0133-b54c-406c8f40a599",
6+
"@type": "RecordOfPerformance",
7+
"created_at": "2015-05-05T04:00:00.000Z",
8+
"organization": {
9+
"@id": "http://purl.kinexis.com:8888/organizations/7",
10+
"@type": "Organization",
11+
"legal_name": "Atlas University",
12+
"website": "ili.imsglobal.org"
13+
},
14+
"progress": [
15+
{
16+
"@id": "http://purl.kinexis.com:8888/5ce4503a-c426-4deb-80e9-b374680a238a",
17+
"@type": "Progress",
18+
"completed": false,
19+
"towards": {
20+
"@id": "http://purl.kinexis.com:8888/programs/7",
21+
"@type": "Program",
22+
"degree_level": "Master of Science",
23+
"title": "Nursing - Nursing Informatics"
24+
}
25+
},
26+
{
27+
"@id": "http://purl.kinexis.com:8888/8a5dbb9c-0e1c-47a8-95b9-7ad6edb2eb0f",
28+
"@type": "Progress",
29+
"completed": true,
30+
"achievement_level": {
31+
"@id": "http://purl.kinexis.com:8888/achievementLevels/Completed?version=1",
32+
"@type": "AchievementLevel",
33+
"level": "Completed"
34+
},
35+
"date_completed": "2015-04-20T04:00:00.000Z",
36+
"towards": {
37+
"@id": "http://purl.kinexis.com:8888/course_sections/61",
38+
"@type": "CourseSection",
39+
"code": "MSN6414",
40+
"title": "Data Management and Health Care Technology",
41+
"description": "Learners in this course analyze the use of data and databases as key drivers in nursing informatics. Throughout the course, learners demonstrate competence in managing and interpreting data in such a way that enhances their roles and decision-making capabilities in today’s health care technology environments."
42+
},
43+
"contexts": [
44+
{
45+
"@id": "http://purl.kinexis.com:8888/programs/7",
46+
"@type": "Program"
47+
}
48+
]
49+
},
50+
{
51+
"@id": "http://purl.kinexis.com:8888/",
52+
"@type": "Progress",
53+
"completed": true,
54+
"achievement_level": {
55+
"@id": "http://purl.kinexis.com:8888/achievementLevels/Basic?version=2",
56+
"@type": "AchievementLevel",
57+
"level": "Basic"
58+
},
59+
"date_completed": "2015-04-20T04:00:00.000Z",
60+
"towards": {
61+
"@id":"http://example.com/competencies/5",
62+
"@type": "Competency",
63+
"code": "MSN6414",
64+
"statement": "Integrate information technology to align with nursing practice.",
65+
"children": [
66+
{
67+
"@id": "http://purl.kinexis.com:8888/competencies/115",
68+
"@type": "Competency",
69+
"code": "MSN6414_1",
70+
"statement": "Differentiate database standard terminologies used by different health information systems."
71+
},
72+
{
73+
"@id": "http://purl.kinexis.com:8888/competencies/115",
74+
"@type": "Competency",
75+
"code": "MSN6414_2",
76+
"statement": "Apply data management techniques to decision making in nursing practice."
77+
}
78+
]
79+
},
80+
"contexts": [
81+
{
82+
"@id": "http://purl.kinexis.com:8888/course_sections/61",
83+
"@type": "CourseSection"
84+
}
85+
]
86+
},
87+
{
88+
"@id": "http://purl.kinexis.com:8888/",
89+
"@type": "Progress",
90+
"completed": true,
91+
"achievement_level": {
92+
"@id": "http://purl.kinexis.com:8888/achievementLevels/Basic?version=2",
93+
"@type": "AchievementLevel",
94+
"level": "Basic"
95+
},
96+
"date_completed": "2015-04-20T04:00:00.000Z",
97+
"towards": {
98+
"@id": "http://purl.kinexis.com:8888/competencies/115",
99+
"@type": "Competency",
100+
"code": "MSN6414_1",
101+
"statement": "Differentiate database standard terminologies used by different health information systems.",
102+
"parent": {
103+
"@id":"http://example.com/competencies/5",
104+
"@type": "Competency",
105+
"code": "MSN6414",
106+
"statement": "Integrate information technology to align with nursing practice."
107+
}
108+
},
109+
"contexts": [
110+
{
111+
"@id": "http://purl.kinexis.com:8888/course_sections/61",
112+
"@type": "CourseSection"
113+
}
114+
]
115+
},{
116+
"@id": "http://purl.kinexis.com:8888/",
117+
"@type": "Progress",
118+
"completed": true,
119+
"achievement_level": {
120+
"@id": "http://purl.kinexis.com:8888/achievementLevels/Proficient?version=2",
121+
"@type": "AchievementLevel",
122+
"level": "Proficient"
123+
},
124+
"date_completed": "",
125+
"towards": {
126+
"@id": "http://purl.kinexis.com:8888/competencies/115",
127+
"@type": "Competency",
128+
"code": "MSN6414_2",
129+
"statement": "Apply data management techniques to decision making in nursing practice.",
130+
"parent": {
131+
"@id":"http://example.com/competencies/5",
132+
"@type": "Competency",
133+
"code": "MSN6414",
134+
"statement": "Integrate information technology to align with nursing practice."
135+
}
136+
},
137+
"contexts": [
138+
{
139+
"@id": "http://purl.kinexis.com:8888/course_sections/61",
140+
"@type": "CourseSection"
141+
}
142+
]
143+
},{
144+
"@id": "http://purl.kinexis.com:8888/",
145+
"@type": "Progress",
146+
"completed": true,
147+
"achievement_level": {
148+
"@id": "http://purl.kinexis.com:8888/achievementLevels/Completed?version=1",
149+
"@type": "AchievementLevel",
150+
"level": "Completed"
151+
},
152+
"date_completed": "2015-04-20T04:00:00.000Z",
153+
"towards": {
154+
"@id": "http://purl.kinexis.com:8888/course_sections/63",
155+
"@type": "CourseSection",
156+
"code": "MSN6416",
157+
"title": "Managing the Nursing Informatics Life Cycle."
158+
},
159+
"contexts": [
160+
{
161+
"@id": "http://purl.kinexis.com:8888/programs/7",
162+
"@type": "Program"
163+
}
164+
]
165+
},{
166+
"@id": "http://purl.kinexis.com:8888/",
167+
"@type": "Progress",
168+
"completed": true,
169+
"achievement_level": {
170+
"@id": "http://purl.kinexis.com:8888/achievementLevels/Completed?version=1",
171+
"@type": "AchievementLevel",
172+
"level": "Completed"
173+
},
174+
"date_completed": "2015-04-20T04:00:00.000Z",
175+
"towards": {
176+
"@id": "http://purl.kinexis.com:8888/course_sections/64",
177+
"@type": "CourseSection",
178+
"code": "MSN6412",
179+
"title": "Health Informatics Systems Planning, Analysis, Design, and Build for Nursing."
180+
},
181+
"contexts": [
182+
{
183+
"@id": "http://purl.kinexis.com:8888/programs/7",
184+
"@type": "Program"
185+
}
186+
]
187+
}
188+
],
189+
"user": {
190+
"@id": "http://purl.kinexis.com:8888/users/14",
191+
"@type": "Person",
192+
"email": "tarne@hotmail.com",
193+
"familyName": "Hafez",
194+
"givenName": "Olivia",
195+
"middleName": "R",
196+
"sourced_id": 123456
197+
}
198+
}

app/components/transcript/transcriptService.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import _ from 'lodash';
44
import moment from 'moment';
55
//import mockTranscript from './mockTranscript';
66

7+
import atlas from "file?name=[path][name].[ext]!../samples/atlas.json";
8+
79
export default ['$http', '$q', function($http, $q){
810

911
//the 'levels' of competencies
@@ -15,11 +17,33 @@ export default ['$http', '$q', function($http, $q){
1517
return levels;
1618
};
1719

20+
this.getTranscriptUrl = function(user) {
21+
//
22+
// Extract sample query param, and match against whitelist of samples.
23+
// If match, return sample json.
24+
// Else, use transcript api.
25+
//
26+
const matches = window.location.href.match(/sample=([^&]*)/);
27+
const sample = !!matches && matches.length === 2 ? matches[1] : null;
28+
29+
switch (sample) {
30+
case 'atlas': return atlas;
31+
}
32+
33+
return window.lo_api_config ?
34+
window.lo_api_config.root + `/api/v2/users/${user}/transcript`:
35+
`/api/v2/users/${user}/transcript`;
36+
};
37+
1838
this.getTranscriptForUser = function(user){
39+
1940
//todo: pull this out to siome sort of filter
20-
const url = window.lo_api_config ?
21-
window.lo_api_config.root + `/api/v2/users/${user}/transcript`:
22-
`/api/v2/users/${user}/transcript`;
41+
const url = this.getTranscriptUrl(user);
42+
43+
// DEBUG:
44+
45+
console.dir("Fetching: "+url);
46+
console.dir(window.location);
2347

2448
return $http.get(url)
2549
.then(res => {

0 commit comments

Comments
 (0)