Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <link rel="stylesheet" href="https://icdcdn.azureedge.net/embeddedct/icd11ect-1.3.css">

<a id="demo-link-docs" target="_blank" href="https://icd.who.int/icdapi/docs2/icd11ect-1.3/">🢥 Go to Documentation</a>
<h2 id="demo-title">DEMO of Multiple Embedded Coding Tool <small>v1.3</small></h2>

<!-- ECT 1 -->
<div class="demo-instance">
  <div class="demo">
    <h3>Embedded Coding Tool #1 <span class="demo-subtitle">This ECT is configured for searching only in chapters 01 Infections and 02 Neoplasms, and for don't display the related words on the left of the search results</span></h3>
    <div class="demo-search">
      <!-- input element used for typing the search  -->
      Type for starting search: <input type="text" class="ctw-input" autocomplete="off" data-ctw-ino="1"> <button class="demo-clear" onclick="ECT.Handler.clear('1');" title="Clear search and results">❌</button>
    </div>
    <div id="demo-selected-1">
      <!-- example of an extra input element for testing the Embedded Coding Tool select entity function -->
      Your selection is: <span id="demo-paste-selected-1"></span>
    </div>
  </div>

  <!-- div element used for showing the search results -->
  <div class="ctw-window" data-ctw-ino="1"></div>
</div>

<!-- ECT 2 -->
<div class="demo-instance">
  <div class="demo">
    <h3>Embedded Coding Tool #2 <span class="demo-subtitle">This ECT is configured for searching only in chapter X Extension Codes</span></h3>
    <div class="demo-search">
      <!-- input element used for typing the search  -->
      Type for starting search: <input type="text" class="ctw-input" autocomplete="off" data-ctw-ino="2"> <button class="demo-clear" onclick="ECT.Handler.clear('2');" title="Clear search and results">❌</button>
    </div>
    <div id="demo-selected-2">
      <!-- example of an extra input element for testing the Embedded Coding Tool select entity function -->
      Your selection is: <span id="demo-paste-selected-2"></span>
    </div>
  </div>

  <!-- div element used for showing the search results -->
  <div class="ctw-window" data-ctw-ino="2"></div>
</div>

<!-- ECT 3 -->
<div class="demo-instance">
  <div class="demo">
    <h3>Embedded Coding Tool #3 <span class="demo-subtitle">This ECT is configured for searching only in chapter 26 Traditional Medicine</span></h3>
    <div class="demo-search">
      <!-- input element used for typing the search  -->
      Type for starting search: <input type="text" class="ctw-input" autocomplete="off" data-ctw-ino="3"> <button class="demo-clear" onclick="ECT.Handler.clear('3');" title="Clear search and results">❌</button>
    </div>
    <div id="demo-selected-3">
      <!-- example of an extra input element for testing the Embedded Coding Tool select entity function -->
      Your selection is: <span id="demo-paste-selected-3"></span>
    </div>
  </div>

  <!-- div element used for showing the search results -->
  <div class="ctw-window" data-ctw-ino="3"></div>
</div>

<script src="https://icdcdn.azureedge.net/embeddedct/icd11ect-1.3.js"></script>
              
            
!

CSS

              
                body {
  font-family: "Ubuntu", Tahoma, "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 10px 20px 20px 20px;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1rem;
  color: #333;
  background-color: #fff;
}
#demo-link-docs {
  float: right;
}
#demo-title {
  margin-top: 50px;
  margin-bottom: 50px;
  text-align: center;
}
#demo-selected-1,
#demo-selected-2,
#demo-selected-3 {
  float: right;
  display: none;
}
#demo-paste-selected-1,
#demo-paste-selected-2,
#demo-paste-selected-3 {
  background-color: #ff9;
  padding: 5px;
}
.demo-instance {
  border: 1px solid #ccc;
  margin-bottom: 40px;
  padding: 10px;
  background-color: #eee;
  border-radius: 0.25rem;
}
.demo {
  margin-top: 20px;
}
.demo::after {
  clear: both;
  content: "";
  display: block;
}
.demo-search {
  float: left;
  margin-bottom: 20px;
}
.demo input {
  width: 400px;
  height: 1.2rem;
  font-size: 0.9rem;
  padding-left: 4px;
}
.demo-clear {
  cursor: pointer;
  padding: 2px;
}
.demo-subtitle {
  font-size: 0.75rem;
  font-weight: normal;
  margin-left: 6px;
}
.ctw-window {
  background-color: #fff;
}

              
            
!

JS

              
                // Embedded Coding Tool settings object
// please note that only the property "apiServerUrl" is required
// the other properties are optional
const mySettings = {
  // The API located at the URL below 
  // should be used only for software
  // development and testing. 
  // ICD content at this location might not
  // be up to date or complete. 
  // For production, use the API located at
  // id.who.int with proper OAUTH authentication
  apiServerUrl: "https://icd11restapi-developer-test.azurewebsites.net",
  height: "30vh"
};

// example of an Embedded Coding Tool using the callback selectedEntityFunction for copying the code selected in an html element
const myCallbacks = {
  selectedEntityFunction: selectedEntity => {
    document.getElementById(
      "demo-paste-selected-" + selectedEntity.iNo
    ).innerHTML =
      selectedEntity.code + " - " + selectedEntity.bestMatchText;
    document.getElementById(
      "demo-selected-" + selectedEntity.iNo
    ).style.display =
      "inline";
  }
};

// configure all the Embedded Coding Tool
ECT.Handler.configure(mySettings, myCallbacks);

// overwrite configuration only for the Embedded Coding Tool 1
ECT.Handler.overwriteConfiguration("1", {
  chaptersFilter: "01;02",
  wordsAvailable: false
});

// overwrite configuration only for the Embedded Coding Tool 2
ECT.Handler.overwriteConfiguration("2", { chaptersFilter: "X" });

// overwrite configuration only for the Embedded Coding Tool 3
ECT.Handler.overwriteConfiguration("3", { chaptersFilter: "26" });

              
            
!
999px

Console