Skip to content

Commit 2d317dc

Browse files
Merge branch 'master' into feature/BFD-4351_Python-CI
2 parents b6cbde4 + c62b177 commit 2d317dc

25 files changed

Lines changed: 1832 additions & 549 deletions

apps/bfd-model-idr/sushi/input/fsh/CodeSystem-CLM-OTAF-IND-CD.fsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CodeSystem: CLM_OTAF_IND_CD
2-
Title: "Claim Revenue Discount Indicator Code"
2+
Title: "Claim OTAF Indicator Code"
33
Id: CLM-OTAF-IND-CD
44
Description: "THE DOMAIN OF OTAF INDICATOR CODES"
55
* ^url = "https://bluebutton.cms.gov/fhir/CodeSystem/CLM-OTAF-IND-CD"

apps/bfd-model-idr/sushi/input/fsh/CodeSystem-CLM-PMT-80-100-CD.fsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CodeSystem: CLM_PMT_80_100_CD
2-
Title: "Claim Place of Service Code"
2+
Title: "Line Payment 80%/100% Code"
33
Id: CLM-PMT-80-100-CD
44
Description: "The code indicating that the amount shown in the payment field on the non-institutional line item represents either 80% or 100% of the allowed charges less any deductible, or 100% limitation of liability only."
55
* ^url = "https://bluebutton.cms.gov/fhir/CodeSystem/CLM-PMT-80-100-CD"

apps/bfd-model-idr/sushi/input/fsh/CodeSystem-CLM-PTNT-RSDNC-CD.fsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CodeSystem: CLM_PTNT_RSDNC_CD
2-
Title: "Pharmacy service type code"
2+
Title: "Patient Residence Code"
33
Id: CLM-PTNT-RSDNC-CD
44
Description: "This variable indicates where the beneficiary lived when the prescription was filled, as reported on the PDE record. CMS requires Part D plans to maintain pharmacy networks that are sufficient to ensure convenient access to Medicare beneficiaries – including retail, home infusion, and long-term care pharmacies. This variable is designed to help CMS and plan sponsors monitor beneficiary access to a range of 'in-network' pharmacies."
55
* ^url = "https://bluebutton.cms.gov/fhir/CodeSystem/CLM-PTNT-RSDNC-CD"
@@ -21,4 +21,4 @@ Description: "This variable indicates where the beneficiary lived when the presc
2121
* #12 "Psychiatric Residential Treatment Facility"
2222
* #13 "Comprehensive Inpatient Rehabilitation Facility"
2323
* #14 "Homeless Shelter"
24-
* #15 "Correctional Institution"
24+
* #15 "Correctional Institution"

apps/bfd-model-idr/sushi/input/fsh/CodeSystem-CLM-REV-CNTR-STUS-CD.fsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CodeSystem: CLM_REV_CNTR_STUS_CD
2-
Title: "Revenue Center Payment Method Indicator Code"
2+
Title: "Revenue Center Status Code"
33
Id: CLM-REV-CNTR-STUS-CD
4-
Description: "THE DOMAIN OF CLAIM PAYMENT METHOD CODES."
4+
Description: "THE DOMAIN OF CLAIM REVENUE CENTER STATUS CODES."
55
* ^url = "https://bluebutton.cms.gov/fhir/CodeSystem/CLM-REV-CNTR-STUS-CD"
66
* ^status = #active
77
* ^content = #complete

apps/bfd-model-idr/sushi/input/fsh/CodeSystem-CLM-REV-PACKG-IND-CD.fsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CodeSystem: CLM_REV_PACKG_IND_CD
2-
Title: "Claim Revenue Discount Indicator Code"
2+
Title: "Claim Revenue Center Packaging Indicator Code"
33
Id: CLM-REV-PACKG-IND-CD
44
Description: "THE DOMAIN OF CLAIM REVENUE PACKAGE INDICATOR CODES."
55
* ^url = "https://bluebutton.cms.gov/fhir/CodeSystem/CLM-REV-PACKG-IND-CD"

