-
Notifications
You must be signed in to change notification settings - Fork 0
/
mcitodcm.sh
2204 lines (2062 loc) · 93.1 KB
/
mcitodcm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
#
# Usage: ./mcitodcm.sh folder/filename.svs [outdir]
# #### NOW DEPENDS ON csvtool installed (pip3 install csvtool) and in path (e.g., "~/Library/Python/3.9/bin")
infile="$1"
outdir="$2"
#JAVATMPDIRARG="-Djava.io.tmpdir=/Volumes/Elements5TBNonEncD/tmp"
TMPJSONFILE="/tmp/`basename $0`.$$"
TMPFILEDESCRIBINGMULTIPLESAMPLES="/tmp/`basename $0`.samples.$$"
# make sure have performed dos2unix ICD-O-3.2_final_update09102020.csv so that CR is not included in extracted text
ICDOFILE="ICD-O-3.2_final_update09102020.csv"
#METADATABASE="MCI_metatdata_CCDI_v1.7.MCI_Metadata_manifest_v1.6.0_CatchERR20231011_wpathology_CatchERR20231011"
#METADATABASE="MCI_metatdata_CCDI_v1.7.2_wPath_CatchERR20240118"
#METADATABASE="MCI_Metadata_manifest_1-25_updated_Pathology_files_CatchERR20240613_CatchERR20240613"
METADATABASE="Submission2_CCDI_v1.9.1_phs002790_CatchERR20240816"
CSVFILENAMEFORSAMPLE="${METADATABASE}_sample.csv"
if [ ! -f "${CSVFILENAMEFORSAMPLE}" ]
then
echo 1>&2 "Error: no sample to patient mapping metadata CSV file called ${CSVFILENAMEFORSAMPLE}"
exit 1
fi
CSVFILENAMEFORIMAGING="${METADATABASE}_pathology_file.csv"
if [ ! -f "${CSVFILENAMEFORIMAGING}" ]
then
echo 1>&2 "Error: no sample to patient mapping metadata CSV file called ${CSVFILENAMEFORIMAGING}"
exit 1
fi
CSVFILENAMEFORPARTICIPANT="${METADATABASE}_participant.csv"
if [ ! -f "${CSVFILENAMEFORPARTICIPANT}" ]
then
echo 1>&2 "Error: no participant metadata CSV file called ${CSVFILENAMEFORPARTICIPANT}"
exit 1
fi
CSVFILENAMEFORDIAGNOSIS="${METADATABASE}_diagnosis.csv"
if [ ! -f "${CSVFILENAMEFORDIAGNOSIS}" ]
then
echo 1>&2 "Error: no diagnosis metadata CSV file called ${CSVFILENAMEFORDIAGNOSIS}"
exit 1
fi
# these persist across invocations ...
FILEMAPPINGSPECIMENIDTOUID="MCIspecimenIDToUIDMap.csv"
FILEMAPPINGSTUDYIDTOUID="MCIstudyIDToUIDMap.csv"
FILEMAPPINGSTUDYIDTODATETIME="MCIstudyIDToDateTimeMap.csv"
#JHOVE="${HOME}/work/jhove/jhove"
if [ -f "${HOME}/work/pixelmed/imgbook/pixelmed.jar" ]
then
PIXELMEDDIR="${HOME}/work/pixelmed/imgbook"
PATHTOADDITIONAL="${PIXELMEDDIR}/lib/additional"
elif [ -f "${HOME}/pixelmed.jar" ]
then
PIXELMEDDIR="${HOME}"
PATHTOADDITIONAL="${HOME}"
fi
dicomclinicaltrialcoordinatingcentername="Nationwide Children's Hospital"
# exactly 64 chars
dicomclinicaltrialsponsorname="National Cancer Institute (NCI) Childhood Cancer Data Initiative"
# lowercase "phs" as used in study.study_id and "https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/study.cgi?study_id=phs002790.v3.p1"
dicomclinicalprotocolid="phs002790"
issuerofdicomclinicalprotocolid="dbGaP"
# study.study_short_title
#dicomclinicalprotocolname="Childhood Cancer Data Initiative (CCDI): Molecular Characterization Initiative"
#needs to be <= 64 chars
dicomclinicalprotocolname="CCDI Molecular Characterization Initiative"
doiclinicalprotocolid="doi:10.5281/zenodo.11099087"
dicomclinicaltrialsiteid=""
# "idc-source-data-mci/0DAX7K_120804.svs"
# "idc-source-data-mci/0DNA2S.svs"
# do not remove suffix '.svs' from filename since need to match what is in CSVFILENAMEFORIMAGING
filename=`basename "${infile}"`
foldername=`dirname "${infile}"`
#slide_id=`echo ${filename} | sed -e 's/^\([A-Z0-9]*_[A-Z0-9]*\).*$/\1/'`
slide_id=`echo ${filename} | sed -e 's/^\([A-Z0-9_]*\).*$/\1/'`
# slide_id = 0DAX7K_120804
# slide_id = 0DNA2S
if [ -z "${outdir}" ]
then
# note: variation between '_' and '-' use will be harmonized to '_' ...
outdir="Converted/${slide_id}"
fi
if [ -f "${CSVFILENAMEFORIMAGING}" ]
then
# OLD:type,sample.sample_id,pdx.pdx_id,cell_line.cell_line_id,pathology_file_id,file_name,file_type,file_description,file_size,md5sum,file_url_in_cds,dcf_indexd_guid,magnification,fixation_embedding_method,staining_method,deidentification_method,file_mapping_level,id,sample.id,pdx.id,cell_line.id
# OLD:type,sample.sample_id,pdx.pdx_id,cell_line.cell_line_id,pathology_file_id,file_name,file_type,file_description,file_size,md5sum,file_url_in_cds,dcf_indexd_guid,image_modality,license,magnification,fixation_embedding_method,staining_method,deidentification_method,percent_tumor,percent_necrosis,file_mapping_level,id,sample.id,pdx.id,cell_line.id
# type,sample.sample_id,pathology_file_id,file_name,file_type,file_description,file_size,md5sum,file_mapping_level,file_access,acl,authz,file_url,dcf_indexd_guid,image_modality,license,magnification,fixation_embedding_method,staining_method,deidentification_method,percent_tumor,percent_necrosis,id,sample.id
# OLD:pathology_file,0DB9NX,,,0DB9NX_0DAX7K_120804.svs,0DAX7K_120804.svs,svs,,405040431,c76dbd73aea635f4faab6e4a27f38eae,,dg.4DFC/c11ab7c7-bb67-4db1-9295-f154ad12acba,40X,Optimal Cutting Temperature,Hematoxylin and Eosin Staining Method,Not applicable,,,,,
# OLD:pathology_file,0DB9NX,,,0DAX7K_120804.svs_1,0DAX7K_120804.svs,svs,,405040431,c76dbd73aea635f4faab6e4a27f38eae,s3://TBD/,dg.4DFC/ce953bd0-f1e7-4117-a358-ff491153b894,Slide Microscopy,CC by 4.0,40X,OCT,H&E,Not applicable,100,0,,,,,
# pathology_file,0DC7SV,0DC67X_172159.svs_2,0DC67X_172159.svs,svs,,233376443,72548664381cbbcad72acd9a2140d239,Sample,Open,['*'],['/open'],s3://TBD/,dg.4DFC/bf8c7bbc-f2c1-4793-b50a-4fb38a3c97bb,Slide Microscopy,CC by 4.0,40X,Formalin fixed paraffin embedded (FFPE),H&E,automatic,90,0,,
# we expect multiple samples on one slide for this project, so 'head -1' is important
csvlineforimagingtogetpatientid=`grep ",${filename}," "${CSVFILENAMEFORIMAGING}" | head -1`
echo "csvlineforimagingtogetpatientid = ${csvlineforimagingtogetpatientid}"
fi
if [ -z "${csvlineforimagingtogetpatientid}" ]
then
echo 1>&2 "Warning: cannot find metadata CSV file entry for sample_id ${sample_id} from which to ultimately lookup participant_id"
else
# OLD:type,sample.sample_id,pdx.pdx_id,cell_line.cell_line_id,pathology_file_id,file_name,file_type,file_description,file_size,md5sum,file_url_in_cds,dcf_indexd_guid,magnification,fixation_embedding_method,staining_method,deidentification_method,file_mapping_level,id,sample.id,pdx.id,cell_line.id
# OLD:type,sample.sample_id,pdx.pdx_id,cell_line.cell_line_id,pathology_file_id,file_name,file_type,file_description,file_size,md5sum,file_url_in_cds,dcf_indexd_guid,image_modality,license,magnification,fixation_embedding_method,staining_method,deidentification_method,percent_tumor,percent_necrosis,file_mapping_level,id,sample.id,pdx.id,cell_line.id
# type,sample.sample_id,pathology_file_id,file_name,file_type,file_description,file_size,md5sum,file_mapping_level,file_access,acl,authz,file_url,dcf_indexd_guid,image_modality,license,magnification,fixation_embedding_method,staining_method,deidentification_method,percent_tumor,percent_necrosis,id,sample.id
# OLD:pathology_file,0DB9NX,,,0DB9NX_0DAX7K_120804.svs,0DAX7K_120804.svs,svs,,405040431,c76dbd73aea635f4faab6e4a27f38eae,,dg.4DFC/c11ab7c7-bb67-4db1-9295-f154ad12acba,40X,Optimal Cutting Temperature,Hematoxylin and Eosin Staining Method,Not applicable,,,,,
# OLD:pathology_file,0DB9NX,,,0DAX7K_120804.svs_1,0DAX7K_120804.svs,svs,,405040431,c76dbd73aea635f4faab6e4a27f38eae,s3://TBD/,dg.4DFC/ce953bd0-f1e7-4117-a358-ff491153b894,Slide Microscopy,CC by 4.0,40X,OCT,H&E,Not applicable,100,0,,,,,
# pathology_file,0DC7SV,0DC67X_172159.svs_2,0DC67X_172159.svs,svs,,233376443,72548664381cbbcad72acd9a2140d239,Sample,Open,['*'],['/open'],s3://TBD/,dg.4DFC/bf8c7bbc-f2c1-4793-b50a-4fb38a3c97bb,Slide Microscopy,CC by 4.0,40X,Formalin fixed paraffin embedded (FFPE),H&E,automatic,90,0,,
sample_id_togetpatientid=`echo "${csvlineforimagingtogetpatientid}" | csvtool -c 2 | tr -d '"'`
echo "sample_id_togetpatientid = ${sample_id_togetpatientid}"
fi
if [ -z "${sample_id_togetpatientid}" ]
then
echo 1>&2 "Error: cannot find metadata CSV file entry for filename ${filename} to get sample_id from which to extract patient_id and anatomy"
exit 1
fi
if [ -f "${CSVFILENAMEFORSAMPLE}" ]
then
# OLD:type,participant.participant_id,sample_id,anatomic_site,participant_age_at_collection,diagnosis_icd_o,diagnosis_finer_resolution,sample_tumor_status,tumor_classification,sample_description,alternate_sample_id,last_known_disease_status,age_at_last_known_disease_status,toronto_childhood_cancer_staging,tumor_grade,tumor_stage_clinical_t,tumor_stage_clinical_n,tumor_stage_clinical_m,diagnosis_icd_cm,id,participant.id
# type,participant.participant_id,cell_line.cell_line_id,pdx.pdx_id,sample_id,anatomic_site,participant_age_at_collection,diagnosis_classification,diagnosis_classification_system,diagnosis_verification_status,diagnosis_basis,diagnosis_comment,sample_tumor_status,tumor_classification,sample_description,alternate_sample_id,last_known_disease_status,age_at_last_known_disease_status,toronto_childhood_cancer_staging,tumor_grade,tumor_stage_clinical_t,tumor_stage_clinical_n,tumor_stage_clinical_m,id,participant.id,cell_line.id,pdx.id
# OLD:sample,PANLMU,0DHY31,Blood,-999,"999 : Unknown, to be completed later",,Normal,Not Applicable,,,,,,,,,,,,
# sample,PANLMU,,,0DHY31,C42.0 : Blood,-999,see diagnosis_comment,Indication for Study,Not Reported,Not Reported,Meningioma,Normal,Not Applicable,,,,,,,,,,,,,
csvlineforsampletogetpatientid=`grep ",${sample_id_togetpatientid}," "${CSVFILENAMEFORSAMPLE}" | head -1`
echo "csvlineforsampletogetpatientid = ${csvlineforsampletogetpatientid}"
fi
if [ -z "${csvlineforsampletogetpatientid}" ]
then
echo 1>&2 "Error: cannot find metadata CSV file entry for sample_id ${sample_id_togetpatientid} from which to extract patient_id and anatomy"
exit 1
else
patient_id=`echo "${csvlineforsampletogetpatientid}" | csvtool -c 2 | tr -d '"'`
fi
echo "patient_id = ${patient_id}"
dicomclinicaltrialsubjectid="${patient_id}"
echo "dicomclinicaltrialsubjectid = ${dicomclinicaltrialsubjectid}"
if [ -f "${CSVFILENAMEFORPARTICIPANT}" ]
then
# gender is now sex_at_birth
# type,study.study_id,participant_id,race,sex_at_birth,ethnicity,alternate_participant_id,id,study.id
# participant,phs002790,PANLMU,White,Female,Not Hispanic or Latino,,,
csvlineforparticipant=`grep ",${patient_id}," "${CSVFILENAMEFORPARTICIPANT}" | head -1`
echo "csvlineforparticipant = ${csvlineforparticipant}"
fi
if [ -z "${csvlineforparticipant}" ]
then
echo 1>&2 "Warning: cannot find participant metadata CSV file entry for patient_id ${patient_id} from which to extract patient characteristics"
else
race=`echo "${csvlineforparticipant}" | csvtool -c 4 | tr -d '"'`
sex_at_birth=`echo "${csvlineforparticipant}" | csvtool -c 5 | tr -d '"'`
#ethnicity=`echo "${csvlineforparticipant}" | csvtool -c 6 | tr -d '"'`
fi
echo "race = ${race}"
echo "sex_at_birth = ${sex_at_birth}"
#echo "ethnicity = ${ethnicity}"
# we have multiple samples on one slide, so use the slide_id as the combined specimen_id for now :(
specimen_id="${slide_id}"
echo "infile = ${infile}"
echo "filename = ${filename}"
echo "slide_id = ${slide_id}"
#sample_id handled later as multiple
#specimen_id handled later as multiple
diagnosisdescription=""
diagnosiscodevalue=""
diagnosiscsd=""
diagnosiscodemeaning=""
anatomycodevalue=""
anatomycsd=""
anatomycodemeaning=""
lateralitycodevalue=""
lateralitycsd=""
lateralitycodemeaning=""
anatomymodifiercodevalue=""
anatomymodifiercsd=""
anatomymodifiercodemeaning=""
if [ -f "${CSVFILENAMEFORDIAGNOSIS}" ]
then
# type,participant.participant_id,diagnosis_id,diagnosis_classification,diagnosis_classification_system,diagnosis_verification_status,diagnosis_basis,diagnosis_comment,disease_phase,tumor_classification,anatomic_site,age_at_diagnosis,toronto_childhood_cancer_staging,age_at_recurrence,last_known_disease_status,age_at_last_known_disease_status,tumor_grade,tumor_stage_clinical_t,tumor_stage_clinical_n,tumor_stage_clinical_m,id,participant.id
# type,participant.participant_id,sample.sample_id,diagnosis_id,diagnosis,diagnosis_classification_system,diagnosis_basis,diagnosis_comment,disease_phase,tumor_classification,anatomic_site,age_at_diagnosis,age_at_recurrence,last_known_disease_status,age_at_last_known_disease_status,toronto_childhood_cancer_staging,tumor_stage_clinical_t,tumor_stage_clinical_n,tumor_stage_clinical_m,tumor_stage_source,tumor_grade,tumor_grade_source,id,participant.id,sample.id
# diagnosis,PBBKUF,PBBKUF_diag,see diagnosis_comment,Indication for Study,Not Reported,Not Reported,Myofibroma,Not Reported,Not Reported,Not Reported,-999,,,,,,,,,,
# diagnosis,PBBKUF,PBBKUF_4,8824/0 : Myofibroma,ICD-O-3.2,Initial,Clinical,8824-0 Myofibroma,Not Reported,Not Reported,C41.0 : Bones of skull and face and associated joints,1335,,,,,,,,,,
# diagnosis,PBBMFU,,PBBMFU_5,"9380/3 : Glioma, malignant",ICD-O-3.2,Clinical,,Not Reported,Not Reported,"C71.9 : Brain, NOS",2139,,,,,,,,,,,,,
#csvlinefodiagnosis=`grep ",${patient_id}," "${CSVFILENAMEFORDIAGNOSIS}" | head -1`
# attempt to get rid of duplicate lines by removing the uncertain ones ...
csvlinefodiagnosis=`grep ",${patient_id}," "${CSVFILENAMEFORDIAGNOSIS}" | grep -v '_diag' | head -1`
if [ -z "${csvlinefodiagnosis}" ]
then
# _diag might have been the only one, so don't ignore it even if incomplete
csvlinefodiagnosis=`grep ",${patient_id}," "${CSVFILENAMEFORDIAGNOSIS}" | head -1`
fi
echo "csvlinefodiagnosis = ${csvlinefodiagnosis}"
fi
if [ -z "${csvlinefodiagnosis}" ]
then
echo 1>&2 "Warning: cannot find diagnosis metadata CSV file entry for patient_id ${patient_id} from which to extract patient characteristics"
else
age=`echo "${csvlinefodiagnosis}" | csvtool -c 12 | tr -d '"'`
if [ "${age}" = "-999" ]
then
echo 1>&2 "Warning: ignoring unreported age ${age}"
age=""
fi
echo "age = ${age}"
anatomic_site=`echo "${csvlinefodiagnosis}" | csvtool -c 11 | tr -d '"'`
echo "extracted anatomic_site = ${anatomic_site}"
if [ ! -z "${anatomic_site}" ]
then
if [ "${anatomic_site}" = "C01.9 : Base of tongue, NOS" ]
then
anatomycodevalue="47975008"
anatomycsd="SCT"
anatomycodemeaning="Root of tongue"
elif [ "${anatomic_site}" = "C02.9 : Tongue, NOS" ]
then
anatomycodevalue="21974007"
anatomycsd="SCT"
anatomycodemeaning="Tongue"
elif [ "${anatomic_site}" = "C05.0 : Hard palate" ]
then
anatomycodevalue="90228003"
anatomycsd="SCT"
anatomycodemeaning="Hard palate"
elif [ "${anatomic_site}" = "C05.1 : Soft palate, NOS" ]
then
anatomycodevalue="49460000"
anatomycsd="SCT"
anatomycodemeaning="Soft palate"
elif [ "${anatomic_site}" = "C06.0 : Cheek mucosa" ]
then
anatomycodevalue="16811007"
anatomycsd="SCT"
anatomycodemeaning="Buccal mucosa"
elif [ "${anatomic_site}" = "C00.5 : Mucosa of lip, NOS" ]
then
anatomycodevalue="59641005"
anatomycsd="SCT"
anatomycodemeaning="Mucosa of lip"
elif [ "${anatomic_site}" = "C06.9 : Mouth, NOS" ]
then
anatomycodevalue="123851003"
anatomycsd="SCT"
anatomycodemeaning="Mouth"
elif [ "${anatomic_site}" = "C07.9 : Parotid gland" ]
then
anatomycodevalue="45289007"
anatomycsd="SCT"
anatomycodemeaning="Parotid gland"
elif [ "${anatomic_site}" = "C08.0 : Submandibular gland" ]
then
anatomycodevalue="385296007"
anatomycsd="SCT"
anatomycodemeaning="Submandibular gland"
elif [ "${anatomic_site}" = "C10.9 : Oropharynx, NOS" ]
then
anatomycodevalue="31389004"
anatomycsd="SCT"
anatomycodemeaning="Oropharynx"
elif [ "${anatomic_site}" = "C10.3 : Posterior wall of oropharynx" ]
then
anatomycodevalue="12999009"
anatomycsd="SCT"
anatomycodemeaning="Posterior wall of oropharynx"
elif [ "${anatomic_site}" = "C11.2 : Lateral wall of nasopharynx" ]
then
anatomycodevalue="70988003"
anatomycsd="SCT"
anatomycodemeaning="Lateral wall of nasopharynx"
elif [ "${anatomic_site}" = "C11.3 : Anterior wall of nasopharynx" ]
then
anatomycodevalue="82521001"
anatomycsd="SCT"
anatomycodemeaning="Anterior wall of nasopharynx"
elif [ "${anatomic_site}" = "C11.0 : Superior wall of nasopharynx" ]
then
anatomycodevalue="20409001"
anatomycsd="SCT"
anatomycodemeaning="Superior wall of nasopharynx"
elif [ "${anatomic_site}" = "C11.8 : Overlapping lesion of nasopharynx" ]
then
anatomycodevalue="71836000"
anatomycsd="SCT"
anatomycodemeaning="Nasopharynx"
elif [ "${anatomic_site}" = "C11.9 : Nasopharynx, NOS" ]
then
anatomycodevalue="71836000"
anatomycsd="SCT"
anatomycodemeaning="Nasopharynx"
elif [ "${anatomic_site}" = "C14.0 : Pharynx, NOS" ]
then
anatomycodevalue="54066008"
anatomycsd="SCT"
anatomycodemeaning="Pharynx"
elif [ "${anatomic_site}" = "C16.2 : Body of stomach" ]
then
anatomycodevalue="68560004"
anatomycsd="SCT"
anatomycodemeaning="Body of stomach"
elif [ "${anatomic_site}" = "C16.3 : Gastric antrum" ]
then
anatomycodevalue="66051006"
anatomycsd="SCT"
anatomycodemeaning="Pyloric antrum"
elif [ "${anatomic_site}" = "C16.9 : Stomach, NOS" ]
then
anatomycodevalue="69695003"
anatomycsd="SCT"
anatomycodemeaning="Stomach"
elif [ "${anatomic_site}" = "C17.0 : Duodenum" ]
then
anatomycodevalue="38848004"
anatomycsd="SCT"
anatomycodemeaning="Duodenum"
elif [ "${anatomic_site}" = "C17.1 : Jejunum" ]
then
anatomycodevalue="21306003"
anatomycsd="SCT"
anatomycodemeaning="Jejunum"
elif [ "${anatomic_site}" = "C17.9 : Small intestine, NOS" ]
then
anatomycodevalue="30315005"
anatomycsd="SCT"
anatomycodemeaning="Small intestine"
elif [ "${anatomic_site}" = "C18.0 : Cecum" ]
then
anatomycodevalue="32713005"
anatomycsd="SCT"
anatomycodemeaning="Cecum"
elif [ "${anatomic_site}" = "C18.1 : Appendix" ]
then
anatomycodevalue="66754008"
anatomycsd="SCT"
anatomycodemeaning="Appendix"
elif [ "${anatomic_site}" = "C18.7 : Sigmoid colon" ]
then
anatomycodevalue="60184004"
anatomycsd="SCT"
anatomycodemeaning="Sigmoid colon"
elif [ "${anatomic_site}" = "C18.6 : Descending colon" ]
then
anatomycodevalue="32622004"
anatomycsd="SCT"
anatomycodemeaning="Descending colon"
elif [ "${anatomic_site}" = "C18.9 : Colon, NOS" ]
then
anatomycodevalue="71854001"
anatomycsd="SCT"
anatomycodemeaning="Colon"
elif [ "${anatomic_site}" = "C19.9 : Rectosigmoid junction" ]
then
anatomycodevalue="49832006"
anatomycsd="SCT"
anatomycodemeaning="Rectosigmoid junction"
elif [ "${anatomic_site}" = "C17.2 : Ileum" ]
then
anatomycodevalue="34516001"
anatomycsd="SCT"
anatomycodemeaning="Ileum"
elif [ "${anatomic_site}" = "C22.0 : Liver" ]
then
anatomycodevalue="10200004"
anatomycsd="SCT"
anatomycodemeaning="Liver"
elif [ "${anatomic_site}" = "C25.0 : Head of pancreas" ]
then
anatomycodevalue="64163001"
anatomycsd="SCT"
anatomycodemeaning="Head of pancreas"
elif [ "${anatomic_site}" = "C25.1 : Body of pancreas" ]
then
anatomycodevalue="40133006"
anatomycsd="SCT"
anatomycodemeaning="Body of pancreas"
elif [ "${anatomic_site}" = "C25.2 : Tail of pancreas" ]
then
anatomycodevalue="73239005"
anatomycsd="SCT"
anatomycodemeaning="Tail of pancreas"
elif [ "${anatomic_site}" = "C25.3 : Pancreatic duct" ]
then
anatomycodevalue="69930009"
anatomycsd="SCT"
anatomycodemeaning="Pancreatic duct"
elif [ "${anatomic_site}" = "C25.9 : Pancreas, NOS" ]
then
anatomycodevalue="15776009"
anatomycsd="SCT"
anatomycodemeaning="Pancreas"
elif [ "${anatomic_site}" = "C26.0 : Intestinal tract, NOS" ]
then
anatomycodevalue="113276009"
anatomycsd="SCT"
anatomycodemeaning="Intestinal tract"
elif [ "${anatomic_site}" = "C26.9 : Gastrointestinal tract, NOS" ]
then
anatomycodevalue="122865005"
anatomycsd="SCT"
anatomycodemeaning="Gastrointestinal tract"
elif [ "${anatomic_site}" = "C30.0 : Nasal cavity" ]
then
anatomycodevalue="279549004"
anatomycsd="SCT"
anatomycodemeaning="Nasal cavity"
elif [ "${anatomic_site}" = "C30.1 : Middle ear" ]
then
anatomycodevalue="25342003"
anatomycsd="SCT"
anatomycodemeaning="Middle ear"
elif [ "${anatomic_site}" = "C31.0 : Maxillary sinus" ]
then
anatomycodevalue="15924003"
anatomycsd="SCT"
anatomycodemeaning="Maxillary sinus"
elif [ "${anatomic_site}" = "C31.1 : Ethmoid sinus" ]
then
anatomycodevalue="54215007"
anatomycsd="SCT"
anatomycodemeaning="Ethmoid sinus"
elif [ "${anatomic_site}" = "C31.3 : Sphenoid sinus" ]
then
anatomycodevalue="24999009"
anatomycsd="SCT"
anatomycodemeaning="Sphenoid sinus"
elif [ "${anatomic_site}" = "C31.9 : Accessory sinus, NOS" ]
then
anatomycodevalue="2095001"
anatomycsd="SCT"
anatomycodemeaning="Nasal sinus"
elif [ "${anatomic_site}" = "C32.1 : Supraglottis" ]
then
anatomycodevalue="119255006"
anatomycsd="SCT"
anatomycodemeaning="Supraglottis"
elif [ "${anatomic_site}" = "C32.9 : Larynx, NOS" ]
then
anatomycodevalue="4596009"
anatomycsd="SCT"
anatomycodemeaning="Larynx"
elif [ "${anatomic_site}" = "C33.9 : Trachea" ]
then
anatomycodevalue="44567001"
anatomycsd="SCT"
anatomycodemeaning="Trachea"
elif [ "${anatomic_site}" = "C34.3 : Lower lobe, lung" ]
then
anatomycodevalue="90572001"
anatomycsd="SCT"
anatomycodemeaning="Lower lobe of lung"
elif [ "${anatomic_site}" = "C34.2 : Middle lobe, lung" ]
then
anatomycodevalue="72481006"
anatomycsd="SCT"
anatomycodemeaning="Middle lobe of right lung"
elif [ "${anatomic_site}" = "C34.1 : Upper lobe, lung" ]
then
anatomycodevalue="45653009"
anatomycsd="SCT"
anatomycodemeaning="Upper lobe of lung"
elif [ "${anatomic_site}" = "C34.8 : Overlapping lesion of lung" ]
then
# actually means bronchus and lung per "https://www.icd10data.com/ICD10CM/Codes/C00-D49/C30-C39/C34-/C34.8"
anatomycodevalue="110736001"
anatomycsd="SCT"
anatomycodemeaning="Bronchus and lung"
elif [ "${anatomic_site}" = "C34.9 : Lung, NOS" ]
then
anatomycodevalue="39607008"
anatomycsd="SCT"
anatomycodemeaning="Lung"
elif [ "${anatomic_site}" = "C38.0 : Heart" ]
then
anatomycodevalue="80891009"
anatomycsd="SCT"
anatomycodemeaning="Heart"
elif [ "${anatomic_site}" = "C38.1 : Anterior mediastinum" ]
then
anatomycodevalue="72410000"
anatomycsd="SCT"
anatomycodemeaning="Mediastinum"
anatomymodifiercodevalue="255549009"
anatomymodifiercsd="SCT"
anatomymodifiercodemeaning="Anterior"
elif [ "${anatomic_site}" = "C38.2 : Posterior mediastinum" ]
then
anatomycodevalue="72410000"
anatomycsd="SCT"
anatomycodemeaning="Mediastinum"
anatomymodifiercodevalue="255551008"
anatomymodifiercsd="SCT"
anatomymodifiercodemeaning="Posterior"
elif [ "${anatomic_site}" = "C38.3 : Mediastinum, NOS" ]
then
anatomycodevalue="72410000"
anatomycsd="SCT"
anatomycodemeaning="Mediastinum"
elif [ "${anatomic_site}" = "C38.4 : Pleura, NOS" ]
then
anatomycodevalue="3120008"
anatomycsd="SCT"
anatomycodemeaning="Pleura"
elif [ "${anatomic_site}" = "C39.8 : Overlapping lesion of respiratory system and intrathoracic organs" ]
then
anatomycodevalue="312419003"
anatomycsd="SCT"
anatomycodemeaning="Respiratory and/or intrathoracic structure"
elif [ "${anatomic_site}" = "C40.0 : Long bones of upper limb, scapula and associated joints" ]
then
anatomycodevalue="400194001"
anatomycsd="SCT"
anatomycodemeaning=" Long bone of upper limb"
elif [ "${anatomic_site}" = "C40.1 : Short bones of upper limb and associated joints" ]
then
anatomycodevalue="712522005"
anatomycsd="SCT"
anatomycodemeaning="Short bone of upper limb"
elif [ "${anatomic_site}" = "C40.2 : Long bones of lower limb and associated joints" ]
then
anatomycodevalue="400143008"
anatomycsd="SCT"
anatomycodemeaning="Long bone of lower limb"
elif [ "${anatomic_site}" = "C40.3 : Short bones of lower limb and associated joints" ]
then
anatomycodevalue="712523000"
anatomycsd="SCT"
anatomycodemeaning="Short bone of lower limb"
elif [ "${anatomic_site}" = "C40.9 : Bone of limb, NOS" ]
then
anatomycodevalue="48566001"
anatomycsd="SCT"
anatomycodemeaning="Bone of limb"
elif [ "${anatomic_site}" = "C41.0 : Bones of skull and face and associated joints" ]
then
anatomycodevalue="272679001"
anatomycsd="SCT"
anatomycodemeaning="Cranial and/or facial bone"
elif [ "${anatomic_site}" = "C41.1 : Mandible" ]
then
anatomycodevalue="91609006"
anatomycsd="SCT"
anatomycodemeaning="Mandible"
elif [ "${anatomic_site}" = "C41.2 : Vertebral column" ]
then
anatomycodevalue="421060004"
anatomycsd="SCT"
anatomycodemeaning="Vertebral column"
elif [ "${anatomic_site}" = "C41.3 : Rib, sternum, clavicle and associated joints" ]
then
anatomycodevalue="312563005"
anatomycsd="SCT"
anatomycodemeaning="Rib, sternum and/or clavicle"
elif [ "${anatomic_site}" = "C41.4 : Pelvic bones, sacrum, coccyx and associated joints" ]
then
anatomycodevalue="118645006"
anatomycsd="SCT"
anatomycodemeaning="Innominate bone and/or sacrum and/or coccyx"
elif [ "${anatomic_site}" = "C41.9 : Bone, NOS" ]
then
anatomycodevalue="272673000"
anatomycsd="SCT"
anatomycodemeaning="Bone"
elif [ "${anatomic_site}" = "C42.0 : Blood" ]
then
# use substance code
anatomycodevalue="87612001"
anatomycsd="SCT"
anatomycodemeaning="Blood"
elif [ "${anatomic_site}" = "C42.1 : Bone marrow" ]
then
anatomycodevalue="14016003"
anatomycsd="SCT"
anatomycodemeaning="Bone marrow"
elif [ "${anatomic_site}" = "C44.1 : Eyelid" ]
then
anatomycodevalue="80243003"
anatomycsd="SCT"
anatomycodemeaning="Eyelid"
elif [ "${anatomic_site}" = "C44.2 : External ear" ]
then
anatomycodevalue="28347008"
anatomycsd="SCT"
anatomycodemeaning="External ear"
elif [ "${anatomic_site}" = "C44.4 : Skin of scalp and neck" ]
then
anatomycodevalue="400056003"
anatomycsd="SCT"
anatomycodemeaning="Skin of scalp and neck"
elif [ "${anatomic_site}" = "C44.5 : Skin of trunk" ]
then
anatomycodevalue="86381001"
anatomycsd="SCT"
anatomycodemeaning="Skin of trunk"
elif [ "${anatomic_site}" = "C44.6 : Skin of upper limb and shoulder" ]
then
anatomycodevalue="371311000"
anatomycsd="SCT"
anatomycodemeaning="Skin of upper limb"
elif [ "${anatomic_site}" = "C44.7 : Skin of lower limb and hip" ]
then
anatomycodevalue="371304004"
anatomycsd="SCT"
anatomycodemeaning="Skin of lower limb"
elif [ "${anatomic_site}" = "C44.9 : Skin, NOS" ]
then
anatomycodevalue="39937001"
anatomycsd="SCT"
anatomycodemeaning="Skin"
elif [ "${anatomic_site}" = "C47.1 : Peripheral nerves and autonomic nervous system of upper limb and shoulder" ]
then
anatomycodevalue="314738007"
anatomycsd="SCT"
anatomycodemeaning=" Upper limb nerve"
elif [ "${anatomic_site}" = "C48.0 : Retroperitoneum" ]
then
anatomycodevalue="82849001"
anatomycsd="SCT"
anatomycodemeaning="Retroperitoneum"
elif [ "${anatomic_site}" = "C48.2 : Peritoneum, NOS" ]
then
anatomycodevalue="15425007"
anatomycsd="SCT"
anatomycodemeaning="Peritoneum"
elif [ "${anatomic_site}" = "C49.0 : Connective, subcutaneous and other soft tissues of head, face, and neck" ]
then
# SCT code includes subcutaneous tissue as a child, therefore is inclusive
anatomycodevalue="34201000"
anatomycsd="SCT"
anatomycodemeaning="Soft tissues of head and neck"
elif [ "${anatomic_site}" = "C49.1 : Connective, subcutaneous and other soft tissues of upper limb and shoulder" ]
then
anatomycodevalue="75490006"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue of upper extremity"
elif [ "${anatomic_site}" = "C49.2 : Connective, subcutaneous and other soft tissues of lower limb and hip" ]
then
# SCT code includes subcutaneous tissue, and of hip, as children, therefore is inclusive
anatomycodevalue="67328008"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue of lower extremity"
elif [ "${anatomic_site}" = "C49.3 : Connective, subcutaneous and other soft tissues of thorax" ]
then
anatomycodevalue="31749008"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue of thorax"
elif [ "${anatomic_site}" = "C49.4 : Connective, subcutaneous and other soft tissues of abdomen" ]
then
anatomycodevalue="818997006"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue of abdomen"
elif [ "${anatomic_site}" = "C49.5 : Connective, subcutaneous and other soft tissues of pelvis" ]
then
anatomycodevalue="20159001"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue of pelvis"
elif [ "${anatomic_site}" = "C49.6 : Connective, subcutaneous and other soft tissues of trunk, NOS" ]
then
anatomycodevalue="1490004"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue of trunk"
elif [ "${anatomic_site}" = "C49.9 : Connective, subcutaneous and other soft tissues, NOS" ]
then
anatomycodevalue="87784001"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue"
elif [ "${anatomic_site}" = "C49.8 : Overlapping lesion of connective, subcutaneous and other soft tissues" ]
then
anatomycodevalue="87784001"
anatomycsd="SCT"
anatomycodemeaning="Soft tissue"
elif [ "${anatomic_site}" = "C50.9 : Breast, NOS" ]
then
anatomycodevalue="76752008"
anatomycsd="SCT"
anatomycodemeaning="Breast"
elif [ "${anatomic_site}" = "C52.9 : Vagina, NOS" ]
then
anatomycodevalue="76784001"
anatomycsd="SCT"
anatomycodemeaning="Vagina"
elif [ "${anatomic_site}" = "C53.0 : Endocervix" ]
then
anatomycodevalue="36973007"
anatomycsd="SCT"
anatomycodemeaning="Endocervix"
elif [ "${anatomic_site}" = "C53.9 : Cervix uteri" ]
then
anatomycodevalue="71252005"
anatomycsd="SCT"
anatomycodemeaning="Cervix uteri"
elif [ "${anatomic_site}" = "C55.9 : Uterus, NOS" ]
then
anatomycodevalue="35039007"
anatomycsd="SCT"
anatomycodemeaning="Uterus"
elif [ "${anatomic_site}" = "C56.9 : Ovary" ]
then
anatomycodevalue="15497006"
anatomycsd="SCT"
anatomycodemeaning="Ovary"
elif [ "${anatomic_site}" = "C57.0 : Fallopian tube" ]
then
anatomycodevalue="31435000"
anatomycsd="SCT"
anatomycodemeaning="Fallopian tube"
elif [ "${anatomic_site}" = "C57.7 : Other specified parts of female genital organs" ]
then
anatomycodevalue="127882003"
anatomycsd="SCT"
anatomycodemeaning="Female genital organ"
elif [ "${anatomic_site}" = "C60.9 : Penis, NOS" ]
then
anatomycodevalue="18911002"
anatomycsd="SCT"
anatomycodemeaning="Penis"
elif [ "${anatomic_site}" = "C61.9 : Prostate gland" ]
then
anatomycodevalue="41216001"
anatomycsd="SCT"
anatomycodemeaning="Prostate"
elif [ "${anatomic_site}" = "C62.1 : Descended testis" ]
then
anatomycodevalue="416953005"
anatomycsd="SCT"
anatomycodemeaning="Descended testis"
elif [ "${anatomic_site}" = "C62.9 : Testis, NOS" ]
then
anatomycodevalue="40689003"
anatomycsd="SCT"
anatomycodemeaning="Testis"
elif [ "${anatomic_site}" = "C63.0 : Epididymis" ]
then
anatomycodevalue="87644002"
anatomycsd="SCT"
anatomycodemeaning="Epididymis"
elif [ "${anatomic_site}" = "C63.2 : Scrotum, NOS" ]
then
anatomycodevalue="20233005"
anatomycsd="SCT"
anatomycodemeaning="Scrotum"
elif [ "${anatomic_site}" = "C64.9 : Kidney, NOS" ]
then
anatomycodevalue="64033007"
anatomycsd="SCT"
anatomycodemeaning="Kidney"
elif [ "${anatomic_site}" = "C67.7 : Urachus" ]
then
anatomycodevalue="14105008"
anatomycsd="SCT"
anatomycodemeaning="Urachus"
elif [ "${anatomic_site}" = "C67.9 : Bladder, NOS" ]
then
anatomycodevalue="89837001"
anatomycsd="SCT"
anatomycodemeaning="Urinary bladder"
elif [ "${anatomic_site}" = "C68.9 : Urinary system, NOS" ]
then
anatomycodevalue="122489005"
anatomycsd="SCT"
anatomycodemeaning="Urinary system"
elif [ "${anatomic_site}" = "C69.2 : Retina" ]
then
anatomycodevalue="5665001"
anatomycsd="SCT"
anatomycodemeaning="Retina"
elif [ "${anatomic_site}" = "C69.3 : Choroid" ]
then
anatomycodevalue="68703001"
anatomycsd="SCT"
anatomycodemeaning="Choroid of eye"
elif [ "${anatomic_site}" = "C69.6 : Orbit, NOS" ]
then
anatomycodevalue="363654007"
anatomycsd="SCT"
anatomycodemeaning="Orbit"
elif [ "${anatomic_site}" = "C69.9 : Eye, NOS" ]
then
anatomycodevalue="81745001"
anatomycsd="SCT"
anatomycodemeaning="Eye"
elif [ "${anatomic_site}" = "C70.1 : Spinal meninges" ]
then
anatomycodevalue="75559006"
anatomycsd="SCT"
anatomycodemeaning="Spinal meninges"
elif [ "${anatomic_site}" = "C70.9 : Meninges, NOS" ]
then
anatomycodevalue="1231004"
anatomycsd="SCT"
anatomycodemeaning="Meninges"
elif [ "${anatomic_site}" = "C71.0 : Cerebrum" ]
then
anatomycodevalue="83678007"
anatomycsd="SCT"
anatomycodemeaning="Cerebrum"
elif [ "${anatomic_site}" = "C71.1 : Frontal lobe" ]
then
anatomycodevalue="83251001"
anatomycsd="SCT"
anatomycodemeaning="Frontal lobe"
elif [ "${anatomic_site}" = "C71.2 : Temporal lobe" ]
then
anatomycodevalue="78277001"
anatomycsd="SCT"
anatomycodemeaning="Temporal lobe"
elif [ "${anatomic_site}" = "C71.3 : Parietal lobe" ]
then
anatomycodevalue="16630005"
anatomycsd="SCT"
anatomycodemeaning="Parietal lobe"
elif [ "${anatomic_site}" = "C71.4 : Occipital lobe" ]
then
anatomycodevalue="31065004"
anatomycsd="SCT"
anatomycodemeaning="Occipital lobe"
elif [ "${anatomic_site}" = "C71.5 : Ventricle, NOS" ]
then
anatomycodevalue="35764002"
anatomycsd="SCT"
anatomycodemeaning="Cerebral ventricle"
elif [ "${anatomic_site}" = "C71.6 : Cerebellum, NOS" ]
then
anatomycodevalue="113305005"
anatomycsd="SCT"
anatomycodemeaning="Cerebellum"
elif [ "${anatomic_site}" = "C71.7 : Brain stem" ]
then
anatomycodevalue="15926001"
anatomycsd="SCT"
anatomycodemeaning="Brain stem"
elif [ "${anatomic_site}" = "C71.8 : Overlapping lesion of brain" ]
then
anatomycodevalue="12738006"
anatomycsd="SCT"
anatomycodemeaning="Brain"
elif [ "${anatomic_site}" = "C71.9 : Brain, NOS" ]
then
anatomycodevalue="12738006"
anatomycsd="SCT"
anatomycodemeaning="Brain"
elif [ "${anatomic_site}" = "C72.0 : Spinal cord" ]
then
anatomycodevalue="2748008"
anatomycsd="SCT"
anatomycodemeaning="Spinal cord"
elif [ "${anatomic_site}" = "C72.1 : Cauda equina" ]
then
anatomycodevalue="7173007"
anatomycsd="SCT"
anatomycodemeaning="Cauda equina"
elif [ "${anatomic_site}" = "C72.3 : Optic nerve" ]
then
anatomycodevalue="18234004"
anatomycsd="SCT"
anatomycodemeaning="Optic nerve"
elif [ "${anatomic_site}" = "C72.5 : Cranial nerve, NOS" ]
then
anatomycodevalue="25238003"
anatomycsd="SCT"
anatomycodemeaning="Cranial nerve"
elif [ "${anatomic_site}" = "C72.8 : Overlapping lesion of brain and central nervous system" ]
then
anatomycodevalue="21483005"
anatomycsd="SCT"
anatomycodemeaning="Central nervous system"
elif [ "${anatomic_site}" = "C73.9 : Thyroid gland" ]
then
anatomycodevalue="69748006"
anatomycsd="SCT"
anatomycodemeaning="Thyroid"
elif [ "${anatomic_site}" = "C37.9 : Thymus" ]
then
anatomycodevalue="9875009"
anatomycsd="SCT"
anatomycodemeaning="Thymus"
elif [ "${anatomic_site}" = "C74.0 : Cortex of adrenal gland" ]
then
anatomycodevalue="68594002"
anatomycsd="SCT"
anatomycodemeaning="Adrenal cortex"
elif [ "${anatomic_site}" = "C74.9 : Adrenal gland, NOS" ]
then
anatomycodevalue="23451007"
anatomycsd="SCT"
anatomycodemeaning="Adrenal gland"
elif [ "${anatomic_site}" = "C75.1 : Pituitary gland" ]
then
anatomycodevalue="56329008"
anatomycsd="SCT"
anatomycodemeaning="Pituitary gland"
elif [ "${anatomic_site}" = "C75.2 : Craniopharyngeal duct" ]
then
anatomycodevalue="86394004"
anatomycsd="SCT"
anatomycodemeaning="Craniopharyngeal duct"
elif [ "${anatomic_site}" = "C75.3 : Pineal gland" ]
then
anatomycodevalue="45793000"
anatomycsd="SCT"
anatomycodemeaning="Pineal gland"
elif [ "${anatomic_site}" = "C76.0 : Head, face or neck, NOS" ]
then
anatomycodevalue="774007"
anatomycsd="SCT"
anatomycodemeaning="Head and neck"
elif [ "${anatomic_site}" = "C76.1 : Thorax, NOS" ]
then
anatomycodevalue="51185008"
anatomycsd="SCT"
anatomycodemeaning="Thorax"
elif [ "${anatomic_site}" = "C76.2 : Abdomen, NOS" ]
then
anatomycodevalue="818983003"
anatomycsd="SCT"
anatomycodemeaning="Abdomen"
elif [ "${anatomic_site}" = "C76.3 : Pelvis, NOS" ]
then
anatomycodevalue="12921003"
anatomycsd="SCT"
anatomycodemeaning="Pelvis"
elif [ "${anatomic_site}" = "C76.4 : Upper limb, NOS" ]
then
anatomycodevalue="53120007"
anatomycsd="SCT"
anatomycodemeaning="Upper limb"
elif [ "${anatomic_site}" = "C76.5 : Lower limb, NOS" ]
then
anatomycodevalue="61685007"
anatomycsd="SCT"
anatomycodemeaning="Lower limb"
elif [ "${anatomic_site}" = "C77.0 : Lymph nodes of head, face and neck" ]
then
anatomycodevalue="312501005"
anatomycsd="SCT"
anatomycodemeaning="Head and neck lymph node"
elif [ "${anatomic_site}" = "C77.3 : Lymph nodes of axilla or arm" ]
then
anatomycodevalue="44914007"
anatomycsd="SCT"
anatomycodemeaning="Upper limb lymph node"
elif [ "${anatomic_site}" = "C77.4 : Lymph nodes of inguinal region or leg" ]
then
anatomycodevalue="4942000"
anatomycsd="SCT"
anatomycodemeaning="Lower limb lymph node"
elif [ "${anatomic_site}" = "C77.8 : Lymph nodes of multiple regions" ]
then
anatomycodevalue="59441001"
anatomycsd="SCT"
anatomycodemeaning="Lymph node"
elif [ "${anatomic_site}" = "C77.9 : Lymph node, NOS" ]
then
anatomycodevalue="59441001"
anatomycsd="SCT"
anatomycodemeaning="Lymph node"
elif [ "${anatomic_site}" = "C69.0 : Conjunctiva" ]
then
anatomycodevalue="29445007"
anatomycsd="SCT"
anatomycodemeaning="Conjunctiva"
elif [ "${anatomic_site}" = "C80 : UNKNOWN PRIMARY SITE" ]
then
# is disorder rather than structure
anatomycodevalue="255051004"
anatomycsd="SCT"
anatomycodemeaning="Neoplasm of unknown origin"
elif [ "${anatomic_site}" = "C76.7 : Other ill-defined sites" ]
then
anatomycodevalue="10003008"