Ejemplo n.º 1
0
class Year2006(Year2005):
    """
    Year 2006 data with specified fields.

    Note:
        Year 2006 and Year 2005 have same `NAMCSMetaMappings`.
    """
    visit_weight = NAMCSMetaMappings(
        field_length=6,
        field_location=276,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)

    # Numeric format
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=826,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=832,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=838,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)
Ejemplo n.º 2
0
    def test_verify_field_location_without_hyphen(self):
        """
        Test to verify correctness of new object when filed location is
        provided without hyphen.
        """
        # Expected attributes
        expected_attributes = {
            "test_field_length": 11,
            "test_field_location": 5,
            "test_field_name": "test"
        }

        # Creating object of :class:`NAMCSMetaMappings`
        namcs_meta_mappings_object = NAMCSMetaMappings(
            field_length=expected_attributes.get("test_field_length"),
            field_location=expected_attributes.get("test_field_location"),
            field_name=expected_attributes.get("test_field_name"),
        )

        # Assert attributes of object :class:`NAMCSMetaMappings`
        self.assertEqual(expected_attributes.get("test_field_name"),
                         namcs_meta_mappings_object.field_name)
        self.assertEqual(expected_attributes.get("test_field_length"),
                         namcs_meta_mappings_object.field_length)
        self.assertEqual(expected_attributes.get("test_field_location"),
                         namcs_meta_mappings_object.field_location)
Ejemplo n.º 3
0
    def test_verify_new_object(self):
        """
        Test for verify correctness of new object.
        """
        # Expected attributes
        expected_attributes = {
            "test_field_length": 10,
            "test_field_location": 5,
            "test_field_name": "test"
        }

        # Creating object of :class:`NAMCSMetaMappings`
        namcs_meta_mappings_object = NAMCSMetaMappings(
            field_length=expected_attributes.get("test_field_length"),
            field_location=expected_attributes.get("test_field_location"),
            field_name=expected_attributes.get("test_field_name"),
        )

        # Checking for object attributes
        self.assertEqual(expected_attributes.get("test_field_name"),
                         namcs_meta_mappings_object.field_name)
        self.assertEqual(expected_attributes.get("test_field_length"),
                         namcs_meta_mappings_object.field_length)
        self.assertEqual(expected_attributes.get("test_field_location"),
                         namcs_meta_mappings_object.field_location)
