Skip to content
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

23.11 fb mense updates #1155

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion onprc_ehr/resources/scripts/onprc_ehr/onprc_triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ exports.init = function(EHR){
var msg = triggerHelper.validateMenseFlagprocess(row.Id);
if (msg)
{
EHR.Server.Utils.addError(scriptErrors, 'category', msg, 'ERROR');
EHR.Server.Utils.addError(scriptErrors, 'category', msg, 'WARN');
}
}

Expand Down
38 changes: 38 additions & 0 deletions onprc_ehr/resources/web/onprc_ehr/model/sources/Menses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2014-2019 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
EHR.model.DataModelManager.registerMetadata('MensesAddendum', {
byQuery: {
'study.clinical_observations': {
category: {
defaultValue: 'Menses'
},
observation: {
defaultValue: 'M'
}
}
}
});


EHR.DataEntryUtils.registerDataEntryFormButton('MENSEFINAL', {
text: 'Submit Final',
name: 'submit',
requiredQC: 'Completed',
targetQC: 'Completed',
errorThreshold: 'INFO',
successURL: LABKEY.ActionURL.getParameter('srcURL') || LABKEY.ActionURL.getParameter('returnUrl') || LABKEY.ActionURL.getParameter('returnURL') || LABKEY.ActionURL.buildURL('ehr', 'enterData.view'),
disabled: true,
itemId: 'finalBtn',
handler: function(btn){
var panel = btn.up('ehr-dataentrypanel');
Ext4.Msg.confirm('Finalize Form', 'You are about to finalize this form. Do you want to do this?', function(v){
if(v == 'yes')
this.onSubmit(btn);
}, this);
},
disableOn: 'ERROR'

});
22 changes: 19 additions & 3 deletions onprc_ehr/src/org/labkey/onprc_ehr/dataentry/MensFormType.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.labkey.api.view.template.ClientDependency;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;

/**
* User: bimber
Expand All @@ -43,16 +45,30 @@ public MensFormType(DataEntryFormContext ctx, Module owner)
new MensFormSection()
));

addClientDependency(ClientDependency.supplierFromPath("ehr/model/sources/Menses.js"));
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/Menses.js"));

setDisplayReviewRequired(true);

for (FormSection s : getFormSections())
{
s.addConfigSource("Task");
s.addConfigSource("Menses");
s.addConfigSource("MensesAddendum");
}
}
// Added 10-9-2024 r. Blasa
@Override
protected List<String> getButtonConfigs()
{
List<String> defaultButtons = new ArrayList<>();

defaultButtons.remove("SUBMIT");
defaultButtons.add("SAVEDRAFT");
defaultButtons.add("CLOSE");
defaultButtons.add("REVIEW");
defaultButtons.add("MENSEFINAL");


return defaultButtons;
}

@Override
protected boolean canInsert()
Expand Down