apps/bfd-model-idr/sushi/input/fsh/Extension-CLM-LINE-PRFNL-MTUS-CNT.fsh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Extension: CLM_LINE_PRFNL_MTUS_CNT
2-
Title: "The count of the total units associated with services needing unit reporting such as transportation, miles, anesthesia time units, number of services, volume of oxygen or blood units."
2+
Title: "Claim Line MTUS Count"
3+
Description: "The count of the total units associated with services needing unit reporting such as transportation, miles, anesthesia time units, number of services, volume of oxygen or blood units."
34
Id: CLM-LINE-PRFNL-MTUS-CNT
45
* ^url = "https://bluebutton.cms.gov/fhir/StructureDefinition/CLM-LINE-PRFNL-MTUS-CNT"
56
* ^context[+].type = #element
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CLM_DT_SGNTR_SK,CLM_UNIQ_ID,CLM_RLT_COND_SGNTR_SK,CLM_TYPE_CD,CLM_SRC_ID,META_SRC_SK,CLM_FROM_DT,CLM_THRU_DT,CLM_CNTL_NUM,CLM_NUM_SK,CLM_EFCTV_DT,CLM_IDR_LD_DT,CLM_OBSLT_DT,GEO_BENE_SK,BENE_SK,CLM_DISP_CD,CLM_QUERY_CD,CLM_ADJSTMT_TYPE_CD,CLM_BILL_FAC_TYPE_CD,CLM_BILL_CLSFCTN_CD,CLM_BILL_FREQ_CD,CLM_CNTRCTR_NUM,CLM_NCH_PRMRY_PYR_CD,CLM_FINL_ACTN_IND,CLM_LTST_CLM_IND,PRVDR_BLG_PRVDR_NPI_NUM,PRVDR_ATNDG_PRVDR_NPI_NUM,PRVDR_OPRTG_PRVDR_NPI_NUM,PRVDR_OTHR_PRVDR_NPI_NUM,PRVDR_RNDRNG_PRVDR_NPI_NUM,CLM_BLG_PRVDR_OSCAR_NUM,CLM_MDCR_COINSRNC_AMT,CLM_BLG_PRVDR_ZIP5_CD,CLM_SBMT_CHRG_AMT,CLM_PMT_AMT,CLM_MDCR_DDCTBL_AMT,CLM_NCVRD_CHRG_AMT,CLM_BLOOD_LBLTY_AMT,CLM_BENE_PMT_COINSRNC_AMT,CLM_BLOOD_CHRG_AMT,CLM_BLOOD_NCVRD_CHRG_AMT,CLM_COB_PTNT_RESP_AMT,CLM_PRVDR_INTRST_PD_AMT,CLM_PRVDR_OTAF_AMT,CLM_PRVDR_RMNG_DUE_AMT,CLM_TOT_CNTRCTL_AMT,CLM_BLOOD_PT_FRNSH_QTY,PRVDR_RFRG_PRVDR_NPI_NUM,CLM_PRVDR_PMT_AMT,CLM_RIC_CD,CLM_BLG_PRVDR_NPI_NUM,CLM_RFRG_PRVDR_PIN_NUM,CLM_ALOWD_CHRG_AMT,CLM_BENE_PD_AMT,CLM_BENE_PMT_AMT,CLM_BENE_INTRST_PD_AMT,CLM_ORIG_CNTL_NUM,PRVDR_SRVC_PRVDR_NPI_NUM,CLM_PD_DT,PRVDR_PRSCRBNG_PRVDR_NPI_NUM,CLM_SBMT_FRMT_CD,CLM_SBMTR_CNTRCT_NUM,CLM_SBMTR_CNTRCT_PBP_NUM,CLM_OTHR_TP_PD_AMT,IDR_INSRT_TS,IDR_UPDT_TS,CLM_ATNDG_PRVDR_NPI_NUM,CLM_OPRTG_PRVDR_NPI_NUM,CLM_OTHR_PRVDR_NPI_NUM,CLM_RNDRG_PRVDR_NPI_NUM,CLM_SRVC_PRVDR_GNRC_ID_NUM,PRVDR_SRVC_ID_QLFYR_CD,PRVDR_PRSBNG_ID_QLFYR_CD,CLM_ATNDG_FED_PRVDR_SPCLTY_CD
2-
322823692140,1071939711294,673069517797,40,20000,7,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,178083966,55,3,0,3,3,X,01211,L,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,77550,815173.1329847890098,625244.33,776.87,189928.8,8.66,544.3189236473176,,,360.5390326439280,609.69,312.97,854.41,243.4283926422387,0,,20.35,,,,916765.7358968634376,,225008.17,,,,9999-12-31,,,,,,2025-12-26 19:21:50.538903,,,,,,,,,5
3-
322823692141,1071939711295,,10,20000,7,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,0,3,3,X,01211,L,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,77005,815173.13,625244.33,776.8698768765123,189928.8,8.6587654578765,,6.9911829076291,77.3,151.2789573902381,377.9276567879876,96.6890386948091,,207.0781097280107,0,,,,,,916765.73,,225008.1723456788765,,,,9999-12-31,,,,,,2026-01-11 04:43:44.721156,,,,,,,,,5
4-
322823692142,1071939711296,616234798483,40,20000,7,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,0,3,3,X,01211,L,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,75205,815173.13,625244.33,776.87,189928.8,8.66,694.2593027489236,,,95.82,180.88,523.7798679801093,393.0490172830912,8569.4,0,,11.09,,,,82490.85,,450536.56,,,,9999-12-31,,,,,,2025-07-13 04:05:01.400693,2025-08-20 03:57:55.730556,,,,,,,,5
5-
322823692143,1071939711297,1699821257,1013,21000,1003,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,~,3,3,X,01211,,N,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,,815173.13,625244.33,776.87,189928.8,8.66,,,,,,,,,,,,,,,82490.85,,450536.56,,,,9999-12-31,,,,,,,,,,,,,,,5
6-
322823692144,1071939711298,111457034536,2013,21000,1003,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,~,3,3,X,01211,,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,,815173.13,625244.33,776.87,189928.8,8.66,,,,,,,,,,,,,,,82490.8499963378906,,450536.56,,,,9999-12-31,,,,,,,,,,,,,,,5
2+
322823692140,1071939711294,673069517797,40,20000,7,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,178083966,55,3,0,3,3,X,01211,L,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,77550,815173.1329847890098,625244.33,776.87,189928.8,8.66,544.3189236473176,,,360.5390326439280,609.69,312.97,854.41,243.4283926422387,0,,20.35,,,,916765.7358968634376,,225008.17,,,,9999-12-31,,,,,,2025-12-26 19:21:50.538903,,,,,,,,,A0
3+
322823692141,1071939711295,,10,20000,7,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,0,3,3,X,01211,L,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,77005,815173.13,625244.33,776.8698768765123,189928.8,8.6587654578765,,6.9911829076291,77.3,151.2789573902381,377.9276567879876,96.6890386948091,,207.0781097280107,0,,,,,,916765.73,,225008.1723456788765,,,,9999-12-31,,,,,,2026-01-11 04:43:44.721156,,,,,,,,,A0
4+
322823692142,1071939711296,616234798483,40,20000,7,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,0,3,3,X,01211,L,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,75205,815173.13,625244.33,776.87,189928.8,8.66,694.2593027489236,,,95.82,180.88,523.7798679801093,393.0490172830912,8569.4,0,,11.09,,,,82490.85,,450536.56,,,,9999-12-31,,,,,,2025-07-13 04:05:01.400693,2025-08-20 03:57:55.730556,,,,,,,,A0
5+
322823692143,1071939711297,1699821257,1013,21000,1003,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,~,3,3,X,01211,,N,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,,815173.13,625244.33,776.87,189928.8,8.66,,,,,,,,,,,,,,,82490.85,,450536.56,,,,9999-12-31,,,,,,,,,,,,,,,A0
6+
322823692144,1071939711298,111457034536,2013,21000,1003,2021-09-26,2021-10-03,67289832423923BIX,1,2025-05-30,2025-05-30,9999-12-31,86974,181968400,55,3,~,3,3,X,01211,,Y,Y,1104867175,1437702123,1942945159,1972944437,1558719914,001500,0.83,,815173.13,625244.33,776.87,189928.8,8.66,,,,,,,,,,,,,,,82490.8499963378906,,450536.56,,,,9999-12-31,,,,,,,,,,,,,,,A0
77
271048844531,1409088853949,-3090332935474150314,1,20000,1,2025-08-10,2025-08-12,31646182683546TDF,1,2025-11-12,2025-11-12,2025-10-02,97992,181968400,54,2,1,3,5,D,12401,A,Y,N,,,,,,,,,99813.94,38656.27,1397.69,61157.67,6.96,,,,,,,,,,,,,,,,,,,31646182683546TDF,1649041195,2025-08-11,1437702123,S,Z0001,001,649.73,2026-01-05 04:03:23.920661,,,,,,1649041195,01,01

