use of org.hl7.fhir.r5.model.Patient in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveNchPtntStusIndCdSupInfo.
@Test
public void shouldHaveNchPtntStusIndCdSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/nch_ptnt_stus_ind_cd", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/nch_ptnt_stus_ind_cd", "NCH Patient Status Indicator Code")), // Code
new Coding("https://bluebutton.cms.gov/resources/variables/nch_ptnt_stus_ind_cd", "A", "Discharged"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.r5.model.Patient in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveClmIpAdmsnTypeCdSupInfo.
@Test
public void shouldHaveClmIpAdmsnTypeCdSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/clm_ip_admsn_type_cd", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/clm_ip_admsn_type_cd", "Claim Inpatient Admission Type Code")), // Code
new Coding("https://bluebutton.cms.gov/resources/variables/clm_ip_admsn_type_cd", "1", "Emergency - The patient required immediate medical intervention as a result of" + " severe, life threatening, or potentially disabling conditions. Generally," + " the patient was admitted through the emergency room."));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.r5.model.Patient in project beneficiary-fhir-data by CMSgov.
the class BeneficiaryTransformerV2Test method shouldHaveReferenceYearExtension.
/**
* test to verify that {@link gov.cms.bfd.server.war.r4.providers.BeneficiaryTransformerV2}
* hanldes patient reference year extension.
*/
@Test
public void shouldHaveReferenceYearExtension() {
Extension ex = TransformerTestUtilsV2.findExtensionByUrl("https://bluebutton.cms.gov/resources/variables/rfrnc_yr", patient.getExtension());
DateType yearValue = null;
try {
Date dt = new SimpleDateFormat("yyyy-MM-dd").parse("2018-01-01");
yearValue = new DateType(dt, TemporalPrecisionEnum.YEAR);
} catch (Exception e) {
}
Extension compare = new Extension().setValue(yearValue).setUrl("https://bluebutton.cms.gov/resources/variables/rfrnc_yr");
assertTrue(compare.equalsDeep(ex));
}
use of org.hl7.fhir.r5.model.Patient in project beneficiary-fhir-data by CMSgov.
the class BeneficiaryTransformerV2Test method verifyDualResourceExtension.
/**
* helper function to verify that {@link
* gov.cms.bfd.server.war.r4.providers.BeneficiaryTransformerV2} correctly handles patient Part D
* attributee.
*/
private void verifyDualResourceExtension(String dualId) {
String uri = "https://bluebutton.cms.gov/resources/variables/" + dualId;
Extension ex = TransformerTestUtilsV2.findExtensionByUrl(uri, patient.getExtension());
assertNotNull(ex);
Extension compare = new Extension(uri, new Coding(uri, "**", "Enrolled in Medicare A and/or B, but no Part D enrollment data for the beneficiary. (This status was indicated as 'XX' for 2006-2009)"));
assertTrue(compare.equalsDeep(ex));
}
use of org.hl7.fhir.r5.model.Patient in project beneficiary-fhir-data by CMSgov.
the class BeneficiaryTransformerV2Test method shouldMatchAddressWithAddrHeader.
/**
* Verifies that {@link gov.cms.bfd.server.war.r4.providers.BeneficiaryTransformerV2} works
* correctly when passed a {@link Beneficiary} with includeAddressFields header values.
*/
@Test
public void shouldMatchAddressWithAddrHeader() {
RequestHeaders reqHdr = getRHwithIncldAddrFldHdr("true");
createPatient(reqHdr);
assertNotNull(patient);
List<Address> addrList = patient.getAddress();
assertEquals(1, addrList.size());
assertEquals(6, addrList.get(0).getLine().size());
Address compare = new Address();
compare.setPostalCode("12345");
compare.setState("MO");
compare.setCity("PODUNK");
ArrayList<StringType> lineList = new ArrayList<>(Arrays.asList(new StringType("204 SOUTH ST"), new StringType("7560 123TH ST"), new StringType("SURREY"), new StringType("DAEJEON SI 34867"), new StringType("COLOMBIA"), new StringType("SURREY")));
compare.setLine(lineList);
assertTrue(compare.equalsDeep(addrList.get(0)));
}
Aggregations