********************************************************
		What is CSNOCtrl ?
********************************************************

CSNOCtrl is a plugin which can be added to any web page enabling SNOMED CT code search.
It can further be used to map entered SNOMED CT code to ICD-10 code.

This control consumes REST API's of CSNOServ service. Therefore, CSNOServ must be deployed.
	To configure CSNOServ service, download CSNOServ component.
	Follow steps in README.txt of CSNOServ package.
	As default settings, CSNOFinder uses CSNOServ available at "http://localhost:8080/csnoserv".
To open ".jar" and ".war" files use WINRAR archiver.

********************************************************
	Pre-Requisite Software requirements
********************************************************

1. Adopt JDK 11 should be installed on the machine for CSNOtk application. 
2. Append the path value for JAVA in the PATH environment variable.
	e.g. :  C:\Program Files\openjdk\jdk11\bin
3. Set the environment variables for Java.
	e.g. :  JAVA_HOME: C:\Program Files\openjdk\jdk11
4. To host the application for different plug-in (JAVA, Dot Net, PHP) different hosting web servers are required.

********************************************************
	How to Embed CSNOCtrl in a web page 
********************************************************

1. Download the CSNOCtrl.zip and extract to a folder.
2. Select the DOTNET folder from CSNOCtrl folder. 
3. Copy the css, ext, images, license.html and js folder from DOTNET folder to your web project. (css, ext, images and js folder contains required stylesheets, jquery scripts, and javascript file respectively)
4. Add the supplied images, js (searchtool.js) and css to your target web page.
   Note: demo.js is required when using index.html provided in WebContent folder for demo purpose.
5. Add following scripts in your web page : searchtool.js, searchtool.css,jquery.js, jquery-ui.custom.min.js, jquery.autocomplete.js
6. Use any HTML control on target web page, add an event to it that will call selectSNOMEDCT function as per requirement.  
	Function:
	selectSNOMEDCT(state_IN, semantictag_IN, acceptability_IN, returnlimit_IN, refsetid_IN, callback)
	This function shall open the CSNOCtrl pop-up window. Refer values for input parameters passed to selectSNOMEDCT function from the Enums defined in searchtool.js
	
	Parameter Description:
	(A)state_IN- Defines the state of concept. Refer enumSTATE in searchtool.js to pass values for the state_IN parameter. 
					Possible values for state_IN parameter are as follows-
					ACTIVE - It will return only active components.
					INACTIVE - It will return only inactive components.
					BOTH - It will return  active and inactive components.
					
	(B)semantictag_IN- Defines semantic tag of the concept. Refer enumSEMANTICTAG in searchtool.js to pass values for the semantictag_IN parameter.
					Possible values for semantictag_IN paramter are as follows-
					ALL, PROCEDURE, DISORDER, FINDING, OBSERVABLE_ENTITY, BODY_STRUCTURE, ORGANISM, SUBSTANCE, SPECIMEN, SPECIAL_CONCEPT, LINKAGE_CONCEPT, PHYSICAL_FORCE, EVENT, ENVIRONMENT, GEOGRAPHIC_LOCATION, SOCIAL_CONCEPT, SITUATION_WITH_EXPLICIT_CONTEXT, STAGING_SCALE, PHYSICAL_OBJECT, QUALIFIER_VALUE, RECORD_ARTIFACT, PERSON, LINK_ASSERTION, NAMESPACE_CONCEPT, ATTRIBUTE : "attribute", ASSESSMENT_SCALE, RACIAL_GROUP, TUMOR_STAGING, OCCUPATION, MORPHOLOGIC_ABNORMALITY, CELL, CELL_STRUCTURE, ETHNIC_GROUP, PRODUCT, INACTIVE_CONCEPT, NAVIGATIONAL_CONCEPT, LIFE_STYLE, REGIME_THERAPY, RELIGION_PHILOSOPHY, DISPOSITION, MEDICINAL_PRODUCT, MEDICINAL_PRODUCT_FORM, CLINICAL_DRUG, UNIT_OF_PRESENTATION, NUMBER, ADMINISTRATION_METHOD, BASIC_DOSE_FORM, DOSE_FORM, INTENDED_SITE, RELEASE_CHARACTERISTIC, STATE_OF_MATTER, TRANSFORMATION
					ALL - It will search for SNOMED CT terms in all semantic tags
		
	(C)acceptability_IN- Refer enumACCEPTABILITY in searchtool.js to pass values for the acceptability_IN parameter. 
					Possible values for acceptability_IN parameter are as follows-
					PREFERRED- If acceptability_IN is PREFERRED, only FSN and Preferred Terms for a given term shall be fetched.
					PREFERRED_EXCLUDING_FSN- Only Preferred Terms excluding FSN for given term shall be fetched.
					SYNONYMS- Only synonyms for the given term shall be fetched.
					ACCEPTABLE- Only acceptable terms shall be fetched.
					ALL- It will return all SNOMED CT terms related to the searched term, irrespective of their acceptability value.
					
	(D)returnlimit_IN- Defines the maximum number of matching terms to be fetched from the SNOMED CT repository.For displaying all results, returnlimit should be -1.

	(E)refsetid_IN- Defines the Refset Identifier for search in specific Refset or null for search in whole SNOMED CT terminology.

	(F)parentid- Concept Identifier, if search is to be done in specific sub-hierarchy (through all descendants of a specific Concept parentid) or null if search is to be done through whole SNOMED CT terminology.
					
	(G)callback- It will contain the definition of the callback function used to retrieve return value/result from the selectSNOMEDCT function.
					The result includes Concept Id,Description Id and Description of the selected concept from SNOMED CT repository.
					Callback function has to be defined for user defined HTML page. 
					
					Code snippet-
					
					var callback =function(selectedSNOMEDTerm){setValue(selectedSNOMEDTerm);};
					
					function setValue(selectedSNOMEDTerm)
					{
						//Parameter selectedSNOMEDTerm contains Concept Id,Description Id and Description. 
						//User can manipulate the string or edit the function definition as per his requirement
						document.getElementById(HTMLcontrolid).html=selectedSNOMEDTerm;
					}
					
					The function shall contain only 1 parameter <selectedSNOMEDTerm> that refers to the result including Concept Id,Description Id and Description.
					User will have to define a function like setValue in the callback function to set the return value <selectedSNOMEDTerm> in some HTML control of the web page.
					For different HTML controls user will have to define different callback functions and write corresponding <setValue> functions for them.
	

