use of org.hl7.fhir.r4.model.ExplanationOfBenefit.Use in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method createExtensionCoding.
/**
* @param rootResource the root FHIR {@link IAnyResource} that the resultant {@link Extension}
* will be contained in
* @param ccwVariable the {@link CcwCodebookInterface} being coded
* @param code the value to use for {@link Coding#getCode()} for the resulting {@link Coding}
* @return the output {@link Extension}, with {@link Extension#getValue()} set to a new {@link
* Coding} to represent the specified input values
*/
static Extension createExtensionCoding(IAnyResource rootResource, CcwCodebookInterface ccwVariable, Optional<?> code) {
if (!code.isPresent())
throw new IllegalArgumentException();
Coding coding = createCoding(rootResource, ccwVariable, code.get());
String extensionUrl = CCWUtils.calculateVariableReferenceUrl(ccwVariable);
Extension extension = new Extension(extensionUrl, coding);
return extension;
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.Use in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method createExtensionCoding.
/**
* @param rootResource the root FHIR {@link IAnyResource} that the resultant {@link Extension}
* will be contained in
* @param ccwVariable the {@link CcwCodebookInterface being coded
* @param code the value to use for {@link Coding#getCode()} for the resulting {@link Coding}
* @return the output {@link Extension}, with {@link Extension#getValue()} set to a new {@link
* Coding} to represent the specified input values
*/
static Extension createExtensionCoding(IAnyResource rootResource, CcwCodebookInterface ccwVariable, String yearMonth, Optional<?> code) {
if (!code.isPresent())
throw new IllegalArgumentException();
Coding coding = createCoding(rootResource, ccwVariable, yearMonth, code.get());
String extensionUrl = String.format("%s/%s", CCWUtils.calculateVariableReferenceUrl(ccwVariable), yearMonth);
Extension extension = new Extension(extensionUrl, coding);
return extension;
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.Use in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method createIdentifierReference.
/**
* @param identifierType the {@link gov.cms.bfd.server.war.stu3.providers.IdentifierType}
* @param identifierValue the {@link Identifier#getValue()} to use in {@link
* Reference#getIdentifier()}
* @return a {@link Reference} with the specified {@link Identifier}
*/
static Reference createIdentifierReference(IdentifierType identifierType, String identifierValue) {
Reference reference = new Reference();
Coding coding = new Coding().setSystem(identifierType.getSystem()).setCode(identifierType.getCode()).setDisplay(identifierType.getDisplay());
List<Coding> codingList = new ArrayList<Coding>();
codingList.add(coding);
CodeableConcept codeableConcept = new CodeableConcept().setCoding(codingList);
return reference.setIdentifier(new Identifier().setSystem(identifierType.getSystem()).setValue(identifierValue).setType(codeableConcept)).setDisplay(retrieveNpiCodeDisplay(identifierValue));
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.Use in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method mapHcpcs.
/**
* @param eob the {@link ExplanationOfBenefit} that the HCPCS code is being mapped into
* @param item the {@link ItemComponent} that the HCPCS code is being mapped into
* @param hcpcsYear the {@link CcwCodebookVariable#CARR_CLM_HCPCS_YR_CD} identifying the HCPCS
* code version in use
* @param hcpcs the {@link CcwCodebookVariable#HCPCS_CD} to be mapped
* @param hcpcsModifiers the {@link CcwCodebookVariable#HCPCS_1ST_MDFR_CD}, etc. values to be
* mapped (if any)
*/
static void mapHcpcs(ExplanationOfBenefit eob, ItemComponent item, Optional<Character> hcpcsYear, Optional<String> hcpcs, List<Optional<String>> hcpcsModifiers) {
// Create and map all of the possible CodeableConcepts.
CodeableConcept hcpcsConcept = hcpcs.isPresent() ? createCodeableConcept(TransformerConstants.CODING_SYSTEM_HCPCS, hcpcs.get()) : null;
if (hcpcsConcept != null)
item.setService(hcpcsConcept);
List<CodeableConcept> hcpcsModifierConcepts = new ArrayList<>(4);
for (Optional<String> hcpcsModifier : hcpcsModifiers) {
if (!hcpcsModifier.isPresent())
continue;
CodeableConcept hcpcsModifierConcept = createCodeableConcept(TransformerConstants.CODING_SYSTEM_HCPCS, hcpcsModifier.get());
hcpcsModifierConcepts.add(hcpcsModifierConcept);
item.addModifier(hcpcsModifierConcept);
}
// Set Coding.version for all of the mappings, if it's available.
Stream.concat(Arrays.asList(hcpcsConcept).stream(), hcpcsModifierConcepts.stream()).forEach(concept -> {
if (concept == null)
return;
if (!hcpcsYear.isPresent())
return;
// Note: Only CARRIER and DME claims have the year/version field.
concept.getCodingFirstRep().setVersion(hcpcsYear.get().toString());
});
}
use of org.hl7.fhir.r4.model.ExplanationOfBenefit.Use in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method addExtensionValueQuantity.
/**
* Adds an {@link Extension} to the specified {@link DomainResource}. {@link Extension#getValue()}
* will be set to a {@link Quantity} with the specified system and value.
*
* @param fhirElement the FHIR element to add the {@link Extension} to
* @param extensionUrl the {@link Extension#getUrl()} to use
* @param quantitySystem the {@link Quantity#getSystem()} to use
* @param quantityValue the {@link Quantity#getValue()} to use
*/
static void addExtensionValueQuantity(IBaseHasExtensions fhirElement, String extensionUrl, String quantitySystem, BigDecimal quantityValue) {
IBaseExtension<?, ?> extension = fhirElement.addExtension();
extension.setUrl(extensionUrl);
extension.setValue(new Quantity().setSystem(extensionUrl).setValue(quantityValue));
// CodeableConcept codeableConcept = new CodeableConcept();
// extension.setValue(codeableConcept);
//
// Coding coding = codeableConcept.addCoding();
// coding.setSystem(codingSystem).setCode(codingCode);
}
Aggregations