use of org.hl7.fhir.dstu3.model.UnsignedIntType in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2 method createBundle.
/**
* Create a bundle from the entire search result
*
* @param resources a list of {@link ExplanationOfBenefit}s, {@link Coverage}s, or {@link
* Patient}s, all of which will be added to the bundle
* @param paging contains the {@link LinkBuilder} information to add to the bundle
* @param transactionTime date for the bundle
* @return Returns a {@link Bundle} of either {@link ExplanationOfBenefit}s, {@link Coverage}s, or
* {@link Patient}s, which may contain multiple matching resources, or may also be empty.
*/
public static Bundle createBundle(List<IBaseResource> resources, LinkBuilder paging, Instant transactionTime) {
Bundle bundle = new Bundle();
TransformerUtilsV2.addResourcesToBundle(bundle, resources);
paging.addLinks(bundle);
bundle.setTotalElement(paging.isPagingRequested() ? new UnsignedIntType() : new UnsignedIntType(resources.size()));
/*
* Dev Note: the Bundle's lastUpdated timestamp is the known last update time for the whole
* database. Because the filterManager's tracking of this timestamp is lazily updated for
* performance reason, the resources of the bundle may be after the filter manager's version of
* the timestamp.
*/
Instant maxBundleDate = resources.stream().map(r -> r.getMeta().getLastUpdated().toInstant()).filter(Objects::nonNull).max(Instant::compareTo).orElse(transactionTime);
bundle.getMeta().setLastUpdated(transactionTime.isAfter(maxBundleDate) ? Date.from(transactionTime) : Date.from(maxBundleDate));
return bundle;
}
use of org.hl7.fhir.dstu3.model.UnsignedIntType in project beneficiary-fhir-data by CMSgov.
the class HospiceClaimTransformerV2Test method shouldHaveCBenefitDayCnt.
@Test
public void shouldHaveCBenefitDayCnt() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_utlztn_day_cnt", eob.getBenefitBalanceFirstRep().getFinancial());
assertNotNull(benefit);
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/clm_utlztn_day_cnt", "Claim Medicare Utilization Day Count")))).setUsed(new UnsignedIntType(30));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.dstu3.model.UnsignedIntType in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveClmUtlztnDayCntFinancial.
@Test
public void shouldHaveClmUtlztnDayCntFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_utlztn_day_cnt", eob.getBenefitBalanceFirstRep().getFinancial());
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/clm_utlztn_day_cnt", "Claim Medicare Utilization Day Count")))).setUsed(new UnsignedIntType(12));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.dstu3.model.UnsignedIntType in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveBeneLrdUsedCntFinancial.
@Test
public void shouldHaveBeneLrdUsedCntFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/bene_lrd_used_cnt", eob.getBenefitBalanceFirstRep().getFinancial());
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/bene_lrd_used_cnt", "Beneficiary Medicare Lifetime Reserve Days (LRD) Used Count")))).setUsed(new UnsignedIntType(0));
assertTrue(compare.equalsDeep(benefit));
}
use of org.hl7.fhir.dstu3.model.UnsignedIntType in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveClmPpsCptlDrgWtNumFinancial.
@Test
public void shouldHaveClmPpsCptlDrgWtNumFinancial() {
BenefitComponent benefit = TransformerTestUtilsV2.findFinancial("https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_drg_wt_num", eob.getBenefitBalanceFirstRep().getFinancial());
BenefitComponent compare = new BenefitComponent().setType(new CodeableConcept().setCoding(Arrays.asList(new Coding("https://bluebutton.cms.gov/resources/codesystem/benefit-balance", "https://bluebutton.cms.gov/resources/variables/clm_pps_cptl_drg_wt_num", "Claim PPS Capital DRG Weight Number")))).setUsed(new UnsignedIntType(1));
assertTrue(compare.equalsDeep(benefit));
}
Aggregations