Professional Documents
Culture Documents
//debugger
PSV.AllDataElement.OnLoad.DataElementClosedStatus(executionContext);
PSV.AllDataElement.OnLoad.DataElementNotesMandatory(executionContext);
PSV.AllDataElement.OnLoad.DisabledFieldsForDeliveredWOStatus(executionContext);
PSV.AllDataElement.OnLoad.addPreSearchFilterVR(executionContext);
//formContext.getControl("psv_verificationresults").addPreSearch(function ()
{ PSV.AllDataElement.OnLoad.FilterVerificationResult(executionContext); });
formContext.getControl("psv_derivedfromde").addPreSearch(function ()
{ PSV.AllDataElement.OnLoad.FilterDerivedFromDE(executionContext); });
}
selectedStatus =
formContext.getAttribute("statuscode").getSelectedOption().value;
},
addPreSearchFilterVR: function (executionContext) {
debugger;
var formContext = executionContext.getFormContext();
formContext.getControl("psv_verificationresults").addPreSearch(function ()
{
PSV.AllDataElement.OnLoad.addLookupFilterVerificationResultMain(executionContext);
});
},
FilterDerivedFromDE: function (executionContext) { //debugger
var formContext = executionContext.getFormContext();
var dataElementType =
formContext.getAttribute("psv_dataelementtype").getValue();
if (dataElementType !== null) {
var dataElementTypeName = dataElementType[0].name;
if (dataElementTypeName === "Education") {
// All the environmentes master data GUIDs are same
var filter = "<filter type='and'>" +
"<condition attribute='psv_dataelementtype' operator='in'>" +
"<value uiname='License'
uitype='psv_dataelementtype'>{5FBE309A-B4F5-E511-80F9-3863BB35AD90}</value>" +
"<value uiname='Board Certification'
uitype='psv_dataelementtype'>{65BE309A-B4F5-E511-80F9-3863BB35AD90}</value>" +
"<value uiname='Training'
uitype='psv_dataelementtype'>{67BE309A-B4F5-E511-80F9-3863BB35AD90}</value>" +
"</condition>" +
"</filter>";
}
if (dataElementTypeName === "Training") {
// All the environmentes master data GUIDs are same
var trainingType =
(formContext.getAttribute("psv_trainingtypepl").getText() != null) ?
formContext.getAttribute("psv_trainingtypepl").getValue() : 0;
// "<condition attribute='psv_trainingtypepl' operator='eq'
value='" + trainingType +"' />"+
var filter = "<filter type='and'>" +
"<condition attribute='psv_dataelementtype' operator='in'>" +
"<value uiname='Board Certification'
uitype='psv_dataelementtype'>{65BE309A-B4F5-E511-80F9-3863BB35AD90}</value>" +
"<value uiname='License'
uitype='psv_dataelementtype'>{5FBE309A-B4F5-E511-80F9-3863BB35AD90}</value>" +
"</condition>" +
"</filter>";
}
formContext.getControl("psv_derivedfromde").addCustomFilter(filter);
}
},
if (dataElementType != null) {
"</filter>";
formContext.getControl("psv_verificationresults").addCustomFilter(filter);
else {
formContext.getControl("psv_verificationresults").addCustomFilter(filter1);
}
}
catch (e) { console.log(e); }
},
// var i = 0;
// formContext.ui.tabs.get(i).setVisible(true);
// }
// else {
// formContext.ui.tabs.get(i).setVisible(false);
// }
// }
//},
debugger;
var formContext = executionContext.getFormContext();
var category =
formContext.getAttribute("psv_dataelementcategory").getText();
if (category !== "Q") {
if (formContext.getAttribute("psv_dataelementtype").getValue() !== null
&& formContext.getAttribute("statuscode").getSelectedOption() !== null) {
var _dataelementtype =
formContext.getAttribute("psv_dataelementtype").getValue()[0].name;
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
switch (_dataelementtype) {
case "Attestation":
CondRquiredAttrArray.push("psv_lastattestationdate",
"psv_attestationstatus");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
//CondRquiredAttrArray.push("psv_certificationexpirationdate",
"psv_boardcertified", "psv_specialty", "psv_specialtytype");
CondRquiredAttrArray.push("psv_boardcertifiedpl",
"psv_specialty", "psv_specialtytype");
var duraType =
formContext.getAttribute("psv_durationtype").getValue();
//alert(formContext.getAttribute("psv_durationtype").getValue());
if (duraType != null) {
var durationtype =
formContext.getAttribute("psv_durationtype").getSelectedOption().value;
}
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
case "CDS":
CondRquiredAttrArray.push("psv_licensecdsdeanumber",
"psv_state", "psv_expirationdate");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
case "Education":
// CondRquiredAttrArray.push("psv_institutionname",
"psv_educationcompletiondate", "psv_degree");
//
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray);
break;
CondRquiredAttrArray.push("psv_hospitalprivilege");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
case "License":
CondRquiredAttrArray.push("psv_licensecdsdeanumber",
"psv_verifiedlicensenumber", "psv_state", "psv_currentlypracticingpl",
"psv_expirationdate");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
case "DEA":
CondRquiredAttrArray.push("psv_licensecdsdeanumber",
"psv_state", "psv_expirationdate");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
CondRquiredAttrArray.push("psv_malpracticehistoryinpast5yearspl");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
CondRquiredAttrArray.push("psv_carriername",
"psv_expirationdate", "psv_amountofcoverageperoccurrence",
"psv_amountofcoverageinaggregate");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
CondRquiredAttrArray.push("psv_medicaremedicaidsanctionsinpast5yearspl");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
case "OIG":
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
case "SAM":
break;
case "Training":
//if
(formContext.getAttribute("psv_trainingtypepl").getText() != null &&
formContext.getAttribute("psv_trainingtypepl").getText() == "Training")
if
(formContext.getAttribute("psv_trainingtypepl").getText() == "Residency")
CondRquiredAttrArray.push("psv_residencyaccreditedpl");
//CondRquiredAttrArray.push("psv_institutionname",
"psv_trainingarea", "psv_educationcompletiondate", "psv_residencyaccreditedpl");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
CondRquiredAttrArray.push("psv_isgapgreaterthanoreqsixmonthspl",
"psv_explanationsufficient", "psv_maximumallowablegap");
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
formContext.getAttribute("psv_issuedate").setRequiredLevel("required");
if
(formContext.getAttribute("psv_pharmacistdocumentstype").getText() != null &&
formContext.getAttribute("psv_pharmacistdocumentstype").getText() == "BLS or CPR")
{
CondRquiredAttrArray.push("psv_certificationtype",
"psv_certificationnumber", "psv_issuedate", "psv_expirationdate");
}
if
(formContext.getAttribute("psv_pharmacistdocumentstype").getText() != null &&
formContext.getAttribute("psv_pharmacistdocumentstype").getText() == "Immunization
Certificate of Achievement") {
CondRquiredAttrArray.push("psv_issuedate");
}
if
(formContext.getAttribute("psv_pharmacistdocumentstype").getText() != null &&
formContext.getAttribute("psv_pharmacistdocumentstype").getText() == "Written
Protocol") {
CondRquiredAttrArray.push("psv_expirationdate",
"psv_executiondate");
}
PSV.AllDataElement.OnLoad.ConditionalRequiredFields(CondRquiredAttrArray,
MandatroyAttrArray, executionContext);
break;
default:
break;
},
PSV.AllDataElement.OnLoad.DataElementClosedStatus(executionContext);
PSV.AllDataElement.OnLoad.DataElementNotesMandatory(executionContext);
//1915 fix, 29May2017
//PSV.AllDataElement.OnLoad.GetDCAnswers();
//PSV.AllDataElement.OnLoad.SetVerifiedDetailsOnManualClosedStatus();
/*
var formContext = executionContext.getFormContext();
if (formContext.ui.getFormType() === 2) {
var alertStrings = { confirmButtonLabel: "OK", text: "I confirm that I
have checked discrepancies for this data element", title: "Discrepancies associated
with the data element" };
var alertOptions = { height: 120, width: 260 };
Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
function (success) {
console.log("Dialog closed using OK button.");
},
function (error) {
console.log(error.message);
}
);
//var confirmStrings = { text: "I confirm that I have checked
discrepancies for this data element", title: "Discrepancies associated with the
data element" };
//var confirmOptions = { height: 150, width: 300 };
//Xrm.Navigation.openConfirmDialog(confirmStrings,
confirmOptions).then(
// function (success) {
// if (success.confirmed) {
// console.log("Dialog closed using OK button.");
// }
// else {
// executionContext.getEventArgs().preventDefault();
// }
// }
//);
}*/
},
else {
formContext.getAttribute(i).setRequiredLevel("none");
}
},
switch (_dataelementtypeonchange) {
case "Attestation":
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
case "CDS":
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//formContext.ui.tabs.get("License To Practice").setLabel("CDS");
formContext.ui.controls.get("psv_licensecdsdeanumber").setLabel("CDS Number");
//var MediEnrollment = formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element Details_Medicare Enrollment");
//if (MediEnrollment != null) MediEnrollment.setVisible(false);
formContext.getControl('psv_expiryflag').setVisible(true);
formContext.ui.controls.get("psv_licenseunlimitedpl").setVisible(false);
//added as per jira 1302
formContext.ui.controls.get("psv_licensetypeid").setVisible(false);
formContext.ui.controls.get("psv_currentlypracticingpl").setVisible(false);
formContext.ui.controls.get("psv_relinquishdate").setVisible(false);
formContext.ui.controls.get("psv_limitationexplanation").setVisible(false);
//Done Check Below in DEA
// Hide DerivedfromDE Lookup field except Training and Education DE
formContext.getControl("psv_derivedfromde").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_DeathMasterFile").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_NPPES").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_StateExclusions").setVisible(false);
break;
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//var MediEnrollment = formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element Details_Medicare Enrollment");
//if (MediEnrollment != null) MediEnrollment.setVisible(false);
case "Education":
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//var MediEnrollment = formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element Details_Medicare Enrollment");
//if (MediEnrollment != null) MediEnrollment.setVisible(false);
break;
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
case "License":
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//formContext.ui.tabs.get("License To
Practice").setLabel("License");
//var MediEnrollment = formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element Details_Medicare Enrollment");
//if (MediEnrollment != null) MediEnrollment.setVisible(false);
formContext.ui.controls.get("psv_licensecdsdeanumber").setLabel("License Number");
formContext.ui.controls.get('psv_expiryflag').setVisible(true);
formContext.ui.controls.get("psv_licenseunlimitedpl").setVisible(false);
//added as per jira 1302
formContext.ui.controls.get("psv_licensetypeid").setVisible(true);
formContext.ui.controls.get("psv_currentlypracticingpl").setVisible(true);
formContext.ui.controls.get("psv_relinquishdate").setVisible(true);
formContext.ui.controls.get("psv_limitationexplanation").setVisible(true);
//Done Check Below in DEA
// Hide DerivedfromDE Lookup field except Training and Education DE
formContext.getControl("psv_derivedfromde").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_DeathMasterFile").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_NPPES").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_StateExclusions").setVisible(false);
break;
case "DEA":
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//formContext.ui.tabs.get("License To
Practice").setLabel("DEA");DE_OIGSAM
formContext.ui.controls.get("psv_licensecdsdeanumber").setLabel("DEA Number");
formContext.getControl('psv_expiryflag').setVisible(true);
formContext.ui.controls.get("psv_licenseunlimitedpl").setVisible(false);
//var MediEnrollment = formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element Details_Medicare Enrollment");
//if (MediEnrollment != null) MediEnrollment.setVisible(false);
formContext.ui.controls.get("psv_currentlypracticingpl").setVisible(false);
formContext.ui.controls.get("psv_relinquishdate").setVisible(false);
formContext.ui.controls.get("psv_limitationexplanation").setVisible(false);
//Done Check Below in DEA
// Hide DerivedfromDE Lookup field except Training and Education DE
formContext.getControl("psv_derivedfromde").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_DeathMasterFile").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_NPPES").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_StateExclusions").setVisible(false);
break;
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
formContext.getControl('psv_expiryflag').setVisible(false);
//var MediEnrollment = formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element Details_Medicare Enrollment");
//if (MediEnrollment != null) MediEnrollment.setVisible(false);
//formContext.ui.controls.get("psv_statee").setVisible(true);
break;
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
case "OIG":
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_Attestation").setVisible(false);
formContext.ui.tabs.get("Data Element
Details").sections.get("DE_OIGSAM").setVisible(true);
//formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element
Details_PharmacistDocuments").setVisible(false);
//formContext.getControl("psv_providerlisted").setLabel('Is
Provider names matched in source?');
//formContext.getControl("psv_state").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_OIGSAM").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_DeathMasterFile").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_NPPES").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_StateExclusions").setVisible(false);
//formContext.ui.controls.get("psv_statee").setVisible(false);
case "SAM":
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
formContext.ui.tabs.get("Data Element
Details").sections.get("DE_OIGSAM").setVisible(true);
formContext.getControl('psv_expiryflag').setVisible(false);
//formContext.getControl("psv_providerlisted").setLabel('Is
Provider names matched in source?');
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_DeathMasterFile").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_NPPES").setVisible(false);
formContext.ui.tabs.get("Data Element Details").sections.get("Data
Element Details_StateExclusions").setVisible(false);
// Hide DerivedfromDE Lookup field except Training and Education DE
formContext.getControl("psv_derivedfromde").setVisible(false);
break;
case "Training":
VisibleTabsArray = new Array("Training", "Work Order And Provider
Details", "Data Element Details", "PS Response", "Deficiencies And Outreache",
"QADetails");
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
break;
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
formContext.ui.tabs.get("Data Element
Details").sections.get("DE_OIGSAM").setVisible(false);
//formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element
Details_PharmacistDocuments").setVisible(true);
//PSV.AllDataElement.OnLoad.ShowHideTab(VisibleTabsArray);
formContext.getControl('psv_expiryflag').setVisible(false);
formContext.ui.tabs.get("Data Element
Details").sections.get("DE_OIGSAM").setVisible(false);
//formContext.ui.tabs.get("Data Element
Details").sections.get("Data Element
Details_PharmacistDocuments").setVisible(false);
PSV.AllDataElement.OnLoad.DataElementClosedStatus(executionContext);
},
VerificationResultId =
formContext.getAttribute("psv_verificationresults").getValue()[0].id;
//VerificationRetrieve(VerificationResultId);
SDK.REST.retrieveRecord(VerificationResultId, "psv_verificationresult",
null, null,
function (verification) {
PSV.AllDataElement.OnLoad.VerificationRetrieve(verification,
formContext);
},
function () {
}
);
},
formContext.getAttribute("psv_dataelementcategory").setValue(psv_categoryvalue);
formContext.getAttribute("psv_dataelementcategory").setSubmitMode("always");
formContext.data.entity.save();
PSV.AllDataElement.OnLoad.DataElementNotesMandatory(executionContext);
},
//1949
if ((category != null)) { //&& ((category == "B") || (category ==
"C") || (category == "D"))
formContext.getAttribute("psv_dataelementnotes").setRequiredLevel("none");
}
else {
formContext.getAttribute("psv_dataelementnotes").setRequiredLevel("required");
}
}
}
},
if ((formContext.getAttribute("psv_dataelementtype").getValue()[0].name
!= "Education") && (formContext.getAttribute("psv_dataelementtype").getValue()
[0].name != "Training")) {
formContext.getAttribute("psv_verifiedon").setValue(new Date());
}
if ((formContext.getAttribute("psv_derivedfromde").getValue() == null)
&& (formContext.getAttribute("psv_dataelementtype").getValue()[0].name ==
"Education" || (formContext.getAttribute("psv_dataelementtype").getValue()[0].name
== "Training"))) {
formContext.getAttribute("psv_verifiedon").setValue(new Date());
}
currentUserValue[0].id = formContext.context.getUserId();
currentUserValue[0].entityType = "systemuser";
currentUserValue[0].name = formContext.context.getUserName();
if ((formContext.getAttribute("psv_dataelementtype").getValue()[0].name
!= "Education") && (formContext.getAttribute("psv_dataelementtype").getValue()
[0].name != "Training")) {
formContext.getAttribute("psv_verifiedby").setValue(currentUserValue);
}
if ((formContext.getAttribute("psv_derivedfromde").getValue() == null)
&& (formContext.getAttribute("psv_dataelementtype").getValue()[0].name ==
"Education" || (formContext.getAttribute("psv_dataelementtype").getValue()[0].name
== "Training"))) {
formContext.getAttribute("psv_verifiedby").setValue(currentUserValue)
}
formContext.getAttribute("psv_verifiedby").setSubmitMode("always");
else {
if (formContext.getAttribute("statuscode").getSelectedOption() != null
&& formContext.getAttribute("statuscode").getSelectedOption().value != 867210005) {
//formContext.getAttribute("psv_verifiedby").setValue(null);
//formContext.getAttribute("psv_verifiedon").setValue(null);
formContext.getAttribute("statuscode").setValue(selectedStatus);
selectedStatus =
formContext.getAttribute("statuscode").getValue();
},
formContext.getAttribute("psv_educationenddate").setValue(null);
formContext.getAttribute("psv_educationcompletiondate").setValue(null);
}
},
var manualQAInitial =
formContext.getAttribute("psv_manualqastatus").getInitialValue();
if
(formContext.getAttribute("psv_appropriatecategorizationofdataelement").getValue()
== null ||
formContext.getAttribute("psv_appropriateprimarysource").getValue() ==
null ||
formContext.getAttribute("psv_attachmentsincludedcorrectcomplete").getValue() ==
null ||
formContext.getAttribute("psv_datameetsverificationtimelimits").getValue() == null
||
formContext.getAttribute("psv_notesclearandcomplete").getValue() ==
null ||
formContext.getAttribute("psv_signaturesanddatetimestampincluded").getValue() ==
null) {
formContext.getAttribute("psv_manualqastatus").setValue(null);
formContext.getAttribute("psv_manualqastatus").setSubmitMode("always");
return;
else if
(formContext.getAttribute("psv_appropriatecategorizationofdataelement").getValue()
== 867210000 &&
formContext.getAttribute("psv_appropriateprimarysource").getValue() ==
867210000 &&
formContext.getAttribute("psv_attachmentsincludedcorrectcomplete").getValue() ==
867210000 &&
formContext.getAttribute("psv_datameetsverificationtimelimits").getValue() ==
867210000 &&
formContext.getAttribute("psv_notesclearandcomplete").getValue() ==
867210000 &&
formContext.getAttribute("psv_signaturesanddatetimestampincluded").getValue() ==
867210000) {
formContext.getAttribute("psv_manualqastatus").setValue(867210000);
formContext.getAttribute("psv_manualqastatus").setSubmitMode("always");
else if
(formContext.getAttribute("psv_appropriatecategorizationofdataelement").getValue()
== 867210001 ||
formContext.getAttribute("psv_appropriateprimarysource").getValue() ==
867210001 ||
formContext.getAttribute("psv_attachmentsincludedcorrectcomplete").getValue() ==
867210001 ||
formContext.getAttribute("psv_datameetsverificationtimelimits").getValue() ==
867210001 ||
formContext.getAttribute("psv_notesclearandcomplete").getValue() ==
867210001 ||
formContext.getAttribute("psv_signaturesanddatetimestampincluded").getValue() ==
867210001) {
formContext.getAttribute("psv_manualqastatus").setValue(867210001);
formContext.getAttribute("psv_manualqastatus").setSubmitMode("always");
currentUser[0].id = formContext.context.getUserId();
currentUser[0].entityType = 'systemuser';
currentUser[0].name = formContext.context.getUserName();
formContext.getAttribute("psv_manualqaperformedby").setValue(currentUser);
formContext.getAttribute("psv_manualqaperformedby").setSubmitMode("always");
formContext.getAttribute("psv_manualqacloseon").setSubmitMode("always");
formContext.getControl("psv_manualqastatus").clearNotification();
},
lookupFieldObject =
formContext.data.entity.attributes.get("psv_lemmprovidername");
if (lookupFieldObject.getValue() != null) {
formContext.ui.controls.get("psv_lemmprovidername").setVisible(true);
formContext.getAttribute("psv_caqhprovider").setRequiredLevel("none");
formContext.getAttribute("psv_primarysource").setRequiredLevel("none");
formContext.ui.controls.get("psv_caqhprovider").setVisible(false);
formContext.ui.controls.get("psv_primarysource").setVisible(false);
formContext.ui.controls.get("psv_psvworkorderid").setVisible(false);
else {
formContext.ui.controls.get("psv_lemmprovidername").setVisible(false);
formContext.ui.controls.get("psv_lemmsentflag").setVisible(false);
formContext.ui.controls.get("psv_lemmreceivedflag").setVisible(false);
},
}
},
},
// The below attribute exists only once in the form, but a field can be
added to the form for that attribute multiple times.
// Disable the fields using the belwo pattern
formContext.getAttribute("psv_sanctiondate").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_providerlisted").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_providerlistedpl").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_npdbinterfacingerror").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_state").controls.forEach(function (control,
index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_expirationdate").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_specialty").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv__educationtype").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_educationstartdate").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_educationenddate").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_programcompletedpl").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_educationcompletiondate").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_educationincompleteexplanation").controls.forEach(fun
ction (control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_derivedfromde").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_institutionname").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_city").controls.forEach(function (control,
index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_institutionphonenumber").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_analystreviewconsent").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_issuedate").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
formContext.getAttribute("psv_certificationnumber").controls.forEach(function
(control, index) { control.setDisabled(IsDisabled); });
});
},
PSV.AllDataElement.OnLoad.MakeDEfieldsReadonly(executionContext, true);
if (formContext.getAttribute("statuscode").getValue() == 867210005) {
formContext.ui.controls.get("statuscode").setDisabled(false);
//Have enabled below field at 11-Sep-2023
formContext.ui.controls.get("psv_appropriateprimarysource").setDisabled(false);
formContext.ui.controls.get("psv_datameetsverificationtimelimits").setDisabled(fals
e);
formContext.ui.controls.get("psv_attachmentsincludedcorrectcomplete").setDisabled(f
alse);
formContext.ui.controls.get("psv_signaturesanddatetimestampincluded").setDisabled(f
alse);
formContext.ui.controls.get("psv_notesclearandcomplete").setDisabled(false);
formContext.ui.controls.get("psv_appropriatecategorizationofdataelement").setDisabl
ed(false);
formContext.ui.controls.get("psv_allyes").setDisabled(false);
formContext.ui.controls.get("psv_manualqanotes").setDisabled(false);
formContext.ui.controls.get("psv_manualqaperformedby").setDisabled(false);
formContext.ui.controls.get("psv_manualqacloseon").setDisabled(false);
formContext.ui.controls.get("psv_manualqastatus").setDisabled(false);
}
}
else if (workOrderStatus != 5 && workOrderStatus != 867210006 &&
workOrderStatus != 1000 && formContext.getAttribute("statuscode").getValue() !=
867210005) {
PSV.AllDataElement.OnLoad.MakeDEfieldsReadonly(executionContext,
false);
PSV.AllDataElement.OnLoad.DisableManualQAResponseAndManualQAStatusField(executionCo
ntext);
},
}
},
formContext.getControl('psv_residencyaccreditedpl').setVisible(true);
}
else {
formContext.getControl('psv_typeoffellowship').setVisible(true);
formContext.getControl('psv_residencyaccreditedpl').setVisible(false);
}
}
else {
formContext.getControl("psv_residencyaccreditedpl").setVisible(true);
formContext.getControl('psv_typeoffellowship').setVisible(true);
}
},
});
},
function (verification) {
PSV.AllDataElement.OnLoad.DataElementStatus(verification,
executionContext);
},
function () {
}
);
},
formContext.getAttribute("psv_educationcompletiondate").setRequiredLevel("required"
);
}
}
},
//changes for 1915 - 29May2017
},
formContext.getControl("psv_carriername").addOnKeyPress(LoadAutoComplete(executionC
ontext));
//},
//LoadAutoComplete: function (executionContext) {
// var formContext = executionContext.getFormContext();
// var salutationtxt =
formContext.getControl("psv_carriername").getValue();
// var entitySchemaName = "imaxer_autofeature";
// var odataQuery = "?$select=imaxer_name&$top=10&" +
// "$filter=startswith(imaxer_name,'" + salutationtxt + "')";
// if (typeof (SDK) != "undefined") {
// SDK.REST.retrieveMultipleRecords(entitySchemaName, odataQuery,
executionContext, Callback, function (error) {
// alert(error.message);
// }, function () { });
// } else {
// alert("Not able to load REST.SDK library");
// }
//},
////customload
//Callback: function (entityresultSet, executionContext) {
// var formContext = executionContext.getFormContext();
// if (entityresultSet.length > 0) {
// var salutationtxt =
formContext.getControl("psv_carriername").getValue();
// resultSet = {
// results: new Array(),
// commands: {
// id: "salutationcmd",
// label: "Search in Google",
// action: function () {
//
window.open("https://caqhverifideuat.crm.dynamics.com");
// }
// }
// };
// var salutationtxtLowerCase = salutationtxt.toLowerCase();
// for (i = 0; i < entityresultSet.length; i++) {
// if (salutationtxtLowerCase ===
entityresultSet[i].him_name.substring(0,
salutationtxtLowerCase.length).toLowerCase()) {
// resultSet.results.push({
// id: i,
// fields: [entityresultSet[i].him_name]
// });
// }
// }
// if (resultSet.results.length > 0) {
//
formContext.getControl("salutation").showAutoComplete(resultSet);
// } else {
// formContext.getControl("salutation").hideAutoComplete();
// }
// }
//},
var userInput =
formContext.getControl("psv_carriername").getValue();
resultSet = {
results: new Array(),
commands: {
id: "sp_commands",
label: "Learn More",
action: function (objectid) {
// Specify what you want to do when the user
// clicks the "Learn More" link at the bottom
// of the auto-completion list.
// For this sample, we are just opening a page
// that provides information on working with
// accounts in CRM.
if (resultSet.results.length > 0) {
ext.getEventSource().showAutoComplete(resultSet);
} else {
ext.getEventSource().hideAutoComplete();
}
} catch (e) {
// Handle any exceptions. In the sample code,
// we are just displaying the exception, if any.
console.log(e);
}
};
formContext.getControl("psv_carriername").addOnKeyPress(keyPressFcn);
},
var CustomerId =
formContext.data.entity.attributes.get("psv_dataelementtype").getValue()[0].id;
var CustomerName =
formContext.data.entity.attributes.get("psv_dataelementtype").getValue()[0].name;
debugger;
var lookupObj = formContext.getAttribute("psv_verfsource");
var optionsetControl =
formContext.ui.controls.get("psv_verificationmethod");
//var lookupobj1 = formContext.getAttribute("psv_dataelementtype");
if (lookupObj != null) {
// if (lookupobj1 != null) {
// var lookupObjValue1 = lookupObj1.getValue();//Check for Lookup
Value
//if (lookupObjValue1 != null) {
//var lookupRecordName1 = lookupObjValue1[0].name;
//alert(CustomerName);
if (CustomerName == "Board Certification") {
var lookupObjValue = lookupObj.getValue();//Check for Lookup
Value
if (lookupObjValue != null) {
var lookupEntityType = lookupObjValue[0].entityType, //To
get EntityName
lookupRecordGuid = lookupObjValue[0].id, // To get
record GUID
lookupRecordName = lookupObjValue[0].name; //To get
record Name
//formContext.getControl("psv_verificationmethod").addOption(867210012);
//formContext.getControl("psv_verificationmethod").addOption(867210001);
//formContext.getControl("psv_verificationmethod").addOption(867210002);
//formContext.getControl("psv_verificationmethod").addOption(867210003);
//formContext.getControl("psv_verificationmethod").addOption(867210000);
formContext.getControl("psv_verificationmethod").removeOption(867210006);
formContext.getControl("psv_verificationmethod").removeOption(867210011);
formContext.getControl("psv_verificationmethod").removeOption(867210010);
formContext.getControl("psv_verificationmethod").removeOption(867210009);
formContext.getControl("psv_verificationmethod").removeOption(867210008);
formContext.getControl("psv_verificationmethod").removeOption(867210005);
formContext.getControl("psv_verificationmethod").removeOption(867210004);
}
else if (lookupRecordName == "ABMS") {
formContext.getControl("psv_verificationmethod").removeOption(867210000);
formContext.getControl("psv_verificationmethod").removeOption(867210001);
formContext.getControl("psv_verificationmethod").removeOption(867210002);
formContext.getControl("psv_verificationmethod").removeOption(867210003);
formContext.getControl("psv_verificationmethod").removeOption(867210004);
formContext.getControl("psv_verificationmethod").removeOption(867210005);
formContext.getControl("psv_verificationmethod").removeOption(867210006);
formContext.getControl("psv_verificationmethod").removeOption(867210007);
formContext.getControl("psv_verificationmethod").removeOption(867210008);
formContext.getControl("psv_verificationmethod").removeOption(867210009);
formContext.getControl("psv_verificationmethod").removeOption(867210010);
//formContext.getControl("psv_verificationmethod").addOption(867210011);
//formContext.getControl("psv_verificationmethod").addOption(867210012);
}
else if (lookupRecordName == "AOA") {
//formContext.getControl("psv_verificationmethod").addOption(867210012);
formContext.getControl("psv_verificationmethod").removeOption(867210000);
formContext.getControl("psv_verificationmethod").removeOption(867210001);
formContext.getControl("psv_verificationmethod").removeOption(867210002);
formContext.getControl("psv_verificationmethod").removeOption(867210003);
formContext.getControl("psv_verificationmethod").removeOption(867210004);
formContext.getControl("psv_verificationmethod").removeOption(867210005);
formContext.getControl("psv_verificationmethod").removeOption(867210006);
formContext.getControl("psv_verificationmethod").removeOption(867210007);
formContext.getControl("psv_verificationmethod").removeOption(867210008);
formContext.getControl("psv_verificationmethod").removeOption(867210009);
formContext.getControl("psv_verificationmethod").removeOption(867210010);
formContext.getControl("psv_verificationmethod").removeOption(867210011);
}
else if (lookupRecordName == "State Licensing Board") {
// 867210004
//optionsetControl.clearOptions();
//
formContext.getControl("psv_verificationmethod").addOption(867210004);
formContext.getControl("psv_verificationmethod").removeOption(867210000);
formContext.getControl("psv_verificationmethod").removeOption(867210001);
formContext.getControl("psv_verificationmethod").removeOption(867210002);
formContext.getControl("psv_verificationmethod").removeOption(867210003);
formContext.getControl("psv_verificationmethod").removeOption(867210005);
formContext.getControl("psv_verificationmethod").removeOption(867210006);
formContext.getControl("psv_verificationmethod").removeOption(867210007);
formContext.getControl("psv_verificationmethod").removeOption(867210008);
formContext.getControl("psv_verificationmethod").removeOption(867210009);
formContext.getControl("psv_verificationmethod").removeOption(867210010);
formContext.getControl("psv_verificationmethod").removeOption(867210011);
formContext.getControl("psv_verificationmethod").removeOption(867210012);
}
}
}
}
}
},
},
},
var salutationtxt =
formContext.getControl("psv_carriername").getValue();
resultSet = {
results: new Array(),
commands: {
id: "salutationcmd",
label: "Create Record",
action: function () {
window.open("https://caqhverifide.crm.dynamics.com");
}
}
};
var salutationtxtLowerCase = salutationtxt.toLowerCase();
if (salutationtxtLowerCase ===
entityresultSet[i].imaxer_name.substring(0,
salutationtxtLowerCase.length).toLowerCase()) {
resultSet.results.push({
id: i,
fields: [entityresultSet[i].imaxer_name]
});
}
}
if (resultSet.results.length > 0) {
formContext.getControl("psv_carriername").showAutoComplete(resultSet);
} else {
formContext.getControl("psv_carriername").hideAutoComplete();
}
}
},
var CustomerName =
formContext.data.entity.attributes.get("psv_dataelementtype").getValue()[0].name;
if (CustomerName == "Board Certification") {
formContext.getAttribute("psv_verificationmethod").setValue(null);
formContext.data.entity.save();
var id = formContext.data.entity.getId();
Xrm.Utility.openEntityForm("psv_dataelement", id);
}
}
},
var CustomerId =
formContext.data.entity.attributes.get("psv_dataelementtype").getValue()[0].id;
var CustomerName =
formContext.data.entity.attributes.get("psv_dataelementtype").getValue()[0].name;
if (CustomerName == "Board Certification") {
// var optionsetControl =
formContext.ui.controls.get("psv_verificationmethod");
if (lookupObj != null) {
var lookupObjValue = lookupObj.getValue();//Check for Lookup
Value
if (lookupObjValue != null) {
var lookupEntityType = lookupObjValue[0].entityType, //To
get EntityName
lookupRecordGuid = lookupObjValue[0].id, // To get
record GUID
lookupRecordName = lookupObjValue[0].name;
var vermeth =
formContext.getAttribute("psv_verificationmethod").getValue();
//alert(formContext.getAttribute("psv_durationtype").getValue());
if (vermeth != null) {
var vermoethexact =
formContext.getAttribute("psv_verificationmethod").getSelectedOption().value;
formContext.getControl("psv_verificationmethod").removeOption(867210006);
//formContext.getControl("psv_verificationmethod").removeOption(867210011);
//formContext.getControl("psv_verificationmethod").removeOption(867210010);
//formContext.getControl("psv_verificationmethod").removeOption(867210009);
//formContext.getControl("psv_verificationmethod").removeOption(867210008);
//formContext.getControl("psv_verificationmethod").removeOption(867210005);
//formContext.getControl("psv_verificationmethod").removeOption(867210004);
if (lookupRecordName == "Specialty Board") {
if (vermoethexact == 867210006 || vermoethexact ==
867210011 || vermoethexact == 867210010 || vermoethexact == 867210009 ||
vermoethexact == 867210008 || vermoethexact == 867210005 || vermoethexact ==
867210004) {
if (saveEvent != null) {
var alertString = { confirmButtonLabel:
null, text: "You are trying to select improper verification method", title:
"Warning" };
Xrm.Navigation.openAlertDialog(alertString,
null);
//alert("You are trying to select improper
verification method");
saveEvent.preventDefault();
}
}
}
if (lookupRecordName == "ABMS") {
if (vermoethexact == 867210000 || vermoethexact ==
867210001 || vermoethexact == 867210002 || vermoethexact == 867210003 ||
vermoethexact == 867210004 || vermoethexact == 867210005 || vermoethexact ==
867210006 || vermoethexact == 867210007 || vermoethexact == 867210008 ||
vermoethexact == 867210009 || vermoethexact == 867210010) {
if (saveEvent != null) {
var alertString = { confirmButtonLabel:
null, text: "You are trying to select improper verification method", title:
"Warning" };
Xrm.Navigation.openAlertDialog(alertString,
null);
//alert("You are trying to select improper
verification method");
saveEvent.preventDefault();
}
}
}
if (lookupRecordName == "AOA") {
if (vermoethexact == 867210000 || vermoethexact ==
867210001 || vermoethexact == 867210002 || vermoethexact == 867210003 ||
vermoethexact == 867210004 || vermoethexact == 867210005 || vermoethexact ==
867210006 || vermoethexact == 867210007 || vermoethexact == 867210008 ||
vermoethexact == 867210009 || vermoethexact == 867210010 || vermoethexact ==
867210011) {
if (saveEvent != null) {
var alertString = { confirmButtonLabel:
null, text: "You are trying to select improper verification method", title:
"Warning" };
Xrm.Navigation.openAlertDialog(alertString,
null);
//alert("You are trying to select improper
verification method");
saveEvent.preventDefault();
}
}
}
}
}
}
}
}
},
DisableManualQAResponseAndManualQAStatusField: function (executionContext) {
debugger;
var formContext = executionContext.getFormContext();
var UserID = Xrm.Utility.getGlobalContext().userSettings.userId;
if (UserID != null) {
var FetchTeamDetail = "<fetch version='1.0' output-format='xml-
platform' mapping='logical' distinct='false'>" +
"<entity name='systemuser'>" +
"<attribute name='fullname'/>" +
"<attribute name='businessunitid'/>" +
"<attribute name='systemuserid'/>" +
"<filter type='and'>" +
"<condition attribute='systemuserid' value='" + UserID + "'
uitype='systemuser' operator='eq'/>" +
"</filter>" +
"<link-entity name='teammembership' intersect='true'
visible='false' to='systemuserid' from='systemuserid'>" +
"<link-entity name='team' to='teamid' from='teamid' alias='ac'>" +
"<attribute name='name'/>" +
"<filter type='and'>" +
"<condition attribute='name' operator='eq' value='QA Team'/>" +
"</filter>" +
"</link-entity>" +
"</link-entity>" +
"</entity>" +
"</fetch>";
formContext.getControl("psv_appropriateprimarysource").setDisabled(true);
formContext.getControl("psv_datameetsverificationtimelimits").setDisabled(true);
formContext.getControl("psv_attachmentsincludedcorrectcomplete").setDisabled(true);
formContext.getControl("psv_signaturesanddatetimestampincluded").setDisabled(true);
formContext.getControl("psv_notesclearandcomplete").setDisabled(true);
formContext.getControl("psv_appropriatecategorizationofdataelement").setDisabled(tr
ue);
formContext.getControl("psv_allyes").setDisabled(true);
formContext.getControl("psv_manualqastatus").setDisabled(true);
}
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
}
},
//__namespace: true
};