Skip to content

Commit bac6611

Browse files
Merge 25.3 to 25.5
2 parents fe6a2c4 + f0febff commit bac6611

File tree

7 files changed

+130
-4
lines changed

7 files changed

+130
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE ehr_compliancedb.requirementsperemployee ADD COLUMN LSID LSIDtype;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE ehr_compliancedb.requirementsperemployee ADD Lsid LsidType null;

EHR_ComplianceDB/resources/schemas/ehr_compliancedb.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,17 @@
453453
<isKeyField>true</isKeyField>
454454
<columnTitle>Key</columnTitle>
455455
</column>
456+
<column columnName="lsid">
457+
<datatype>lsidtype</datatype>
458+
<isReadOnly>true</isReadOnly>
459+
<isHidden>true</isHidden>
460+
<isUserEditable>false</isUserEditable>
461+
<fk>
462+
<fkColumnName>ObjectUri</fkColumnName>
463+
<fkTable>Object</fkTable>
464+
<fkDbSchema>exp</fkDbSchema>
465+
</fk>
466+
</column>
456467
<column columnName="employeeid">
457468
<columnTitle>Employee Id</columnTitle>
458469
<fk>

EHR_ComplianceDB/src/org/labkey/ehr_compliancedb/EHR_ComplianceDBModule.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
import org.jetbrains.annotations.Nullable;
2020
import org.labkey.api.data.DbSchema;
2121
import org.labkey.api.data.DbSchemaType;
22+
import org.labkey.api.exp.property.PropertyService;
2223
import org.labkey.api.ldk.ExtendedSimpleModule;
2324
import org.labkey.api.ldk.LDKService;
2425
import org.labkey.api.ldk.notification.NotificationService;
26+
import org.labkey.ehr_compliancedb.model.EHRComplianceDBDomainKind;
2527
import org.labkey.ehr_compliancedb.notification.EmployeeComplianceNotification;
2628
import org.labkey.api.module.ModuleContext;
2729
import org.labkey.ehr_compliancedb.api.EHR_ComplianceService;
@@ -49,7 +51,7 @@ public String getName()
4951
@Override
5052
public @Nullable Double getSchemaVersion()
5153
{
52-
return 12.44;
54+
return 25.001;
5355
}
5456

5557
@Override
@@ -64,6 +66,7 @@ protected void init()
6466
addController(CONTROLLER_NAME, EHR_ComplianceDBController.class);
6567

6668
EHR_ComplianceService.setInstance(new EHR_ComplianceServiceImpl());
69+
PropertyService.get().registerDomainKind(new EHRComplianceDBDomainKind());
6770
}
6871

6972
@Override

EHR_ComplianceDB/src/org/labkey/ehr_compliancedb/EHR_ComplianceDBUserSchema.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
import org.labkey.api.module.Module;
2626
import org.labkey.api.query.DefaultSchema;
2727
import org.labkey.api.query.QuerySchema;
28+
import org.labkey.api.query.SimpleTableDomainKind;
2829
import org.labkey.api.query.SimpleUserSchema;
2930
import org.labkey.api.security.User;
31+
import org.labkey.ehr_compliancedb.model.EHRComplianceDBDomainKind;
3032