apps/bfd-server-ng/src/main/java/gov/cms/bfd/server/ng/claim/model/BillingProviderInstitutional.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public class BillingProviderInstitutional extends ProviderHistoryBase {
2828
@Column(name = "clm_blg_prvdr_oscar_num")
2929
private Optional<String> providerOscarNumber;
3030

31+
@Override
32+
protected CareTeamType getCareTeamType() {
33+
return CareTeamType.BILLING;
34+
}
35+
3136
/**
3237
* Derives the NPI_TYPE based on the presence of the providerLegalName. NPI_TYPE = INDIVIDUAL
3338
* means the NPI is for an individual (legal name is null/empty). NPI_TYPE = ORGANIZATION means
@@ -44,11 +49,6 @@ public ProviderHistoryBase.NpiType getNpiType() {
4449
}
4550
}
4651

47-
@Override
48-
protected CareTeamType getCareTeamType() {
49-
return CareTeamType.BILLING;
50-
}
51-
5252
/**
5353
* Builds the correct FHIR provider resource (Organization or Practitioner) according to FHIR
5454
* mapping rules.

apps/bfd-server-ng/src/main/java/gov/cms/bfd/server/ng/claim/model/CareTeamBase.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,24 @@ public abstract class CareTeamBase extends ProviderHistoryBase {
1212
private Optional<ProviderSpecialtyCode> specialtyCode;
1313

1414
@Override
15-
Optional<ExplanationOfBenefit.CareTeamComponent> toFhirCareTeamComponent(Integer sequence) {
16-
var careTeamComponent = super.toFhirCareTeamComponent(sequence);
15+
Optional<ExplanationOfBenefit.CareTeamComponent> toFhirCareTeamComponent(
16+
Integer sequence, Optional<ClaimContext> claimContext) {
17+
var careTeamComponent = super.toFhirCareTeamComponent(sequence, claimContext);
1718

18-
// If present, set the qualification
1919
careTeamComponent.ifPresent(
20-
ctc -> specialtyCode.ifPresent(sc -> ctc.setQualification(sc.toFhir())));
20+
ctc ->
21+
specialtyCode.ifPresent(
22+
sc -> {
23+
ctc.setQualification(sc.toFhir());
24+
25+
// Determine NPI Type based on provider specialty code
26+
var npiType = sc.getNpiType();
27+
if (npiType != NpiType.UNKNOWN) {
28+
var reference = ctc.getProvider();
29+
reference.setType(npiType.getType());
30+
ctc.setProvider(reference);
31+
}
32+
}));
2133

2234
return careTeamComponent;
2335
}

apps/bfd-server-ng/src/main/java/gov/cms/bfd/server/ng/claim/model/ClaimInstitutionalBase.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ private void addClaimItems(ExplanationOfBenefit eob) {
123123
.forEach(
124124
item -> {
125125
var claimLine = item.getClaimLine().toFhirItemComponent();
126+
var claimContext = getClaimTypeCode().toContext();
126127

127128
claimLine.ifPresent(eob::addItem);
128129
item.getClaimLine()
@@ -131,7 +132,9 @@ private void addClaimItems(ExplanationOfBenefit eob) {
131132
provider ->
132133
item.getClaimLine()
133134
.getClaimLineNumber()
134-
.flatMap(provider::toFhirCareTeamComponent))
135+
.flatMap(
136+
sequence ->
137+
provider.toFhirCareTeamComponent(sequence, claimContext)))
135138
.ifPresent(eob::addCareTeam);
136139
item.getClaimLine()
137140
.toFhirSupportingInfo(supportingInfoFactory)
@@ -197,13 +200,14 @@ private void addAllSupportingInfo(ExplanationOfBenefit eob) {
197200

198201
private void addCareTeam(ExplanationOfBenefit eob) {
199202
var sequenceGenerator = new SequenceGenerator(eob.getCareTeam().size() + 1);
203+
var claimContext = getClaimTypeCode().toContext();
200204
Stream.of(
201205
getAttendingProviderHistory(),
202206
getOperatingProviderHistory(),
203207
getOtherProviderHistory(),
204208
getRenderingProviderHistory(),
205209
getReferringProviderHistory())
206-
.flatMap(p -> p.toFhirCareTeamComponent(sequenceGenerator.next()).stream())
210+
.flatMap(p -> p.toFhirCareTeamComponent(sequenceGenerator.next(), claimContext).stream())
207211
.forEach(eob::addCareTeam);
208212

209213
addSubclassCareTeam(eob, sequenceGenerator);

0 commit comments

Comments
 (0)