Ejemplo n.º 4
0
class Year2013(Year):
    """
    Year 2013 data with specified fields.
    """
    visit_weight = NAMCSMetaMappings(
        field_length=11,
        field_location=1363,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
    month_of_visit = NAMCSMetaMappings(
        field_length=2,
        field_location=1,
        field_name=NAMCSFieldEnum.MONTH_OF_VISIT.value)
    age = NAMCSMetaMappings(field_length=3,
                            field_location=4,
                            field_name=NAMCSFieldEnum.PATIENT_AGE.value)
    gender = NAMCSMetaMappings(field_length=1,
                               field_location=11,
                               field_name=NAMCSFieldEnum.GENDER.value)

    # Numeric format
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=96,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=102,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=108,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)
Ejemplo n.º 5
0
class Year2014(Year):
    """
    Year 2014 data with specified fields.

    Note:
        New diagnosis fields `DIAGNOSES 4 ` and `DIAGNOSES  5` in record
        for year 2014 and onwards
    """
    visit_weight = NAMCSMetaMappings(
        field_length=11,
        field_location=2722,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
    month_of_visit = NAMCSMetaMappings(
        field_length=2,
        field_location=1,
        field_name=NAMCSFieldEnum.MONTH_OF_VISIT.value)
    age = NAMCSMetaMappings(field_length=3,
                            field_location=4,
                            field_name=NAMCSFieldEnum.PATIENT_AGE.value)
    gender = NAMCSMetaMappings(field_length=1,
                               field_location=11,
                               field_name=NAMCSFieldEnum.GENDER.value)

    # Numeric format
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=146,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=152,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=158,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    __physician_diagnoses_4 = NAMCSMetaMappings(
        field_length=6,
        field_location=164,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_4.value)
    __physician_diagnoses_5 = NAMCSMetaMappings(
        field_length=6,
        field_location=170,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_5.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3, __physician_diagnoses_4,
                           __physician_diagnoses_5)
Ejemplo n.º 6
0
class Year1993(Year1991):
    """
    Year 1993 data with specified fields.

    Note:
        Year 1993 and Year 1991 have same `NAMCSMetaMappings`.
    """
    visit_weight = NAMCSMetaMappings(
        field_length=6,
        field_location=160,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
Ejemplo n.º 7
0
class Year1975(Year1973):
    """
    Year 1975 data with specified fields.

    Note:
        Year 1975 and 1973 have same `NAMCSMetaMappings`.
    """
    visit_weight = NAMCSMetaMappings(
        field_length=10,
        field_location=78,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
Ejemplo n.º 8
0
class Year1995(Year1991):
    """
    Year 1995 data with specified fields.
    """
    age = NAMCSMetaMappings(field_length=3,
                            field_location=7,
                            field_name=NAMCSFieldEnum.PATIENT_AGE.value)
    gender = NAMCSMetaMappings(field_length=1,
                               field_location=10,
                               field_name=NAMCSFieldEnum.GENDER.value)
    visit_weight = NAMCSMetaMappings(
        field_length=6,
        field_location=196,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=5,
        field_location=52,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=5,
        field_location=57,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=5,
        field_location=62,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)
Ejemplo n.º 9
0
class Year1979(Year):
    """
    Year 1979 data with specified fields.
    """
    month_of_visit = NAMCSMetaMappings(
        field_length=2,
        field_location=1,
        field_name=NAMCSFieldEnum.MONTH_OF_VISIT.value)
    year_of_visit = NAMCSMetaMappings(
        field_length=2,
        field_location=3,
        field_name=NAMCSFieldEnum.YEAR_OF_VISIT.value)
    month_of_birth = NAMCSMetaMappings(
        field_length=2,
        field_location=5,
        field_name=NAMCSFieldEnum.MONTH_OF_BIRTH.value)
    year_of_birth = NAMCSMetaMappings(
        field_length=2,
        field_location=7,
        field_name=NAMCSFieldEnum.YEAR_OF_BIRTH.value)
    gender = NAMCSMetaMappings(field_length=1,
                               field_location=9,
                               field_name=NAMCSFieldEnum.GENDER.value)
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=29,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)

    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=35,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=41,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)

    visit_weight = NAMCSMetaMappings(
        field_length=10,
        field_location=84,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
Ejemplo n.º 10
0
class Year2010(Year2007):
    """
    Year 2010 data with specified fields.
    """
    visit_weight = NAMCSMetaMappings(
        field_length=6,
        field_location=294,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
    # Numeric format
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=919,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=925,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=931,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)
Ejemplo n.º 11
0
class Year2012(Year):
    """
    Year 2012 data with specified fields.

    Note:
        Extra field  in record `AGE RECODE`,
        `AGE IN DAYS FOR PATIENTS LESS THAN ONE YEAR OF AGE`, for year 2012
        and onwards
        [PATWT] PATIENT VISIT WEIGHT (NOT FOR STATE ESTIMATES)
        This variable has been produced as an un rounded integer in 2012,
        which will make estimates slightly more precise. It is ONLY for use in
        producing national, regional, division, and MSA-level estimates, NOT
        state estimates.
        168.792 – 82313.10758
        [PATWTST] PATIENT VISIT WEIGHT FOR STATE ESTIMATES
        This variable has been produced as an un rounded integer in 2012,
        which will make estimates slightly more precise. It is ONLY for use in
        producing state estimates, NOT national, regional, division, or MSA-
        level estimates.
    """
    visit_weight = NAMCSMetaMappings(
        field_length=11,
        field_location=1383,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
    month_of_visit = NAMCSMetaMappings(
        field_length=2,
        field_location=1,
        field_name=NAMCSFieldEnum.MONTH_OF_VISIT.value)
    age = NAMCSMetaMappings(field_length=3,
                            field_location=4,
                            field_name=NAMCSFieldEnum.PATIENT_AGE.value)
    gender = NAMCSMetaMappings(field_length=1,
                               field_location=11,
                               field_name=NAMCSFieldEnum.GENDER.value)

    # Numeric format
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=96,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=102,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=108,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)
Ejemplo n.º 12
0
class Year1997(Year):
    """
    Year 1997 data with specified fields.
    """
    month_of_visit = NAMCSMetaMappings(
        field_length=2,
        field_location=1,
        field_name=NAMCSFieldEnum.MONTH_OF_VISIT.value)
    year_of_visit = NAMCSMetaMappings(
        field_length=4,
        field_location=3,
        field_name=NAMCSFieldEnum.YEAR_OF_VISIT.value)
    age = NAMCSMetaMappings(field_length=3,
                            field_location=8,
                            field_name=NAMCSFieldEnum.PATIENT_AGE.value)
    gender = NAMCSMetaMappings(field_length=1,
                               field_location=11,
                               field_name=NAMCSFieldEnum.GENDER.value)
    visit_weight = NAMCSMetaMappings(
        field_length=6,
        field_location=297,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=567,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=573,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=579,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)
Ejemplo n.º 13
0
class Year2011(Year):
    """
    Year 2011 data with specified fields.

    Note:
        Field `Year_of_visit` has been removed from records.
    """
    visit_weight = NAMCSMetaMappings(
        field_length=6,
        field_location=286,
        field_name=NAMCSFieldEnum.VISIT_WEIGHT.value)
    month_of_visit = NAMCSMetaMappings(
        field_length=2,
        field_location=1,
        field_name=NAMCSFieldEnum.MONTH_OF_VISIT.value)
    age = NAMCSMetaMappings(field_length=3,
                            field_location=4,
                            field_name=NAMCSFieldEnum.PATIENT_AGE.value)
    gender = NAMCSMetaMappings(field_length=1,
                               field_location=7,
                               field_name=NAMCSFieldEnum.GENDER.value)

    # Numeric format
    __physician_diagnoses_1 = NAMCSMetaMappings(
        field_length=6,
        field_location=919,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_1.value)
    __physician_diagnoses_2 = NAMCSMetaMappings(
        field_length=6,
        field_location=925,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_2.value)
    __physician_diagnoses_3 = NAMCSMetaMappings(
        field_length=6,
        field_location=931,
        field_name=NAMCSFieldEnum.PHYSICIANS_DIAGNOSES_3.value)
    physician_diagnoses = (__physician_diagnoses_1, __physician_diagnoses_2,
                           __physician_diagnoses_3)