Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
65978fe
add us core 7 mapping code
Jammjammjamm Sep 9, 2025
eef93ad
update mappings for us core 7
Jammjammjamm Sep 9, 2025
05e7c52
add us core 7 conformance resources for testing
Jammjammjamm Sep 9, 2025
747c005
add unit test for us core 7 export
Jammjammjamm Sep 11, 2025
f7f9f72
WIP
Jammjammjamm Sep 15, 2025
0b48511
update loinc 787-2 display
Jammjammjamm Sep 16, 2025
6abd72b
update loinc 786-4 display
Jammjammjamm Sep 16, 2025
4719bb9
replaced deprecated loinc code
Jammjammjamm Sep 16, 2025
cacbd12
update loinc 32623-1 display
Jammjammjamm Sep 16, 2025
7c471dd
update sdoh survey displays
Jammjammjamm Sep 16, 2025
894d1eb
update cvx 140 display
Jammjammjamm Sep 16, 2025
e8bcf5d
update loinc 2571-8 display
Jammjammjamm Sep 16, 2025
fa198fb
update loinc 18262-6 display
Jammjammjamm Sep 16, 2025
ceca7bf
update display for RxNorm 748879
Jammjammjamm Sep 16, 2025
d53b0b0
update display for RxNorm 1605257
Jammjammjamm Sep 16, 2025
7212fea
update display for RxNorm 751905
Jammjammjamm Sep 16, 2025
d4b508c
update displays in medication costs csv
Jammjammjamm Sep 16, 2025
c82db20
update display for loinc 20570-8
Jammjammjamm Sep 16, 2025
608ad1a
update display for RxNorm 978950
Jammjammjamm Sep 16, 2025
83615fd
update display for RxNorm 807283
Jammjammjamm Sep 16, 2025
e248633
revert changes to medications cost csv
Jammjammjamm Sep 16, 2025
f77d0da
update display for snomed 169553002
Jammjammjamm Sep 16, 2025
eb787d5
update display for RxNorm 748962
Jammjammjamm Sep 16, 2025
5dce626
update remaining contraceptive displays
Jammjammjamm Sep 16, 2025
f532345
update loinc 92142-9 display
Jammjammjamm Sep 16, 2025
bdcf35e
update loinc 92141-1 display
Jammjammjamm Sep 16, 2025
6dd18dc
update loinc 92131-2 display
Jammjammjamm Sep 16, 2025
29a7d45
update loinc parainfluenza displays
Jammjammjamm Sep 16, 2025
6006e7b
update display for loinc 92130-4 and 92134-6
Jammjammjamm Sep 16, 2025
b0622a6
update loinc 94040-3 display
Jammjammjamm Sep 16, 2025
8cea50a
update loinc 92143-7 display
Jammjammjamm Sep 16, 2025
8835387
update display for RxNorm 831533
Jammjammjamm Sep 16, 2025
a50985d
update display for loinc 91148-7
Jammjammjamm Sep 16, 2025
e21780d
update loinc 33914-3 display
Jammjammjamm Sep 17, 2025
27909c9
fix RxNorm 1367439 display whitespace
Jammjammjamm Sep 17, 2025
c883fb0
update loinc 788-0 display
Jammjammjamm Sep 17, 2025
3286fef
fix RxNorm 1367439 display
Jammjammjamm Sep 17, 2025
61b96bb
fix RxNorm 198031 display
Jammjammjamm Sep 17, 2025
a267658
fix snomed 90560007 display
Jammjammjamm Sep 17, 2025
8e091f4
update snomed 415070008 display
Jammjammjamm Sep 18, 2025
aa90868
fix RxNorm 284215 display
Jammjammjamm Sep 18, 2025
5626808
fix snomed 5602001 display
Jammjammjamm Sep 18, 2025
17bb63a
update RxNorm 200346 display
Jammjammjamm Sep 18, 2025
6a5906e
update snomed 1551000119108 display
Jammjammjamm Sep 18, 2025
18feb40
fix snomed 57676002 display
Jammjammjamm Sep 18, 2025
c2bc7f2
fix loinc 58410-2 display
Jammjammjamm Sep 19, 2025
3718126
fix RxNorm 108515 display
Jammjammjamm Sep 19, 2025
0a3bcef
fix RxNorm 1664463 display
Jammjammjamm Sep 19, 2025
781b0bf
update loinc 24321-2 display
Jammjammjamm Sep 19, 2025
5d20c11
update loinc 51990-0 display
Jammjammjamm Sep 19, 2025
8e4c10b
fix loinc 600-7 display
Jammjammjamm Sep 19, 2025
6ba4737
update RxNorm 897685 display
Jammjammjamm Sep 19, 2025
d063c41
fix RxNorm 1656356 display
Jammjammjamm Sep 19, 2025
74be49a
fix RxNorm 2563431 display
Jammjammjamm Sep 19, 2025
900f97c
fix RxNorm 205532 display
Jammjammjamm Sep 19, 2025
d12a147
fix RxNorm 999999 display
Jammjammjamm Sep 19, 2025
7c72265
fix RxNorm 1431987 display
Jammjammjamm Sep 19, 2025
e8c9314
fix RxNorm 542347 display
Jammjammjamm Sep 19, 2025
7666bf1
fix RxNorm 1856546 display
Jammjammjamm Sep 19, 2025
2e3eae6
fix RxNorm 748856 display
Jammjammjamm Sep 19, 2025
bfca86b
fix RxNorm 749762 display
Jammjammjamm Sep 19, 2025
7a3ef42
fix RxNorm 749785 display
Jammjammjamm Sep 19, 2025
e442656
fix RxNorm 1359133 display
Jammjammjamm Sep 19, 2025
2d3ed73
fix RxNorm 1243052 display
Jammjammjamm Sep 19, 2025
e3d27dd
fix loinc 5821-4 display
Jammjammjamm Sep 19, 2025
4d80d7d
fix loinc 13945-1 display
Jammjammjamm Sep 19, 2025
6985ba3
update loinc 5787-7 display
Jammjammjamm Sep 19, 2025
3038694
fix loinc 24124-0 display
Jammjammjamm Sep 19, 2025
fd8135d
fix loinc 8247-9 display
Jammjammjamm Sep 19, 2025
857ec4d
fix loinc 5769-5 display
Jammjammjamm Sep 19, 2025
8a973c0
fix loinc 75636-1 display
Jammjammjamm Sep 19, 2025
61c3e4a
update loinc 85354-9 display
Jammjammjamm Sep 19, 2025
9a6554b
fix loinc 788-0 display
Jammjammjamm Sep 19, 2025
00f1453
fix loinc 33762-6 display
Jammjammjamm Sep 19, 2025
960ee4a
fix loinc 33914-3 display
Jammjammjamm Sep 19, 2025
0763e83
update loinc 2106-3 display
Jammjammjamm Sep 19, 2025
c5cac9a
fix loinc 85318-4 display
Jammjammjamm Sep 19, 2025
0747614
fix loinc 2339-0 display
Jammjammjamm Sep 19, 2025
a2f9f0e
fix loinc 6299-2 display
Jammjammjamm Sep 19, 2025
a1856f2
fix loinc 38483-4 display
Jammjammjamm Sep 19, 2025
30de7c2
fix loinc 49765-1 display
Jammjammjamm Sep 19, 2025
a80a346
fix loinc 2947-0 display
Jammjammjamm Sep 19, 2025
a46144a
fix loinc 6298-4 display
Jammjammjamm Sep 19, 2025
50a0149
fix loinc 2069-3 display
Jammjammjamm Sep 19, 2025
b336bce
fix loinc 20565-8 display
Jammjammjamm Sep 19, 2025
5f8be57
update loinc 5767-9 display
Jammjammjamm Sep 19, 2025
cc506f1
update loinc 770-8 display
Jammjammjamm Sep 19, 2025
847e9e7
update loinc 736-9 display
Jammjammjamm Sep 19, 2025
3ba712f
update loinc 5905-5 display
Jammjammjamm Sep 19, 2025
62a162d
update loinc 713-8 display
Jammjammjamm Sep 19, 2025
ff49ec2
update loinc 706-2 display
Jammjammjamm Sep 19, 2025
4ba06f9
fix loinc 718-7 display
Jammjammjamm Sep 19, 2025
79982bc
fix loinc 30428-7 display
Jammjammjamm Sep 19, 2025
89fbac4
fix loinc 30385-9 display
Jammjammjamm Sep 19, 2025
b24cc5a
fix loinc 26515-7 display
Jammjammjamm Sep 19, 2025
244fd16
fix loinc 42719-5 display
Jammjammjamm Sep 19, 2025
8cdfd70
fix loinc 1742-6 display
Jammjammjamm Sep 19, 2025
eac0342
fix loinc 1920-8 display
Jammjammjamm Sep 19, 2025
0edf7b9
fix loinc 33037-3 display
Jammjammjamm Sep 19, 2025
11057fc
fix loinc 2885-2 display
Jammjammjamm Sep 19, 2025
d8b0172
fix loinc 1751-7 display
Jammjammjamm Sep 19, 2025
a381fbc
fix loinc 10834-0 display
Jammjammjamm Sep 19, 2025
3b9b7ef
fix loinc 6768-6 display
Jammjammjamm Sep 19, 2025
3314fa3
fix bcp47 ru-RU display
Jammjammjamm Sep 19, 2025
e44fee5
fix RxNorm 808917 display
Jammjammjamm Sep 19, 2025
21032fb
fix RxNorm 1648756 display
Jammjammjamm Sep 19, 2025
18220fa
fix RxNorm 1997015 display
Jammjammjamm Sep 19, 2025
34dde4e
fix RxNorm 1648755 display
Jammjammjamm Sep 19, 2025
690c594
fix RxNorm 808917 display
Jammjammjamm Sep 19, 2025
c89644a
fix RxNorm 1648755 display
Jammjammjamm Sep 19, 2025
ed88329
fix RxNorm 856980 display
Jammjammjamm Sep 19, 2025
4a95a93
fix RxNorm 212446 display
Jammjammjamm Sep 19, 2025
ff0e27f
fix RxNorm 1946840 display
Jammjammjamm Sep 19, 2025
ebbcd87
fix RxNorm 1648755 display
Jammjammjamm Sep 22, 2025
94feb80
fix RxNorm 226719 display
Jammjammjamm Sep 22, 2025
376e906
fix snomed 1501000119109 display
Jammjammjamm Sep 22, 2025
4dfe187
fix RxNorm 1747691 display
Jammjammjamm Sep 22, 2025
6011e66
fix RxNorm 2119714 display
Jammjammjamm Sep 22, 2025
e165074
fix RxNorm 1648756 display
Jammjammjamm Sep 22, 2025
e5d5704
fix RxNorm 1648755 display
Jammjammjamm Sep 22, 2025
822ff98
fix RxNorm 1789958 display
Jammjammjamm Sep 22, 2025
2823ae4
fix RxNorm 1190766 display
Jammjammjamm Sep 22, 2025
8c8b3a2
add pregnancy status observation to pregnancy module
Jammjammjamm Sep 23, 2025
9acb071
add pregnancy status to export for us core 6 & 7
Jammjammjamm Sep 23, 2025
dc7f7c2
fix assigning pregnancy status profile
Jammjammjamm Sep 23, 2025
c28b77f
add value_code to pregnancy module
Jammjammjamm Sep 23, 2025
86c86e9
remove duplicate us core mapping entries for loinc 76690-7
Jammjammjamm Sep 26, 2025
01c4081
update category for sexual orientation observation
Jammjammjamm Sep 26, 2025
e61e117
update homelessness module to create sexual orientation observations …
Jammjammjamm Sep 26, 2025
697d81b
update snomed suicide attempt code displays
Jammjammjamm Sep 29, 2025
4cbd1db
update display for RxNorm 999999
Jammjammjamm Sep 29, 2025
d9e4185
add unknown system to excluded systems to update displays
Jammjammjamm Sep 30, 2025
064454f
update remaining outdated displays
Jammjammjamm Sep 30, 2025
17d70e4
update RxNorm 999999 to 999970
Jammjammjamm Sep 30, 2025
0a9a11d
update RxNorm 205532 display
Jammjammjamm Oct 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions src/main/java/org/mitre/synthea/export/FhirR4.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ public class FhirR4 {
private static final Table<String, String, String> US_CORE_4_MAPPING;
private static final Table<String, String, String> US_CORE_5_MAPPING;
private static final Table<String, String, String> US_CORE_6_MAPPING;
private static final Table<String, String, String> US_CORE_7_MAPPING;

public static enum USCoreVersion {
v311, v400, v501, v610
v311, v400, v501, v610, v700
}

protected static boolean useUSCore3() {
Expand Down Expand Up @@ -235,6 +236,14 @@ protected static boolean useUSCore6() {
return useUSCore6;
}

protected static boolean useUSCore7() {
boolean useUSCore7 = USE_US_CORE_IG && US_CORE_VERSION.startsWith("7");
if (useUSCore7) {
US_CORE_MAPPING = US_CORE_7_MAPPING;
}
return useUSCore7;
}

private static final String COUNTRY_CODE = Config.get("generate.geography.country_code");
private static final String PASSPORT_URI = Config.get("generate.geography.passport_uri", "http://hl7.org/fhir/sid/passport-USA");

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

Map<String, Table<String, String, String>> usCoreMappings =
loadMappingWithVersions("us_core_mapping.csv", "3", "4", "5", "6");
loadMappingWithVersions("us_core_mapping.csv", "3", "4", "5", "6", "7");

US_CORE_3_MAPPING = usCoreMappings.get("3");
US_CORE_4_MAPPING = usCoreMappings.get("4");
US_CORE_5_MAPPING = usCoreMappings.get("5");
US_CORE_6_MAPPING = usCoreMappings.get("6");
US_CORE_7_MAPPING = usCoreMappings.get("7");

if (US_CORE_VERSION.startsWith("3")) {
US_CORE_MAPPING = US_CORE_3_MAPPING;
Expand All @@ -260,6 +270,8 @@ protected static boolean useUSCore6() {
US_CORE_MAPPING = US_CORE_5_MAPPING;
} else if (US_CORE_VERSION.startsWith("6")) {
US_CORE_MAPPING = US_CORE_6_MAPPING;
} else if (US_CORE_VERSION.startsWith("7")) {
US_CORE_MAPPING = US_CORE_7_MAPPING;
}
}

Expand Down Expand Up @@ -370,7 +382,7 @@ private static Map loadLanguageLookup() {

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

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

if (USE_US_CORE_IG) {
Meta meta = new Meta();
if (useUSCore5() || useUSCore6()) {
if (useUSCore5() || useUSCore6() || useUSCore7()) {
meta.addProfile(
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-encounter-diagnosis");
} else {
Expand Down Expand Up @@ -1867,14 +1880,20 @@ private static BundleEntryComponent observation(
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab");
}


if (observation.category != null) {
if (useUSCore6()) {
if (useUSCore6() || useUSCore7()) {
switch (observation.category) {
case "imaging":
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-clinical-result");
break;
case "social-history":
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-simple-observation");
if (code.code.equals("82810-3")) {
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-pregnancystatus");
} else {
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-simple-observation");
}

break;
case "survey":
meta.addProfile("http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-screening-assessment");
Expand Down Expand Up @@ -3476,4 +3495,4 @@ protected static String getUrlPrefix(String resourceType) {
return "urn:uuid:";
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/javascript/update_code_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const codeDictionary = {};
// codeDictionary[system][code] = "display to use"

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

// codes used in Synthea as placeholders that we know aren't real
const PLACEHOLDER_CODES = ['999999',
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/costs/medications.csv
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,4 @@ CODE,MIN,MODE,MAX,COMMENTS
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
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
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
993452,816.12,1014.45,1237.68,1 ML denosumab 60 MG/ML Prefilled Syringe (Prolia) - https://data.medicaid.gov/d/a4y5-998d/visualization
993452,816.12,1014.45,1237.68,1 ML denosumab 60 MG/ML Prefilled Syringe (Prolia) - https://data.medicaid.gov/d/a4y5-998d/visualization
2 changes: 1 addition & 1 deletion src/main/resources/immunization_schedule.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"code": {
"system": "http://hl7.org/fhir/sid/cvx",
"code": "140",
"display": "Influenza, seasonal, injectable, preservative free"
"display": "Influenza, split virus, trivalent, PF"
},
"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.",
"at_months": [
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/keep_modules/keep_diabetes_no_dr.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{
"system": "SNOMED-CT",
"code": "1551000119108",
"display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)"
"display": "Nonproliferative diabetic retinopathy due to type II diabetes mellitus"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/keep_modules/keep_npdr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"system": "SNOMED-CT",
"code": "1551000119108",
"display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)"
"display": "Nonproliferative diabetic retinopathy due to type II diabetes mellitus"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/keep_modules/keep_npdr_no_pdr.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"system": "SNOMED-CT",
"code": "1551000119108",
"display": "Nonproliferative diabetic retinopathy due to type 2 diabetes mellitus (disorder)"
"display": "Nonproliferative diabetic retinopathy due to type II diabetes mellitus"
}
]
},
Expand All @@ -30,7 +30,7 @@
{
"system": "SNOMED-CT",
"code": "1501000119109",
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)"
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/keep_modules/keep_pdr.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"system": "SNOMED-CT",
"code": "1501000119109",
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus (disorder)"
"display": "Proliferative diabetic retinopathy due to type II diabetes mellitus"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/language_lookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"russian": {
"code": "ru-RU",
"system": "urn:ietf:bcp:47",
"display": "Russian (Russia)"
"display": "Russian (Region=Russian Federation)"
},
"vietnamese": {
"code": "vi",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/modules/acute_myeloid_leukemia.json
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@
{
"system": "RxNorm",
"code": 199885,
"display": "levofloxacin 500MG Oral tablet"
"display": "levofloxacin 500 MG Oral Tablet"
}
]
},
Expand Down
Loading