********************************************************
	How to Embed CSNOCtrl for ICDMAP in a web page 
********************************************************

1. Download the CSNOCtrl.zip and extract to a folder.
2. Select the DOTNET folder from CSNOCtrl folder. 
3. Copy the css, ext, images, license.html and js folder from JAVA folder to your web project. (css, ext, images and js folder contains required stylesheets, jquery scripts, and javascript file respectively)
4. Add the supplied images, js (map.js) and css to your target web page.
   Note: autosearch.js is required when using icdmap.html provided in WebContent folder for demo purpose.
5. Add following scripts in your web page : map.js, map.css, searchtool.css, jquery.js, jquery-ui.custom.min.js, jquery.autocomplete.js
6. Use any HTML control on target web page, add an event to it that will call mapICDCode function as per requirement.  
	Function:
	mapICDCode(field_IN, snomedctid_IN, gender_IN, birthdate_IN, diagnosisdate_IN, secondary_IN, callback_icd) 
	This function shall open the CSNOCtrl pop-up window. Refer values for input parameters passed to mapICDCode function from the Enums defined in map.js
	
	Parameter Description:
	(A)field_IN- Id of the field to which resultant mapped ICD-10 code to be set.
					
	(B)snomedctid_IN- SNOMED CT concept id that need to be mapped to ICD-10 code.
		
	(C)gender_IN- Gender of the patient.
					Possible values for gender_IN parameter are as follows-
					MALE
					FEMALE
					NONE - otherwise or unknown.
										
	(D)birthdate_IN- Date of birth of the patient. It need to in YYYY-MM-DD format to be send to API.

	(E)diagnosisdate_IN- Date of the diagnosis i.e. date on which patient was diagnosed. It need to in YYYY-MM-DD format to be send to API. If not provided, it will be considered as the current date.

	(F)secondary_IN- Secondary diagnosis concept id. It can hold multiple SNOMED CT concept ids assumed to be separated by a plus (+) sign.
					
	(G)callback- It will contain the definition of the callback function used to retrieve return value/result from the mapICDCode function.
					The result includes ICD-10 code. 
					Callback function has to be defined for user defined HTML page. 
					
					Code snippet-
					
					var callback =function(ret_OUT, field_id){setValue_icd(ret_OUT, field_id);};
					function setValue_icd(mappedTerm, field_id)
					{
					
						 /* Parameter mappedTerm contains the resultant ICD-10 code.*/
						 document.getElementById(field_id).html=mappedTerm;
					}
					
					The function shall contain only 2 parameter  - 
					<field_id> that refers to field id/name of html page to which need to be set. 
						It is useful if control is invoked from  julitpl fields from the same html page.
					<mappedTerm> that refers to the result providing ICD-10 code.
					User will have to define a function like setValue_icd in the callback function to set the return value mappedTerm in some HTML control of the web page.
					For different HTML controls, user will have to define different callback functions and write corresponding <setValue> functions for them.

