-
Notifications
You must be signed in to change notification settings - Fork 3
Add earliest housing demographics provider #868
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
5cfa757
Added earliest housing demographics provider and query.
spamhurts 171ee7a
removed redundant column wrapping method and replaced "Id" strings wi…
spamhurts 7c22bdf
actually removed the redundant column wrapping method that was missed…
spamhurts 8431213
- Use the ID_COLUMN constant in QueryConstants.java.
spamhurts c6c0029
commented out earliest housing registration to sort out test issue
spamhurts 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
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
17 changes: 17 additions & 0 deletions
17
snprc_ehr/resources/queries/study/demographicsEarliestHousing.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,17 @@ | ||
| /* | ||
| * Copyright (c) 2017-2018 LabKey Corporation | ||
| * | ||
| * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 | ||
| */ | ||
| SELECT | ||
| d.Id AS Id, | ||
| h.date as FirstHousingDate, | ||
| h.room as FirstHousingRoom, | ||
| h.room.area.description as FirstHousingRoomDescription | ||
| FROM study.demographics d | ||
|
|
||
|
|
||
| --date of first housing | ||
| LEFT JOIN study.housing as h on h.id = d.id and h.qcstate.publicdata = true | ||
| and h.date = (select min(c1.date) from study.housing as c1 | ||
| where h.id = c1.id) | ||
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
43 changes: 43 additions & 0 deletions
43
snprc_ehr/src/org/labkey/snprc_ehr/demographics/EarliestHousingDemographicsProvider.java
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,43 @@ | ||
| package org.labkey.snprc_ehr.demographics; | ||
|
|
||
| import org.labkey.api.ehr.demographics.AbstractListDemographicsProvider; | ||
| import org.labkey.api.module.Module; | ||
| import org.labkey.api.query.FieldKey; | ||
|
|
||
| import java.util.Collection; | ||
| import java.util.HashSet; | ||
| import java.util.Set; | ||
|
|
||
| public class EarliestHousingDemographicsProvider extends AbstractListDemographicsProvider | ||
|
|
||
| { | ||
|
|
||
| public EarliestHousingDemographicsProvider(Module owner) | ||
| { | ||
| super(owner, "study", "demographicsEarliestHousing", "earliestHousing"); | ||
| _supportsQCState = false; | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() | ||
| { | ||
| return "Earliest Housing"; | ||
| } | ||
|
|
||
| @Override | ||
| protected Collection<FieldKey> getFieldKeys() | ||
| { | ||
| Set<FieldKey> keys = new HashSet<>(); | ||
| keys.add(FieldKey.fromString("FirstHousingDate")); | ||
| keys.add(FieldKey.fromString("FirstHousingRoom")); | ||
| keys.add(FieldKey.fromString("FirstHousingRoomDescription")); | ||
|
|
||
| return keys; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean requiresRecalc(String schema, String query) | ||
| { | ||
| return ("study".equalsIgnoreCase(schema) && "Housing".equalsIgnoreCase(query)); | ||
| } | ||
| } |
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.