use of org.hl7.fhir.dstu2.model.DateType in project beneficiary-fhir-data by CMSgov.
the class TransformerUtils method createExtensionDate.
/**
* @param ccwVariable the {@link CcwCodebookInterface} being mapped
* @param dateYear the value to use for {@link Coding#getCode()} for the resulting {@link Coding}
* @return the output {@link Extension}, with {@link Extension#getValue()} set to represent the
* specified input values
*/
static Extension createExtensionDate(CcwCodebookInterface ccwVariable, Optional<BigDecimal> dateYear) {
Extension extension = null;
if (!dateYear.isPresent()) {
throw new NoSuchElementException();
}
try {
String stringDate = String.format("%04d", dateYear.get().intValue());
DateType dateYearValue = new DateType(stringDate);
String extensionUrl = CCWUtils.calculateVariableReferenceUrl(ccwVariable);
extension = new Extension(extensionUrl, dateYearValue);
} catch (DataFormatException e) {
throw new InvalidRifValueException(String.format("Unable to create DateType with reference year: '%s'.", dateYear.get()), e);
}
return extension;
}
use of org.hl7.fhir.dstu2.model.DateType in project beneficiary-fhir-data by CMSgov.
the class OutpatientClaimTransformerV2Test method shouldHaveClaimReceivedDateSupInfo.
@Test
public void shouldHaveClaimReceivedDateSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("clmrecvddate", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", "clmrecvddate", "Claim Received Date"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/nch_wkly_proc_dt", "NCH Weekly Claim Processing Date"))).setTiming(new DateType("2011-02-26"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.dstu2.model.DateType in project beneficiary-fhir-data by CMSgov.
the class OutpatientClaimTransformerV2Test method shouldHaveLineItemServicedDate.
@Test
public void shouldHaveLineItemServicedDate() {
DateType servicedDate = eob.getItemFirstRep().getServicedDateType();
DateType compare = new DateType("1942-01-03");
assertEquals(servicedDate.toString(), compare.toString());
}
use of org.hl7.fhir.dstu2.model.DateType in project beneficiary-fhir-data by CMSgov.
the class CarrierClaimTransformerV2Test method shouldHaveSupportingInfoListForClaimReceivedDate.
@Test
public void shouldHaveSupportingInfoListForClaimReceivedDate() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("clmrecvddate", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", "clmrecvddate", "Claim Received Date"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/nch_wkly_proc_dt", "NCH Weekly Claim Processing Date")));
compare.setTiming(new DateType("1999-11-06"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.dstu2.model.DateType in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveClaimReceivedDateSupInfo.
@Test
public void shouldHaveClaimReceivedDateSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("clmrecvddate", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBSupportingInfoType", "clmrecvddate", "Claim Received Date"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/nch_wkly_proc_dt", "NCH Weekly Claim Processing Date"))).setTiming(new DateType("2016-02-26"));
assertTrue(compare.equalsDeep(sic));
}
Aggregations