use of io.adminshell.aas.v3.model.Reference in project bunsen by cerner.
the class TestData method newMedRequest.
/**
* Returns a FHIR medication request for testing purposes.
*/
public static MedicationRequest newMedRequest() {
MedicationRequest medReq = new MedicationRequest();
medReq.setId("test-med");
// Medication code
CodeableConcept med = new CodeableConcept();
med.addCoding().setSystem("http://www.nlm.nih.gov/research/umls/rxnorm").setCode("582620").setDisplay("Nizatidine 15 MG/ML Oral Solution [Axid]");
med.setText("Nizatidine 15 MG/ML Oral Solution [Axid]");
medReq.setMedication(med);
Annotation annotation = new Annotation();
annotation.setText("Test medication note.");
annotation.setAuthor(new Reference("Provider/example").setDisplay("Example provider."));
medReq.addNote(annotation);
return medReq;
}
use of io.adminshell.aas.v3.model.Reference in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method mapEobCommonGroupCarrierDME.
/**
* Transforms the common group level data elements between the {@link CarrierClaim} and {@link
* DMEClaim} claim types to FHIR. The method parameter fields from {@link CarrierClaim} and {@link
* DMEClaim} are listed below and their corresponding RIF CCW fields (denoted in all CAPS below
* from {@link CarrierClaimColumn} and {@link DMEClaimColumn}).
*
* @param eob the {@link ExplanationOfBenefit} to modify
* @param benficiaryId BEME_ID, *
* @param carrierNumber CARR_NUM,
* @param clinicalTrialNumber CLM_CLNCL_TRIL_NUM,
* @param beneficiaryPartBDeductAmount CARR_CLM_CASH_DDCTBL_APLD_AMT,
* @param paymentDenialCode CARR_CLM_PMT_DNL_CD,
* @param referringPhysicianNpi RFR_PHYSN_NPI
* @param providerAssignmentIndicator CARR_CLM_PRVDR_ASGNMT_IND_SW,
* @param providerPaymentAmount NCH_CLM_PRVDR_PMT_AMT,
* @param beneficiaryPaymentAmount NCH_CLM_BENE_PMT_AMT,
* @param submittedChargeAmount NCH_CARR_CLM_SBMTD_CHRG_AMT,
* @param allowedChargeAmount NCH_CARR_CLM_ALOWD_AMT,
*/
static void mapEobCommonGroupCarrierDME(ExplanationOfBenefit eob, String beneficiaryId, String carrierNumber, Optional<String> clinicalTrialNumber, BigDecimal beneficiaryPartBDeductAmount, String paymentDenialCode, Optional<String> referringPhysicianNpi, Optional<Character> providerAssignmentIndicator, BigDecimal providerPaymentAmount, BigDecimal beneficiaryPaymentAmount, BigDecimal submittedChargeAmount, BigDecimal allowedChargeAmount, String claimDispositionCode, Optional<String> claimCarrierControlNumber) {
eob.addExtension(createExtensionIdentifier(CcwCodebookVariable.CARR_NUM, carrierNumber));
// Carrier Claim Control Number
if (claimCarrierControlNumber.isPresent()) {
eob.addExtension(createExtensionIdentifier(CcwCodebookMissingVariable.CARR_CLM_CNTL_NUM, claimCarrierControlNumber.get()));
}
eob.addExtension(createExtensionCoding(eob, CcwCodebookVariable.CARR_CLM_PMT_DNL_CD, paymentDenialCode));
// Claim Disposition Code
eob.setDisposition(claimDispositionCode);
/*
* Referrals are represented as contained resources, since they share the lifecycle and identity
* of their containing EOB.
*/
if (referringPhysicianNpi.isPresent()) {
ReferralRequest referral = new ReferralRequest();
referral.setStatus(ReferralRequestStatus.COMPLETED);
referral.setSubject(referencePatient(beneficiaryId));
referral.setRequester(new ReferralRequestRequesterComponent(referencePractitioner(referringPhysicianNpi.get())));
referral.addRecipient(referencePractitioner(referringPhysicianNpi.get()));
// Set the ReferralRequest as a contained resource in the EOB:
eob.setReferral(new Reference(referral));
}
if (providerAssignmentIndicator.isPresent()) {
eob.addExtension(createExtensionCoding(eob, CcwCodebookVariable.ASGMNTCD, providerAssignmentIndicator));
}
if (clinicalTrialNumber.isPresent()) {
eob.addExtension(createExtensionIdentifier(CcwCodebookVariable.CLM_CLNCL_TRIL_NUM, clinicalTrialNumber));
}
addAdjudicationTotal(eob, CcwCodebookVariable.CARR_CLM_CASH_DDCTBL_APLD_AMT, beneficiaryPartBDeductAmount);
addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CLM_PRVDR_PMT_AMT, providerPaymentAmount);
addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CLM_BENE_PMT_AMT, beneficiaryPaymentAmount);
addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CARR_CLM_SBMTD_CHRG_AMT, submittedChargeAmount);
addAdjudicationTotal(eob, CcwCodebookVariable.NCH_CARR_CLM_ALOWD_AMT, allowedChargeAmount);
}
use of io.adminshell.aas.v3.model.Reference in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method addCareTeamPractitioner.
/**
* Ensures that the specified {@link ExplanationOfBenefit} has the specified {@link
* CareTeamComponent}, and links the specified {@link ItemComponent} to that {@link
* CareTeamComponent} (via {@link ItemComponent#addCareTeamLinkId(int)}).
*
* @param eob the {@link ExplanationOfBenefit} that the {@link CareTeamComponent} should be part
* of
* @param eobItem the {@link ItemComponent} that should be linked to the {@link CareTeamComponent}
* @param practitionerIdSystem the {@link Identifier#getSystem()} of the practitioner to reference
* in {@link CareTeamComponent#getProvider()}
* @param practitionerIdValue the {@link Identifier#getValue()} of the practitioner to reference
* in {@link CareTeamComponent#getProvider()}
* @param careTeamRole the {@link ClaimCareteamrole} to use for the {@link
* CareTeamComponent#getRole()}
* @return the {@link CareTeamComponent} that was created/linked
*/
static CareTeamComponent addCareTeamPractitioner(ExplanationOfBenefit eob, ItemComponent eobItem, String practitionerIdSystem, String practitionerIdValue, ClaimCareteamrole careTeamRole) {
// Try to find a matching pre-existing entry.
CareTeamComponent careTeamEntry = eob.getCareTeam().stream().filter(ctc -> ctc.getProvider().hasIdentifier()).filter(ctc -> practitionerIdSystem.equals(ctc.getProvider().getIdentifier().getSystem()) && practitionerIdValue.equals(ctc.getProvider().getIdentifier().getValue())).filter(ctc -> ctc.hasRole()).filter(ctc -> careTeamRole.toCode().equals(ctc.getRole().getCodingFirstRep().getCode()) && careTeamRole.getSystem().equals(ctc.getRole().getCodingFirstRep().getSystem())).findAny().orElse(null);
// If no match was found, add one to the EOB.
if (careTeamEntry == null) {
careTeamEntry = eob.addCareTeam();
careTeamEntry.setSequence(eob.getCareTeam().size() + 1);
careTeamEntry.setProvider(createIdentifierReference(practitionerIdSystem, practitionerIdValue));
CodeableConcept careTeamRoleConcept = createCodeableConcept(ClaimCareteamrole.OTHER.getSystem(), careTeamRole.toCode());
careTeamRoleConcept.getCodingFirstRep().setDisplay(careTeamRole.getDisplay());
careTeamEntry.setRole(careTeamRoleConcept);
}
// care team entry is at eob level so no need to create item link id
if (eobItem == null) {
return careTeamEntry;
}
// Link the EOB.item to the care team entry (if it isn't already).
final int careTeamEntrySequence = careTeamEntry.getSequence();
if (eobItem.getCareTeamLinkId().stream().noneMatch(id -> id.getValue() == careTeamEntrySequence)) {
eobItem.addCareTeamLinkId(careTeamEntrySequence);
}
return careTeamEntry;
}
use of io.adminshell.aas.v3.model.Reference 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 io.adminshell.aas.v3.model.Reference in project beneficiary-fhir-data by CMSgov.
the class FissClaimResponseTransformerV2 method transformClaim.
/**
* @param claimGroup the {@link PreAdjFissClaim} to transform
* @return a FHIR {@link ClaimResponse} resource that represents the specified {@link
* PreAdjFissClaim}
*/
private static ClaimResponse transformClaim(PreAdjFissClaim claimGroup) {
ClaimResponse claim = new ClaimResponse();
claim.setId("f-" + claimGroup.getDcn());
claim.setContained(List.of(getContainedPatient(claimGroup)));
claim.setExtension(getExtension(claimGroup));
claim.setIdentifier(getIdentifier(claimGroup));
claim.setStatus(ClaimResponse.ClaimResponseStatus.ACTIVE);
claim.setOutcome(STATUS_TO_OUTCOME.get(Character.toLowerCase(claimGroup.getCurrStatus())));
claim.setType(getType());
claim.setUse(ClaimResponse.Use.CLAIM);
claim.setInsurer(new Reference().setIdentifier(new Identifier().setValue("CMS")));
claim.setPatient(new Reference("#patient"));
claim.setRequest(new Reference(String.format("Claim/f-%s", claimGroup.getDcn())));
claim.setMeta(new Meta().setLastUpdated(Date.from(claimGroup.getLastUpdated())));
claim.setCreated(new Date());
return claim;
}
Aggregations