Skip to content

Commit 7187764

Browse files
authored
US Core 7 Support (#1620)
* add us core 7 mapping code * update mappings for us core 7 * add us core 7 conformance resources for testing * add unit test for us core 7 export * WIP * update loinc 787-2 display * update loinc 786-4 display * replaced deprecated loinc code * update loinc 32623-1 display * update sdoh survey displays * update cvx 140 display * update loinc 2571-8 display * update loinc 18262-6 display * update display for RxNorm 748879 * update display for RxNorm 1605257 * update display for RxNorm 751905 * update displays in medication costs csv * update display for loinc 20570-8 * update display for RxNorm 978950 * update display for RxNorm 807283 * revert changes to medications cost csv * update display for snomed 169553002 * update display for RxNorm 748962 * update remaining contraceptive displays * update loinc 92142-9 display * update loinc 92141-1 display * update loinc 92131-2 display * update loinc parainfluenza displays * update display for loinc 92130-4 and 92134-6 * update loinc 94040-3 display * update loinc 92143-7 display * update display for RxNorm 831533 * update display for loinc 91148-7 * update loinc 33914-3 display * fix RxNorm 1367439 display whitespace * update loinc 788-0 display * fix RxNorm 1367439 display * fix RxNorm 198031 display * fix snomed 90560007 display * update snomed 415070008 display * fix RxNorm 284215 display * fix snomed 5602001 display * update RxNorm 200346 display * update snomed 1551000119108 display * fix snomed 57676002 display * fix loinc 58410-2 display * fix RxNorm 108515 display * fix RxNorm 1664463 display * update loinc 24321-2 display * update loinc 51990-0 display * fix loinc 600-7 display * update RxNorm 897685 display * fix RxNorm 1656356 display * fix RxNorm 2563431 display * fix RxNorm 205532 display * fix RxNorm 999999 display * fix RxNorm 1431987 display * fix RxNorm 542347 display * fix RxNorm 1856546 display * fix RxNorm 748856 display * fix RxNorm 749762 display * fix RxNorm 749785 display * fix RxNorm 1359133 display * fix RxNorm 1243052 display * fix loinc 5821-4 display * fix loinc 13945-1 display * update loinc 5787-7 display * fix loinc 24124-0 display * fix loinc 8247-9 display * fix loinc 5769-5 display * fix loinc 75636-1 display * update loinc 85354-9 display * fix loinc 788-0 display * fix loinc 33762-6 display * fix loinc 33914-3 display * update loinc 2106-3 display * fix loinc 85318-4 display * fix loinc 2339-0 display * fix loinc 6299-2 display * fix loinc 38483-4 display * fix loinc 49765-1 display * fix loinc 2947-0 display * fix loinc 6298-4 display * fix loinc 2069-3 display * fix loinc 20565-8 display * update loinc 5767-9 display * update loinc 770-8 display * update loinc 736-9 display * update loinc 5905-5 display * update loinc 713-8 display * update loinc 706-2 display * fix loinc 718-7 display * fix loinc 30428-7 display * fix loinc 30385-9 display * fix loinc 26515-7 display * fix loinc 42719-5 display * fix loinc 1742-6 display * fix loinc 1920-8 display * fix loinc 33037-3 display * fix loinc 2885-2 display * fix loinc 1751-7 display * fix loinc 10834-0 display * fix loinc 6768-6 display * fix bcp47 ru-RU display * fix RxNorm 808917 display * fix RxNorm 1648756 display * fix RxNorm 1997015 display * fix RxNorm 1648755 display * fix RxNorm 808917 display * fix RxNorm 1648755 display * fix RxNorm 856980 display * fix RxNorm 212446 display * fix RxNorm 1946840 display * fix RxNorm 1648755 display * fix RxNorm 226719 display * fix snomed 1501000119109 display * fix RxNorm 1747691 display * fix RxNorm 2119714 display * fix RxNorm 1648756 display * fix RxNorm 1648755 display * fix RxNorm 1789958 display * fix RxNorm 1190766 display * add pregnancy status observation to pregnancy module * add pregnancy status to export for us core 6 & 7 * fix assigning pregnancy status profile * add value_code to pregnancy module * remove duplicate us core mapping entries for loinc 76690-7 * update category for sexual orientation observation * update homelessness module to create sexual orientation observations which fit the US Core profile * update snomed suicide attempt code displays * update display for RxNorm 999999 * add unknown system to excluded systems to update displays * update remaining outdated displays * update RxNorm 999999 to 999970 * update RxNorm 205532 display
1 parent a64d3be commit 7187764

File tree

180 files changed

+915
-548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+915
-548
lines changed

src/main/java/org/mitre/synthea/export/FhirR4.java

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,10 @@ public class FhirR4 {
198198
private static final Table<String, String, String> US_CORE_4_MAPPING;
199199
private static final Table<String, String, String> US_CORE_5_MAPPING;
200200
private static final Table<String, String, String> US_CORE_6_MAPPING;
201+
private static final Table<String, String, String> US_CORE_7_MAPPING;
201202

202203
public static enum USCoreVersion {
203-
v311, v400, v501, v610
204+
v311, v400, v501, v610, v700
204205
}
205206

206207
protected static boolean useUSCore3() {
@@ -235,6 +236,14 @@ protected static boolean useUSCore6() {
235236
return useUSCore6;
236237
}
237238

239+
protected static boolean useUSCore7() {
240+
boolean useUSCore7 = USE_US_CORE_IG && US_CORE_VERSION.startsWith("7");
241+
if (useUSCore7) {
242+
US_CORE_MAPPING = US_CORE_7_MAPPING;
243+
}
244+
return useUSCore7;
245+
}
246+
238247
private static final String COUNTRY_CODE = Config.get("generate.geography.country_code");
239248
private static final String PASSPORT_URI = Config.get("generate.geography.passport_uri", "http://hl7.org/fhir/sid/passport-USA");
240249

@@ -245,12 +254,13 @@ protected static boolean useUSCore6() {
245254
reloadIncludeExclude();
246255

247256
Map<String, Table<String, String, String>> usCoreMappings =
248-
loadMappingWithVersions("us_core_mapping.csv", "3", "4", "5", "6");
257+
loadMappingWithVersions("us_core_mapping.csv", "3", "4", "5", "6", "7");
249258

250259
US_CORE_3_MAPPING = usCoreMappings.get("3");
251260
US_CORE_4_MAPPING = usCoreMappings.get("4");
252261
US_CORE_5_MAPPING = usCoreMappings.get("5");
253262
US_CORE_6_MAPPING = usCoreMappings.get("6");
263+
US_CORE_7_MAPPING = usCoreMappings.get("7");
254264

255265
if (US_CORE_VERSION.startsWith("3")) {
256266
US_CORE_MAPPING = US_CORE_3_MAPPING;
@@ -260,6 +270,8 @@ protected static boolean useUSCore6() {
260270
US_CORE_MAPPING = US_CORE_5_MAPPING;
261271
} else if (US_CORE_VERSION.startsWith("6")) {
262272
US_CORE_MAPPING = US_CORE_6_MAPPING;
273+
} else if (US_CORE_VERSION.startsWith("7")) {
274+
US_CORE_MAPPING = US_CORE_7_MAPPING;
263275
}
264276
}
265277

@@ -370,7 +382,7 @@ private static Map loadLanguageLookup() {
370382

371383
if (StringUtils.isBlank(version) || version.contains(versionKey)) {
372384
// blank means applies to ALL versions
373-
// version.contains allows for things like "4,5,6"
385+
// version.contains allows for things like "4+5+6"
374386
mappingTable.put(system, code, url);
375387
}
376388
}
@@ -1404,6 +1416,7 @@ private static BundleEntryComponent explanationOfBenefit(BundleEntryComponent pe
14041416
eob.addContained(referral);
14051417
eob.setReferral(new Reference().setReference("#referral"));
14061418

1419+
// TODO: Make Coverage separate resources for US Core 6 & 7?
14071420
// Get the insurance info at the time that the encounter occurred.
14081421
Payer payer = claim.getPayer();
14091422
Coverage coverage = new Coverage();
@@ -1639,7 +1652,7 @@ private static BundleEntryComponent condition(
16391652

16401653
if (USE_US_CORE_IG) {
16411654
Meta meta = new Meta();
1642-
if (useUSCore5() || useUSCore6()) {
1655+
if (useUSCore5() || useUSCore6() || useUSCore7()) {
16431656
meta.addProfile(
16441657
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-encounter-diagnosis");
16451658
} else {
@@ -1867,14 +1880,20 @@ private static BundleEntryComponent observation(
18671880
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab");
18681881
}
18691882

1883+
18701884
if (observation.category != null) {
1871-
if (useUSCore6()) {
1885+
if (useUSCore6() || useUSCore7()) {
18721886
switch (observation.category) {
18731887
case "imaging":
18741888
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result");
18751889
break;
18761890
case "social-history":
1877-
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-simple-observation");
1891+
if (code.code.equals("82810-3")) {
1892+
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-pregnancystatus");
1893+
} else {
1894+
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-simple-observation");
1895+
}
1896+
18781897
break;
18791898
case "survey":
18801899
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-screening-assessment");
@@ -3476,4 +3495,4 @@ protected static String getUrlPrefix(String resourceType) {
34763495
return "urn:uuid:";
34773496
}
34783497
}
3479-
}
3498+
}

src/main/javascript/update_code_display.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const codeDictionary = {};
3131
// codeDictionary[system][code] = "display to use"
3232

3333
// systems to skip because tx.fhir.org doesn't know about them
34-
const SYSTEMS_TO_SKIP = ['NUBC', 'DICOM-DCM', 'DICOM-SOP'];
34+
const SYSTEMS_TO_SKIP = ['NUBC', 'DICOM-DCM', 'DICOM-SOP', 'NullFlavor'];
3535

3636
// codes used in Synthea as placeholders that we know aren't real
3737
const PLACEHOLDER_CODES = ['999999',

src/main/resources/costs/medications.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,4 @@ CODE,MIN,MODE,MAX,COMMENTS
187187
966222,0.25,0.28,0.43,Levothyroxine Sodium 0.075 MG Oral Tablet - https://data.medicaid.gov/Drug-Pricing-and-Payment/NADAC-National-Average-Drug-Acquisition-Cost-/a4y5-998d
188188
979092,0.1,0.28,2.62,Hydroxychloroquine Sulfate 200 MG Oral Tablet - https://data.medicaid.gov/Drug-Pricing-and-Payment/NADAC-National-Average-Drug-Acquisition-Cost-/a4y5-998d
189189
979485,0.03,0.08,0.09,Losartan Potassium 25 MG Oral Tablet - https://data.medicaid.gov/Drug-Pricing-and-Payment/NADAC-National-Average-Drug-Acquisition-Cost-/a4y5-998d
190-
993452,816.12,1014.45,1237.68,1 ML denosumab 60 MG/ML Prefilled Syringe (Prolia) - https://data.medicaid.gov/d/a4y5-998d/visualization
190+
993452,816.12,1014.45,1237.68,1 ML denosumab 60 MG/ML Prefilled Syringe (Prolia) - https://data.medicaid.gov/d/a4y5-998d/visualization

src/main/resources/immunization_schedule.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"code": {
103103
"system": "http://hl7.org/fhir/sid/cvx",
104104
"code": "140",
105-
"display": "Influenza, seasonal, injectable, preservative free"
105+
"display": "Influenza, split virus, trivalent, PF"
106106
},
107107
"remark": "This should really only happen Aug - Feb (preferring earlier). That may take some trickery. Since this is annual administration just populate the array with every 12 months, starting at 6 months.",
108108
"at_months": [

src/main/resources/keep_modules/keep_diabetes_no_dr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
{
3131
"system": "SNOMED-CT",
3232
"code": "1551000119108",
33-
"display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)"
33+
"display": "Nonproliferative diabetic retinopathy due to type II diabetes mellitus"
3434
}
3535
]
3636
}

src/main/resources/keep_modules/keep_npdr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{
1414
"system": "SNOMED-CT",
1515
"code": "1551000119108",
16-
"display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)"
16+
"display": "Nonproliferative diabetic retinopathy due to type II diabetes mellitus"
1717
}
1818
]
1919
}

src/main/resources/keep_modules/keep_npdr_no_pdr.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{
1919
"system": "SNOMED-CT",
2020
"code": "1551000119108",
21-
"display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)"
21+
"display": "Nonproliferative diabetic retinopathy due to type II diabetes mellitus"
2222
}
2323
]
2424
},
@@ -30,7 +30,7 @@
3030
{
3131
"system": "SNOMED-CT",
3232
"code": "1501000119109",
33-
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)"
33+
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus"
3434
}
3535
]
3636
}

src/main/resources/keep_modules/keep_pdr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{
1414
"system": "SNOMED-CT",
1515
"code": "1501000119109",
16-
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)"
16+
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus"
1717
}
1818
]
1919
}

src/main/resources/language_lookup.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"russian": {
4848
"code": "ru-RU",
4949
"system": "urn:ietf:bcp:47",
50-
"display": "Russian (Russia)"
50+
"display": "Russian (Region=Russian Federation)"
5151
},
5252
"vietnamese": {
5353
"code": "vi",

src/main/resources/modules/acute_myeloid_leukemia.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@
720720
{
721721
"system": "RxNorm",
722722
"code": 199885,
723-
"display": "levofloxacin 500MG Oral tablet"
723+
"display": "levofloxacin 500 MG Oral Tablet"
724724
}
725725
]
726726
},

0 commit comments

Comments
 (0)