Information on the ICD10CM mapping project.

  • ModuleId: 5991000124107
  • RefsetId: 6011000124106

Helpful Admin Commands

Setting up new ICD10CM Mapping Project

Load ICD10CM

Do xml to claml conversion to create icd10cm file to load.

 ./xml2claml.pl -episode 2018-ICD-10-Table-And-Index/icd10cm_tabular_2018.xml > icd10cm_2018.xml

Remove the following line from icd10cm_2018.xml


Load icd10cm_2018.xml to /home/ihtsdo/data/ICD10CM
Change owner of icd10cm_2018.xml to root
Load icd10cm data
cd /home/ihtsdo/code/admin/loader
mvn clean install -PClaML -Drun.config=/opt/mapping-service/conf/config.properties -Dinput.file=/home/ihtsdo/data/ICD10CM/icd10cm-2018.xml -Dterminology=ICD10CM -Dversion=2018


Pre-process the map file to clean up map relations  (see code below - examples 109006, 2217001, 2268003)

cd /home/ihtsdo/code/admin/loader
make sure complex_map_refset_members table mapRule field is type longtext, not varchar(255)
make sure enough memory is provided (consider ~/.bash_profile): export MAVEN_OPTS="-XX:MaxPermSize=512m -Xmx3300M"
mvn clean install -PRF2-snapshot -Drun.config=/opt/mapping-service/conf/config.properties -Dinput.dir=/home/ihtsdo/data/SNOMEDCT_US/SnomedCT_USEditionRF2_Production_20170301T120000/Snapshot -Dterminology=SNOMEDCT_US -Dversion=latest

Make SNOMEDCT_US to ICD10CM project logged in as Administrator
Confirm refsetId by looking for mapping in the Terminology/..descriptions.. file in the SNOMEDCT_US release files refsetId (6011000124106)

Load Map Records from RF2
cd /home/ihtsdo/code/admin/loader
set file = /home/ihtsdo/data/SNOMEDCT_US/SnomedCT_USEditionRF2_Production_20170301T120000/Snapshot/Refset/Map/der2_iisssccRefset_ExtendedMapSnapshot_US1000124_20170301.txt
perl -ne '@_=split/\t/; print if $_[4] eq "6011000124106"' $file > /tmp/x.txt
mvn install -PMapRecords -Drun.config=/opt/mapping-service/conf/config.properties -Dinput.file=/tmp/x.txt -Dmember.flag=false -Drecord.flag=true

Load Refset Members from RF2
cd /home/ihtsdo/code/admin/loader
perl -ne '@_=split/\t/; print if $_[4] eq "6011000124106" && $_[2] eq "1"' /home/ihtsdo/data/SNOMEDCT_US/SnomedCT_USEditionRF2_Production_20170301T120000/Snapshot/Refset/Map/der2_iisssccRefset_ExtendedMapSnapshot_US1000124_20170301.txt > /tmp/x.txt
mvn install -PMapRecords -Drun.config=/opt/mapping-service/conf/config.properties -Dinput.file=/tmp/x.txt -Dmember.flag=true -Drecord.flag=false

Compute workflow
cd /home/ihtsdo/code/admin/loader
mvn install -PComputeWorkflow -Drun.config=/opt/mapping-service/conf/config.properties -Drefset.id=6011000124106

Add advices, map relations, users

Recalculate Map Advice
cd /home/ihtsdo/code/admin/release
mvn install -PRecalculateMapAdvice -Drun.config=/opt/mapping-service/conf/config.properties -Drefset.id=6011000124106 > /opt/mapping-service/logs/recalculateMapAdvice_YYYYMMDD.log

Release process

  • delete from complex_map_refset_members where terminology = 'SNOMEDCT_US';
  •  perl -ne '@_=split/\t/; print if $_[4] eq "6011000124106"' /home/dshapiro/der2_iisssccRefset_ExtendedMapSnapshot_US1000124_20180901.txt > /home/dshapiro/icd10cm.20180901.txt
  • cd /home/ihtsdo/code/admin/loader
  •  mvn install -PMapRecords -Drun.config=/opt/mapping-service/conf/config.properties -Dinput.file=/home/dshapiro/icd10cm.20180901.txt -Dmember.flag=true -Drecord.flag=false > /opt/mapping-service/logs/reloadComplexMapRefsetMembers.log

International Release Update

  1.  Clone us-mapping to uat-us-mapping.  Reindex.
  2.  Get Rory to confirm when the Member International release has been loaded into the US authoring tool
  3.  Wait till the drip feed files at https://release.ihtsdotools.org/api/v1/centers/us/products/snomed_ct_us_daily_build/builds/2019-07-{DAY/TIME}/outputfiles/sct2_{Component}_Delta_US1000124_20190901.txt  have international data in them.  (This location may change and should be checked with Rory/Andrew)
  4.  Have Rory/Terance or systems increase the UAT box to 16 GB / 4 CPU.  Have auto-shutoff turned off temporarily for test load.
  5.  Run the script on UAT called /opt/mapping-service-admin/config/bin/loadDeltaInternationalOnly.csh.  This will likely need to be run step by step.  First the international only data needs to be parsed out and files put in a single flat directory.  The flat directory should not be a /tmp subdirectory or else it will be deleted before it can be transfered for the prod insertion.  Then the delta needs to be loaded, tree positions removed, tree positions reindexed, tree positions loaded and workflow computed.
  6. Spot-check concept Ids in Available work, that they were all in-scope and mapped on Int'l mapping,
  7.  Have NLM confirm it looks correct on UAT.
  8.  Have Rory/Terance revert settings on uat-us-mapping.
  9.  Get maintenance window for us-mapping and resize box on us-mapping.
  10. Put OFF file in /home/ihtsdo/bin directory.
  11.  Run it there too.

Deploying on us-mapping

  1. supervisorctl stop mapping-service

  2. cd /home/ihtsdo/code

  3. git pull
  4. mvn clean install

  5. mvn install package -f pom-us.xml

  6. cp /home/ihtsdo/code/rest/target/mapping-rest.war /opt/mapping-service/run/target/tomcat.10002/webapps/expanded/mapping-rest.war
  7. supervisorctl start mapping-service
  • No labels