diff --git a/nbri_ehr/resources/domain-templates/ehr_lookups.template.xml b/nbri_ehr/resources/domain-templates/ehr_lookups.template.xml
index 051dfb2..b96a281 100644
--- a/nbri_ehr/resources/domain-templates/ehr_lookups.template.xml
+++ b/nbri_ehr/resources/domain-templates/ehr_lookups.template.xml
@@ -55,6 +55,10 @@
string
+
+ string
+ 10
+
dateTime
diff --git a/nbri_ehr/resources/queries/ehr/project.js b/nbri_ehr/resources/queries/ehr/project.js
index bb57d44..33ecb6e 100644
--- a/nbri_ehr/resources/queries/ehr/project.js
+++ b/nbri_ehr/resources/queries/ehr/project.js
@@ -26,7 +26,7 @@ function onInit(event, helper){
function onUpsert(helper, scriptErrors, row, oldRow) {
if (!helper.isETL()) {
if (!row.project) {
- row.project = nextProjectNum;
+ row.project = nextProjectNum++;
}
}
}
\ No newline at end of file
diff --git a/nbri_ehr/resources/queries/ehr/project.query.xml b/nbri_ehr/resources/queries/ehr/project.query.xml
index 97ce065..cd38553 100644
--- a/nbri_ehr/resources/queries/ehr/project.query.xml
+++ b/nbri_ehr/resources/queries/ehr/project.query.xml
@@ -17,6 +17,9 @@
Project Id
+
+ false
+ false
diff --git a/nbri_ehr/resources/queries/ehr_lookups/cage.query.xml b/nbri_ehr/resources/queries/ehr_lookups/cage.query.xml
index c3b3060..88ddffe 100644
--- a/nbri_ehr/resources/queries/ehr_lookups/cage.query.xml
+++ b/nbri_ehr/resources/queries/ehr_lookups/cage.query.xml
@@ -33,6 +33,9 @@
value
+
+ Per Diem
+
diff --git a/nbri_ehr/resources/queries/ehr_lookups/cage/.qview.xml b/nbri_ehr/resources/queries/ehr_lookups/cage/.qview.xml
index 6f9c44d..6d3b27f 100644
--- a/nbri_ehr/resources/queries/ehr_lookups/cage/.qview.xml
+++ b/nbri_ehr/resources/queries/ehr_lookups/cage/.qview.xml
@@ -3,6 +3,7 @@
+
diff --git a/nbri_ehr/resources/queries/ehr_lookups/roomUtilization.sql b/nbri_ehr/resources/queries/ehr_lookups/roomUtilization.sql
index de3fa9e..4b15932 100644
--- a/nbri_ehr/resources/queries/ehr_lookups/roomUtilization.sql
+++ b/nbri_ehr/resources/queries/ehr_lookups/roomUtilization.sql
@@ -11,6 +11,6 @@ SELECT
r.area,
FROM ehr_lookups.rooms r
LEFT JOIN study.housing h
-ON r.room = h.room
+ON r.room = h.room AND h.isActive = true AND h.qcstate.publicdata = true
GROUP BY r.room, r.building, r.area
\ No newline at end of file
diff --git a/nbri_ehr/resources/web/nbri_ehr/field/EditCase.js b/nbri_ehr/resources/web/nbri_ehr/field/EditCase.js
index 9b240a5..16f9421 100644
--- a/nbri_ehr/resources/web/nbri_ehr/field/EditCase.js
+++ b/nbri_ehr/resources/web/nbri_ehr/field/EditCase.js
@@ -74,10 +74,14 @@ Ext4.define('NBRI_EHR.form.EditCases', {
fieldEnableChange: function(disable){
var panel = this.up('panel');
panel.items.each(function(item){
- if (item.name != 'objectid'){
- this.disableItem(item, disable);
- this.disabledDisplay(item, disable);
- }
+ if (item.name === 'objectid')
+ return;
+
+ // A saved case stays bound to its animal, so Edit must never reopen the Id.
+ var itemDisable = disable || (this.editing && item.name === 'Id');
+
+ this.disableItem(item, itemDisable);
+ this.disabledDisplay(item, itemDisable);
}, this);
},
@@ -93,11 +97,11 @@ Ext4.define('NBRI_EHR.form.EditCases', {
},
onCaseSelect: function(){
+ this.editing = true;
this.fieldEnableChange(true);
if (this.readonly) {
return;
}
- this.editing = true;
this.disabled = true;
this.editBtn.show();
},