********************************************************
	How to Embed CSNOCtrl for Simple Map in a web page 
********************************************************

1. Download the CSNOCtrl.zip and extract to a folder.
2. Select the DOTNET folder from CSNOCtrl folder. 
3. Copy the css, ext, images, license.html and js folder from DOTNET folder to your web project. (css, ext, images and js folder contains required stylesheets, jquery scripts, and javascript file respectively)
4. Add the supplied images, js (map.js) and css to your target web page.
   Note: autosearch.js is required when using icdmap.html provided in WebContent folder for demo purpose.
5. Add following scripts in your web page : map.js, map.css, searchtool.css, jquery.js, jquery-ui.custom.min.js, jquery.autocomplete.js
6. Use any HTML control on target web page, add an event to it that will call getSimpleMap function as per requirement.  
	Function:
		getSimpleMap(conceptId,targetSpanId) 
		This function used to retrieve Concept ID, Map Status and Simple Mapped Target Code of the concept from SNOMED CT repository
			Parameter Description:
				a.conceptId- Defines the SNOMED CT Concept Identifier.
				b.targetSpanId- Defines the span id where to display concept details. used to retrieve return value/result from the getSimpleMapfunction.



********************************************************
	How to Embed CSNOCtrl with DISB in a web page 
********************************************************

1. Download the CSNOCtrl.zip and extract to a folder.
2. Select the DOTNET folder from CSNOCtrl folder. 
3. Copy the css, ext, images, license.html and js folder from DOTNET folder to your web project. (css, ext, images and js folder contains required stylesheets, jquery scripts, and javascript file respectively)
4. Add the supplied images, js (disb.js) and css to your target web page.   
5. Add following scripts in your web page : disb.js, jquery.js, jquery-ui.custom.min.js, jquery.js
6. Use any HTML control on target web page, add an event to it that will call disbByConcept function as per requirement.  
	Function:
		(A) Add following javascripts in your web page :
			jquery.js
			jquery-ui.custom.min.js
		(B) Add following CSNOCtrl scripts in your web page :
			disb.js
		(C) Call disbByConcept(conceptId,category,targetSpanId) function to get concept(Substance, Medicine, Generic) details.
			Parameter Description
				conceptId- Defines the SNOMED CT Concept Identifier.
				Category- Defines category. Refer enumSemantic in disb.js to pass values for the category parameter. Possible values for category parameter are as follows-
						substance - It will provide concept details of substance
						medicine - It will provide concept details from real clinical drug.
						generic - It will provide concept details from clinical drug.
				targetSpanId- Defines the span id where to display concept details. used to retrieve return value/result from the disbByConcept function.
		(D) The result includes details from DISB

********************************************************
    How to Change the CSNOServ service in CSNOCtrl
********************************************************

1. Open searchtool.js from js folder.
2. Search for "http://localhost:8080/csnoserv" and replace with the new url.

For getting Semantic tags at run time.
1. Open index.html "http://localhost:8080/";  and replace with the new url.

For ICDMap/ SimpleMap,
1. Open map.js from js folder.
2. Search for "http://localhost:8080/csnoserv" and replace with the new url.

For DISB,
1. Open disb.js and search for "http://localhost:8080/csnoserv/api/disb/" and replace with the new url

********************************************************
		Demonstration page
********************************************************		

Check the index.html page from the downloaded zip for demonstration.

********************************************************
			FINISH
********************************************************
