Ejemplo n.º 1
0
class MedicationOptions(DataModelOptions):
    model_class_name = 'Medication'
    serializers = MedicationSerializers
    field_validators = {
        'drugName_system': [ExactValueValidator(RXN_URI)],
#        'drugName_identifier': [NonNullValidator()],
        'drugName_title': [NonNullValidator()],
        'provenance_system': [ExactValueValidator(MED_PROV_URI, nullable=True)],
        'provenance_identifier': [ValueInSetValidator(MED_PROVS, nullable=True)],
        'startDate': [NonNullValidator()],
        }
Ejemplo n.º 2
0
class LabOptions(DataModelOptions):
    model_class_name = 'LabResult'
    serializers = LabSerializers
    field_validators = {
        'abnormal_interpretation_system':
        [ExactValueValidator(LAB_INTERP_URI, nullable=True)],
        'abnormal_interpretation_identifier':
        [ValueInSetValidator(VALID_INTERPS, nullable=True)],
        'test_name_system': [ExactValueValidator(LOINC_URI)],
        'test_name_identifier': [NonNullValidator()],
        'test_name_title': [NonNullValidator()],
        'status_system': [ExactValueValidator(LAB_STATUS_URI, nullable=True)],
        'status_identifier':
        [ValueInSetValidator(VALID_STATUSES, nullable=True)],
    }
Ejemplo n.º 3
0
class AllergyExclusionOptions(DataModelOptions):
    model_class_name = 'AllergyExclusion'
    field_validators = {
        'name_system': [ExactValueValidator(SNOMED)],
        'name_identifier': [ValueInSetValidator(VALID_EXCLUSION_IDS)],
        'name_title': [NonNullValidator()],
    }
Ejemplo n.º 4
0
class ProblemOptions(DataModelOptions):
    model_class_name = 'Problem'
    serializers = ProblemSerializers
    field_validators = {
        'name_system': [ExactValueValidator(SNOMED_URI)],
        'name_title': [NonNullValidator()],
        'startDate': [NonNullValidator()],
    }
Ejemplo n.º 5
0
class EncounterOptions(DataModelOptions):
    model_class_name = 'Encounter'
    serializers = EncounterSerializers
    field_validators = {
        'encounterType_system': [ExactValueValidator(ENC_TYPE_URI)],
        'encounterType_identifier': [ValueInSetValidator(ENC_TYPES)],
        'encounterType_title': [NonNullValidator()],
        'startDate': [NonNullValidator()],
    }
Ejemplo n.º 6
0
class ImmunizationOptions(DataModelOptions):
    model_class_name = 'Immunization'
    serializers = ImmunizationSerializers
    field_validators = {
        'date': [NonNullValidator()],
        'administration_status_system': [ExactValueValidator(IMM_STATUS_URI)],
        'administration_status_identifier':
        [ValueInSetValidator(VALID_IMM_STATUSES)],
        'administration_status_title': [NonNullValidator()],
        'product_class_system':
        [ExactValueValidator(IMM_CLASS_URI, nullable=True)],
        'product_class_2_system':
        [ExactValueValidator(IMM_CLASS_URI, nullable=True)],
        'product_name_system': [ExactValueValidator(IMM_PROD_URI)],
        'product_name_identifier': [NonNullValidator()],
        'product_name_title': [NonNullValidator()],
        'refusal_reason_system':
        [ExactValueValidator(IMM_REFUSE_URI, nullable=True)],
        'refusal_reason_identifier':
        [ValueInSetValidator(VALID_REFUSALS, nullable=True)],
    }
Ejemplo n.º 7
0
class AllergyOptions(DataModelOptions):
    model_class_name = 'Allergy'
    field_validators = {
        'allergic_reaction_system': [ExactValueValidator(SNOMED)],
        #        'allergic_reaction_identifier': [NonNullValidator()],
        'allergic_reaction_title': [NonNullValidator()],
        'category_system': [ExactValueValidator(SNOMED)],
        'category_identifier': [ValueInSetValidator(VALID_CATEGORY_IDS)],
        'category_title': [NonNullValidator()],
        'drug_allergen_system': [ExactValueValidator(RXNORM, nullable=True)],
        'drug_class_allergen_system':
        [ExactValueValidator(NUI, nullable=True)],
        'food_allergen_system': [ExactValueValidator(UNII, nullable=True)],
        'severity_system': [ExactValueValidator(SNOMED)],
        'severity_identifier': [ValueInSetValidator(VALID_SEVERITY_IDS)],
        'severity_title': [NonNullValidator()],
    }
