-
Notifications
You must be signed in to change notification settings - Fork 0
Necropsy reporting enhancements #569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a19f804
last project and protocol
labkey-martyp eb7f6a0
Necropsy print report
labkey-martyp 9a2e01f
Inactive users not in performedby dropdowns
labkey-martyp 3f4dc71
Performed by updates
labkey-martyp bbf2979
remove commented code
labkey-martyp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
nirc_ehr/resources/queries/study/demographicsLastProject.query.xml
This file contains hidden or 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,13 @@ | ||
| <query xmlns="http://labkey.org/data/xml/query"> | ||
| <metadata> | ||
| <tables xmlns="http://labkey.org/data/xml"> | ||
| <table tableName="demographicsLastProject" tableDbType="NOT_IN_DB"> | ||
| <columns> | ||
| <column columnName="project"> | ||
| <columnTitle>Last Project</columnTitle> | ||
| </column> | ||
| </columns> | ||
| </table> | ||
| </tables> | ||
| </metadata> | ||
| </query> |
10 changes: 10 additions & 0 deletions
10
nirc_ehr/resources/queries/study/demographicsLastProject.sql
This file contains hidden or 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,10 @@ | ||
|
|
||
| SELECT | ||
| d2.id, | ||
| d2.project, | ||
| h.enddate as enddate | ||
|
|
||
| FROM study.assignment d2 | ||
| JOIN (SELECT id, max(date) as maxDate, max(enddate) as enddate FROM study.assignment h GROUP BY id) h | ||
| ON (h.id = d2.id and d2.date = h.maxdate) | ||
| WHERE d2.qcstate.publicdata = true | ||
13 changes: 13 additions & 0 deletions
13
nirc_ehr/resources/queries/study/demographicsLastProtocol.query.xml
This file contains hidden or 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,13 @@ | ||
| <query xmlns="http://labkey.org/data/xml/query"> | ||
| <metadata> | ||
| <tables xmlns="http://labkey.org/data/xml"> | ||
| <table tableName="demographicsLastProtocol" tableDbType="NOT_IN_DB"> | ||
| <columns> | ||
| <column columnName="protocol"> | ||
| <columnTitle>Last Protocol</columnTitle> | ||
| </column> | ||
| </columns> | ||
| </table> | ||
| </tables> | ||
| </metadata> | ||
| </query> |
10 changes: 10 additions & 0 deletions
10
nirc_ehr/resources/queries/study/demographicsLastProtocol.sql
This file contains hidden or 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,10 @@ | ||
|
|
||
| SELECT | ||
| d2.id, | ||
| d2.protocol, | ||
| h.enddate as enddate | ||
|
|
||
| FROM study.protocolAssignment d2 | ||
| JOIN (SELECT id, max(date) as maxDate, max(enddate) as enddate FROM study.protocolAssignment h GROUP BY id) h | ||
| ON (h.id = d2.id and d2.date = h.maxdate) | ||
| WHERE d2.qcstate.publicdata = true | ||
labkey-bpatel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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 hidden or 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 hidden or 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,94 @@ | ||
|
|
||
| <style> | ||
| .page-break { | ||
| page-break-before: always; /* Older CSS spec */ | ||
| break-before: page; /* Newer spec */ | ||
| } | ||
|
|
||
| @media print { | ||
| .hide-on-print { | ||
| display: none !important; | ||
| } | ||
| } | ||
|
|
||
| /* Top border on panel header when printing */ | ||
| .panel-heading { | ||
| border-top: 1px solid black; | ||
| } | ||
| </style> | ||
| <div class="hide-on-print"> | ||
| <label for="animalId" style="margin-right: 10px;">Animal Id</label><input id="animalId" type="text" /> | ||
| <button id="animalIdSubmit" name="animalIdSubmit">Submit</button> | ||
| <br> | ||
| <div id="animalIdError"></div> | ||
| </div> | ||
| <br> | ||
|
|
||
| <div id="animalDeath"></div> | ||
| <div id="animalNecropsy"></div> | ||
| <div class="page-break"></div> | ||
| <div id="grossPathology"></div> | ||
| <div id="tissueDisposition"></div> | ||
|
|
||
| <script type="text/javascript" nonce="<%=scriptNonce%>"> | ||
| document.getElementById('animalIdSubmit')['onclick'] = function(){ submitNecropsyForm(); return false; } | ||
|
|
||
| const submitNecropsyForm = function() { | ||
| const animalId = document.getElementById('animalId').value; | ||
|
|
||
| if (!animalId) { | ||
| document.getElementById('animalIdError').innerHTML = 'Please enter an Animal Id'; | ||
| } | ||
|
|
||
| const animalIdError = document.getElementById('animalIdError'); | ||
| const animalDeath = document.getElementById('animalDeath'); | ||
| const animalNecropsy = document.getElementById('animalNecropsy'); | ||
| const grossPathology = document.getElementById('grossPathology'); | ||
| const tissueDisposition = document.getElementById('tissueDisposition'); | ||
|
|
||
| animalIdError.innerHTML = ''; | ||
| animalDeath.innerHTML = ''; | ||
| animalNecropsy.innerHTML = ''; | ||
| grossPathology.innerHTML = ''; | ||
| tissueDisposition.innerHTML = ''; | ||
|
|
||
| const filterArray = [LABKEY.Filter.create('Id', animalId, LABKEY.Filter.Types.EQUAL)] | ||
|
|
||
| Ext4.create('LDK.panel.DetailsPanel', { | ||
| store: { | ||
| schemaName: 'study', | ||
| queryName: 'deaths', | ||
| filterArray: filterArray, | ||
| columns: 'Id,Id/demographics/species,date,reason,remark,performedby,Id/lastProtocol/protocol,Id/lastProject/project', | ||
| }, | ||
| title: 'Death', | ||
| renderTo: 'animalDeath', | ||
| showBackBtn: false | ||
| }); | ||
|
|
||
| Ext4.create('LDK.panel.DetailsPanel', { | ||
| store: { | ||
| schemaName: 'study', | ||
| queryName: 'necropsy', | ||
| filterArray: filterArray, | ||
| }, | ||
| title: 'Necropsy', | ||
| renderTo: 'animalNecropsy', | ||
| showBackBtn: false | ||
| }); | ||
|
|
||
| LDK.Utils.getReadOnlyQWP({ | ||
| title: 'Gross Pathology', | ||
| schemaName: 'study', | ||
| queryName: 'grossPathology', | ||
| filterArray: filterArray, | ||
| }).render('grossPathology'); | ||
|
|
||
| LDK.Utils.getReadOnlyQWP({ | ||
| title: 'Tissue Disposition', | ||
| schemaName: 'study', | ||
| queryName: 'tissueDisposition', | ||
| filterArray: filterArray, | ||
| }).render('tissueDisposition'); | ||
| } | ||
| </script> |
This file contains hidden or 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,3 @@ | ||
| <view xmlns="http://labkey.org/data/xml/view" template="print" title="Necropsy Report"> | ||
| <requiresLogin/> | ||
| </view> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.