3133
/**
3234
* User: bimber
@@ -36,6 +38,7 @@
3638
public class EHR_ComplianceDBUserSchema extends SimpleUserSchema
3739
{
3840
public static final String TABLE_REQUIREMENTS = "requirements";
41+
private static final String TABLE_REQUIREMENTSPEREMPLOYEE = "requirementsperemployee";
3942

4043
public EHR_ComplianceDBUserSchema(User user, Container container, DbSchema dbschema)
4144
{
@@ -50,6 +53,23 @@ public TableInfo createTable(String name, ContainerFilter cf)
5053
SchemaTableInfo table = _dbSchema.getTable(name);
5154
return new ContainerScopedTable<>(this, table, cf, "requirementname").init();
5255
}
56+
else if (TABLE_REQUIREMENTSPEREMPLOYEE.equalsIgnoreCase(name))
57+
{
58+
SchemaTableInfo table = _dbSchema.getTable(name);
59+
return new SimpleTable<>(this, table, cf)
60+
{
61+
// There are issues with the '_' in the name of this module and creating template domains. This addresses
62+
// the domain URI by normalizing with the domain kind.
63+
@Override
64+
public String getDomainURI()
65+
{
66+
if (_objectUriCol == null)
67+
return null;
68+
69+
return SimpleTableDomainKind.getDomainURI(EHRComplianceDBDomainKind.KIND_NAME, getName(), getDomainContainer(), _userSchema.getUser());
70+
}
71+
}.init();
72+
}
5373

5474
return super.createTable(name, cf);
5575
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package org.labkey.ehr_compliancedb.model;
2+
3+
import org.labkey.api.data.Container;
4+
import org.labkey.api.exp.property.Domain;
5+
import org.labkey.api.gwt.client.model.GWTPropertyDescriptor;
6+
import org.labkey.api.query.ExtendedTableDomainKind;
7+
import org.labkey.api.security.User;
8+
import org.labkey.api.security.permissions.AdminPermission;
9+
import org.labkey.data.xml.domainTemplate.DomainTemplateType;
10+
import org.labkey.data.xml.domainTemplate.EHRComplianceDBTemplateType;
11+
12+
13+
import java.util.List;
14+
import java.util.Set;
15+
16+
public class EHRComplianceDBDomainKind extends ExtendedTableDomainKind
17+
{
18+
public static final String KIND_NAME = "EHRComplianceDB";
19+
20+
@Override
21+
public boolean canCreateDefinition(User user, Container container)
22+
{
23+
return container.hasPermission("EHRComplianceDBDomainKind.canCreateDefinition", user, AdminPermission.class);
24+
}
25+
26+
@Override
27+
protected String getSchemaName()
28+
{
29+
return KIND_NAME.toLowerCase();
30+
}
31+
32+
@Override
33+
protected String getNamespacePrefix()
34+
{
35+
return KIND_NAME.toLowerCase();
36+
}
37+
38+
@Override
39+
public String getKindName()
40+
{
41+
return KIND_NAME;
42+
}
43+
44+
@Override
45+
public Set<String> getReservedPropertyNames(Domain domain, User user)
46+
{
47+
return super.getReservedPropertyNames(domain, user);
48+
}
49+
50+
@Override
51+
public boolean matchesTemplateXML(String templateName, DomainTemplateType template, List<GWTPropertyDescriptor> properties)
52+
{
53+
return template instanceof EHRComplianceDBTemplateType;
54+
}
55+
}
56+
57+

ehr/resources/views/ehrTemplates.html

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,52 @@
5454
});
5555
}
5656

57+
createEHRComplianceDomainHandler = function () {
58+
var ctx = EHR.Utils.getEHRContext();
59+
var container = document.getElementById("ehrcompliance_container").value;
60+
if (!container) {
61+
LABKEY.Utils.alert("Error", "Must enter the container path of the compliance folder.");
62+
}
63+
else {
64+
LABKEY.Domain.create({
65+
module: ctx ? ctx['EHRCustomModule'] : null,
66+
domainKind: "EHRComplianceDB",
67+
domainGroup: "ehrcompliancedb",
68+
importData: false,
69+
containerPath: container,
70+
success: function () {
71+
LABKEY.Utils.alert("Success", "EHR_ComplianceDB tables updated successfully.");
72+
},
73+
failure: function (e) {
74+
LABKEY.Utils.alert("Error", e.exception);
75+
}
76+
});
77+
}
78+
}
79+
5780
LABKEY.Utils.onReady(function(){
5881
document.getElementById('createEHRDomainHandler')['onclick'] = function(){ createEHRDomainHandler(); return false; }
5982
document.getElementById('createEHRLookupsDomainHandler')['onclick'] = function(){ createEHRLookupsDomainHandler(); return false; }
6083
document.getElementById('createEHRBillingDomainHandler')['onclick'] = function(){ createEHRBillingDomainHandler(); return false; }
84+
document.getElementById('createEHRComplianceDomainHandler')['onclick'] = function(){ createEHRComplianceDomainHandler(); return false; }
6185
});
6286
</script>
6387

6488
<html>
6589
<div style="margin: 20px 0;">
6690
<h5><b>
67-
<a style="margin-right: 30px; cursor: pointer;" id='createEHRDomainHandler'>Load EHR table definitions</a>
68-
<a style="margin-right: 30px; cursor: pointer;" id='createEHRLookupsDomainHandler'>Load EHR_Lookup table definitions</a>
69-
<a style="margin-right: 30px; cursor: pointer;" id='createEHRBillingDomainHandler'>Load EHR_Billing table definitions</a>
91+
<a style="cursor: pointer;" id='createEHRDomainHandler'>Load EHR table definitions</a>
92+
<br><br>
93+
<a style="cursor: pointer;" id='createEHRLookupsDomainHandler'>Load EHR_Lookup table definitions</a>
94+
<br><br>
95+
<a style="cursor: pointer;" id='createEHRBillingDomainHandler'>Load EHR_Billing table definitions</a>
96+
<br><br>
97+
<div>
98+
<a style="margin-right: 10px; cursor: pointer;" id='createEHRComplianceDomainHandler'>Load EHR_Compliance table definitions</a>
99+
<label for="ehrcompliance_container">Container:</label>
100+
<input type="text" id="ehrcompliance_container" name="ehrcompliance_container" style="width: 300px;">
101+
102+
</div>
70103
</b></h5>
71104
</div>
72105
</html>

0 commit comments

Comments
 (0)