Ejemplo n.º 8
0
class TestFillOptions(DataModelOptions):
    model_class_name = 'TestFill'
    serializers = TestFillSerializers
    field_validators = {
        'supply_days': [ExactValueValidator(30)],
    }
Ejemplo n.º 9
0
class VitalsOptions(DataModelOptions):
    model_class_name = 'VitalSigns'
    serializers = VitalsSerializers
    field_validators = {
        'date': [NonNullValidator()],
        'bp_position_system': [ExactValueValidator(SNOMED_URI, nullable=True)],
        'bp_position_identifier':
        [ValueInSetValidator(BP_POSITION_IDS, nullable=True)],
        'bp_site_system': [ExactValueValidator(SNOMED_URI, nullable=True)],
        'bp_site_identifier':
        [ValueInSetValidator(BP_SITE_IDS, nullable=True)],
        'bp_method_system':
        [ExactValueValidator(BP_METHOD_URI, nullable=True)],
        'bp_method_identifier':
        [ValueInSetValidator(BP_METHODS, nullable=True)],
        'bp_diastolic_unit': [ValueInSetValidator(UNITS['bp'], nullable=True)],
        'bp_diastolic_name_system':
        [ExactValueValidator(LOINC_URI, nullable=True)],
        'bp_diastolic_name_identifier':
        [ValueInSetValidator(VITAL_SIGN_IDS['bp_diastolic'], nullable=True)],
        'bp_systolic_unit': [ValueInSetValidator(UNITS['bp'], nullable=True)],
        'bp_systolic_name_system':
        [ExactValueValidator(LOINC_URI, nullable=True)],
        'bp_systolic_name_identifier':
        [ValueInSetValidator(VITAL_SIGN_IDS['bp_systolic'], nullable=True)],
        'bmi_unit': [ValueInSetValidator(UNITS['bmi'], nullable=True)],
        'bmi_name_system': [ExactValueValidator(LOINC_URI, nullable=True)],
        'bmi_name_identifier':
        [ValueInSetValidator(VITAL_SIGN_IDS['bmi'], nullable=True)],
        'heart_rate_unit':
        [ValueInSetValidator(UNITS['heart_rate'], nullable=True)],
        'heart_rate_name_system':
        [ExactValueValidator(LOINC_URI, nullable=True)],
        'heart_rate_name_identifier':
        [ValueInSetValidator(VITAL_SIGN_IDS['heart_rate'], nullable=True)],
        'height_unit': [ValueInSetValidator(UNITS['height'], nullable=True)],
        'height_name_system': [ExactValueValidator(LOINC_URI, nullable=True)],
        'height_name_identifier': [
            ValueInSetValidator(VITAL_SIGN_IDS['height'], nullable=True)
        ],
        'oxygen_saturation_unit': [
            ValueInSetValidator(UNITS['oxygen_saturation'], nullable=True)
        ],
        'oxygen_saturation_name_system': [
            ExactValueValidator(LOINC_URI, nullable=True)
        ],
        'oxygen_saturation_name_identifier': [
            ValueInSetValidator(VITAL_SIGN_IDS['oxygen_saturation'],
                                nullable=True)
        ],
        'respiratory_rate_unit': [
            ValueInSetValidator(UNITS['resp_rate'], nullable=True)
        ],
        'respiratory_rate_name_system': [
            ExactValueValidator(LOINC_URI, nullable=True)
        ],
        'respiratory_rate_name_identifier': [
            ValueInSetValidator(VITAL_SIGN_IDS['resp_rate'], nullable=True)
        ],
        'temperature_unit': [
            ValueInSetValidator(UNITS['temperature'], nullable=True)
        ],
        'temperature_name_system': [
            ExactValueValidator(LOINC_URI, nullable=True)
        ],
        'temperature_name_identifier': [
            ValueInSetValidator(VITAL_SIGN_IDS['temperature'], nullable=True)
        ],
        'weight_unit': [ValueInSetValidator(UNITS['weight'], nullable=True)],
        'weight_name_system': [ExactValueValidator(LOINC_URI, nullable=True)],
        'weight_name_identifier': [
            ValueInSetValidator(VITAL_SIGN_IDS['weight'], nullable=True)
        ],
    }