Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic display for Managing Notes
- Loading branch information
Showing
7 changed files
with
175 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
api/src/main/java/org/openmrs/module/chartsearch/TestPlayStationForMyModules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.openmrs.module.chartsearch; | ||
|
||
|
||
public class TestPlayStationForMyModules { | ||
private static String appendBackwardSlashBeforeMustBePassedCharacters(String str) { | ||
if (str.contains("'")) { | ||
str = str.replace("'", "\'"); | ||
} | ||
if (str.contains("\"")) { | ||
str = str.replace("\"", "\\\""); | ||
} | ||
return str; | ||
} | ||
|
||
public static void main(String[] dsds) { | ||
System.out.println(appendBackwardSlashBeforeMustBePassedCharacters("testst's")); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ava/org/openmrs/module/chartsearch/fragment/controller/ManageNotesFragmentController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* This Source Code Form is subject to the terms of the Mozilla Public License, | ||
* v. 2.0. If a copy of the MPL was not distributed with this file, You can | ||
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under | ||
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license. | ||
* | ||
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS | ||
* graphic logo is a trademark of OpenMRS Inc. | ||
*/ | ||
package org.openmrs.module.chartsearch.fragment.controller; | ||
|
||
import org.openmrs.module.chartsearch.ChartSearchCache; | ||
import org.openmrs.ui.framework.fragment.FragmentModel; | ||
|
||
public class ManageNotesFragmentController { | ||
|
||
ChartSearchCache cache = new ChartSearchCache(); | ||
|
||
public void controller(FragmentModel fragmentModel) { | ||
fragmentModel.addAttribute("allFoundNotes", cache.fetchAllNotesForManageUI(true).toString()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,66 @@ | ||
<h1>Manage Notes</h1> | ||
<style type="text/css"> | ||
</style> | ||
|
||
|
||
<script type="text/javascript"> | ||
var allNotes =' ${ allFoundNotes }'; | ||
var notesAfterparse = JSON.parse(allNotes); | ||
jq(document).ready(function(event) { | ||
displayExistingNotes(); | ||
function displayExistingNotes() { | ||
var displayNotes; | ||
if(notesAfterparse && notesAfterparse.length !== 0) { | ||
displayNotes = "<tr><th><input type='checkbox' id='select-all-notes' style='width:55%;height:1.5em;'/>Patient</th><th>Search Phrase</th><th>Comment/Note</th><th>Priority</th><th>Last Updated</th></tr>"; | ||
for(i = 0; i < notesAfterparse.length; i++) { | ||
var note = notesAfterparse[i]; | ||
if(note) { | ||
var uuid = note.uuid; | ||
var patient = "<td><input type='checkbox' class='select-this-note' id='" + uuid + "' style='width:55%;height:1.5em;'/>" + note.patientFName + "</td>"; | ||
var phrase = "<td>" + note.searchPhrase + "</td>"; | ||
var comment = "<td><textarea class='m-notes-comment' style='width: 488px;'>" + note.comment + "</textarea></td>"; | ||
var priority = setPriorityDisplay(note.priority); | ||
var date = new Date(note.createdOrLastModifiedAt); | ||
displayNotes += "<tr>" + patient + phrase + comment + priority + "<td>" + date.toString() + "</td></tr>"; | ||
} | ||
} | ||
} | ||
if(displayNotes && displayNotes !== "") { | ||
jq("#manage-notes-display-table").html(displayNotes); | ||
} | ||
} | ||
function setPriorityDisplay(priority) { | ||
var allPiorities = ["LOW", "HIGH"]; | ||
var priorityDisplay = ""; | ||
if(priority === allPiorities[1]) { | ||
priorityDisplay = "<td><select class='m-notes-priority'><option>" + allPiorities[1] + "</option><option>" + allPiorities[0] + "</option></select></td>"; | ||
} else { | ||
priorityDisplay = "<td><select class='m-notes-priority'><option>" + allPiorities[0] + "</option><option>" + allPiorities[1] + "</option></select></td>"; | ||
} | ||
return priorityDisplay; | ||
} | ||
}); | ||
</script> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h1>Manage Notes</h1> | ||
<div id="manage-notes-display"> | ||
<table id="manage-notes-display-table"></table> | ||
</div> |