diff --git a/src/app/core/assets/data/application_dictionary.json b/src/app/core/assets/data/application_dictionary.json index c8351fc15..f31a6ebc3 100644 --- a/src/app/core/assets/data/application_dictionary.json +++ b/src/app/core/assets/data/application_dictionary.json @@ -285,7 +285,7 @@ "type":"string", "cvDomain":null, "priority":"x", - "suggest":null + "suggest":"Substance_Key" }, "Title":{ "lucenePath":"root_title", diff --git a/src/app/core/facets-manager/facet-display.pipe.ts b/src/app/core/facets-manager/facet-display.pipe.ts index ed384b5eb..2b2dac483 100644 --- a/src/app/core/facets-manager/facet-display.pipe.ts +++ b/src/app/core/facets-manager/facet-display.pipe.ts @@ -97,10 +97,16 @@ export class FacetDisplayPipe implements PipeTransform { return 'Submit Date'; } if (name === 'root_creationDate') { - return 'Record Create Date'; + return 'Record Created Date'; + } + if (name === 'root_createdDate') { + return 'Record Created Date'; } if (name === 'root_lastModifiedDate') { return 'Record Last Edited'; + } + if (name === 'root_modifiedDate') { + return 'Record Last Edited'; } return name.trim(); diff --git a/src/app/fda/config/config.json b/src/app/fda/config/config.json index 23722d19e..4837c1ce7 100644 --- a/src/app/fda/config/config.json +++ b/src/app/fda/config/config.json @@ -1054,6 +1054,7 @@ "Product Name", "Dosage Form Name", "Substance UUID", + "Substance Class", "Ingredient Name (Preferred)", "Ingredient Name", "Has Ingredients", @@ -1183,10 +1184,10 @@ "Sponsor Report Submitter Name" ], "admin": [ + "root_createdDate", "Record Created By", - "Record Last Edited By", - "Record Create Date", - "Record Last Edited" + "root_modifiedDate", + "Record Last Edited By" ] } }, diff --git a/src/app/fda/invitro-pharmacology/invitro-pharmacology-form/invitro-pharmacology-assay-form/invitro-pharmacology-assay-form.component.ts b/src/app/fda/invitro-pharmacology/invitro-pharmacology-form/invitro-pharmacology-assay-form/invitro-pharmacology-assay-form.component.ts index 152a563c4..a5a30f8e8 100644 --- a/src/app/fda/invitro-pharmacology/invitro-pharmacology-form/invitro-pharmacology-assay-form/invitro-pharmacology-assay-form.component.ts +++ b/src/app/fda/invitro-pharmacology/invitro-pharmacology-form/invitro-pharmacology-assay-form/invitro-pharmacology-assay-form.component.ts @@ -53,6 +53,8 @@ export class InvitroPharmacologyAssayFormComponent implements OnInit, OnDestroy newAssaySetObject: InvitroAssaySet; newAssaySet: string; + correctTargetNameApprovalID: string; + correctLigandApprovalID: string; checkBoxAssaySetList: Array = []; existingAssaySetList: Array = []; @@ -154,13 +156,13 @@ export class InvitroPharmacologyAssayFormComponent implements OnInit, OnDestroy } // if response } // if record has JSON else { - // if No JSON file selected, show message to user - // Initialized the Assay Objects - this.invitroPharmacologyService.loadAssayOnly(); - this.assay = this.invitroPharmacologyService.assay; + // if No JSON file selected, show message to user + // Initialized the Assay Objects + this.invitroPharmacologyService.loadAssayOnly(); + this.assay = this.invitroPharmacologyService.assay; - // Get All the Assay Sets for checkboxes on the form - this.getAllAssaySets(); + // Get All the Assay Sets for checkboxes on the form + this.getAllAssaySets(); // Stop the Loading/Spinner after the form data is loaded this.isLoading = false; @@ -423,6 +425,24 @@ export class InvitroPharmacologyAssayFormComponent implements OnInit, OnDestroy } } + if ((this.assay.targetName) && (this.assay.targetNameApprovalId)) { + if (this.correctTargetNameApprovalID) { + // if NOT SAME, display error message + if (this.correctTargetNameApprovalID !== this.assay.targetNameApprovalId) { + this.setValidationMessage("The Target Name Approval ID for Target Name '" + this.assay.targetName + "' should be '" + this.correctTargetNameApprovalID + "'"); + } + } + } + + if ((this.assay.ligandSubstrate) && (this.assay.ligandSubstrateApprovalId)) { + if (this.correctLigandApprovalID) { + // if NOT SAME, display error message + if (this.correctLigandApprovalID !== this.assay.ligandSubstrateApprovalId) { + this.setValidationMessage("The Ligand/Substrate Approval ID for Ligand/Substrate '" + this.assay.ligandSubstrate + "' should be '" + this.correctLigandApprovalID + "'"); + } + } + } + if (this.validationMessages.length > 0) { this.showSubmissionMessages = true; this.loadingService.setLoading(false); @@ -569,7 +589,7 @@ export class InvitroPharmacologyAssayFormComponent implements OnInit, OnDestroy const date = new Date(); let jsonFilename = 'invitro_pharm_assay_' + moment(date).format('MMM-DD-YYYY_H-mm-ss'); - let data = {jsonData: this.invitroPharmacologyService.assay, jsonFilename: jsonFilename}; + let data = { jsonData: this.invitroPharmacologyService.assay, jsonFilename: jsonFilename }; const dialogRef = this.dialog.open(JsonDialogFdaComponent, { width: '90%', @@ -707,6 +727,10 @@ export class InvitroPharmacologyAssayFormComponent implements OnInit, OnDestroy this.assay.targetNameSubstanceKey = substanceKey; this.assay.targetNameSubstanceKeyType = this.substanceKeyTypeForInvitroPharmacologyConfig; + // Need this for validation, if user changes the Target Name Approval ID in the texbox, + // need to verify that it matches with this Approval ID. + this.correctTargetNameApprovalID = substance.approvalID; + } else if (fieldName === this.HUMAN_HOMOLOG_TARGET) { this.assay.humanHomologTargetApprovalId = substance.approvalID; this.assay.humanHomologTargetSubstanceKey = substanceKey; @@ -717,6 +741,10 @@ export class InvitroPharmacologyAssayFormComponent implements OnInit, OnDestroy this.assay.ligandSubstrateSubstanceKey = substanceKey; this.assay.ligandSubstrateSubstanceKeyType = this.substanceKeyTypeForInvitroPharmacologyConfig; + // Need this for validation, if user changes the Ligand/Substrate Approval ID in the texbox, + // need to verify that it matches with this Approval ID. + this.correctLigandApprovalID = substance.approvalID; + } else if (fieldName === this.ANALYTE) { this.assay.invitroAssayAnalytes[indexRow].analyteSubstanceKey = substanceKey; this.assay.invitroAssayAnalytes[indexRow].analyteSubstanceKeyType = this.substanceKeyTypeForInvitroPharmacologyConfig; diff --git a/src/app/fda/product/model/product.model.ts b/src/app/fda/product/model/product.model.ts index 4373d4157..88eb567c1 100644 --- a/src/app/fda/product/model/product.model.ts +++ b/src/app/fda/product/model/product.model.ts @@ -273,6 +273,7 @@ export interface ProductIngredient { _basisOfStrengthSubstanceUuid?: string; _basisOfStrengthIngredientName?: string; _basisOfStrengthActiveMoieties?: Array; + _substanceClass?: string; $$ingredientNameValidation?: string; $$basisOfStrengthValidation?: string; } diff --git a/src/app/fda/product/product-details/product-details-base.component.ts b/src/app/fda/product/product-details/product-details-base.component.ts index 774f6481f..c60ce7b73 100644 --- a/src/app/fda/product/product-details/product-details-base.component.ts +++ b/src/app/fda/product/product-details/product-details-base.component.ts @@ -213,6 +213,14 @@ export class ProductDetailsBaseComponent implements OnInit, AfterViewInit, OnDes } // if Substance is public + // Substance Type, convert from 'Chemical' to 'C', and for other types also + if (response.substanceClass) { + let subClassIndex = this.generalService.substanceClassArray.findIndex(subClass => subClass.class === response.substanceClass); + if (subClassIndex > -1) { + elementIngred._substanceClass = this.generalService.substanceClassArray[subClassIndex].shortDisplay; + } + } + // if Ingredient Type exists if (elementIngred.ingredientType) { @@ -305,6 +313,16 @@ export class ProductDetailsBaseComponent implements OnInit, AfterViewInit, OnDes } } + getSubstanceClass(substanceClass: string): string { + if (substanceClass) { + let subClassIndex = this.generalService.substanceClassArray.findIndex(subClass => subClass.shortDisplay === substanceClass); + if (subClassIndex > -1) { + return "The Substance Type is " + this.generalService.substanceClassArray[subClassIndex].longDisplay; + } + } + return ""; + } + sortProductCodes() { this.product.productProvenances.forEach((prov, indexProv) => { // Sort by Product Code Type, such as NDC CODE @@ -576,6 +594,13 @@ export class ProductDetailsBaseComponent implements OnInit, AfterViewInit, OnDes } } + const ingredSubstanceClassHolders = jp.query(old, '$..[?(@._substanceClass)]'); + for (let i = 0; i < ingredSubstanceClassHolders.length; i++) { + if (ingredSubstanceClassHolders[i]._substanceClass) { + delete ingredSubstanceClassHolders[i]._substanceClass; + } + } + delete old['_activeIngredients']; delete old['_otherIngredients']; diff --git a/src/app/fda/product/product-details/product-details/product-details.component.html b/src/app/fda/product/product-details/product-details/product-details.component.html index 69444e485..be6b830ef 100644 --- a/src/app/fda/product/product-details/product-details/product-details.component.html +++ b/src/app/fda/product/product-details/product-details/product-details.component.html @@ -139,7 +139,7 @@ Product Code:
- +
{{prodCode.productCodeType}}: @@ -322,6 +322,17 @@ {{prodIngred._ingredientName}} + +
+    + + {{prodIngred._substanceClass}} + + +
+ +
- -
@@ -438,6 +436,17 @@ {{prodIngred._ingredientName}} + +
+    + + {{prodIngred._substanceClass}} + + +
+ +
- - - - - -

@@ -180,7 +103,7 @@
- diff --git a/src/app/fda/product/products-browse/products-browse.component.html b/src/app/fda/product/products-browse/products-browse.component.html index 3b941e6bd..2b23fb9d1 100644 --- a/src/app/fda/product/products-browse/products-browse.component.html +++ b/src/app/fda/product/products-browse/products-browse.component.html @@ -631,7 +631,7 @@ - + + +
+    + + {{prodIngred._substanceClass}} + + +
+ -
+
- - -
@@ -950,6 +954,17 @@ {{prodIngred._ingredientName}} + +
+    + + {{prodIngred._substanceClass}} + + +
+ +