diff --git a/onprc_ehr/resources/queries/study/IPC_CassetteColors.sql b/onprc_ehr/resources/queries/study/IPC_CassetteColors.sql
new file mode 100644
index 000000000..1d8615bbb
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_CassetteColors.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCCassetteColor' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_CassettePrinting.query.xml b/onprc_ehr/resources/queries/study/IPC_CassettePrinting.query.xml
new file mode 100644
index 000000000..411c222a9
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_CassettePrinting.query.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+ IPC Cassette Printing
+
+
+ true
+
+
+
+ Id
+
+
+
+ Date
+
+
+
+ Tissue Types
+
+ study
+ IPC_TissueTypes
+ value
+
+
+
+
+ PI Label Text
+
+
+
+ Cassette Color
+
+ study
+ IPC_CassetteColors
+ value
+
+
+
+
+ Remarks
+
+
+
+
+ study
+ qcstate
+ RowId
+
+
+
+
+ Task Id
+
+ ehr
+ tasks
+ taskid
+
+
+
+ true
+
+
+ Performed By
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_CurrentFixative.sql b/onprc_ehr/resources/queries/study/IPC_CurrentFixative.sql
new file mode 100644
index 000000000..938ce4733
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_CurrentFixative.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCCurrentFixative' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_Embedding.sql b/onprc_ehr/resources/queries/study/IPC_Embedding.sql
new file mode 100644
index 000000000..c6eaaaf27
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Embedding.sql
@@ -0,0 +1,3 @@
+-- Get Embedding values
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCEmbedding' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_FixationMethod.sql b/onprc_ehr/resources/queries/study/IPC_FixationMethod.sql
new file mode 100644
index 000000000..6ecbe81c9
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_FixationMethod.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCFixationMethod' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_FrozenSectionThickness.sql b/onprc_ehr/resources/queries/study/IPC_FrozenSectionThickness.sql
new file mode 100644
index 000000000..fba375624
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_FrozenSectionThickness.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCFrozenSectionThickness' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_FrozenSectioning.sql b/onprc_ehr/resources/queries/study/IPC_FrozenSectioning.sql
new file mode 100644
index 000000000..58c327335
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_FrozenSectioning.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCFrozenSectioning' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_HandE.sql b/onprc_ehr/resources/queries/study/IPC_HandE.sql
new file mode 100644
index 000000000..2ce40daf3
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_HandE.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCHAndE' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_IHC.sql b/onprc_ehr/resources/queries/study/IPC_IHC.sql
new file mode 100644
index 000000000..ae25fc6a7
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_IHC.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCIHC' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_IHCAntibody.sql b/onprc_ehr/resources/queries/study/IPC_IHCAntibody.sql
new file mode 100644
index 000000000..e6c0c0f3f
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_IHCAntibody.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCIHCAntibody' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_Investigators.sql b/onprc_ehr/resources/queries/study/IPC_Investigators.sql
new file mode 100644
index 000000000..2daa61cc5
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Investigators.sql
@@ -0,0 +1,3 @@
+SELECT lastName + ', ' + firstName as name
+From Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.investigators
+Where dateDisabled is null
diff --git a/onprc_ehr/resources/queries/study/IPC_Locations.sql b/onprc_ehr/resources/queries/study/IPC_Locations.sql
new file mode 100644
index 000000000..6841c99bd
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Locations.sql
@@ -0,0 +1,3 @@
+SELECT room
+From Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr_lookups.rooms
+Where dateDisabled is null order by room
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_Other.query.xml b/onprc_ehr/resources/queries/study/IPC_Other.query.xml
new file mode 100644
index 000000000..576026f9c
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Other.query.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+ IPC Other
+
+
+ true
+
+
+
+ Id
+
+
+
+ Date
+
+
+
+ Tissue Types
+
+ study
+ IPC_TissueTypes
+ value
+
+
+
+
+ Services And Products
+
+ study
+ IPC_OtherServices
+ value
+
+
+
+
+ Performed By
+
+
+
+
+ study
+ qcstate
+ RowId
+
+
+
+
+ Task Id
+
+ ehr
+ tasks
+ taskid
+
+
+
+ true
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_OtherServices.sql b/onprc_ehr/resources/queries/study/IPC_OtherServices.sql
new file mode 100644
index 000000000..e386f8d10
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_OtherServices.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCOtherServices' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_ParaffinSectioning.sql b/onprc_ehr/resources/queries/study/IPC_ParaffinSectioning.sql
new file mode 100644
index 000000000..051c9c60d
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_ParaffinSectioning.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCParaffinSectioning' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_Pathologist.sql b/onprc_ehr/resources/queries/study/IPC_Pathologist.sql
new file mode 100644
index 000000000..8aa6bf066
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Pathologist.sql
@@ -0,0 +1,3 @@
+SELECT displayname as name
+From Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.Reference_StaffNames
+Where Type like 'Necropsy' and DisableDate is null
diff --git a/onprc_ehr/resources/queries/study/IPC_ProcessingEmbedding.query.xml b/onprc_ehr/resources/queries/study/IPC_ProcessingEmbedding.query.xml
new file mode 100644
index 000000000..07d1ee788
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_ProcessingEmbedding.query.xml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+ IPC Processing Embedding
+
+
+ true
+
+
+
+ Id
+
+
+
+ Date
+
+
+
+ Tissue Types
+
+ study
+ IPC_TissueTypes
+ value
+
+
+
+
+ Embedding
+
+ study
+ IPC_Embedding
+ value
+
+
+
+
+ Initial Fixative
+
+ study
+ IPC_FixationMethod
+ value
+
+
+
+
+ Fixation Duration
+
+
+
+ Current Fixative
+
+ study
+ IPC_CurrentFixative
+ value
+
+
+
+
+ Processing Type
+
+ study
+ IPC_ProcessingType
+ value
+
+
+
+
+ Embedding Instructions
+
+
+
+ Performed By
+
+
+
+
+ study
+ qcstate
+ RowId
+
+
+
+
+ Task Id
+
+ ehr
+ tasks
+ taskid
+
+
+
+ true
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_ProcessingType.sql b/onprc_ehr/resources/queries/study/IPC_ProcessingType.sql
new file mode 100644
index 000000000..e83a09e73
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_ProcessingType.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCProcessingType' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_RNAScope.sql b/onprc_ehr/resources/queries/study/IPC_RNAScope.sql
new file mode 100644
index 000000000..be4d130ca
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_RNAScope.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCRNAScope' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_SectionThickness.sql b/onprc_ehr/resources/queries/study/IPC_SectionThickness.sql
new file mode 100644
index 000000000..c5ee1653e
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_SectionThickness.sql
@@ -0,0 +1,2 @@
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCSectionThickness' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_Sectioning.query.xml b/onprc_ehr/resources/queries/study/IPC_Sectioning.query.xml
new file mode 100644
index 000000000..8dbc44715
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Sectioning.query.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+ IPC Sectioning
+
+
+ true
+
+
+
+ Id
+
+
+
+ Date
+
+
+
+ Tissue Types
+
+ study
+ IPC_TissueTypes
+ value
+
+
+
+
+ Paraffin Sectioning
+
+ study
+ IPC_ParaffinSectioning
+ value
+
+
+
+
+ Paraffin Section Thickness
+
+ study
+ IPC_SectionThickness
+ value
+
+
+
+
+ Frozen Section Thickness
+
+ study
+ IPC_FrozenSectionThickness
+ value
+
+
+
+
+ Special Instructions
+
+
+
+ Performed By
+
+
+
+
+ study
+ qcstate
+ RowId
+
+
+
+
+ Task Id
+
+ ehr
+ tasks
+ taskid
+
+
+
+ true
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_ServiceRequestDetails.query.xml b/onprc_ehr/resources/queries/study/IPC_ServiceRequestDetails.query.xml
new file mode 100644
index 000000000..566f5ac49
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_ServiceRequestDetails.query.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+ IPC Service Request Details
+
+
+ true
+
+
+
+ Id
+
+
+
+ Date
+
+
+
+ Requested By
+
+
+
+ Email
+
+
+
+ Department
+
+
+
+ Pathologist
+
+ study
+ IPC_Pathologist
+ name
+
+
+
+
+ Investigator
+
+ study
+ IPC_Investigators
+ name
+
+
+
+
+ Alias
+
+
+
+ Sample Dropoff/Pickup Location
+
+ study
+ IPC_Locations
+ room
+
+
+
+
+
+ study
+ qcstate
+ RowId
+
+
+
+
+ Task Id
+
+ ehr
+ tasks
+ taskid
+
+
+
+ true
+
+
+ Performed By
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_SlidePrinting.query.xml b/onprc_ehr/resources/queries/study/IPC_SlidePrinting.query.xml
new file mode 100644
index 000000000..af5f93e07
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_SlidePrinting.query.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+ IPC Sectioning
+
+
+ true
+
+
+
+ Id
+
+
+
+ Date
+
+
+
+ Tissue Types
+
+ study
+ IPC_TissueTypes
+ value
+
+
+
+
+ Project Notes
+
+
+
+ Additional text on slide
+
+
+
+ Performed By
+
+
+
+
+ study
+ qcstate
+ RowId
+
+
+
+
+ Task Id
+
+ ehr
+ tasks
+ taskid
+
+
+
+ true
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_Staining.query.xml b/onprc_ehr/resources/queries/study/IPC_Staining.query.xml
new file mode 100644
index 000000000..21be6119d
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Staining.query.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+ IPC Staining
+
+
+ true
+
+
+
+ Id
+
+
+
+ Date
+
+
+
+ Tissue Types
+
+ study
+ IPC_TissueTypes
+ value
+
+
+
+
+ H And E
+
+ study
+ IPC_HandE
+ value
+
+
+
+
+ Special Stain
+
+ study
+ IPC_Stains
+ value
+
+
+
+
+ IHC
+
+ study
+ IPC_IHC
+ value
+
+
+
+
+ IHC Primary Antibody
+
+ study
+ IPC_IHCAntibody
+ value
+
+
+
+
+ Irrevelant Antibody
+
+
+
+ RNA Scope
+
+ study
+ IPC_RNAScope
+ value
+
+
+
+
+ Other
+
+
+
+ Performed By
+
+
+
+
+ study
+ qcstate
+ RowId
+
+
+
+
+ Task Id
+
+ ehr
+ tasks
+ taskid
+
+
+
+ true
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_Stains.sql b/onprc_ehr/resources/queries/study/IPC_Stains.sql
new file mode 100644
index 000000000..d2aa3e2e8
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_Stains.sql
@@ -0,0 +1,3 @@
+--Get the stains data
+SELECT value, name from Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCStains' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/queries/study/IPC_TissueTypes.sql b/onprc_ehr/resources/queries/study/IPC_TissueTypes.sql
new file mode 100644
index 000000000..028ed41d1
--- /dev/null
+++ b/onprc_ehr/resources/queries/study/IPC_TissueTypes.sql
@@ -0,0 +1,2 @@
+SELECT value, name From Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.IPC_Reference_Data
+Where name like 'IPCTissueType' and dateDisabled is null
\ No newline at end of file
diff --git a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-23.007-23.008.sql b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-23.007-23.008.sql
new file mode 100644
index 000000000..5889279c9
--- /dev/null
+++ b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-23.007-23.008.sql
@@ -0,0 +1,17 @@
+EXEC core.fn_dropifexists 'IPC_Reference_Data','onprc_ehr','TABLE';
+GO
+
+/****** Object: Table [onprc_ehr].[IPC_Reference_Data] Script Date: 4/27/2020 ******/
+CREATE TABLE [onprc_ehr].[IPC_Reference_Data](
+ [rowId] INT IDENTITY(1,1)NOT NULL,
+ [value] [nvarchar](1000) NULL,
+ [name] [nvarchar](1000) NULL,
+ [remark] [nvarchar](4000) NULL,
+ [dateDisabled] [datetime] NULL,
+ [created] [datetime] NULL,
+ [createdBy] [int] NULL,
+ [modified] [datetime] NULL,
+ [modifiedBy] [int] NULL
+
+ CONSTRAINT pk_IPC_Reference_Data PRIMARY KEY (rowId)
+ )
\ No newline at end of file
diff --git a/onprc_ehr/resources/schemas/onprc_ehr.xml b/onprc_ehr/resources/schemas/onprc_ehr.xml
index 858275b36..2aea6cd99 100644
--- a/onprc_ehr/resources/schemas/onprc_ehr.xml
+++ b/onprc_ehr/resources/schemas/onprc_ehr.xml
@@ -1309,4 +1309,38 @@
+
+
+ IPC_Reference_Data
+
+ DETAILED
+
+
+ true
+
+
+
+ Value
+
+
+
+ Name
+
+
+
+
+ End Date
+
+
+
+ true
+
+
+
+ true
+
+
+
+
+
diff --git a/onprc_ehr/resources/web/onprc_ehr/data/IPCClientStore.js b/onprc_ehr/resources/web/onprc_ehr/data/IPCClientStore.js
new file mode 100644
index 000000000..91eda9bce
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/data/IPCClientStore.js
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2013-2015 LabKey Corporation
+ *
+ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
+ */
+Ext4.define('EHR.data.IPCClientStore', {
+ extend: 'EHR.data.DataEntryClientStore',
+
+ constructor: function(){
+ this.callParent(arguments);
+
+ this.on('add', this.onAddRecord, this);
+ },
+
+ onAddRecord: function(store, records){
+ Ext4.each(records, function(record){
+ this.onRecordUpdate(record, ['procedureid']);
+ }, this);
+ },
+
+ afterEdit: function(record, modifiedFieldNames){
+ this.onRecordUpdate(record, modifiedFieldNames);
+
+ this.callParent(arguments);
+ },
+
+ onRecordUpdate: function(record, modifiedFieldNames){
+ if (record.get('procedureid')){
+ modifiedFieldNames = modifiedFieldNames || [];
+
+ var lookupRec = this.getProcedureRecord(record.get('procedureid'));
+ if (!lookupRec)
+ return;
+
+ if (lookupRec.get('remark')&& record.get('remark')== null){
+ record.beginEdit();
+ record.set('remark', lookupRec.get('remark'));
+ record.endEdit(true);
+ }
+ }
+
+ if (modifiedFieldNames && (modifiedFieldNames.indexOf('Id') > -1 || modifiedFieldNames.indexOf('project') > -1 )){ //} modifiedFieldNames.indexOf('chargetype') > -1)){
+ if (record.get('objectid')){
+ var toApply = {
+ Id: record.get('Id'),
+ project: record.get('project'),
+ //chargetype: record.get('chargetype')
+ };
+
+ this.storeCollection.clientStores.each(function(cs){
+ if (cs.storeId === this.storeCollection.collectionId + '-' + 'IPC_ServiceRequestDetails'){
+ return;
+ }
+
+ var projectField = cs.getFields().get('project');
+ // var chargeTypeField = cs.getFields().get('chargetype');
+ var hasChanges = false;
+
+ if (cs.getFields().get('parentid')){
+ if (cs.getFields().get('Id') || cs.getFields().get('project')){
+ cs.each(function(r){
+ if (r.get('parentid') === record.get('objectid')){
+ var obj = {};
+
+ if (projectField){
+ if (!r.get('project') || (projectField.inheritFromParent && r.get('project') !== record.get('project'))){
+ obj.project = record.get('project');
+ }
+ }
+ //
+ // if (chargeTypeField){
+ // if (!r.get('chargetype') || (chargeTypeField.inheritFromParent && r.get('chargetype') !== record.get('chargetype'))){
+ // obj.chargetype = record.get('chargetype');
+ // }
+ // }
+
+ if (r.get('Id') !== record.get('Id')){
+ obj.Id = record.get('Id');
+ }
+
+ if (!Ext4.Object.isEmpty(obj)){
+ r.beginEdit();
+ r.set(obj);
+ r.endEdit(true);
+ hasChanges = true;
+ }
+ }
+ }, this);
+ }
+ }
+
+ if (hasChanges){
+ cs.fireEvent('datachanged', cs);
+ }
+ }, this);
+ }
+ }
+ },
+
+ getProcedureRecord: function(procedureId) {
+ var procedureStore = EHR.DataEntryUtils.getProceduresStore();
+ LDK.Assert.assertNotEmpty('Unable to find procedureStore from IPCClientStore', procedureStore);
+
+ var procRecIdx = procedureStore.findExact('rowid', procedureId);
+ LDK.Assert.assertTrue('Unable to find procedure record in IPCClientStore for procedureId: [' + procedureId + ']', procRecIdx > -1);
+
+ var procedureRec = procedureStore.getAt(procRecIdx);
+ LDK.Assert.assertNotEmpty('Unable to find procedure record from IPCClientStore. ProcedureId was: [' + procedureId + ']', procedureRec);
+
+ return procedureRec;
+ }
+
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/data/IPCStoreCollection.js b/onprc_ehr/resources/web/onprc_ehr/data/IPCStoreCollection.js
new file mode 100644
index 000000000..5b387f01d
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/data/IPCStoreCollection.js
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2013-2014 LabKey Corporation
+ *
+ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
+ */
+Ext4.define('EHR.data.IPCStoreCollection', {
+ extend: 'EHR.data.TaskStoreCollection',
+
+ getIPCStore: function(){
+ if (this.IPCStore){
+ return this.IPCStore;
+ }
+
+ this.IPCStore = this.getClientStoreByName('IPC_ServiceRequestDetails');
+ LDK.Assert.assertNotEmpty('Unable to find IPC store in IPCStoreCollection', this.IPCStore);
+
+ return this.IPCStore;
+ },
+
+ getIPCRecord: function(parentid){
+ if (!parentid){
+ return null;
+ }
+
+ var IPCStore = this.getIPCStore();
+ var er;
+ IPCStore.each(function(r){
+ if (r.get('objectid') == parentid){
+ er = r;
+ return false;
+ }
+ }, this);
+
+ return er;
+ },
+
+ onClientStoreUpdate: function(){
+ this.doUpdateRecords();
+ this.callParent(arguments);
+ },
+
+ setClientModelDefaults: function(model){
+ this.callParent(arguments);
+
+ var IPCStore = this.getIPCStore();
+ if (model.store && model.store.storeId == IPCStore.storeId){
+ console.log('is IPC service request, skipping');
+ return;
+ }
+
+ if (IPCStore.getCount() == 1){
+ if (model.fields.get('parentid') && model.get('parentid') == null){
+ model.data.parentid = IPCStore.getAt(0).get('objectid');
+ }
+ }
+
+ if (model.fields.get('parentid') && model.get('parentid')){
+ //find matching IPC record and update fields if needed
+ var parentRec = this.getIPCRecord(model.get('parentid'));
+ if (parentRec){
+ model.beginEdit();
+ if (parentRec.get('Id') !== model.get('Id')){
+ model.set('Id', parentRec.get('Id'));
+ }
+
+ if (model.fields.get('date') && !model.get('date') && parentRec.get('date')){
+ model.set('date', parentRec.get('date'));
+ }
+
+ if (model.fields.get('project') && !model.get('project') && parentRec.get('project')){
+ model.set('project', parentRec.get('project'));
+ }
+
+ // if (model.fields.get('chargetype') && !model.get('chargetype') && parentRec.get('chargetype')){
+ // model.set('chargetype', parentRec.get('chargetype'));
+ // }
+
+ model.endEdit(true);
+ }
+ }
+ },
+
+ doUpdateRecords: function(){
+ var IPCStore = this.getIPCStore();
+ this.clientStores.each(function(cs){
+ if (cs.storeId == IPCStore.storeId){
+ return;
+ }
+
+ if (cs.getFields().get('Id') == null || cs.getFields().get('parentid') == null){
+ return;
+ }
+
+ var isIPCChild = cs.model.prototype.sectionCfg.configSources && cs.model.prototype.sectionCfg.configSources.indexOf('IPCChild') > -1;
+ cs.each(function(rec){
+ var IPCRec = this.getIPCRecord(rec.get('parentid'));
+ if (IPCRec != null){
+ var obj = {};
+ if (rec.get('Id') !== IPCRec.get('Id')){
+ //the goal of this is to allow specific sections to avoid inheriting the Id of the parent
+ if (isIPCChild || !IPCRec.get('Id'))
+ obj.Id = IPCRec.get('Id');
+
+ //if the ID doesnt match, clear parentid
+ if (!isIPCChild){
+ obj.parentid = null;
+ }
+ }
+
+ var pf = rec.fields.get('project');
+ if (pf && IPCRec.get('project')){
+ if (!rec.get('project')){
+ obj.project = IPCRec.get('project');
+ }
+ else if (pf.inheritFromParent && IPCRec.get('project') !== rec.get('project')){
+ obj.project = IPCRec.get('project');
+ }
+ }
+
+ // var cf = rec.fields.get('chargetype');
+ // if (cf && IPCRec.get('chargetype')){
+ // if (!rec.get('chargetype') || cf.inheritDateFromParent){
+ // obj.chargetype = IPCRec.get('chargetype');
+ // }
+ // }
+
+ var df = rec.fields.get('date');
+ if (df && IPCRec.get('date')){
+ if (!rec.get('date') || df.inheritDateFromParent){
+ if (!Ext4.Date.isEqual(rec.get('date'), IPCRec.get('date')))
+ obj.date = IPCRec.get('date');
+ }
+ }
+
+ if (!Ext4.Object.isEmpty(obj)){
+ rec.beginEdit();
+ rec.set(obj);
+ rec.endEdit(true);
+
+ // this is a slight misuse of this event. validation will queue and batch changes, rather than immediately updating each row
+ // individually. this is better than doing them one-by-one in large grids
+ if (rec.store){
+ rec.store.fireEvent('validation', rec.store, rec);
+ }
+ }
+ }
+
+ }, this);
+ }, this);
+ }
+});
\ No newline at end of file
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_CassettePrinting.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_CassettePrinting.js
new file mode 100644
index 000000000..b1547c6d6
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_CassettePrinting.js
@@ -0,0 +1,55 @@
+/**
+ * User: Kolli
+ * Date: 4/10/2020
+ * Time: 10:36 AM
+ */
+EHR.model.DataModelManager.registerMetadata('CassettePrinting', {
+ allQueries: {
+ },
+
+ byQuery: {
+ 'study.IPC_CassettePrinting': {
+
+ tissueType: {
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ PILabel: {
+ header:"Additional text on cassette",
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ cassetteColor: {
+ header:"Cassette Color",
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ remark: {
+ header:"Remark",
+ hidden: false,
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ performedBy: {
+ defaultValue: LABKEY.Security.currentUser.displayName,
+ columnConfig: {
+ width: 150
+ }
+ }
+ // ,
+ //
+ // qcstate: {
+ // hidden: true,
+ // defaultValue: 21
+ // }
+ }
+ }
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Child.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Child.js
new file mode 100644
index 000000000..cd7cbfe51
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Child.js
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2013-2014 LabKey Corporation
+ *
+ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
+ */
+EHR.model.DataModelManager.registerMetadata('IPC_Child', {
+ allQueries: {
+ Id: {
+ editable: false,
+ columnConfig: {
+ editable: false
+ }
+ },
+ date: {
+ inheritDateFromParent: true
+ }
+ }
+});
\ No newline at end of file
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Other.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Other.js
new file mode 100644
index 000000000..9ac83b136
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Other.js
@@ -0,0 +1,38 @@
+/**
+ * User: Kolli
+ * Date: 4/10/2020
+ * Time: 10:36 AM
+ */
+
+EHR.model.DataModelManager.registerMetadata('IPC_Other', {
+ allQueries: {
+ },
+
+ byQuery: {
+ 'study.IPC_Other': {
+
+ tissueType: {
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ serviceAndProducts: {
+ header:"Service & Products",
+ hidden: false,
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ performedBy: {
+ defaultValue: LABKEY.Security.currentUser.displayName,
+ columnConfig: {
+ width: 150
+ }
+ }
+
+ }
+
+ }
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_ProcessingEmbedding.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_ProcessingEmbedding.js
new file mode 100644
index 000000000..3c00ead12
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_ProcessingEmbedding.js
@@ -0,0 +1,71 @@
+/**
+ * User: Kolli
+ * Date: 4/10/2020
+ * Time: 10:36 AM
+ */
+EHR.model.DataModelManager.registerMetadata('ProcessingEmbedding', {
+ allQueries: {
+ },
+ byQuery: {
+ 'study.IPC_ProcessingEmbedding': {
+
+ tissueType: {
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ embedding: {
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ fixationMethod: {
+ header:"Initial Fixative",
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ fixationDuration: {
+ header:"Fixation Duration",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ currentFixative: {
+ header:"Current Fixative",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ processingType: {
+ header:"Processing Type",
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ embeddingIns: {
+ header:"Embedding Instructions",
+ hidden: false,
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ performedBy: {
+ defaultValue: LABKEY.Security.currentUser.displayName,
+ columnConfig: {
+ width: 150
+ }
+ }
+
+ }
+
+ }
+
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Sectioning.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Sectioning.js
new file mode 100644
index 000000000..983f0a496
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Sectioning.js
@@ -0,0 +1,58 @@
+/**
+ * User: Kolli
+ * Date: 4/10/2020
+ * Time: 10:36 AM
+ */
+EHR.model.DataModelManager.registerMetadata('Sectioning', {
+ allQueries: {
+ },
+ byQuery: {
+ 'study.IPC_Sectioning': {
+
+ tissueType: {
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ paraffinSectioning: {
+ header:"Paraffin Sectioning",
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ sectionThickness: {
+ header:"Paraffin Section Thickness",
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ frozenSectioning: {
+ header:"Frozen Section Thickness",
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ specialIns: {
+ header:"Special Instructions",
+ hidden: false,
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ performedBy: {
+ defaultValue: LABKEY.Security.currentUser.displayName,
+ columnConfig: {
+ width: 150
+ }
+ }
+
+ }
+
+ }
+
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_ServiceRequestDetails.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_ServiceRequestDetails.js
new file mode 100644
index 000000000..41db8a33e
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_ServiceRequestDetails.js
@@ -0,0 +1,102 @@
+/**
+ * User: Kolli
+ * Date: 4/10/2020
+ * Time: 10:36 AM
+ */
+EHR.model.DataModelManager.registerMetadata('ServiceRequestDetails', {
+ allQueries: {
+ },
+ byQuery: {
+ 'study.IPC_ServiceRequestDetails': {
+
+ project: {
+ header:"Center Project",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ requestedBy: {
+ header:"Requested By",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ email: {
+ header:"Email",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ department: {
+ header:"Department",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ pathologist: {
+ xtype: 'combo',
+ header:'Pathologist',
+ hidden: false,
+ lookup: {schemaName: 'study', queryName: 'IPC_Pathologist', displayColumn:'name' },
+
+ editorConfig: {
+ listConfig: {
+ //innerTpl: '{[values.lastName + (values.firstName ? ", " + values.firstName : "")]}',
+ innerTpl: '{[(values.name)]}',
+ getInnerTpl: function(){
+ return this.innerTpl;
+ }
+ }
+ },
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ investigator: {
+ xtype: 'combo',
+ header: 'Investigator',
+ hidden: false,
+ lookup: {schemaName: 'study', queryName: 'IPC_Investigators', displayColumn: 'name'},
+ editorConfig: {
+ listConfig: {
+ // innerTpl: '{[values.lastName + (values.firstName ? ", " + values.firstName : "")]}',
+ innerTpl: '{[(values.name)]}',
+ getInnerTpl: function(){
+ return this.innerTpl;
+ }
+ }
+ },
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ sampleLocation: {
+ xtype: 'combo',
+ header: 'Sample DropOff/PickUp Location',
+ hidden: true,
+ lookup: {schemaName: 'study', queryName: 'IPC_Locations', displayColumn: 'room'},
+
+ editorConfig: {
+ listConfig: {
+ innerTpl: '{[(values.room)]}',
+ getInnerTpl: function(){
+ return this.innerTpl;
+ }
+ }
+ },
+ columnConfig: {
+ width: 200
+ }
+ }
+
+ }
+
+ }
+
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_SlidePrinting.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_SlidePrinting.js
new file mode 100644
index 000000000..fdac82072
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_SlidePrinting.js
@@ -0,0 +1,45 @@
+/**
+ * User: Kolli
+ * Date: 4/10/2020
+ * Time: 10:36 AM
+ */
+EHR.model.DataModelManager.registerMetadata('SlidePrinting', {
+ allQueries: {
+ },
+ byQuery: {
+ 'study.IPC_SlidePrinting': {
+
+ tissueType: {
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ projectNotes: {
+ header:"Project Notes",
+ hidden: false,
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ additionalText: {
+ header:"Additional text on slide",
+ hidden: false,
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ performedBy: {
+ defaultValue: LABKEY.Security.currentUser.displayName,
+ columnConfig: {
+ width: 150
+ }
+ }
+
+ }
+
+ }
+
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Staining.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Staining.js
new file mode 100644
index 000000000..528903673
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/IPC_Staining.js
@@ -0,0 +1,82 @@
+/**
+ * User: Kolli
+ * Date: 4/10/2020
+ * Time: 10:36 AM
+ */
+EHR.model.DataModelManager.registerMetadata('Staining', {
+ allQueries: {
+ },
+
+ byQuery: {
+ 'study.IPC_Staining': {
+
+ tissueType: {
+ columnConfig: {
+ width: 250
+ }
+ },
+
+ HAndE: {
+ header:"H&E",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ specialStain: {
+ header:"Special Stain",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ IHC: {
+ header:"IHC",
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ IHCPrimaryAntibody: {
+ header:"IHC Primary Antibody",
+ hidden: false,
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ irrelevantAntibody: {
+ header:"Irrelevant Antibody",
+ hidden: false,
+ columnConfig: {
+ width: 200
+ }
+ },
+
+ RNAScope: {
+ header:"RNA Scope",
+ hidden: false,
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ other: {
+ header:"Other",
+ hidden: false,
+ columnConfig: {
+ width: 150
+ }
+ },
+
+ performedBy: {
+ defaultValue: LABKEY.Security.currentUser.displayName,
+ columnConfig: {
+ width: 150
+ }
+ }
+
+ }
+
+ }
+});
diff --git a/onprc_ehr/resources/web/onprc_ehr/window/IPC_CopyFromSectionWindow.js b/onprc_ehr/resources/web/onprc_ehr/window/IPC_CopyFromSectionWindow.js
new file mode 100644
index 000000000..889a8cbcb
--- /dev/null
+++ b/onprc_ehr/resources/web/onprc_ehr/window/IPC_CopyFromSectionWindow.js
@@ -0,0 +1,398 @@
+/*
+ * Copyright (c) 2013-2017 LabKey Corporation
+ *
+ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
+ */
+/**
+ * @cfg targetGrid
+ * @cfg parentStore
+ * @cfg sourceLabel
+ * Created: Kollil, 5/19/2020
+ */
+Ext4.define('ONPRC_EHR.window.IPC_CopyFromSectionWindow', {
+ extend: 'Ext.window.Window',
+
+ initComponent: function(){
+ this.getParentRecords();
+
+ Ext4.applyIf(this, {
+ modal: true,
+ width: 1000,
+ closeAction: 'destroy',
+ title: 'Copy From ' + this.sourceLabel,
+ bodyStyle: 'padding: 5px;',
+ defaults: {
+ border: false
+ },
+ items: [{
+ html: 'This helper allows you to populate 1 row for each animal from the ' + this.sourceLabel + ' section. Choose which IDs to add from the list below.',
+ style: 'margin-bottom: 10px;'
+ },{
+ xtype: 'checkbox',
+ fieldLabel: 'Bulk Edit Values',
+ labelWidth: 150,
+ helpPopup: 'If checked, you will be prompted with a screen that lets you bulk edit the records that will be created. This is often very useful when adding many similar records.',
+ itemId: 'chooseValues',
+ style: 'margin-bottom: 10px;'
+ },{
+ itemId: 'animalIds',
+ items: this.getInitialItems()
+ }],
+ buttons: [{
+ text: 'Submit',
+ itemId: 'submitBtn',
+ scope: this,
+ handler: this.onSubmit
+ },{
+ text: 'Close',
+ handler: function(btn){
+ btn.up('window').close();
+ }
+ }]
+ });
+
+ this.callParent();
+
+ this.on('beforeshow', function(window){
+ if (!this.parentRecords.length){
+ Ext4.Msg.alert('No Records', 'There are no records to copy. Note: only records with an Id/Date can be copied.');
+ return false;
+ }
+ }, this);
+ },
+
+ getParentRecords: function(){
+ var records = [];
+ this.parentStore.each(function(r){
+ if (r.get('Id') && r.get('date')){
+ records.push(r);
+ }
+ }, this);
+
+ this.parentRecords = records;
+
+ return records;
+ },
+
+ getExistingIds: function(keyFields){
+ var map = {};
+ this.targetGrid.store.each(function(r){
+ var key = this.getKeyValue(r, keyFields);
+ if (r.get('Id'))
+ map[key] = true;
+ }, this);
+
+ return map;
+ },
+
+ getKeyValue: function(record, keyFields){
+ var key = [];
+ Ext4.Array.forEach(keyFields, function(kf){
+ if (record.get(kf))
+ key.push(record.get(kf));
+ }, this);
+
+ return key.join ('||');
+ },
+
+ getInitialItems: function(){
+ var items = [{
+ html: 'Animal'
+ },{
+ html: 'Date'
+ },{
+ html: 'Project'
+ }]
+
+ if (this.targetGrid.store.getFields().get('chargetype'))
+ {
+ items.push({
+ html: 'Charge Unit'
+ });
+ }
+
+ if (this.targetGrid.store.getFields().get('tissueType'))
+ {
+ items.push({
+ html: 'Tissue Type'
+ });
+ }
+
+ items = items.concat([{
+ html: 'Performed By'
+ },{
+ html: 'Skip?'
+ }]);
+
+ var keys = {}, key;
+ var keyFields = ['Id', 'date', 'tissueType'];
+// if (this.targetGrid.store.getFields().get('parentid')){
+// keyFields.push('parentid');
+// }
+// if (this.targetGrid.store.getFields().get('runid')){
+// keyFields.push('runid');
+// }
+
+ //console.log(keyFields);
+ var orderedKeys = [];
+ Ext4.Array.forEach(this.parentRecords, function(record){
+ key = this.getKeyValue(record, keyFields);
+ if (orderedKeys.indexOf(key) == -1){
+ orderedKeys.push(key);
+ }
+
+ keys[key] = keys[key] || {
+ Id: record.get('Id'),
+// parentid: keyFields.indexOf('parentid') > -1 ? record.get('parentid') : null,
+// runid: keyFields.indexOf('runid') > -1 ? record.get('runid') : null,
+ performedby: [],
+ projects: [],
+ chargeUnits: [],
+ tissueTypes: [],
+ dates: [],
+ total: 0
+ };
+
+ keys[key].total++;
+ if (record.get('performedby'))
+ keys[key].performedby.push(record.get('performedby'));
+ if (record.get('project'))
+ keys[key].projects.push(record.get('project'));
+ if (record.fields.get('chargetype') && record.get('chargetype'))
+ keys[key].chargeUnits.push(record.get('chargetype'));
+
+ if (record.fields.get('tissueType') && record.get('tissueType'))
+ keys[key].tissueTypes.push(record.get('tissueType'));
+
+ keys[key].dates.push(record.get('date'))
+ }, this);
+
+ var existingIds = this.getExistingIds(keyFields);
+ Ext4.Array.forEach(orderedKeys, function(key){
+ var o = keys[key];
+
+ items.push({
+ xtype: 'displayfield',
+ key: key,
+ value: o.Id,
+ fieldName: 'Id'
+ });
+
+ var dates = [];
+ var minDate;
+ Ext4.Array.forEach(o.dates, function(date){
+ if (!minDate || date < minDate)
+ minDate = date;
+
+ dates.push(date.format(LABKEY.extDefaultDateTimeFormat));
+ }, this);
+
+ o.performedby = Ext4.unique(o.performedby);
+ var performedby = o.performedby.length == 1 ? o.performedby[0] : null;
+
+ o.projects = Ext4.unique(o.projects);
+ var project = o.projects.length == 1 ? o.projects[0] : null;
+
+ o.chargeUnits = Ext4.unique(o.chargeUnits);
+ var chargeUnit = o.chargeUnits.length == 1 ? o.chargeUnits[0] : null;
+
+ o.tissueTypes = Ext4.unique(o.tissueTypes);
+ var tissueType = o.tissueTypes.length == 1 ? o.tissueTypes[0] : null;
+
+
+ items.push({
+ xtype: 'xdatetime',
+ width: 300,
+ format: LABKEY.extDefaultDateTimeFormat,
+ timeFormat: 'H:i',
+ fieldName: 'date',
+ key: key,
+ value: minDate
+ });
+
+ items.push({
+ xtype: 'ehr-projectfield',
+ matchFieldWidth: false,
+ showInactive: true,
+ fieldLabel: null,
+ width: 100,
+ fieldName: 'project',
+ key: key,
+ value: project
+ });
+
+ if (this.targetGrid.store.getFields().get('chargetype')){
+ var cfg = LABKEY.ext4.Util.getDefaultEditorConfig(this.targetGrid.store.getFields().get('chargetype'));
+
+ items.push(Ext4.apply(cfg, {
+ matchFieldWidth: false,
+ showInactive: true,
+ fieldLabel: null,
+ width: 160,
+ fieldName: 'chargetype',
+ key: key,
+ value: chargeUnit
+ }));
+ }
+
+ if (this.targetGrid.store.getFields().get('tissueType')){
+ var cfg = LABKEY.ext4.Util.getDefaultEditorConfig(this.targetGrid.store.getFields().get('tissueType'));
+
+ items.push(Ext4.apply(cfg, {
+ matchFieldWidth: false,
+ showInactive: true,
+ fieldLabel: null,
+ width: 160,
+ fieldName: 'tissueType',
+ key: key,
+ value: tissueType
+ }));
+ }
+
+ items.push({
+ xtype: 'textfield',
+ width: 200,
+ fieldName: 'performedby',
+ key: key,
+ value: performedby
+ });
+
+ items.push({
+ xtype: 'checkbox',
+ key: key,
+ fieldName: 'exclude',
+ checked: existingIds[key]
+ });
+ }, this);
+
+ return [{
+ itemId: 'theTable',
+ border: false,
+ layout: {
+ type: 'table',
+ //columns: this.targetGrid.store.getFields().get('chargetype') ? 6 : 5,
+ columns: this.targetGrid.store.getFields().get('tissueType') ? 6 : 5
+ },
+ defaults: {
+ border: false,
+ style: 'margin: 5px;'
+ },
+ items: items
+ }]
+ },
+
+ getRows: function(){
+ var table = this.down('#theTable');
+ var orderedKeys = [];
+ var rowMap = {};
+ table.items.each(function(item){
+ if (item.fieldName){
+ if (orderedKeys.indexOf(item.key) == -1)
+ orderedKeys.push(item.key);
+
+ rowMap[item.key] = rowMap[item.key] || {};
+ rowMap[item.key][item.fieldName] = item.getValue ? item.getValue() : item.value;
+ }
+ }, this);
+
+ var ret = [];
+ Ext4.Array.forEach(orderedKeys, function(key){
+ ret.push(rowMap[key]);
+ }, this);
+
+ return ret;
+ },
+
+ onSubmit: function(btn){
+ var toAdd = [];
+ Ext4.Array.forEach(this.getRows(), function(data){
+ if (!data.exclude){
+ toAdd.push(this.targetGrid.store.createModel(data));
+ }
+ }, this);
+
+ if (toAdd.length){
+ var choose = this.down('#chooseValues').getValue();
+ if (choose){
+ Ext4.create('EHR.window.BulkEditWindow', {
+ suppressConfirmMsg: true,
+ records: toAdd,
+ targetStore: this.targetGrid.store,
+ formConfig: this.targetGrid.formConfig
+ }).show();
+ this.close();
+ }
+ else {
+ this.targetGrid.store.add(toAdd);
+ }
+ }
+
+ this.close();
+ }
+});
+
+
+EHR.DataEntryUtils.registerGridButton('IPC_COPYFROMSECTION', function(config){
+ return Ext4.Object.merge({
+ text: 'IPC Copy From Section',
+ xtype: 'button',
+ tooltip: 'Click to copy records from one of the other sections',
+ listeners: {
+ beforerender: function(btn){
+ var grid = btn.up('gridpanel');
+ LDK.Assert.assertNotEmpty('Unable to find gridpanel in COPYFROMSECTION button', grid);
+
+ btn.grid = grid;
+
+ btn.appendButtons.call(btn);
+ }
+ },
+ menu: {
+ xtype: 'menu',
+ items: [{
+ text: 'Loading...'
+ }]
+ },
+ appendButtons: function(){
+ this.dataEntryPanel = this.grid.up('ehr-dataentrypanel');
+ LDK.Assert.assertNotEmpty('Unable to find dataEntryPanel in COPYFROMSECTION button', this.dataEntryPanel);
+
+ var toAdd = [];
+ Ext4.Array.forEach(this.dataEntryPanel.formConfig.sections, function(section){
+ if (section.name == this.grid.formConfig.name){
+ return;
+ }
+
+ var store = this.dataEntryPanel.storeCollection.getClientStoreByName(section.name);
+ if (store){
+ //only allow copying from sections with an ID field
+ if (!store.getFields().get('Id')){
+ return;
+ }
+
+ toAdd.push({
+ text: section.label,
+ scope: this,
+ handler: function(menu){
+ Ext4.create('ONPRC_EHR.window.IPC_CopyFromSectionWindow', {
+ targetGrid: this.grid,
+ sourceLabel: section.label,
+ parentStore: store
+ }).show();
+ }
+ });
+ }
+ }, this);
+
+ this.menu.removeAll();
+ if (toAdd.length){
+ this.menu.add(toAdd);
+ }
+ else {
+ this.menu.add({
+ text: 'There are no other sections'
+ })
+ }
+ }
+ });
+});
\ No newline at end of file
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
index edbb6bde0..1375343b1 100644
--- a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
@@ -123,7 +123,7 @@ public String getName()
@Override
public @Nullable Double getSchemaVersion()
{
- return 23.007;
+ return 23.008;
}
@Override
@@ -553,8 +553,9 @@ public String toString()
//Added: 1/13/2021 Kolli
// EHRService.get().registerFormType(new DefaultDataEntryFormFactory(ARTCoreRequestFormType.class, this));
- //Added: 8/10/2019 Kolli
-// EHRService.get().registerFormType(new DefaultDataEntryFormFactory(IPCRequestFormType.class, this));
+ //Added: 8/10/2019 Kolli, Re-opened: 10/24/23 by Kolli
+ EHRService.get().registerFormType(new DefaultDataEntryFormFactory(IPCRequestFormType.class, this));
+
// Added: 11-21-2017 R.Blasa
EHRService.get().registerFormType(new DefaultDataEntryFormFactory(ProcedureRequestBulkEditFormType.class, this));
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPCRequestFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPCRequestFormType.java
new file mode 100644
index 000000000..d73b3ee1b
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPCRequestFormType.java
@@ -0,0 +1,40 @@
+package org.labkey.onprc_ehr.dataentry;
+
+import org.labkey.api.ehr.dataentry.DataEntryFormContext;
+import org.labkey.api.ehr.dataentry.TaskForm;
+import org.labkey.api.ehr.dataentry.TaskFormSection;
+import org.labkey.api.module.Module;
+import org.labkey.api.view.template.ClientDependency;
+
+import java.util.Arrays;
+
+/**
+ * User: Kolli
+ * Date: 7/7/19
+ * Time: 10:36 AM
+ */
+public class IPCRequestFormType extends TaskForm
+{
+ public static final String NAME = "IPC SERVICE REQUEST";
+
+ public IPCRequestFormType(DataEntryFormContext ctx, Module owner)
+ {
+ super(ctx, owner, NAME, "Histology Service Request", "Requests", Arrays.asList(
+ new TaskFormSection(),
+ new IPC_ServiceRequestDetailsFormSection("Service Request Details"),
+ new AnimalDetailssFormSection(),
+ new IPC_CassettePrintingFormSection(),
+ new IPC_ProcessingEmbeddingFormSection(),
+ new IPC_SectioningFormSection(),
+ new IPC_StainingFormSection(),
+ new IPC_SlidePrintingFormSection(),
+ new IPC_OtherFormSection()
+ ));
+
+ setStoreCollectionClass("EHR.data.IPCStoreCollection");
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/data/IPCStoreCollection.js"));
+ }
+
+}
+
+
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_CassettePrintingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_CassettePrintingFormSection.java
new file mode 100644
index 000000000..fc08a4d65
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_CassettePrintingFormSection.java
@@ -0,0 +1,50 @@
+package org.labkey.onprc_ehr.dataentry;
+
+import org.labkey.api.ehr.EHRService;
+import org.labkey.api.ehr.dataentry.SimpleGridPanel;
+import org.labkey.api.view.template.ClientDependency;
+import java.util.List;
+
+
+/**
+ * User: Kollil
+ * Date: 4/01/2020
+ * Time: 10:36 AM
+ */
+public class IPC_CassettePrintingFormSection extends SimpleGridPanel
+{
+ public IPC_CassettePrintingFormSection()
+ {
+ this(EHRService.FORM_SECTION_LOCATION.Body);
+ }
+
+ public IPC_CassettePrintingFormSection(EHRService.FORM_SECTION_LOCATION location)
+ {
+ super("study", "IPC_CassettePrinting", "Cassette Printing", location);
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_CassettePrinting.js"));
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Child.js"));
+ addConfigSource("IPC_Child");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/IPC_CopyFromSectionWindow.js"));
+
+ addConfigSource("CassettePrinting");
+ }
+
+ @Override
+ public List getTbarButtons()
+ {
+ List defaultButtons = super.getTbarButtons();
+
+ if (defaultButtons.contains("COPYFROMSECTION"))
+ {
+ int idx = defaultButtons.indexOf("COPYFROMSECTION");
+ defaultButtons.remove("COPYFROMSECTION");
+ defaultButtons.add(idx, "IPC_COPYFROMSECTION");
+ }
+
+ return defaultButtons;
+ }
+
+}
+
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_OtherFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_OtherFormSection.java
new file mode 100644
index 000000000..597ddcebf
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_OtherFormSection.java
@@ -0,0 +1,44 @@
+package org.labkey.onprc_ehr.dataentry;
+
+import org.labkey.api.ehr.EHRService;
+import org.labkey.api.ehr.dataentry.SimpleGridPanel;
+import org.labkey.api.view.template.ClientDependency;
+import java.util.List;
+
+/**
+ * User: Kolli
+ * Date: 4/01/2020
+ * Time: 10:36 AM
+ */
+public class IPC_OtherFormSection extends SimpleGridPanel
+{
+ public IPC_OtherFormSection()
+ {
+ this(EHRService.FORM_SECTION_LOCATION.Body);
+ }
+
+ public IPC_OtherFormSection(EHRService.FORM_SECTION_LOCATION location)
+ {
+ super("study", "IPC_Other", "Other", location);
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Other.js"));
+ addConfigSource("IPC_Other");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/IPC_CopyFromSectionWindow.js"));
+ }
+
+ @Override
+ public List getTbarButtons()
+ {
+ List defaultButtons = super.getTbarButtons();
+
+ if (defaultButtons.contains("COPYFROMSECTION"))
+ {
+ int idx = defaultButtons.indexOf("COPYFROMSECTION");
+ defaultButtons.remove("COPYFROMSECTION");
+ defaultButtons.add(idx, "IPC_COPYFROMSECTION");
+ }
+
+ return defaultButtons;
+ }
+
+}
\ No newline at end of file
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_ProcessingEmbeddingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_ProcessingEmbeddingFormSection.java
new file mode 100644
index 000000000..dd147b6f6
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_ProcessingEmbeddingFormSection.java
@@ -0,0 +1,48 @@
+package org.labkey.onprc_ehr.dataentry;
+
+import org.labkey.api.ehr.EHRService;
+import org.labkey.api.ehr.dataentry.SimpleGridPanel;
+import org.labkey.api.view.template.ClientDependency;
+import java.util.List;
+
+/**
+ * User: Kolli
+ * Date: 4/01/2020
+ * Time: 10:36 AM
+ */
+public class IPC_ProcessingEmbeddingFormSection extends SimpleGridPanel
+{
+ public IPC_ProcessingEmbeddingFormSection()
+ {
+ this(EHRService.FORM_SECTION_LOCATION.Body);
+ }
+
+ public IPC_ProcessingEmbeddingFormSection(EHRService.FORM_SECTION_LOCATION location)
+ {
+ super("study", "IPC_ProcessingEmbedding", "Tissue Processing / Embedding", location);
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_ProcessingEmbedding.js"));
+
+ addConfigSource("ProcessingEmbedding");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Child.js"));
+ addConfigSource("IPC_Child");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/IPC_CopyFromSectionWindow.js"));
+ }
+
+ @Override
+ public List getTbarButtons()
+ {
+ List defaultButtons = super.getTbarButtons();
+
+ if (defaultButtons.contains("COPYFROMSECTION"))
+ {
+ int idx = defaultButtons.indexOf("COPYFROMSECTION");
+ defaultButtons.remove("COPYFROMSECTION");
+ defaultButtons.add(idx, "IPC_COPYFROMSECTION");
+ }
+
+ return defaultButtons;
+ }
+
+}
\ No newline at end of file
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_SectioningFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_SectioningFormSection.java
new file mode 100644
index 000000000..9e1bd4cdd
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_SectioningFormSection.java
@@ -0,0 +1,47 @@
+package org.labkey.onprc_ehr.dataentry;
+
+import org.labkey.api.ehr.EHRService;
+import org.labkey.api.ehr.dataentry.SimpleGridPanel;
+import org.labkey.api.view.template.ClientDependency;
+import java.util.List;
+
+/**
+ * User: Kolli
+ * Date: 4/01/2020
+ * Time: 10:36 AM
+ */
+public class IPC_SectioningFormSection extends SimpleGridPanel
+{
+ public IPC_SectioningFormSection()
+ {
+ this(EHRService.FORM_SECTION_LOCATION.Body);
+ }
+
+ public IPC_SectioningFormSection(EHRService.FORM_SECTION_LOCATION location)
+ {
+ super("study", "IPC_Sectioning", "Sectioning", location);
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Sectioning.js"));
+ addConfigSource("Sectioning");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Child.js"));
+ addConfigSource("IPC_Child");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/IPC_CopyFromSectionWindow.js"));
+ }
+
+ @Override
+ public List getTbarButtons()
+ {
+ List defaultButtons = super.getTbarButtons();
+
+ if (defaultButtons.contains("COPYFROMSECTION"))
+ {
+ int idx = defaultButtons.indexOf("COPYFROMSECTION");
+ defaultButtons.remove("COPYFROMSECTION");
+ defaultButtons.add(idx, "IPC_COPYFROMSECTION");
+ }
+
+ return defaultButtons;
+ }
+
+}
\ No newline at end of file
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_ServiceRequestDetailsFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_ServiceRequestDetailsFormSection.java
new file mode 100644
index 000000000..c623a20bf
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_ServiceRequestDetailsFormSection.java
@@ -0,0 +1,22 @@
+/*
+// * User: Kolli
+// * Date: 4/01/2020
+// * Time: 10:36 AM
+ */
+
+package org.labkey.onprc_ehr.dataentry;
+
+import org.labkey.api.ehr.dataentry.SimpleFormPanelSection;
+import org.labkey.api.view.template.ClientDependency;
+
+public class IPC_ServiceRequestDetailsFormSection extends SimpleFormPanelSection
+{
+ public IPC_ServiceRequestDetailsFormSection(String label)
+ {
+ super("study", "IPC_ServiceRequestDetails", label);
+ setTemplateMode(TEMPLATE_MODE.NONE);
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_ServiceRequestDetails.js"));
+ addConfigSource("ServiceRequestDetails");
+ }
+}
+
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_SlidePrintingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_SlidePrintingFormSection.java
new file mode 100644
index 000000000..e07b9d149
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_SlidePrintingFormSection.java
@@ -0,0 +1,46 @@
+package org.labkey.onprc_ehr.dataentry;
+
+import org.labkey.api.ehr.EHRService;
+import org.labkey.api.ehr.dataentry.SimpleGridPanel;
+import org.labkey.api.view.template.ClientDependency;
+import java.util.List;
+
+/**
+ * User: Kolli
+ * Date: 4/01/2020
+ * Time: 10:36 AM
+ */
+public class IPC_SlidePrintingFormSection extends SimpleGridPanel
+{
+ public IPC_SlidePrintingFormSection()
+ {
+ this(EHRService.FORM_SECTION_LOCATION.Body);
+ }
+
+ public IPC_SlidePrintingFormSection(EHRService.FORM_SECTION_LOCATION location)
+ {
+ super("study", "IPC_SlidePrinting", "Slide Printing (No Sectioning)", location);
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_SlidePrinting.js"));
+ addConfigSource("SlidePrinting");
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Child.js"));
+ addConfigSource("IPC_Child");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/IPC_CopyFromSectionWindow.js"));
+ }
+
+ @Override
+ public List getTbarButtons()
+ {
+ List defaultButtons = super.getTbarButtons();
+
+ if (defaultButtons.contains("COPYFROMSECTION"))
+ {
+ int idx = defaultButtons.indexOf("COPYFROMSECTION");
+ defaultButtons.remove("COPYFROMSECTION");
+ defaultButtons.add(idx, "IPC_COPYFROMSECTION");
+ }
+
+ return defaultButtons;
+ }
+
+}
\ No newline at end of file
diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_StainingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_StainingFormSection.java
new file mode 100644
index 000000000..28120b2ea
--- /dev/null
+++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/IPC_StainingFormSection.java
@@ -0,0 +1,45 @@
+package org.labkey.onprc_ehr.dataentry;
+import org.labkey.api.ehr.EHRService;
+import org.labkey.api.ehr.dataentry.SimpleGridPanel;
+import org.labkey.api.view.template.ClientDependency;
+import java.util.List;
+
+/**
+ * User: Kolli
+ * Date: 4/01/2020
+ * Time: 10:36 AM
+ */
+public class IPC_StainingFormSection extends SimpleGridPanel
+{
+ public IPC_StainingFormSection()
+ {
+ this(EHRService.FORM_SECTION_LOCATION.Body);
+ }
+
+ public IPC_StainingFormSection(EHRService.FORM_SECTION_LOCATION location)
+ {
+ super("study", "IPC_Staining", "Staining", location);
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Staining.js"));
+ addConfigSource("Staining");
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/IPC_Child.js"));
+ addConfigSource("IPC_Child");
+
+ addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/IPC_CopyFromSectionWindow.js"));
+ }
+
+ @Override
+ public List getTbarButtons()
+ {
+ List defaultButtons = super.getTbarButtons();
+
+ if (defaultButtons.contains("COPYFROMSECTION"))
+ {
+ int idx = defaultButtons.indexOf("COPYFROMSECTION");
+ defaultButtons.remove("COPYFROMSECTION");
+ defaultButtons.add(idx, "IPC_COPYFROMSECTION");
+ }
+
+ return defaultButtons;
+ }
+
+}
\ No newline at end of file