Skip to content

Commit

Permalink
Updates #52
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ignatov committed Jun 10, 2019
1 parent fff1c79 commit a5dc066
Show file tree
Hide file tree
Showing 7 changed files with 1,357 additions and 215 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cSpell.words": [
"agemos",
"weeker"
]
}
1 change: 1 addition & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ i {
padding: 10px 10px 10px 60px;
text-align: left;
width: 150px;
line-height: normal;
}

#loading-indicator h2 .msg {
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

<!-- Standard JS Libraries -->
<script src="js/polyfills.js"></script>
<script src="node_modules/fhirclient/fhir-client.js"></script>
<!-- <script src="node_modules/fhirclient/fhir-client.js"></script> -->
<script src="https://combinatronics.com/smart-on-fhir/client-js/master/build/fhir-client.js"></script>
<script type="text/javascript" src="load-fhir-data.js"></script>
<script type="text/javascript" src="lib/jquery-1.8.2.js"></script>
<script type="text/javascript" src="lib/jquery-ui-1.9.1.js"></script>
Expand Down
15 changes: 7 additions & 8 deletions js/gc-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@
onModelsReady();
// Patient
GC.get_data()
.done(function(data) {
.then(function(data) {
GC.currentPatient = PATIENT = new GC.Patient(
data.demographics,
data.vitals,
Expand All @@ -832,18 +832,17 @@
GC.translatePreemieDatasets(PATIENT);
done();
})
.fail(function(response){
var msg = response.responseText;
console.log("Failed.");
.catch(function(error) {
console.error(error);

if (response.showMessage) {
showMessage(response);
if (error.showMessage) {
showMessage(error.message);
}
else {
$("#loading-indicator h2").html(msg);
$("#loading-indicator h2").html(error.message);
}

if (response.status === 404) {
if (error.status === 404) {
$("#loading-indicator h2").append($("<button>Make me a fake one!</button>"));
$("#loading-indicator button").click(function(){
$.get("/my/ccda/fixture").success(function(){
Expand Down
5 changes: 3 additions & 2 deletions launch.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Growth Chart SMART Application</title>
<script src="node_modules/fhirclient/fhir-client.js"></script>
<!-- <script src="node_modules/fhirclient/fhir-client.js"></script> -->
<script src="https://combinatronics.com/smart-on-fhir/client-js/master/build/fhir-client.js"></script>
<script>
FHIR.oauth2.authorize({
"client_id": "growth_chart",
"scope": "patient/*.read"
"scope": "patient/*.read offline_access"
});
</script>
</head>
Expand Down
Loading

0 comments on commit a5dc066

Please sign in to comment.