Skip to content

Commit 596baf5

Browse files
committedJun 20, 2023
Fix narrative view and dev/prod path discrepancy
1 parent 09cc07b commit 596baf5

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed
 

‎Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ RUN ./fix-popper.sh
1616
COPY . .
1717
RUN npm run build
1818

19+
RUN cp -r build/ips/assets build/assets
20+
1921
RUN cp build/404.html build/index.html
2022

2123
CMD ["npm", "run", "start"]

‎static/ips/assets/js/renderIPS.js

+20-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let headerLength = 0;
33

44
import config from "./config.js";
55

6-
export { update, updateFromText, mode };
6+
export { update };
77

88
let sectionCount = 0;
99

@@ -40,8 +40,10 @@ $(document).ready(function () {
4040
});
4141
});
4242
}
43-
$('#FhirDropdown').attr('href', "javascript:mode='Entries'; $('#mode').html('Displaying FHIR Entries'); updateFromText();");
44-
$('#NarrativeDropdown').attr('href', "javascript:mode='Text'; $('#mode').html('Displaying Narrative'); updateFromText();");
43+
44+
$('#FhirDropdown').on('click', () => updateDisplayMode('Entries'));
45+
$('#NarrativeDropdown').on('click', () => updateDisplayMode('Text'));
46+
4547
if (footerLength === 1) {
4648
$("#footer").load(config.html_dir + "footer.html", function () {
4749
// no actions on footer currently
@@ -53,6 +55,21 @@ $(window).on('load', function () {
5355
$("#content").show();
5456
});
5557

58+
const updateDisplayMode = function (displayMode) {
59+
let dropdown = $('#mode');
60+
61+
if (displayMode == 'Entries') {
62+
var newText = 'Displaying FHIR Entries';
63+
} else if (displayMode == 'Text') {
64+
var newText = 'Displaying Narrative';
65+
}
66+
if (newText) {
67+
mode = displayMode
68+
dropdown.html(newText);
69+
}
70+
updateFromText();
71+
};
72+
5673
// Clear data button function. Should be called on all new data loads
5774
const clearData = function () {
5875
// clear textbox

‎static/ips/index.html

+7-12
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,11 @@
2121
crossorigin="anonymous"></script>
2222
<script src="https://unpkg.com/squirrelly@7.9.2/dist/squirrelly.min.js"></script>
2323
<!-- IPS Specific Custom CSS-->
24-
<link rel="stylesheet" href="/ips/assets/css/custom.css">
24+
<link rel="stylesheet" href="./assets/css/custom.css">
2525

2626
<!-- IPS Rendering -->
27-
<script type="module" src="/ips/assets/js/renderIPS.js"></script>
28-
<script type="module" src="/ips/assets/js/retreiveIPS.js"></script>
29-
<script type="module">
30-
import { updateFromText, mode } from "/ips/assets/js/renderIPS.js";
31-
window.updateFromText = updateFromText;
32-
window.mode = mode;
33-
</script>
27+
<script type="module" src="./assets/js/renderIPS.js"></script>
28+
<script type="module" src="./assets/js/retreiveIPS.js"></script>
3429

3530

3631
<title>IPS Viewer</title>
@@ -50,17 +45,17 @@
5045
<!-- IPS documents have both machine-processable FHIR resources and Narrative HTML -->
5146
<div style="padding-left: 17px">
5247
<h2>Patient Summary Viewer</h2>
53-
<div class="dropdown" style="display:none">
48+
<div class="dropdown" style="display:inline">
5449
<button class="btn btn-secondary dropdown-toggle" id="mode" type="button" data-toggle="dropdown"
5550
aria-haspopup="true" aria-expanded="false">
56-
Display FHIR Entries
51+
Displaying FHIR Entries
5752
</button>
5853
<br>
5954
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
60-
<a id="FhirDropdown" class="dropdown-item">
55+
<a id="FhirDropdown" class="dropdown-item" style="cursor:pointer">
6156
Display FHIR Entries
6257
</a>
63-
<a id= "NarrativeDropdown" class="dropdown-item" >
58+
<a id= "NarrativeDropdown" class="dropdown-item" style="cursor:pointer">
6459
Display Narrative
6560
</a>
6661
</div>

0 commit comments

Comments
 (0)
Please sign in to comment.